[PATCH v3 0/3] Add devicetree support of USB for QDU/QRU1000

Komal Bajaj posted 3 patches 1 year, 7 months ago
arch/arm64/boot/dts/qcom/qdu1000-idp.dts |  23 +++++
arch/arm64/boot/dts/qcom/qdu1000.dtsi    | 120 +++++++++++++++++++++++
arch/arm64/boot/dts/qcom/qru1000-idp.dts |  23 +++++
3 files changed, 166 insertions(+)
[PATCH v3 0/3] Add devicetree support of USB for QDU/QRU1000
Posted by Komal Bajaj 1 year, 7 months ago
This series adds devicetree nodes to support interconnects and usb for qdu/qru1000.
This is based on previously sent driver series[1].

------
Changes in v3:
* As per comments on upstream[2], to get role-switch working on QDU/QRU1000, it was recommended to
  use the actual TI switch driver. Since driver doesn't have the functionality to provide role-switch
  based on gpio, thus reverting back USB dr_mode to peripheral and removed the remote end-point nodes
  and usb-conn-gpio based role switch functionality.
* Link to v2: https://lore.kernel.org/linux-arm-msm/20240319091020.15137-1-quic_kbajaj@quicinc.com/

Changes in v2:
* Changes qmpphy node name
* Changes dr_mode to otg and added USB-B port USB role switch
* Dropped maximum-speed property from usb dwc3 node
* Link to v1: https://lore.kernel.org/linux-arm-msm/20240311120859.18489-1-quic_kbajaj@quicinc.com/

[1] https://lore.kernel.org/linux-arm-msm/20240502082017.13777-1-quic_kbajaj@quicinc.com/
[2] https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
------

Komal Bajaj (3):
  arm64: dts: qcom: qdu1000: Add USB3 and PHY support
  arm64: dts: qcom: qdu1000-idp: enable USB nodes
  arm64: dts: qcom: qru1000-idp: enable USB nodes

 arch/arm64/boot/dts/qcom/qdu1000-idp.dts |  23 +++++
 arch/arm64/boot/dts/qcom/qdu1000.dtsi    | 120 +++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/qru1000-idp.dts |  23 +++++
 3 files changed, 166 insertions(+)

--
2.42.0
Re: [PATCH v3 0/3] Add devicetree support of USB for QDU/QRU1000
Posted by Bjorn Andersson 1 year, 6 months ago
On Thu, 02 May 2024 14:33:23 +0530, Komal Bajaj wrote:
> This series adds devicetree nodes to support interconnects and usb for qdu/qru1000.
> This is based on previously sent driver series[1].
> 
> ------
> Changes in v3:
> * As per comments on upstream[2], to get role-switch working on QDU/QRU1000, it was recommended to
>   use the actual TI switch driver. Since driver doesn't have the functionality to provide role-switch
>   based on gpio, thus reverting back USB dr_mode to peripheral and removed the remote end-point nodes
>   and usb-conn-gpio based role switch functionality.
> * Link to v2: https://lore.kernel.org/linux-arm-msm/20240319091020.15137-1-quic_kbajaj@quicinc.com/
> 
> [...]

Applied, thanks!

[1/3] arm64: dts: qcom: qdu1000: Add USB3 and PHY support
      commit: dd1bd5bf7420497aace9521d314f6c7e22f22118
[2/3] arm64: dts: qcom: qdu1000-idp: enable USB nodes
      commit: 00ea07cd1c884efe4b02a5a61794673054547488
[3/3] arm64: dts: qcom: qru1000-idp: enable USB nodes
      commit: 4d3fadbcd63372e9a1cd15701f882ece252437f4

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>
Re: [PATCH v3 0/3] Add devicetree support of USB for QDU/QRU1000
Posted by Dmitry Baryshkov 1 year, 7 months ago
On Thu, 2 May 2024 at 12:04, Komal Bajaj <quic_kbajaj@quicinc.com> wrote:
>
> This series adds devicetree nodes to support interconnects and usb for qdu/qru1000.
> This is based on previously sent driver series[1].
>
> ------
> Changes in v3:
> * As per comments on upstream[2], to get role-switch working on QDU/QRU1000, it was recommended to
>   use the actual TI switch driver. Since driver doesn't have the functionality to provide role-switch
>   based on gpio, thus reverting back USB dr_mode to peripheral and removed the remote end-point nodes
>   and usb-conn-gpio based role switch functionality.

