Re: [PATCH net-next v4 07/14] net:phy:motorcomm: Add PHY_INTERFACE_MODE_INTERNAL to support YT6801

From: Andrew Lunn
Date: Tue Apr 08 2025 - 09:22:57 EST


On Tue, Apr 08, 2025 at 05:28:28PM +0800, Frank Sae wrote:
> YT6801 NIC Integrated a PHY that is YT8531S, but it used GMII interface.
> Add a case of PHY_INTERFACE_MODE_INTERNAL to support YT6801.
>
> Signed-off-by: Frank Sae <Frank.Sae@xxxxxxxxxxxxxx>
> ---
> drivers/net/phy/motorcomm.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
> index 0e91f5d1a..ac3a46939 100644
> --- a/drivers/net/phy/motorcomm.c
> +++ b/drivers/net/phy/motorcomm.c
> @@ -896,6 +896,12 @@ static int ytphy_rgmii_clk_delay_config(struct phy_device *phydev)
> val |= FIELD_PREP(YT8521_RC1R_RX_DELAY_MASK, rx_reg) |
> FIELD_PREP(YT8521_RC1R_GE_TX_DELAY_MASK, tx_reg);
> break;
> + case PHY_INTERFACE_MODE_INTERNAL:
> + if (phydev->drv->phy_id != PHY_ID_YT8531S)
> + return -EOPNOTSUPP;
> +
> + dev_info_once(&phydev->mdio.dev, "Integrated YT8531S phy of YT6801.\n");

Drivers should be silent unless something going wrong. dev_dbg() or
nothing please.

Andrew