RE: [PATCH v2 net-next 2/2] net: phy: c45-tja11xx: add support for outputing RMII reference clock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Russell King <linux@xxxxxxxxxxxxxxx>
> Sent: 2024年10月8日 16:31
> To: Wei Fang <wei.fang@xxxxxxx>
> Cc: davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx;
> pabeni@xxxxxxxxxx; robh@xxxxxxxxxx; krzk+dt@xxxxxxxxxx;
> conor+dt@xxxxxxxxxx; andrew@xxxxxxx; f.fainelli@xxxxxxxxx;
> hkallweit1@xxxxxxxxx; Andrei Botila (OSS) <andrei.botila@xxxxxxxxxxx>;
> devicetree@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; imx@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v2 net-next 2/2] net: phy: c45-tja11xx: add support for
> outputing RMII reference clock
> 
> On Tue, Oct 08, 2024 at 03:07:08PM +0800, Wei Fang wrote:
> > @@ -1561,8 +1565,13 @@ static int nxp_c45_set_phy_mode(struct
> phy_device *phydev)
> >  			phydev_err(phydev, "rmii mode not supported\n");
> >  			return -EINVAL;
> >  		}
> > -		phy_write_mmd(phydev, MDIO_MMD_VEND1,
> VEND1_MII_BASIC_CONFIG,
> > -			      MII_BASIC_CONFIG_RMII);
> > +
> > +		if (priv->flags & TJA11XX_REVERSE_MODE)
> > +			phy_write_mmd(phydev, MDIO_MMD_VEND1,
> VEND1_MII_BASIC_CONFIG,
> > +				      MII_BASIC_CONFIG_RMII |
> MII_BASIC_CONFIG_REV);
> > +		else
> > +			phy_write_mmd(phydev, MDIO_MMD_VEND1,
> VEND1_MII_BASIC_CONFIG,
> > +				      MII_BASIC_CONFIG_RMII);
> 
> Netdev has an 80 column limit, and this needs commenting because we have
> PHY_INTERFACE_MODE_REVRMII which could be confused with this (although
> I haven't checked.)
> 
> 		u16 basic_config;
> 		...
> 		basic_config = MII_BASIC_CONFIG_RMII;
> 
> 		/* This is not PHY_INTERFACE_MODE_REVRMII */
> 		if (priv->flags & TJA11XX_REVERSE_MODE)
> 			basic_config |= MII_BASIC_CONFIG_REV;
> 
> 		phy_write_mmd(phydev, MDIO_MMD_VEND1,
> VEND1_MII_BASIC_CONFIG,
> 			      basic_config);
> 
> is much nicer to read.
> 

Okay, I will refine the patch, thanks!




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux