Re: [PATCH v5 2/5] include: linux: phy: Add phy attribute "type" and associated helpers

Thinh Nguyen <[email protected]>
Newsgroups org.kernel.vger.linux-devicetree,org.infradead.lists.linux-phy,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-usb
Message-ID <anJhN9-4dOtDqncs@vbox>
On Sun, Jul 26, 2026, Dmitry Baryshkov wrote:
> On Thu, Jul 23, 2026 at 04:09:05PM +0530, Krishna Kurapati wrote:
> > In cases like USB High-speed phys which can be either USB2 or EUSB2, it is
> > required to know the type of phy (rather than the operating mode).
> 
> Why?

Perhaps Krishna should expand on this in the commit message. See patch
5/5 for the reason.

> 
> > Add
> > support to cache the PHY_TYPE and add the following helpers:
> > 
> > - phy_set_type() for the phy drivers (like m31_eusb2 or snps-eusb2) to
> > declare what type of PHY they are (in this case PHY_TYPE_EUSB2).
> 
> PHY type is usually coveyed through the PHY cells in DT. Why do you need
> to set it from the driver?

PHY_TYPE_* via phy cells is typically used for combo PHYs for multiple
protocols where cell arg selects the lane. In this case, the eusb2 phy
is a single protocol phy with #phy-cells = <0>. Adding a cell arg just
for the type would require updating all the eusb2 phy bindings and every
dts file referencing it. Introducing a new interface and setting it from
the phy driver is IMHO a cleaner approach.

BR,
Thinh

> 
> > 
> > - phy_get_type() for the consumers (like USB controllers) to query the
> > type of phy connected to them.
> > 
> > Signed-off-by: Krishna Kurapati <[email protected]>
> > ---
> >  include/linux/phy/phy.h | 27 +++++++++++++++++++++++++++
> >  1 file changed, 27 insertions(+)
> > 
> 
> -- 
> With best wishes
> Dmitry
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.