2020-07-10 13:27:35

by Philippe Schenker

[permalink] [raw]
Subject: [PATCH 2/3] ARM: dts: colibri-imx6: add usb dual-role switch capability

Since the runtime-pm wakeup bug was fixed in
drivers/usb/chipidea/core.c usb dual-role host/device switching is
working. So make use of it.

Signed-off-by: Philippe Schenker <[email protected]>
---

arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts | 8 ++++++++
arch/arm/boot/dts/imx6qdl-colibri.dtsi | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts b/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
index 65359aece950..c978b3f19a2d 100644
--- a/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
+++ b/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
@@ -45,6 +45,13 @@ clk16m: clock-16m {
clock-output-names = "clk16m";
};

+ extcon_usbc_det: usbc_det {
+ compatible = "linux,extcon-usb-gpio";
+ id-gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_usbc_det>;
+ };
+
gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
@@ -220,6 +227,7 @@ &usbh1 {
};

&usbotg {
+ extcon = <0>, <&extcon_usbc_det>;
status = "okay";
};

diff --git a/arch/arm/boot/dts/imx6qdl-colibri.dtsi b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
index a4a54c82e28f..de49f9faa426 100644
--- a/arch/arm/boot/dts/imx6qdl-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
@@ -363,7 +363,7 @@ &uart3 {

&usbotg {
disable-over-current;
- dr_mode = "peripheral";
+ dr_mode = "otg";
status = "disabled";
};

--
2.27.0


2020-07-10 13:46:52

by Oleksandr Suvorov

[permalink] [raw]
Subject: Re: [PATCH 2/3] ARM: dts: colibri-imx6: add usb dual-role switch capability

On Fri, Jul 10, 2020 at 4:26 PM Philippe Schenker
<[email protected]> wrote:
>
> Since the runtime-pm wakeup bug was fixed in
> drivers/usb/chipidea/core.c usb dual-role host/device switching is
> working. So make use of it.
>
> Signed-off-by: Philippe Schenker <[email protected]>

Reviewed-by: Oleksandr Suvorov <[email protected]>

> ---
>
> arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts | 8 ++++++++
> arch/arm/boot/dts/imx6qdl-colibri.dtsi | 2 +-
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts b/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
> index 65359aece950..c978b3f19a2d 100644
> --- a/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
> +++ b/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
> @@ -45,6 +45,13 @@ clk16m: clock-16m {
> clock-output-names = "clk16m";
> };
>
> + extcon_usbc_det: usbc_det {
> + compatible = "linux,extcon-usb-gpio";
> + id-gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_usbc_det>;
> + };
> +
> gpio-keys {
> compatible = "gpio-keys";
> pinctrl-names = "default";
> @@ -220,6 +227,7 @@ &usbh1 {
> };
>
> &usbotg {
> + extcon = <0>, <&extcon_usbc_det>;
> status = "okay";
> };
>
> diff --git a/arch/arm/boot/dts/imx6qdl-colibri.dtsi b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
> index a4a54c82e28f..de49f9faa426 100644
> --- a/arch/arm/boot/dts/imx6qdl-colibri.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
> @@ -363,7 +363,7 @@ &uart3 {
>
> &usbotg {
> disable-over-current;
> - dr_mode = "peripheral";
> + dr_mode = "otg";
> status = "disabled";
> };
>
> --
> 2.27.0
>


--
Best regards

Oleksandr Suvorov
[email protected]

--
Best regards
Oleksandr Suvorov

Toradex AG
Ebenaustrasse 10 | 6048 Horw | Switzerland | T: +41 41 500 48 00