This is not correct. The recommendation was to describe hardware properly.
Which means adding schema description, adding  ti,your-switch
compatible to the usb-conn-gpio.c driver, etc.

> * Link to v2: https://lore.kernel.org/linux-arm-msm/20240319091020.15137-1-quic_kbajaj@quicinc.com/
>
> Changes in v2:
> * Changes qmpphy node name
> * Changes dr_mode to otg and added USB-B port USB role switch
> * Dropped maximum-speed property from usb dwc3 node
> * Link to v1: https://lore.kernel.org/linux-arm-msm/20240311120859.18489-1-quic_kbajaj@quicinc.com/
>
> [1] https://lore.kernel.org/linux-arm-msm/20240502082017.13777-1-quic_kbajaj@quicinc.com/
> [2] https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
> ------
>
> Komal Bajaj (3):
>   arm64: dts: qcom: qdu1000: Add USB3 and PHY support
>   arm64: dts: qcom: qdu1000-idp: enable USB nodes
>   arm64: dts: qcom: qru1000-idp: enable USB nodes
>
>  arch/arm64/boot/dts/qcom/qdu1000-idp.dts |  23 +++++
>  arch/arm64/boot/dts/qcom/qdu1000.dtsi    | 120 +++++++++++++++++++++++
>  arch/arm64/boot/dts/qcom/qru1000-idp.dts |  23 +++++
>  3 files changed, 166 insertions(+)
>
> --
> 2.42.0
>
>


-- 
With best wishes
Dmitry
Re: [PATCH v3 0/3] Add devicetree support of USB for QDU/QRU1000
Posted by Bjorn Andersson 1 year, 6 months ago
On Thu, May 02, 2024 at 12:09:41PM GMT, Dmitry Baryshkov wrote:
> On Thu, 2 May 2024 at 12:04, Komal Bajaj <quic_kbajaj@quicinc.com> wrote:
> >
> > This series adds devicetree nodes to support interconnects and usb for qdu/qru1000.
> > This is based on previously sent driver series[1].
> >
> > ------
> > Changes in v3:
> > * As per comments on upstream[2], to get role-switch working on QDU/QRU1000, it was recommended to
> >   use the actual TI switch driver. Since driver doesn't have the functionality to provide role-switch
> >   based on gpio, thus reverting back USB dr_mode to peripheral and removed the remote end-point nodes
> >   and usb-conn-gpio based role switch functionality.
> 
> This is not correct. The recommendation was to describe hardware properly.
> Which means adding schema description, adding  ti,your-switch
> compatible to the usb-conn-gpio.c driver, etc.
> 

In addition to wrangling the ti,switch implementation (and binding) into
something that only deals with the gpios and not actually talks to the
chip, this would also require us to add support for fishing out
vbus-supply of the connector and control that from said driver (or from
dwc3, or from dwc3-qcom...).

Given that I find it acceptable to pick up the peripheral-only support
as presented...

Regards,
Bjorn

