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

From: Vinod Koul

Date: Thu Nov 12 2026 - 03:49:39 EST


On 27-10-26, 13:37, Krishna Kurapati wrote:
>
>
> On 10/9/2026 10:29 PM, Krishna Kurapati wrote:
> >
> >
> > On 10/5/2026 2:14 PM, Vinod Koul wrote:
> > > On 13-09-26, 20:10, 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) because
> > > > DP and DM interrupt lines need to be configured differently for each of
> > > > them.
> > >
> > > Does the controller care? In preceding patch you defined the EUSB2 in dt
> > > type, so this describes the hardware. So phy knows it is usb or eusb...
> > > >
> >
> > Controller is agnostic of whether the phy is usb2 or eusb2. Phy does now
> > its type, but it needs to communicate the same to controller.
> >
> > > > 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_get_type() for the consumers (like USB controllers) to query the
> > > > type of phy connected to them.
> > >
> > > I am not convinced that this is the way to go... Driver already knows
> > > the type and should use it...
> > > we alreayd have mode, i am inclined to not say yes to adding type here
> > >
> >
> > "Mode" attribute describes the current operating scenario of the phy
> > (device mode, host mode, high speed, super speed etc.,). But it doesn't
> > describe the type of hardware and hence a new attribute.

Not really. A combo phy can be usb/type c and we do set that mode...

> >
>
> Vinod, can you please let know if you are fine with this approach. If yes, I
> will send v9 rebased on top of phy-next.

I am not convinced that this is the way to go..

--
~Vinod