[PATCH net-next v8 06/13] net: phy: mediatek: Hook LED helper functions in mtk-ge.c

Andrew Lunn andrew at lunn.ch
Sat Jun 22 10:29:45 PDT 2024


> +static int mt753x_phy_led_blink_set(struct phy_device *phydev, u8 index,
> +				    unsigned long *delay_on,
> +				    unsigned long *delay_off)
> +{
> +	struct mtk_gephy_priv *priv = phydev->priv;
> +	bool blinking = false;
> +	int err = 0;
> +
> +	if (index > 1)
> +		return -EINVAL;
> +

It looks like this test could be moved into the common code. It seems
like all variants have a single LED.

> +	if (delay_on && delay_off && (*delay_on > 0) && (*delay_off > 0)) {
> +		blinking = true;
> +		*delay_on = 50;
> +		*delay_off = 50;
> +	}

Do the different hardware variants have different blink speeds? If
not, maybe also move this into the common code. Otherwise maybe add a
comment in the commit message explaining the differences between the
hardware variants.

    Andrew

---
pw-bot: cr



More information about the Linux-mediatek mailing list