> > * Link to v2: https://lore.kernel.org/linux-arm-msm/20240319091020.15137-1-quic_kbajaj@quicinc.com/
> >
> > Changes in v2:
> > * Changes qmpphy node name
> > * Changes dr_mode to otg and added USB-B port USB role switch
> > * Dropped maximum-speed property from usb dwc3 node
> > * Link to v1: https://lore.kernel.org/linux-arm-msm/20240311120859.18489-1-quic_kbajaj@quicinc.com/
> >
> > [1] https://lore.kernel.org/linux-arm-msm/20240502082017.13777-1-quic_kbajaj@quicinc.com/
> > [2] https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
> > ------
> >
> > Komal Bajaj (3):
> >   arm64: dts: qcom: qdu1000: Add USB3 and PHY support
> >   arm64: dts: qcom: qdu1000-idp: enable USB nodes
> >   arm64: dts: qcom: qru1000-idp: enable USB nodes
> >
> >  arch/arm64/boot/dts/qcom/qdu1000-idp.dts |  23 +++++
> >  arch/arm64/boot/dts/qcom/qdu1000.dtsi    | 120 +++++++++++++++++++++++
> >  arch/arm64/boot/dts/qcom/qru1000-idp.dts |  23 +++++
> >  3 files changed, 166 insertions(+)
> >
> > --
> > 2.42.0
> >
> >
> 
> 
> -- 
> With best wishes
> Dmitry
Re: [PATCH v3 0/3] Add devicetree support of USB for QDU/QRU1000
Posted by Dmitry Baryshkov 1 year, 6 months ago
On Sun, May 26, 2024 at 07:28:42PM -0500, Bjorn Andersson wrote:
> On Thu, May 02, 2024 at 12:09:41PM GMT, Dmitry Baryshkov wrote:
> > On Thu, 2 May 2024 at 12:04, Komal Bajaj <quic_kbajaj@quicinc.com> wrote:
> > >
> > > This series adds devicetree nodes to support interconnects and usb for qdu/qru1000.
> > > This is based on previously sent driver series[1].
> > >
> > > ------
> > > Changes in v3:
> > > * As per comments on upstream[2], to get role-switch working on QDU/QRU1000, it was recommended to
> > >   use the actual TI switch driver. Since driver doesn't have the functionality to provide role-switch
> > >   based on gpio, thus reverting back USB dr_mode to peripheral and removed the remote end-point nodes
> > >   and usb-conn-gpio based role switch functionality.
> > 
> > This is not correct. The recommendation was to describe hardware properly.
> > Which means adding schema description, adding  ti,your-switch
> > compatible to the usb-conn-gpio.c driver, etc.
> > 
> 
> In addition to wrangling the ti,switch implementation (and binding) into
> something that only deals with the gpios and not actually talks to the
> chip, this would also require us to add support for fishing out
> vbus-supply of the connector and control that from said driver (or from
> dwc3, or from dwc3-qcom...).
> 
> Given that I find it acceptable to pick up the peripheral-only support
> as presented...

If there will be a followup, I tend to agree here.

For the series:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


> 
> Regards,
> Bjorn
> 
> > > * Link to v2: https://lore.kernel.org/linux-arm-msm/20240319091020.15137-1-quic_kbajaj@quicinc.com/
> > >
> > > Changes in v2:
> > > * Changes qmpphy node name
> > > * Changes dr_mode to otg and added USB-B port USB role switch
> > > * Dropped maximum-speed property from usb dwc3 node
> > > * Link to v1: https://lore.kernel.org/linux-arm-msm/20240311120859.18489-1-quic_kbajaj@quicinc.com/
> > >
> > > [1] https://lore.kernel.org/linux-arm-msm/20240502082017.13777-1-quic_kbajaj@quicinc.com/
> > > [2] https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
> > > ------
> > >
> > > Komal Bajaj (3):
> > >   arm64: dts: qcom: qdu1000: Add USB3 and PHY support
> > >   arm64: dts: qcom: qdu1000-idp: enable USB nodes
> > >   arm64: dts: qcom: qru1000-idp: enable USB nodes
> > >
> > >  arch/arm64/boot/dts/qcom/qdu1000-idp.dts |  23 +++++
> > >  arch/arm64/boot/dts/qcom/qdu1000.dtsi    | 120 +++++++++++++++++++++++
> > >  arch/arm64/boot/dts/qcom/qru1000-idp.dts |  23 +++++
> > >  3 files changed, 166 insertions(+)
> > >
> > > --
> > > 2.42.0
> > >
> > >
> > 
> > 
> > -- 
> > With best wishes
> > Dmitry

