Re: [PATCH net-next] net: phy: mediatek-ge-soc: support PHY LEDs

From: Andrew Lunn
Date: Fri Aug 11 2023 - 09:14:05 EST


>
> +#define MTK_PHY_LED_STATE_FORCE_ON BIT(0)
> +#define MTK_PHY_LED_STATE_FORCE_BLINK BIT(1)
> +#define MTK_PHY_LED_STATE_NETDEV BIT(2)
> +struct mtk_socphy_priv {
> + unsigned long led_state;
> +};

Hi Daniel

A blank line between the #defines and the struct would be nice.

> +
> +struct mtk_socphy_shared {
> + u32 boottrap;
> + struct mtk_socphy_priv priv[4];
> +};
> +
> static int mtk_socphy_read_page(struct phy_device *phydev)
> {
> return __phy_read(phydev, MTK_EXT_PAGE_ACCESS);
> @@ -1071,6 +1112,370 @@ static int mt798x_phy_config_init(struct phy_device *phydev)
> return mt798x_phy_calibration(phydev);
> }
>
> +static int mt798x_phy_hw_led_on_set(struct phy_device *phydev, u8 index,
> + bool on)
> +{
> + struct mtk_socphy_priv *priv = phydev->priv;
> + u32 mask = MTK_PHY_LED_STATE_FORCE_ON << (index ? 16 : 0);
> + bool changed;

Reverse christmass tree please.

Otherwise, this looks good.

Andrew