Hi Andrew, On Thu, 8 Feb 2018 13:51:44 +0100 <and...@lunn.ch> wrote:
> On Thu, Feb 08, 2018 at 07:09:25PM +0900, Kunihiko Hayashi wrote: > > Hello, > > > > Is there a way to specify "phy is internal" to generic phy driver, > > that is, to make phy_is_internal() function available? > > > > I found "phy-is-integrated" DT property in > > Documentation/devicetree/bindings/net/phy.txt, however, it seems > > that the property is no effect for generic phy. And I think that > > the meaning of "integrated" is slightly different from "internal". > > Hi Kunihiko > > Could you explain the bigger picture. Why do you need this? There are some SoCs that have a built-in phy, and sometimes these SoCs can choose to use built-in phy or external phy. In our case, MAC driver needs to set a register to choose whether to use them. This choice depends on the board implemented on the SoC. And this built-in phy can be driven with generic phy driver. If 'struct phy_driver' of a phy driver has the flag with PHY_IS_INTERNAL, phy_is_internal() returns true, and the MAC driver can decide a value of the register using it. drivers/net/phy/phy_device.c: if (phydrv->flags & PHY_IS_INTERNAL) phydev->is_internal = true; include/linux/phy.h: static inline bool phy_is_internal(struct phy_device *phydev) { return phydev->is_internal; } Although I can write a new driver with PHY_IS_INTERNAL, or add a new property to the MAC driver, I'd like to use generic phy driver if possible. However, it seems that the generic phy driver doesn't have the way to express built-in phy with/without even DT. How can I handle such built-in phy? Thank you, --- Best Regards, Kunihiko Hayashi