-- 
With best wishes
Dmitry
Re: [PATCH v3 0/3] Add devicetree support of USB for QDU/QRU1000
Posted by Krishna Kurapati PSSNV 1 year, 7 months ago

On 5/2/2024 2:39 PM, Dmitry Baryshkov wrote:
> On Thu, 2 May 2024 at 12:04, Komal Bajaj <quic_kbajaj@quicinc.com> wrote:
>>
>> This series adds devicetree nodes to support interconnects and usb for qdu/qru1000.
>> This is based on previously sent driver series[1].
>>
>> ------
>> Changes in v3:
>> * As per comments on upstream[2], to get role-switch working on QDU/QRU1000, it was recommended to
>>    use the actual TI switch driver. Since driver doesn't have the functionality to provide role-switch
>>    based on gpio, thus reverting back USB dr_mode to peripheral and removed the remote end-point nodes
>>    and usb-conn-gpio based role switch functionality.
> 
> This is not correct. The recommendation was to describe hardware properly.
> Which means adding schema description, adding  ti,your-switch
> compatible to the usb-conn-gpio.c driver, etc.
> 

Hi Dmitry,

  Sorry for the confusion. In the comments [1],

"So the compatible string should be "ti,hd3ss3220". Which is fine to be
used in the platform driver. Just describe the differences in the
schema."

The compatible "ti,hd3ss3220" is already associated with a TI switch 
driver [2]. But it works based on I2C. So we assumed you wanted us to 
make changes to [2] by adding GPIO functionality (which usb-conn-gpio 
exactly does), since the compatible you suggested matched with the TI 
driver.

If it was to add compatible in usb-conn-gpio, then we can support OTG 
functionality with no schema changes I believe, but the compatible 
string might need a different name to avoid clashing with the name in [2].

[1]: 
https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/

[2]: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/typec/hd3ss3220.c?h=v6.9-rc2

Regards,
Krishna,

>> * Link to v2: https://lore.kernel.org/linux-arm-msm/20240319091020.15137-1-quic_kbajaj@quicinc.com/
>>
>> Changes in v2:
>> * Changes qmpphy node name
>> * Changes dr_mode to otg and added USB-B port USB role switch
>> * Dropped maximum-speed property from usb dwc3 node
>> * Link to v1: https://lore.kernel.org/linux-arm-msm/20240311120859.18489-1-quic_kbajaj@quicinc.com/
>>
>> [1] https://lore.kernel.org/linux-arm-msm/20240502082017.13777-1-quic_kbajaj@quicinc.com/
>> [2] https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
>> ------
>>
>> Komal Bajaj (3):
>>    arm64: dts: qcom: qdu1000: Add USB3 and PHY support
>>    arm64: dts: qcom: qdu1000-idp: enable USB nodes
>>    arm64: dts: qcom: qru1000-idp: enable USB nodes
>>
>>   arch/arm64/boot/dts/qcom/qdu1000-idp.dts |  23 +++++
>>   arch/arm64/boot/dts/qcom/qdu1000.dtsi    | 120 +++++++++++++++++++++++
>>   arch/arm64/boot/dts/qcom/qru1000-idp.dts |  23 +++++
>>   3 files changed, 166 insertions(+)
>>
>> --
>> 2.42.0
>>
>>
> 
>
Re: [PATCH v3 0/3] Add devicetree support of USB for QDU/QRU1000
Posted by Dmitry Baryshkov 1 year, 7 months ago
On Thu, 2 May 2024 at 12:48, Krishna Kurapati PSSNV
<quic_kriskura@quicinc.com> wrote:
>
>
>
> On 5/2/2024 2:39 PM, Dmitry Baryshkov wrote:
> > On Thu, 2 May 2024 at 12:04, Komal Bajaj <quic_kbajaj@quicinc.com> wrote:
> >>
> >> This series adds devicetree nodes to support interconnects and usb for qdu/qru1000.
> >> This is based on previously sent driver series[1].
> >>
> >> ------
> >> Changes in v3:
> >> * As per comments on upstream[2], to get role-switch working on QDU/QRU1000, it was recommended to
> >>    use the actual TI switch driver. Since driver doesn't have the functionality to provide role-switch
> >>    based on gpio, thus reverting back USB dr_mode to peripheral and removed the remote end-point nodes
> >>    and usb-conn-gpio based role switch functionality.
> >
> > This is not correct. The recommendation was to describe hardware properly.
> > Which means adding schema description, adding  ti,your-switch
> > compatible to the usb-conn-gpio.c driver, etc.
> >
>
> Hi Dmitry,
>
>   Sorry for the confusion. In the comments [1],
>
> "So the compatible string should be "ti,hd3ss3220". Which is fine to be
> used in the platform driver. Just describe the differences in the
> schema."
>
> The compatible "ti,hd3ss3220" is already associated with a TI switch
> driver [2]. But it works based on I2C. So we assumed you wanted us to
> make changes to [2] by adding GPIO functionality (which usb-conn-gpio
> exactly does), since the compatible you suggested matched with the TI
> driver.

