Subject: Re: [PATCH RFC net-next] net: phy: mxl-gpy: add basic LED support

From: Simon Horman <[email-masked]>
Date: Mon, 30 Sep 2024 16:38:41 +0100

On Sun, Sep 29, 2024 at 11:02:16PM +0100, Daniel Golle wrote:
> Add basic support for LEDs connected to MaxLinear GPY2xx and GPY115 PHYs.
> The PHYs allow up to 4 LEDs to be connected.
> Implement controlling LEDs in software as well as netdev trigger offloading
> and LED polarity setup.
> 
> The hardware claims to support 16 PWM brightness levels but there is no
> documentation on how to use that feature, hence this is not supported.
> 
> Signed-off-by: Daniel Golle <[email-masked]>
> ---
>  drivers/net/phy/mxl-gpy.c | 212 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 212 insertions(+)
> 
> diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c

...

> +static int gpy_led_hw_control_set(struct phy_device *phydev, u8 index,
> +				  unsigned long rules)
> +{
> +	int ret;
> +	u16 val = 0;

nit: Please consider arranging local variables in reverse xmas tree order -
     longest line to shortest.

	u16 val = 0;
	int ret;

> +
> +	if (index >= GPY_MAX_LEDS)
> +		return -EINVAL;

...