* Re: [PATCH] ARM: dts: colibri-imx6ull: Enable dual-role switching
@ 2022-11-03 8:04 ` Francesco Dolcini
0 siblings, 0 replies; 10+ messages in thread
From: Francesco Dolcini @ 2022-11-03 8:04 UTC (permalink / raw)
To: Alexander Stein
Cc: Philippe Schenker, Shawn Guo, devicetree, linux-arm-kernel,
Fabio Estevam, Krzysztof Kozlowski, NXP Linux Team,
Pengutronix Kernel Team, Rob Herring, Sascha Hauer, linux-kernel,
Philippe Schenker
On Thu, Nov 03, 2022 at 08:46:58AM +0100, Alexander Stein wrote:
> Hi Philippe,
>
> Am Mittwoch, 2. November 2022, 16:52:26 CET schrieb Philippe Schenker:
> > From: Philippe Schenker <philippe.schenker@toradex.com>
> >
> > The Colibri standard provides a GPIO called USBC_DET to switch from
> > USB Host to USB Device and back. The Colibri iMX6ULL does have the SoC
> > ball USB_OTG1_VBUS connected in series with a capacitor to ground.
> >
> > This means that we need to provide to the extcon framework VBUS and ID
> > events using the single GPIO we have. The Extcon USB GPIO driver does
> > use id-gpio also for VBUS event, as in our case where vbus-gpio is
> > absent.
> >
> > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
> >
> > ---
> >
> > arch/arm/boot/dts/imx6ull-colibri.dtsi | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > b/arch/arm/boot/dts/imx6ull-colibri.dtsi index 577a424b0e1d..feb1fcd9a684
> > 100644
> > --- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > +++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > @@ -24,6 +24,13 @@ backlight: backlight {
> > status = "okay";
> > };
> >
> > + extcon_usbc_det: usbc-det {
> > + compatible = "linux,extcon-usb-gpio";
> > + id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SODIMM 137 /
> USBC_DET */
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&pinctrl_snvs_usbc_det>;
> > + };
> > +
> > gpio-keys {
> > compatible = "gpio-keys";
> > pinctrl-names = "default";
> > @@ -275,6 +282,7 @@ &uart5 {
> > /* Colibri USBC */
> > &usbotg1 {
> > dr_mode = "otg";
> > + extcon = <&extcon_usbc_det>, <&extcon_usbc_det>;
>
> How came you up with this double entries? Is there some documentation you need
> two phandles?
extcon-usb-gpio provides both vbus/otg_id with a single handle, however
the integration in chipidea is somehow weird, the first entry is supposed to be
used to read the vbus, the second one to read the otg_id.
So if you need to read both you really need to have the handle twice ...
Francesco
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] ARM: dts: colibri-imx6ull: Enable dual-role switching
2022-11-03 8:04 ` Francesco Dolcini
@ 2022-11-07 12:00 ` Philippe Schenker
-1 siblings, 0 replies; 10+ messages in thread
From: Philippe Schenker @ 2022-11-07 12:00 UTC (permalink / raw)
To: francesco@dolcini.it, alexander.stein@ew.tq-group.com
Cc: kernel@pengutronix.de, linux-imx@nxp.com, festevam@gmail.com,
devicetree@vger.kernel.org, shawnguo@kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, s.hauer@pengutronix.de,
krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org
On Thu, 2022-11-03 at 09:04 +0100, Francesco Dolcini wrote:
> On Thu, Nov 03, 2022 at 08:46:58AM +0100, Alexander Stein wrote:
> > Hi Philippe,
> >
> > Am Mittwoch, 2. November 2022, 16:52:26 CET schrieb Philippe
> > Schenker:
> > > From: Philippe Schenker <philippe.schenker@toradex.com>
> > >
> > > The Colibri standard provides a GPIO called USBC_DET to switch
> > > from
> > > USB Host to USB Device and back. The Colibri iMX6ULL does have the
> > > SoC
> > > ball USB_OTG1_VBUS connected in series with a capacitor to ground.
> > >
> > > This means that we need to provide to the extcon framework VBUS
> > > and ID
> > > events using the single GPIO we have. The Extcon USB GPIO driver
> > > does
> > > use id-gpio also for VBUS event, as in our case where vbus-gpio is
> > > absent.
> > >
> > > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
> > >
> > > ---
> > >
> > > arch/arm/boot/dts/imx6ull-colibri.dtsi | 8 ++++++++
> > > 1 file changed, 8 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > b/arch/arm/boot/dts/imx6ull-colibri.dtsi index
> > > 577a424b0e1d..feb1fcd9a684
> > > 100644
> > > --- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > +++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > @@ -24,6 +24,13 @@ backlight: backlight {
> > > status = "okay";
> > > };
> > >
> > > + extcon_usbc_det: usbc-det {
> > > + compatible = "linux,extcon-usb-gpio";
> > > + id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SODIMM
> > > 137 /
> > USBC_DET */
> > > + pinctrl-names = "default";
> > > + pinctrl-0 = <&pinctrl_snvs_usbc_det>;
> > > + };
> > > +
> > > gpio-keys {
> > > compatible = "gpio-keys";
> > > pinctrl-names = "default";
> > > @@ -275,6 +282,7 @@ &uart5 {
> > > /* Colibri USBC */
> > > &usbotg1 {
> > > dr_mode = "otg";
> > > + extcon = <&extcon_usbc_det>, <&extcon_usbc_det>;
> >
> > How came you up with this double entries? Is there some
> > documentation you need
> > two phandles?
>
> extcon-usb-gpio provides both vbus/otg_id with a single handle,
> however
> the integration in chipidea is somehow weird, the first entry is
> supposed to be
> used to read the vbus, the second one to read the otg_id.
>
> So if you need to read both you really need to have the handle twice
> ...
Thanks for the suggestion Alex and Francesco for answering. I cannot add
much more, we tried a lot back and forth due to the really special
hardware-design this solution was the best we found for the colibri-
imx6ull.
Regards,
Philippe
>
> Francesco
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] ARM: dts: colibri-imx6ull: Enable dual-role switching
@ 2022-11-07 12:00 ` Philippe Schenker
0 siblings, 0 replies; 10+ messages in thread
From: Philippe Schenker @ 2022-11-07 12:00 UTC (permalink / raw)
To: francesco@dolcini.it, alexander.stein@ew.tq-group.com
Cc: kernel@pengutronix.de, linux-imx@nxp.com, festevam@gmail.com,
devicetree@vger.kernel.org, shawnguo@kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, s.hauer@pengutronix.de,
krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org
On Thu, 2022-11-03 at 09:04 +0100, Francesco Dolcini wrote:
> On Thu, Nov 03, 2022 at 08:46:58AM +0100, Alexander Stein wrote:
> > Hi Philippe,
> >
> > Am Mittwoch, 2. November 2022, 16:52:26 CET schrieb Philippe
> > Schenker:
> > > From: Philippe Schenker <philippe.schenker@toradex.com>
> > >
> > > The Colibri standard provides a GPIO called USBC_DET to switch
> > > from
> > > USB Host to USB Device and back. The Colibri iMX6ULL does have the
> > > SoC
> > > ball USB_OTG1_VBUS connected in series with a capacitor to ground.
> > >
> > > This means that we need to provide to the extcon framework VBUS
> > > and ID
> > > events using the single GPIO we have. The Extcon USB GPIO driver
> > > does
> > > use id-gpio also for VBUS event, as in our case where vbus-gpio is
> > > absent.
> > >
> > > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
> > >
> > > ---
> > >
> > > arch/arm/boot/dts/imx6ull-colibri.dtsi | 8 ++++++++
> > > 1 file changed, 8 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > b/arch/arm/boot/dts/imx6ull-colibri.dtsi index
> > > 577a424b0e1d..feb1fcd9a684
> > > 100644
> > > --- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > +++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > @@ -24,6 +24,13 @@ backlight: backlight {
> > > status = "okay";
> > > };
> > >
> > > + extcon_usbc_det: usbc-det {
> > > + compatible = "linux,extcon-usb-gpio";
> > > + id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SODIMM
> > > 137 /
> > USBC_DET */
> > > + pinctrl-names = "default";
> > > + pinctrl-0 = <&pinctrl_snvs_usbc_det>;
> > > + };
> > > +
> > > gpio-keys {
> > > compatible = "gpio-keys";
> > > pinctrl-names = "default";
> > > @@ -275,6 +282,7 @@ &uart5 {
> > > /* Colibri USBC */
> > > &usbotg1 {
> > > dr_mode = "otg";
> > > + extcon = <&extcon_usbc_det>, <&extcon_usbc_det>;
> >
> > How came you up with this double entries? Is there some
> > documentation you need
> > two phandles?
>
> extcon-usb-gpio provides both vbus/otg_id with a single handle,
> however
> the integration in chipidea is somehow weird, the first entry is
> supposed to be
> used to read the vbus, the second one to read the otg_id.
>
> So if you need to read both you really need to have the handle twice
> ...
Thanks for the suggestion Alex and Francesco for answering. I cannot add
much more, we tried a lot back and forth due to the really special
hardware-design this solution was the best we found for the colibri-
imx6ull.
Regards,
Philippe
>
> Francesco
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ARM: dts: colibri-imx6ull: Enable dual-role switching
2022-11-03 8:04 ` Francesco Dolcini
@ 2022-11-11 5:17 ` Shawn Guo
-1 siblings, 0 replies; 10+ messages in thread
From: Shawn Guo @ 2022-11-11 5:17 UTC (permalink / raw)
To: Francesco Dolcini
Cc: Alexander Stein, Philippe Schenker, devicetree, linux-arm-kernel,
Fabio Estevam, Krzysztof Kozlowski, NXP Linux Team,
Pengutronix Kernel Team, Rob Herring, Sascha Hauer, linux-kernel,
Philippe Schenker
On Thu, Nov 03, 2022 at 09:04:53AM +0100, Francesco Dolcini wrote:
> On Thu, Nov 03, 2022 at 08:46:58AM +0100, Alexander Stein wrote:
> > Hi Philippe,
> >
> > Am Mittwoch, 2. November 2022, 16:52:26 CET schrieb Philippe Schenker:
> > > From: Philippe Schenker <philippe.schenker@toradex.com>
> > >
> > > The Colibri standard provides a GPIO called USBC_DET to switch from
> > > USB Host to USB Device and back. The Colibri iMX6ULL does have the SoC
> > > ball USB_OTG1_VBUS connected in series with a capacitor to ground.
> > >
> > > This means that we need to provide to the extcon framework VBUS and ID
> > > events using the single GPIO we have. The Extcon USB GPIO driver does
> > > use id-gpio also for VBUS event, as in our case where vbus-gpio is
> > > absent.
> > >
> > > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
> > >
> > > ---
> > >
> > > arch/arm/boot/dts/imx6ull-colibri.dtsi | 8 ++++++++
> > > 1 file changed, 8 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > b/arch/arm/boot/dts/imx6ull-colibri.dtsi index 577a424b0e1d..feb1fcd9a684
> > > 100644
> > > --- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > +++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > @@ -24,6 +24,13 @@ backlight: backlight {
> > > status = "okay";
> > > };
> > >
> > > + extcon_usbc_det: usbc-det {
> > > + compatible = "linux,extcon-usb-gpio";
> > > + id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SODIMM 137 /
> > USBC_DET */
> > > + pinctrl-names = "default";
> > > + pinctrl-0 = <&pinctrl_snvs_usbc_det>;
> > > + };
> > > +
> > > gpio-keys {
> > > compatible = "gpio-keys";
> > > pinctrl-names = "default";
> > > @@ -275,6 +282,7 @@ &uart5 {
> > > /* Colibri USBC */
> > > &usbotg1 {
> > > dr_mode = "otg";
> > > + extcon = <&extcon_usbc_det>, <&extcon_usbc_det>;
> >
> > How came you up with this double entries? Is there some documentation you need
> > two phandles?
>
> extcon-usb-gpio provides both vbus/otg_id with a single handle, however
> the integration in chipidea is somehow weird, the first entry is supposed to be
> used to read the vbus, the second one to read the otg_id.
>
> So if you need to read both you really need to have the handle twice ...
Thanks for the input, Francesco!
Philippe,
Do you consider to use usb-role-switch as suggested by Alexander,
considering the weirdness of how chipidea driver supports extcon-usb-gpio?
Shawn
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] ARM: dts: colibri-imx6ull: Enable dual-role switching
@ 2022-11-11 5:17 ` Shawn Guo
0 siblings, 0 replies; 10+ messages in thread
From: Shawn Guo @ 2022-11-11 5:17 UTC (permalink / raw)
To: Francesco Dolcini
Cc: Alexander Stein, Philippe Schenker, devicetree, linux-arm-kernel,
Fabio Estevam, Krzysztof Kozlowski, NXP Linux Team,
Pengutronix Kernel Team, Rob Herring, Sascha Hauer, linux-kernel,
Philippe Schenker
On Thu, Nov 03, 2022 at 09:04:53AM +0100, Francesco Dolcini wrote:
> On Thu, Nov 03, 2022 at 08:46:58AM +0100, Alexander Stein wrote:
> > Hi Philippe,
> >
> > Am Mittwoch, 2. November 2022, 16:52:26 CET schrieb Philippe Schenker:
> > > From: Philippe Schenker <philippe.schenker@toradex.com>
> > >
> > > The Colibri standard provides a GPIO called USBC_DET to switch from
> > > USB Host to USB Device and back. The Colibri iMX6ULL does have the SoC
> > > ball USB_OTG1_VBUS connected in series with a capacitor to ground.
> > >
> > > This means that we need to provide to the extcon framework VBUS and ID
> > > events using the single GPIO we have. The Extcon USB GPIO driver does
> > > use id-gpio also for VBUS event, as in our case where vbus-gpio is
> > > absent.
> > >
> > > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
> > >
> > > ---
> > >
> > > arch/arm/boot/dts/imx6ull-colibri.dtsi | 8 ++++++++
> > > 1 file changed, 8 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > b/arch/arm/boot/dts/imx6ull-colibri.dtsi index 577a424b0e1d..feb1fcd9a684
> > > 100644
> > > --- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > +++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
> > > @@ -24,6 +24,13 @@ backlight: backlight {
> > > status = "okay";
> > > };
> > >
> > > + extcon_usbc_det: usbc-det {
> > > + compatible = "linux,extcon-usb-gpio";
> > > + id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SODIMM 137 /
> > USBC_DET */
> > > + pinctrl-names = "default";
> > > + pinctrl-0 = <&pinctrl_snvs_usbc_det>;
> > > + };
> > > +
> > > gpio-keys {
> > > compatible = "gpio-keys";
> > > pinctrl-names = "default";
> > > @@ -275,6 +282,7 @@ &uart5 {
> > > /* Colibri USBC */
> > > &usbotg1 {
> > > dr_mode = "otg";
> > > + extcon = <&extcon_usbc_det>, <&extcon_usbc_det>;
> >
> > How came you up with this double entries? Is there some documentation you need
> > two phandles?
>
> extcon-usb-gpio provides both vbus/otg_id with a single handle, however
> the integration in chipidea is somehow weird, the first entry is supposed to be
> used to read the vbus, the second one to read the otg_id.
>
> So if you need to read both you really need to have the handle twice ...
Thanks for the input, Francesco!
Philippe,
Do you consider to use usb-role-switch as suggested by Alexander,
considering the weirdness of how chipidea driver supports extcon-usb-gpio?
Shawn
^ permalink raw reply [flat|nested] 10+ messages in thread