First of all, please don't make assumptions. It's better to ask rather
than making assumptions which turn up to be incorrect.

Compatibles describe hardware. DT describes hardware. There are no
drivers in question (yet).
You have TI switch on your board, so you have to use "ti,hd3ss3220" to
describe it.

Existing schema describes it as an I2C device. You have to extend the
schema to allow non-i2c attachment. Describe GPIOs, make reg optional.
Make this description purely from the datasheet and usb-c-connector
point of view.

> If it was to add compatible in usb-conn-gpio, then we can support OTG
> functionality with no schema changes I believe, but the compatible
> string might need a different name to avoid clashing with the name in [2].

And this is the second, largely independent question. The
usb-conn-gpio driver is a platform driver.The existing hd3ss3220.c
driver is an I2C one. There is no clash between them.

Note, unlike plain gpio-b-connector, the switch supports more pins and
actually provides USB-C information to the host even when used in the
dumb mode. Thus it might be better to add a separate driver that
registers typec port and reports USB-C events.

>
> [1]:
> https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
>
> [2]:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/typec/hd3ss3220.c?h=v6.9-rc2
>
> Regards,
> Krishna,
>
> >> * Link to v2: https://lore.kernel.org/linux-arm-msm/20240319091020.15137-1-quic_kbajaj@quicinc.com/
> >>
> >> Changes in v2:
> >> * Changes qmpphy node name
> >> * Changes dr_mode to otg and added USB-B port USB role switch
> >> * Dropped maximum-speed property from usb dwc3 node
> >> * Link to v1: https://lore.kernel.org/linux-arm-msm/20240311120859.18489-1-quic_kbajaj@quicinc.com/
> >>
> >> [1] https://lore.kernel.org/linux-arm-msm/20240502082017.13777-1-quic_kbajaj@quicinc.com/
> >> [2] https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
> >> ------
> >>
> >> Komal Bajaj (3):
> >>    arm64: dts: qcom: qdu1000: Add USB3 and PHY support
> >>    arm64: dts: qcom: qdu1000-idp: enable USB nodes
> >>    arm64: dts: qcom: qru1000-idp: enable USB nodes
> >>
> >>   arch/arm64/boot/dts/qcom/qdu1000-idp.dts |  23 +++++
> >>   arch/arm64/boot/dts/qcom/qdu1000.dtsi    | 120 +++++++++++++++++++++++
> >>   arch/arm64/boot/dts/qcom/qru1000-idp.dts |  23 +++++
> >>   3 files changed, 166 insertions(+)
> >>
> >> --
> >> 2.42.0
> >>
> >>
> >
> >



-- 
With best wishes
Dmitry
Re: [PATCH v3 0/3] Add devicetree support of USB for QDU/QRU1000
Posted by Komal Bajaj 1 year, 7 months ago

