[net-next PATCH v10 8/9] net: dsa: Add Airoha AN8855 5-Port Gigabit DSA Switch driver

Christophe JAILLET christophe.jaillet at wanadoo.fr
Sun Dec 8 07:26:46 PST 2024


Le 08/12/2024 à 01:20, Christian Marangi a écrit :
> Add Airoha AN8855 5-Port Gigabit DSA switch. Switch can support
> 10M, 100M, 1Gb, 2.5G and 5G Ethernet Speed but 5G is currently error out
> as it's not currently supported as requires additional configuration for
> the PCS.
> 
> The switch is also a nvmem-provider as it does have EFUSE to calibrate
> the internal PHYs.
> 
> Signed-off-by: Christian Marangi <ansuelsmth-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
> ---

...

> +static int an8855_read_switch_id(struct an8855_priv *priv)
> +{
> +	u32 id;
> +	int ret;
> +
> +	ret = regmap_read(priv->regmap, AN8855_CREV, &id);
> +	if (ret)
> +		return ret;
> +
> +	if (id != AN8855_ID) {
> +		dev_err(priv->dev,
> +			"Switch id detected %x but expected %x",

missing \n

> +			id, AN8855_ID);
> +		return -ENODEV;
> +	}
> +
> +	return 0;
> +}

...

> +static void an8855_switch_remove(struct platform_device *pdev)
> +{
> +	struct an8855_priv *priv = dev_get_drvdata(&pdev->dev);
> +
> +	if (!priv)
> +		return;

I don't think this can happen. So it could be removed?

> +
> +	dsa_unregister_switch(priv->ds);
> +}

...

CJ



More information about the Linux-mediatek mailing list