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

Thinh Nguyen Thinh.Nguyen at synopsys.com
Tue Aug 4 15:22:20 PDT 2026


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 <krishna.kurapati at oss.qualcomm.com>
> > ---
> >  include/linux/phy/phy.h | 27 +++++++++++++++++++++++++++
> >  1 file changed, 27 insertions(+)
> > 
> 
> -- 
> With best wishes
> Dmitry


More information about the linux-phy mailing list