On 5/2/2024 5:14 PM, Dmitry Baryshkov wrote:
> On Thu, 2 May 2024 at 12:48, Krishna Kurapati PSSNV
> <quic_kriskura@quicinc.com> wrote:
>>
>>
>>
>> On 5/2/2024 2:39 PM, Dmitry Baryshkov wrote:
>>> On Thu, 2 May 2024 at 12:04, Komal Bajaj <quic_kbajaj@quicinc.com> wrote:
>>>>
>>>> This series adds devicetree nodes to support interconnects and usb for qdu/qru1000.
>>>> This is based on previously sent driver series[1].
>>>>
>>>> ------
>>>> Changes in v3:
>>>> * As per comments on upstream[2], to get role-switch working on QDU/QRU1000, it was recommended to
>>>>     use the actual TI switch driver. Since driver doesn't have the functionality to provide role-switch
>>>>     based on gpio, thus reverting back USB dr_mode to peripheral and removed the remote end-point nodes
>>>>     and usb-conn-gpio based role switch functionality.
>>>
>>> This is not correct. The recommendation was to describe hardware properly.
>>> Which means adding schema description, adding  ti,your-switch
>>> compatible to the usb-conn-gpio.c driver, etc.
>>>
>>
>> Hi Dmitry,
>>
>>    Sorry for the confusion. In the comments [1],
>>
>> "So the compatible string should be "ti,hd3ss3220". Which is fine to be
>> used in the platform driver. Just describe the differences in the
>> schema."
>>
>> The compatible "ti,hd3ss3220" is already associated with a TI switch
>> driver [2]. But it works based on I2C. So we assumed you wanted us to
>> make changes to [2] by adding GPIO functionality (which usb-conn-gpio
>> exactly does), since the compatible you suggested matched with the TI
>> driver.
> 
> First of all, please don't make assumptions. It's better to ask rather
> than making assumptions which turn up to be incorrect.
> 
> Compatibles describe hardware. DT describes hardware. There are no
> drivers in question (yet).
> You have TI switch on your board, so you have to use "ti,hd3ss3220" to
> describe it.
> 
> Existing schema describes it as an I2C device. You have to extend the
> schema to allow non-i2c attachment. Describe GPIOs, make reg optional.
> Make this description purely from the datasheet and usb-c-connector
> point of view.
> 
>> If it was to add compatible in usb-conn-gpio, then we can support OTG
>> functionality with no schema changes I believe, but the compatible
>> string might need a different name to avoid clashing with the name in [2].
> 
> And this is the second, largely independent question. The
> usb-conn-gpio driver is a platform driver.The existing hd3ss3220.c
> driver is an I2C one. There is no clash between them.
> 
> Note, unlike plain gpio-b-connector, the switch supports more pins and
> actually provides USB-C information to the host even when used in the
> dumb mode. Thus it might be better to add a separate driver that
> registers typec port and reports USB-C events.

Hi Dmitry,

Regarding the comment:
"Note, unlike plain gpio-b-connector, the switch supports more pins and 
actually provides USB-C information to the host even when used in the 
dumb mode. Thus it might be better to add a separate driver that 
registers typec port and reports USB-C events."

We are also aligned with your statement of expressing the hardware 
correctly. Since this needs quite a bit of effort to write a new driver 
for TI switch or modifying existing TI driver to add GPIO support, can't 
we go ahead with peripheral support only since the driver support is 
absent currently.

We will plan to submit the patches in upcoming days for this. Since we 
usually enable USB in peripheral mode so that USB debug (adb) will work, 
I am thinking we can merge this and take up the OTG/host mode 
separately. Please let me know your feedback on this.

Thanks
Komal

> 
>>
>> [1]:
>> https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
>>
>> [2]:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/typec/hd3ss3220.c?h=v6.9-rc2
>>
>> Regards,
>> Krishna,
>>
>>>> * Link to v2: https://lore.kernel.org/linux-arm-msm/20240319091020.15137-1-quic_kbajaj@quicinc.com/
>>>>
>>>> Changes in v2:
>>>> * Changes qmpphy node name
>>>> * Changes dr_mode to otg and added USB-B port USB role switch
>>>> * Dropped maximum-speed property from usb dwc3 node
>>>> * Link to v1: https://lore.kernel.org/linux-arm-msm/20240311120859.18489-1-quic_kbajaj@quicinc.com/
>>>>
>>>> [1] https://lore.kernel.org/linux-arm-msm/20240502082017.13777-1-quic_kbajaj@quicinc.com/
>>>> [2] https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
>>>> ------
>>>>
>>>> Komal Bajaj (3):
>>>>     arm64: dts: qcom: qdu1000: Add USB3 and PHY support
>>>>     arm64: dts: qcom: qdu1000-idp: enable USB nodes
>>>>     arm64: dts: qcom: qru1000-idp: enable USB nodes
>>>>
>>>>    arch/arm64/boot/dts/qcom/qdu1000-idp.dts |  23 +++++
>>>>    arch/arm64/boot/dts/qcom/qdu1000.dtsi    | 120 +++++++++++++++++++++++
>>>>    arch/arm64/boot/dts/qcom/qru1000-idp.dts |  23 +++++
>>>>    3 files changed, 166 insertions(+)
>>>>
>>>> --
>>>> 2.42.0
>>>>
>>>>
>>>
>>>
> 
> 
>
Re: [PATCH v3 0/3] Add devicetree support of USB for QDU/QRU1000
Posted by Dmitry Baryshkov 1 year, 7 months ago
On Wed, 8 May 2024 at 09:12, Komal Bajaj <quic_kbajaj@quicinc.com> wrote:
>
>
>
> On 5/2/2024 5:14 PM, Dmitry Baryshkov wrote:
> > On Thu, 2 May 2024 at 12:48, Krishna Kurapati PSSNV
> > <quic_kriskura@quicinc.com> wrote:
> >>
> >>
> >>
> >> On 5/2/2024 2:39 PM, Dmitry Baryshkov wrote:
> >>> On Thu, 2 May 2024 at 12:04, Komal Bajaj <quic_kbajaj@quicinc.com> wrote:
> >>>>
> >>>> This series adds devicetree nodes to support interconnects and usb for qdu/qru1000.
> >>>> This is based on previously sent driver series[1].
> >>>>
> >>>> ------
> >>>> Changes in v3:
> >>>> * As per comments on upstream[2], to get role-switch working on QDU/QRU1000, it was recommended to
> >>>>     use the actual TI switch driver. Since driver doesn't have the functionality to provide role-switch
> >>>>     based on gpio, thus reverting back USB dr_mode to peripheral and removed the remote end-point nodes
> >>>>     and usb-conn-gpio based role switch functionality.
> >>>
> >>> This is not correct. The recommendation was to describe hardware properly.
> >>> Which means adding schema description, adding  ti,your-switch
> >>> compatible to the usb-conn-gpio.c driver, etc.
> >>>
> >>
> >> Hi Dmitry,
> >>
> >>    Sorry for the confusion. In the comments [1],
> >>
> >> "So the compatible string should be "ti,hd3ss3220". Which is fine to be
> >> used in the platform driver. Just describe the differences in the
> >> schema."
> >>
> >> The compatible "ti,hd3ss3220" is already associated with a TI switch
> >> driver [2]. But it works based on I2C. So we assumed you wanted us to
> >> make changes to [2] by adding GPIO functionality (which usb-conn-gpio
> >> exactly does), since the compatible you suggested matched with the TI
> >> driver.
> >
> > First of all, please don't make assumptions. It's better to ask rather
> > than making assumptions which turn up to be incorrect.
> >
> > Compatibles describe hardware. DT describes hardware. There are no
> > drivers in question (yet).
> > You have TI switch on your board, so you have to use "ti,hd3ss3220" to
> > describe it.
> >
> > Existing schema describes it as an I2C device. You have to extend the
> > schema to allow non-i2c attachment. Describe GPIOs, make reg optional.
> > Make this description purely from the datasheet and usb-c-connector
> > point of view.
> >
> >> If it was to add compatible in usb-conn-gpio, then we can support OTG
> >> functionality with no schema changes I believe, but the compatible
> >> string might need a different name to avoid clashing with the name in [2].
> >
> > And this is the second, largely independent question. The
> > usb-conn-gpio driver is a platform driver.The existing hd3ss3220.c
> > driver is an I2C one. There is no clash between them.
> >
> > Note, unlike plain gpio-b-connector, the switch supports more pins and
> > actually provides USB-C information to the host even when used in the
> > dumb mode. Thus it might be better to add a separate driver that
> > registers typec port and reports USB-C events.
>
> Hi Dmitry,
>
> Regarding the comment:
> "Note, unlike plain gpio-b-connector, the switch supports more pins and
> actually provides USB-C information to the host even when used in the
> dumb mode. Thus it might be better to add a separate driver that
> registers typec port and reports USB-C events."
>
> We are also aligned with your statement of expressing the hardware
> correctly. Since this needs quite a bit of effort to write a new driver
> for TI switch or modifying existing TI driver to add GPIO support, can't
> we go ahead with peripheral support only since the driver support is
> absent currently.

I think you are again mixing things here. You don't have to use the
existing TI driver. Instead you can start with the
gpio-b-usb-connector driver and later push a new driver for the switch
instead. This has nothing to do with the hardware description of the
device.

>
> We will plan to submit the patches in upcoming days for this. Since we
> usually enable USB in peripheral mode so that USB debug (adb) will work,
> I am thinking we can merge this and take up the OTG/host mode
> separately. Please let me know your feedback on this.

Well, granted that we are now close to the release, you can not merge
anything. So you have about three weeks before the next patches can
hit Bjorn's tree. I think this leaves plenty of time to develop a
proper solution.

>
> Thanks
> Komal
>
> >
> >>
> >> [1]:
> >> https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
> >>
> >> [2]:
> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/typec/hd3ss3220.c?h=v6.9-rc2
> >>
> >> Regards,
> >> Krishna,
> >>
> >>>> * Link to v2: https://lore.kernel.org/linux-arm-msm/20240319091020.15137-1-quic_kbajaj@quicinc.com/
> >>>>
> >>>> Changes in v2:
> >>>> * Changes qmpphy node name
> >>>> * Changes dr_mode to otg and added USB-B port USB role switch
> >>>> * Dropped maximum-speed property from usb dwc3 node
> >>>> * Link to v1: https://lore.kernel.org/linux-arm-msm/20240311120859.18489-1-quic_kbajaj@quicinc.com/
> >>>>
> >>>> [1] https://lore.kernel.org/linux-arm-msm/20240502082017.13777-1-quic_kbajaj@quicinc.com/
> >>>> [2] https://lore.kernel.org/all/CAA8EJppNZrLzT=vGS0NXnKJT_wL+bMB9jFhJ9K7b7FPgFQbcig@mail.gmail.com/
> >>>> ------
> >>>>
> >>>> Komal Bajaj (3):
> >>>>     arm64: dts: qcom: qdu1000: Add USB3 and PHY support
> >>>>     arm64: dts: qcom: qdu1000-idp: enable USB nodes
> >>>>     arm64: dts: qcom: qru1000-idp: enable USB nodes
> >>>>
> >>>>    arch/arm64/boot/dts/qcom/qdu1000-idp.dts |  23 +++++
> >>>>    arch/arm64/boot/dts/qcom/qdu1000.dtsi    | 120 +++++++++++++++++++++++
> >>>>    arch/arm64/boot/dts/qcom/qru1000-idp.dts |  23 +++++
> >>>>    3 files changed, 166 insertions(+)
> >>>>
> >>>> --
> >>>> 2.42.0
> >>>>
> >>>>
> >>>
> >>>
> >
> >
> >



-- 
With best wishes
Dmitry