All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
@ 2019-05-22  7:12 ` Andrey Smirnov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-22  7:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrey Smirnov, Shawn Guo, Chris Healy, Fabio Estevam,
	Lucas Stach, linux-kernel

Add node for UCS1002 USB charger chip connected to front panel USB and
replace "regulator-fixed" previously used to control VBUS.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 35 ++++++++++++-------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 93be00a60c88..977d923e35df 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -60,18 +60,6 @@
 		regulator-always-on;
 	};
 
-	reg_5p0v_user_usb: regulator-5p0v-user-usb {
-		compatible = "regulator-fixed";
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_reg_user_usb>;
-		vin-supply = <&reg_5p0v_main>;
-		regulator-name = "5V_USER_USB";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
-		startup-delay-us = <1000>;
-	};
-
 	reg_3p3v_pmic: regulator-3p3v-pmic {
 		compatible = "regulator-fixed";
 		vin-supply = <&reg_12p0v>;
@@ -590,6 +578,16 @@
 		status = "disabled";
 	};
 
+	reg_5p0v_user_usb: charger@32 {
+		compatible = "microchip,ucs1002";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_ucs1002_pins>;
+		reg = <0x32>;
+		interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
+				      <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
+		interrupt-names = "a_det", "alert";
+	};
+
 	hpa1: amp@60 {
 		compatible = "ti,tpa6130a2";
 		pinctrl-names = "default";
@@ -982,12 +980,6 @@
 		>;
 	};
 
-	pinctrl_reg_user_usb: usbotggrp {
-		fsl,pins = <
-			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x40000038
-		>;
-	};
-
 	pinctrl_rmii_phy_irq: phygrp {
 		fsl,pins = <
 			MX6QDL_PAD_EIM_D30__GPIO3_IO30		0x40010000
@@ -1047,6 +1039,13 @@
 		>;
 	};
 
+	pinctrl_ucs1002_pins: ucs1002grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_A25__GPIO5_IO02  	0x1b0b0
+			MX6QDL_PAD_EIM_D21__GPIO3_IO21  	0x1b0b0
+		>;
+	};
+
 	pinctrl_usdhc2: usdhc2grp {
 		fsl,pins = <
 			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x10059
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
@ 2019-05-22  7:12 ` Andrey Smirnov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-22  7:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrey Smirnov, Shawn Guo, linux-kernel, Fabio Estevam,
	Chris Healy, Lucas Stach

Add node for UCS1002 USB charger chip connected to front panel USB and
replace "regulator-fixed" previously used to control VBUS.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 35 ++++++++++++-------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 93be00a60c88..977d923e35df 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -60,18 +60,6 @@
 		regulator-always-on;
 	};
 
-	reg_5p0v_user_usb: regulator-5p0v-user-usb {
-		compatible = "regulator-fixed";
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_reg_user_usb>;
-		vin-supply = <&reg_5p0v_main>;
-		regulator-name = "5V_USER_USB";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
-		startup-delay-us = <1000>;
-	};
-
 	reg_3p3v_pmic: regulator-3p3v-pmic {
 		compatible = "regulator-fixed";
 		vin-supply = <&reg_12p0v>;
@@ -590,6 +578,16 @@
 		status = "disabled";
 	};
 
+	reg_5p0v_user_usb: charger@32 {
+		compatible = "microchip,ucs1002";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_ucs1002_pins>;
+		reg = <0x32>;
+		interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
+				      <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
+		interrupt-names = "a_det", "alert";
+	};
+
 	hpa1: amp@60 {
 		compatible = "ti,tpa6130a2";
 		pinctrl-names = "default";
@@ -982,12 +980,6 @@
 		>;
 	};
 
-	pinctrl_reg_user_usb: usbotggrp {
-		fsl,pins = <
-			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x40000038
-		>;
-	};
-
 	pinctrl_rmii_phy_irq: phygrp {
 		fsl,pins = <
 			MX6QDL_PAD_EIM_D30__GPIO3_IO30		0x40010000
@@ -1047,6 +1039,13 @@
 		>;
 	};
 
+	pinctrl_ucs1002_pins: ucs1002grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_A25__GPIO5_IO02  	0x1b0b0
+			MX6QDL_PAD_EIM_D21__GPIO3_IO21  	0x1b0b0
+		>;
+	};
+
 	pinctrl_usdhc2: usdhc2grp {
 		fsl,pins = <
 			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x10059
-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/3] ARM: dts: imx6: rdu2: Disable WP for USDHC2 and USDHC3
  2019-05-22  7:12 ` Andrey Smirnov
@ 2019-05-22  7:12   ` Andrey Smirnov
  -1 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-22  7:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrey Smirnov, Chris Healy, Shawn Guo, Fabio Estevam,
	Lucas Stach, linux-kernel

RDU2 production units come with resistor connecting WP pin to
correpsonding GPIO DNPed for both SD card slots. Drop any WP related
configuration and mark both slots with "disable-wp".

Reported-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 977d923e35df..5484e4b87975 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -625,7 +625,7 @@
 	pinctrl-0 = <&pinctrl_usdhc2>;
 	bus-width = <4>;
 	cd-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
-	wp-gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
+	disable-wp;
 	vmmc-supply = <&reg_3p3v_sd>;
 	vqmmc-supply = <&reg_3p3v>;
 	no-1-8-v;
@@ -638,7 +638,7 @@
 	pinctrl-0 = <&pinctrl_usdhc3>;
 	bus-width = <4>;
 	cd-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
-	wp-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+	disable-wp;
 	vmmc-supply = <&reg_3p3v_sd>;
 	vqmmc-supply = <&reg_3p3v>;
 	no-1-8-v;
@@ -1054,7 +1054,6 @@
 			MX6QDL_PAD_SD2_DAT1__SD2_DATA1		0x17059
 			MX6QDL_PAD_SD2_DAT2__SD2_DATA2		0x17059
 			MX6QDL_PAD_SD2_DAT3__SD2_DATA3		0x17059
-			MX6QDL_PAD_NANDF_D3__GPIO2_IO03		0x40010040
 			MX6QDL_PAD_NANDF_D2__GPIO2_IO02		0x40010040
 		>;
 	};
@@ -1067,7 +1066,6 @@
 			MX6QDL_PAD_SD3_DAT1__SD3_DATA1		0x17059
 			MX6QDL_PAD_SD3_DAT2__SD3_DATA2		0x17059
 			MX6QDL_PAD_SD3_DAT3__SD3_DATA3		0x17059
-			MX6QDL_PAD_NANDF_D1__GPIO2_IO01		0x40010040
 			MX6QDL_PAD_NANDF_D0__GPIO2_IO00		0x40010040
 
 		>;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/3] ARM: dts: imx6: rdu2: Disable WP for USDHC2 and USDHC3
@ 2019-05-22  7:12   ` Andrey Smirnov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-22  7:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrey Smirnov, Shawn Guo, linux-kernel, Fabio Estevam,
	Chris Healy, Lucas Stach

RDU2 production units come with resistor connecting WP pin to
correpsonding GPIO DNPed for both SD card slots. Drop any WP related
configuration and mark both slots with "disable-wp".

Reported-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 977d923e35df..5484e4b87975 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -625,7 +625,7 @@
 	pinctrl-0 = <&pinctrl_usdhc2>;
 	bus-width = <4>;
 	cd-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
-	wp-gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
+	disable-wp;
 	vmmc-supply = <&reg_3p3v_sd>;
 	vqmmc-supply = <&reg_3p3v>;
 	no-1-8-v;
@@ -638,7 +638,7 @@
 	pinctrl-0 = <&pinctrl_usdhc3>;
 	bus-width = <4>;
 	cd-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
-	wp-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+	disable-wp;
 	vmmc-supply = <&reg_3p3v_sd>;
 	vqmmc-supply = <&reg_3p3v>;
 	no-1-8-v;
@@ -1054,7 +1054,6 @@
 			MX6QDL_PAD_SD2_DAT1__SD2_DATA1		0x17059
 			MX6QDL_PAD_SD2_DAT2__SD2_DATA2		0x17059
 			MX6QDL_PAD_SD2_DAT3__SD2_DATA3		0x17059
-			MX6QDL_PAD_NANDF_D3__GPIO2_IO03		0x40010040
 			MX6QDL_PAD_NANDF_D2__GPIO2_IO02		0x40010040
 		>;
 	};
@@ -1067,7 +1066,6 @@
 			MX6QDL_PAD_SD3_DAT1__SD3_DATA1		0x17059
 			MX6QDL_PAD_SD3_DAT2__SD3_DATA2		0x17059
 			MX6QDL_PAD_SD3_DAT3__SD3_DATA3		0x17059
-			MX6QDL_PAD_NANDF_D1__GPIO2_IO01		0x40010040
 			MX6QDL_PAD_NANDF_D0__GPIO2_IO00		0x40010040
 
 		>;
-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 3/3] ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed
  2019-05-22  7:12 ` Andrey Smirnov
@ 2019-05-22  7:12   ` Andrey Smirnov
  -1 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-22  7:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrey Smirnov, Chris Healy, Shawn Guo, Fabio Estevam,
	Lucas Stach, linux-kernel

Cabling used to connect devices to USBH1 on RDU2 does not meet USB
spec cable quality and cable length requirements to operate at High
Speed, so limit the port to Full Speed only.

Reported-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 5484e4b87975..3b37fe68d373 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -772,6 +772,7 @@
 &usbh1 {
 	vbus-supply = <&reg_5p0v_main>;
 	disable-over-current;
+	maximum-speed = "full-speed";
 	status = "okay";
 };
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 3/3] ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed
@ 2019-05-22  7:12   ` Andrey Smirnov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-22  7:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrey Smirnov, Shawn Guo, linux-kernel, Fabio Estevam,
	Chris Healy, Lucas Stach

Cabling used to connect devices to USBH1 on RDU2 does not meet USB
spec cable quality and cable length requirements to operate at High
Speed, so limit the port to Full Speed only.

Reported-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 5484e4b87975..3b37fe68d373 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -772,6 +772,7 @@
 &usbh1 {
 	vbus-supply = <&reg_5p0v_main>;
 	disable-over-current;
+	maximum-speed = "full-speed";
 	status = "okay";
 };
 
-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/3] ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed
  2019-05-22  7:12   ` Andrey Smirnov
@ 2019-05-22  9:33     ` Lucas Stach
  -1 siblings, 0 replies; 24+ messages in thread
From: Lucas Stach @ 2019-05-22  9:33 UTC (permalink / raw)
  To: Andrey Smirnov, linux-arm-kernel
  Cc: Chris Healy, Shawn Guo, Fabio Estevam, linux-kernel

Hi Andrey,

Am Mittwoch, den 22.05.2019, 00:12 -0700 schrieb Andrey Smirnov:
> Cabling used to connect devices to USBH1 on RDU2 does not meet USB
> spec cable quality and cable length requirements to operate at High
> Speed, so limit the port to Full Speed only.

Really? I thought this issue is specific to the RDU1, but you've been
looking at this USB stuff for a lot longer than me.

Regards,
Lucas

> Reported-by: Chris Healy <cphealy@gmail.com>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> index 5484e4b87975..3b37fe68d373 100644
> --- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> @@ -772,6 +772,7 @@
>  &usbh1 {
>  	vbus-supply = <&reg_5p0v_main>;
>  	disable-over-current;
> +	maximum-speed = "full-speed";
>  	status = "okay";
>  };
>  

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/3] ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed
@ 2019-05-22  9:33     ` Lucas Stach
  0 siblings, 0 replies; 24+ messages in thread
From: Lucas Stach @ 2019-05-22  9:33 UTC (permalink / raw)
  To: Andrey Smirnov, linux-arm-kernel
  Cc: Fabio Estevam, Shawn Guo, linux-kernel, Chris Healy

Hi Andrey,

Am Mittwoch, den 22.05.2019, 00:12 -0700 schrieb Andrey Smirnov:
> Cabling used to connect devices to USBH1 on RDU2 does not meet USB
> spec cable quality and cable length requirements to operate at High
> Speed, so limit the port to Full Speed only.

Really? I thought this issue is specific to the RDU1, but you've been
looking at this USB stuff for a lot longer than me.

Regards,
Lucas

> Reported-by: Chris Healy <cphealy@gmail.com>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> index 5484e4b87975..3b37fe68d373 100644
> --- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> @@ -772,6 +772,7 @@
>  &usbh1 {
>  	vbus-supply = <&reg_5p0v_main>;
>  	disable-over-current;
> +	maximum-speed = "full-speed";
>  	status = "okay";
>  };
>  

_______________________________________________
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] 24+ messages in thread

* Re: [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
  2019-05-22  7:12 ` Andrey Smirnov
@ 2019-05-22  9:37   ` Lucas Stach
  -1 siblings, 0 replies; 24+ messages in thread
From: Lucas Stach @ 2019-05-22  9:37 UTC (permalink / raw)
  To: Andrey Smirnov, linux-arm-kernel
  Cc: Shawn Guo, Chris Healy, Fabio Estevam, linux-kernel

Hi Andrey,

Am Mittwoch, den 22.05.2019, 00:12 -0700 schrieb Andrey Smirnov:
> Add node for UCS1002 USB charger chip connected to front panel USB and
> replace "regulator-fixed" previously used to control VBUS.

I've had a similar version of this patch, but also added GPIO hogs for
the UCS1002 configuration pins, so the device is put into the expected
state even before driver load. Maybe something worth to consider?

Regards,
Lucas

> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > Cc: Shawn Guo <shawnguo@kernel.org>
> > Cc: Chris Healy <cphealy@gmail.com>
> > Cc: Fabio Estevam <festevam@gmail.com>
> > Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 35 ++++++++++++-------------
>  1 file changed, 17 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> index 93be00a60c88..977d923e35df 100644
> --- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> @@ -60,18 +60,6 @@
> >  		regulator-always-on;
> >  	};
>  
> > -	reg_5p0v_user_usb: regulator-5p0v-user-usb {
> > -		compatible = "regulator-fixed";
> > -		pinctrl-names = "default";
> > -		pinctrl-0 = <&pinctrl_reg_user_usb>;
> > -		vin-supply = <&reg_5p0v_main>;
> > -		regulator-name = "5V_USER_USB";
> > -		regulator-min-microvolt = <5000000>;
> > -		regulator-max-microvolt = <5000000>;
> > -		gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
> > -		startup-delay-us = <1000>;
> > -	};
> -
> >  	reg_3p3v_pmic: regulator-3p3v-pmic {
> >  		compatible = "regulator-fixed";
> >  		vin-supply = <&reg_12p0v>;
> @@ -590,6 +578,16 @@
> >  		status = "disabled";
> >  	};
>  
> > > +	reg_5p0v_user_usb: charger@32 {
> > +		compatible = "microchip,ucs1002";
> > +		pinctrl-names = "default";
> > +		pinctrl-0 = <&pinctrl_ucs1002_pins>;
> > +		reg = <0x32>;
> > +		interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
> > +				      <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
> > +		interrupt-names = "a_det", "alert";
> > +	};
> +
> > >  	hpa1: amp@60 {
> >  		compatible = "ti,tpa6130a2";
> >  		pinctrl-names = "default";
> @@ -982,12 +980,6 @@
> >  		>;
> >  	};
>  
> > -	pinctrl_reg_user_usb: usbotggrp {
> > -		fsl,pins = <
> > > -			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x40000038
> > -		>;
> > -	};
> -
> >  	pinctrl_rmii_phy_irq: phygrp {
> >  		fsl,pins = <
> > >  			MX6QDL_PAD_EIM_D30__GPIO3_IO30		0x40010000
> @@ -1047,6 +1039,13 @@
> >  		>;
> >  	};
>  
> > +	pinctrl_ucs1002_pins: ucs1002grp {
> > +		fsl,pins = <
> > > +			MX6QDL_PAD_EIM_A25__GPIO5_IO02  	0x1b0b0
> > > +			MX6QDL_PAD_EIM_D21__GPIO3_IO21  	0x1b0b0
> > +		>;
> > +	};
> +
> >  	pinctrl_usdhc2: usdhc2grp {
> >  		fsl,pins = <
> > >  			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x10059

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
@ 2019-05-22  9:37   ` Lucas Stach
  0 siblings, 0 replies; 24+ messages in thread
From: Lucas Stach @ 2019-05-22  9:37 UTC (permalink / raw)
  To: Andrey Smirnov, linux-arm-kernel
  Cc: Fabio Estevam, Shawn Guo, linux-kernel, Chris Healy

Hi Andrey,

Am Mittwoch, den 22.05.2019, 00:12 -0700 schrieb Andrey Smirnov:
> Add node for UCS1002 USB charger chip connected to front panel USB and
> replace "regulator-fixed" previously used to control VBUS.

I've had a similar version of this patch, but also added GPIO hogs for
the UCS1002 configuration pins, so the device is put into the expected
state even before driver load. Maybe something worth to consider?

Regards,
Lucas

> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > Cc: Shawn Guo <shawnguo@kernel.org>
> > Cc: Chris Healy <cphealy@gmail.com>
> > Cc: Fabio Estevam <festevam@gmail.com>
> > Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 35 ++++++++++++-------------
>  1 file changed, 17 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> index 93be00a60c88..977d923e35df 100644
> --- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> @@ -60,18 +60,6 @@
> >  		regulator-always-on;
> >  	};
>  
> > -	reg_5p0v_user_usb: regulator-5p0v-user-usb {
> > -		compatible = "regulator-fixed";
> > -		pinctrl-names = "default";
> > -		pinctrl-0 = <&pinctrl_reg_user_usb>;
> > -		vin-supply = <&reg_5p0v_main>;
> > -		regulator-name = "5V_USER_USB";
> > -		regulator-min-microvolt = <5000000>;
> > -		regulator-max-microvolt = <5000000>;
> > -		gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
> > -		startup-delay-us = <1000>;
> > -	};
> -
> >  	reg_3p3v_pmic: regulator-3p3v-pmic {
> >  		compatible = "regulator-fixed";
> >  		vin-supply = <&reg_12p0v>;
> @@ -590,6 +578,16 @@
> >  		status = "disabled";
> >  	};
>  
> > > +	reg_5p0v_user_usb: charger@32 {
> > +		compatible = "microchip,ucs1002";
> > +		pinctrl-names = "default";
> > +		pinctrl-0 = <&pinctrl_ucs1002_pins>;
> > +		reg = <0x32>;
> > +		interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
> > +				      <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
> > +		interrupt-names = "a_det", "alert";
> > +	};
> +
> > >  	hpa1: amp@60 {
> >  		compatible = "ti,tpa6130a2";
> >  		pinctrl-names = "default";
> @@ -982,12 +980,6 @@
> >  		>;
> >  	};
>  
> > -	pinctrl_reg_user_usb: usbotggrp {
> > -		fsl,pins = <
> > > -			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x40000038
> > -		>;
> > -	};
> -
> >  	pinctrl_rmii_phy_irq: phygrp {
> >  		fsl,pins = <
> > >  			MX6QDL_PAD_EIM_D30__GPIO3_IO30		0x40010000
> @@ -1047,6 +1039,13 @@
> >  		>;
> >  	};
>  
> > +	pinctrl_ucs1002_pins: ucs1002grp {
> > +		fsl,pins = <
> > > +			MX6QDL_PAD_EIM_A25__GPIO5_IO02  	0x1b0b0
> > > +			MX6QDL_PAD_EIM_D21__GPIO3_IO21  	0x1b0b0
> > +		>;
> > +	};
> +
> >  	pinctrl_usdhc2: usdhc2grp {
> >  		fsl,pins = <
> > >  			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x10059

_______________________________________________
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] 24+ messages in thread

* Re: [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
  2019-05-22  9:37   ` Lucas Stach
@ 2019-05-22 17:49     ` Andrey Smirnov
  -1 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-22 17:49 UTC (permalink / raw)
  To: Lucas Stach
  Cc: linux-arm-kernel, Shawn Guo, Chris Healy, Fabio Estevam, linux-kernel

On Wed, May 22, 2019 at 2:37 AM Lucas Stach <l.stach@pengutronix.de> wrote:
>
> Hi Andrey,
>
> Am Mittwoch, den 22.05.2019, 00:12 -0700 schrieb Andrey Smirnov:
> > Add node for UCS1002 USB charger chip connected to front panel USB and
> > replace "regulator-fixed" previously used to control VBUS.
>
> I've had a similar version of this patch, but also added GPIO hogs for
> the UCS1002 configuration pins, so the device is put into the expected
> state even before driver load. Maybe something worth to consider?

Makes sense, will add in v2.

Thanks,
Andrey Smirnov

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
@ 2019-05-22 17:49     ` Andrey Smirnov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-22 17:49 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Fabio Estevam, Shawn Guo, Chris Healy, linux-arm-kernel, linux-kernel

On Wed, May 22, 2019 at 2:37 AM Lucas Stach <l.stach@pengutronix.de> wrote:
>
> Hi Andrey,
>
> Am Mittwoch, den 22.05.2019, 00:12 -0700 schrieb Andrey Smirnov:
> > Add node for UCS1002 USB charger chip connected to front panel USB and
> > replace "regulator-fixed" previously used to control VBUS.
>
> I've had a similar version of this patch, but also added GPIO hogs for
> the UCS1002 configuration pins, so the device is put into the expected
> state even before driver load. Maybe something worth to consider?

Makes sense, will add in v2.

Thanks,
Andrey Smirnov

_______________________________________________
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] 24+ messages in thread

* Re: [PATCH 3/3] ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed
  2019-05-22  9:33     ` Lucas Stach
@ 2019-05-22 17:56       ` Andrey Smirnov
  -1 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-22 17:56 UTC (permalink / raw)
  To: Lucas Stach
  Cc: linux-arm-kernel, Chris Healy, Shawn Guo, Fabio Estevam, linux-kernel

On Wed, May 22, 2019 at 2:33 AM Lucas Stach <l.stach@pengutronix.de> wrote:
>
> Hi Andrey,
>
> Am Mittwoch, den 22.05.2019, 00:12 -0700 schrieb Andrey Smirnov:
> > Cabling used to connect devices to USBH1 on RDU2 does not meet USB
> > spec cable quality and cable length requirements to operate at High
> > Speed, so limit the port to Full Speed only.
>
> Really? I thought this issue is specific to the RDU1, but you've been
> looking at this USB stuff for a lot longer than me.
>

I am merely a messenger here. I didn't personally verify this to be
the case, so your knowledge is probably as good as mine. Chris
reported this based on feedback from their EE team, so he should know
all of the details better.

Thanks,
Andrey Smirnov

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/3] ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed
@ 2019-05-22 17:56       ` Andrey Smirnov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-22 17:56 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Fabio Estevam, Shawn Guo, Chris Healy, linux-arm-kernel, linux-kernel

On Wed, May 22, 2019 at 2:33 AM Lucas Stach <l.stach@pengutronix.de> wrote:
>
> Hi Andrey,
>
> Am Mittwoch, den 22.05.2019, 00:12 -0700 schrieb Andrey Smirnov:
> > Cabling used to connect devices to USBH1 on RDU2 does not meet USB
> > spec cable quality and cable length requirements to operate at High
> > Speed, so limit the port to Full Speed only.
>
> Really? I thought this issue is specific to the RDU1, but you've been
> looking at this USB stuff for a lot longer than me.
>

I am merely a messenger here. I didn't personally verify this to be
the case, so your knowledge is probably as good as mine. Chris
reported this based on feedback from their EE team, so he should know
all of the details better.

Thanks,
Andrey Smirnov

_______________________________________________
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] 24+ messages in thread

* Re: [PATCH 3/3] ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed
  2019-05-22 17:56       ` Andrey Smirnov
@ 2019-05-22 18:10         ` Chris Healy
  -1 siblings, 0 replies; 24+ messages in thread
From: Chris Healy @ 2019-05-22 18:10 UTC (permalink / raw)
  To: Andrey Smirnov
  Cc: Lucas Stach, linux-arm-kernel, Shawn Guo, Fabio Estevam, linux-kernel

> > Am Mittwoch, den 22.05.2019, 00:12 -0700 schrieb Andrey Smirnov:
> > > Cabling used to connect devices to USBH1 on RDU2 does not meet USB
> > > spec cable quality and cable length requirements to operate at High
> > > Speed, so limit the port to Full Speed only.
> >
> > Really? I thought this issue is specific to the RDU1, but you've been
> > looking at this USB stuff for a lot longer than me.
> >
>
> I am merely a messenger here. I didn't personally verify this to be
> the case, so your knowledge is probably as good as mine. Chris
> reported this based on feedback from their EE team, so he should know
> all of the details better.

The issue is less about the internals of the device and more about the
cabling that the device is connected to.  In the target application of
this device, the USB cables are almost always longer than the spec
limit of the USB standard for high speed.  Given our use cases, we
don't have need for high speed so limiting the max speed to full speed
is the way we work around cables that are too long for stable high
speed operation.

We have validated that running with full speed does mitigate the
problems experienced when attempting to run with high speed on the
target application installations.

Reviewed-by: Chris Healy <cphealy@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/3] ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed
@ 2019-05-22 18:10         ` Chris Healy
  0 siblings, 0 replies; 24+ messages in thread
From: Chris Healy @ 2019-05-22 18:10 UTC (permalink / raw)
  To: Andrey Smirnov
  Cc: Fabio Estevam, Shawn Guo, linux-kernel, linux-arm-kernel, Lucas Stach

> > Am Mittwoch, den 22.05.2019, 00:12 -0700 schrieb Andrey Smirnov:
> > > Cabling used to connect devices to USBH1 on RDU2 does not meet USB
> > > spec cable quality and cable length requirements to operate at High
> > > Speed, so limit the port to Full Speed only.
> >
> > Really? I thought this issue is specific to the RDU1, but you've been
> > looking at this USB stuff for a lot longer than me.
> >
>
> I am merely a messenger here. I didn't personally verify this to be
> the case, so your knowledge is probably as good as mine. Chris
> reported this based on feedback from their EE team, so he should know
> all of the details better.

The issue is less about the internals of the device and more about the
cabling that the device is connected to.  In the target application of
this device, the USB cables are almost always longer than the spec
limit of the USB standard for high speed.  Given our use cases, we
don't have need for high speed so limiting the max speed to full speed
is the way we work around cables that are too long for stable high
speed operation.

We have validated that running with full speed does mitigate the
problems experienced when attempting to run with high speed on the
target application installations.

Reviewed-by: Chris Healy <cphealy@gmail.com>

_______________________________________________
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] 24+ messages in thread

* Re: [PATCH 2/3] ARM: dts: imx6: rdu2: Disable WP for USDHC2 and USDHC3
  2019-05-22  7:12   ` Andrey Smirnov
@ 2019-05-23  0:27     ` Chris Healy
  -1 siblings, 0 replies; 24+ messages in thread
From: Chris Healy @ 2019-05-23  0:27 UTC (permalink / raw)
  To: Andrey Smirnov
  Cc: linux ARM, Shawn Guo, Fabio Estevam, Lucas Stach, linux-kernel

> RDU2 production units come with resistor connecting WP pin to
> correpsonding GPIO DNPed for both SD card slots. Drop any WP related
> configuration and mark both slots with "disable-wp".
>
> Reported-by: Chris Healy <cphealy@gmail.com>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> index 977d923e35df..5484e4b87975 100644
> --- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> @@ -625,7 +625,7 @@
>         pinctrl-0 = <&pinctrl_usdhc2>;


Reviewed-by: Chris Healy <cphealy@gmail.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/3] ARM: dts: imx6: rdu2: Disable WP for USDHC2 and USDHC3
@ 2019-05-23  0:27     ` Chris Healy
  0 siblings, 0 replies; 24+ messages in thread
From: Chris Healy @ 2019-05-23  0:27 UTC (permalink / raw)
  To: Andrey Smirnov
  Cc: Fabio Estevam, Shawn Guo, linux-kernel, linux ARM, Lucas Stach

> RDU2 production units come with resistor connecting WP pin to
> correpsonding GPIO DNPed for both SD card slots. Drop any WP related
> configuration and mark both slots with "disable-wp".
>
> Reported-by: Chris Healy <cphealy@gmail.com>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> index 977d923e35df..5484e4b87975 100644
> --- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> @@ -625,7 +625,7 @@
>         pinctrl-0 = <&pinctrl_usdhc2>;


Reviewed-by: Chris Healy <cphealy@gmail.com>

_______________________________________________
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] 24+ messages in thread

* Re: [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
  2019-05-29  7:18 ` Andrey Smirnov
@ 2019-05-29  8:27   ` Lucas Stach
  -1 siblings, 0 replies; 24+ messages in thread
From: Lucas Stach @ 2019-05-29  8:27 UTC (permalink / raw)
  To: Andrey Smirnov, linux-arm-kernel
  Cc: Shawn Guo, Chris Healy, Fabio Estevam, linux-kernel

Am Mittwoch, den 29.05.2019, 00:18 -0700 schrieb Andrey Smirnov:
> Add node for UCS1002 USB charger chip connected to front panel USB and
> replace "regulator-fixed" previously used to control VBUS.
> 
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > Cc: Shawn Guo <shawnguo@kernel.org>
> > Cc: Chris Healy <cphealy@gmail.com>
> > Cc: Fabio Estevam <festevam@gmail.com>
> > Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org

FWIW:

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
> 
> Changes since [v1]:
> 
>     - Added GPIO hog configuration to put UCS1002 into correct mode
>       even before its driver takes over. The code for that is taken
>       from similar patch from Lucas, so I added his Signed-off-by as
>       well.
> 
> [v1] lore.kernel.org/r/20190522071227.31488-1-andrew.smirnov@gmail.com
> 
>  arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 77 +++++++++++++++++++------
>  1 file changed, 59 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> index 93be00a60c88..07e21d1e5b4c 100644
> --- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> @@ -60,18 +60,6 @@
> >  		regulator-always-on;
> >  	};
>  
> > -	reg_5p0v_user_usb: regulator-5p0v-user-usb {
> > -		compatible = "regulator-fixed";
> > -		pinctrl-names = "default";
> > -		pinctrl-0 = <&pinctrl_reg_user_usb>;
> > -		vin-supply = <&reg_5p0v_main>;
> > -		regulator-name = "5V_USER_USB";
> > -		regulator-min-microvolt = <5000000>;
> > -		regulator-max-microvolt = <5000000>;
> > -		gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
> > -		startup-delay-us = <1000>;
> > -	};
> -
> >  	reg_3p3v_pmic: regulator-3p3v-pmic {
> >  		compatible = "regulator-fixed";
> >  		vin-supply = <&reg_12p0v>;
> @@ -331,6 +319,39 @@
> >  	};
>  };
>  
> +&gpio3 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_gpio3_hog>;
> +
> > +	usb-emulation {
> > +		gpio-hog;
> > +		gpios = <19 GPIO_ACTIVE_HIGH>;
> > +		output-low;
> > +		line-name = "usb-emulation";
> > +	};
> +
> > +	usb-mode1 {
> > +		gpio-hog;
> > +		gpios = <20 GPIO_ACTIVE_HIGH>;
> > +		output-high;
> > +		line-name = "usb-mode1";
> > +	};
> +
> > +	usb-pwr {
> > +		gpio-hog;
> > +		gpios = <22 GPIO_ACTIVE_LOW>;
> > +		output-high;
> > +		line-name = "usb-pwr-ctrl-en-n";
> > +	};
> +
> > +	usb-mode2 {
> > +		gpio-hog;
> > +		gpios = <23 GPIO_ACTIVE_HIGH>;
> > +		output-high;
> > +		line-name = "usb-mode2";
> > +	};
> +};
> +
>  &i2c1 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&pinctrl_i2c1>;
> @@ -590,6 +611,16 @@
> >  		status = "disabled";
> >  	};
>  
> > > +	reg_5p0v_user_usb: charger@32 {
> > +		compatible = "microchip,ucs1002";
> > +		pinctrl-names = "default";
> > +		pinctrl-0 = <&pinctrl_ucs1002_pins>;
> > +		reg = <0x32>;
> > +		interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
> > +				      <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
> > +		interrupt-names = "a_det", "alert";
> > +	};
> +
> > >  	hpa1: amp@60 {
> >  		compatible = "ti,tpa6130a2";
> >  		pinctrl-names = "default";
> @@ -935,6 +966,15 @@
> >  		>;
> >  	};
>  
> > +	pinctrl_gpio3_hog: gpio3hoggrp {
> > +		fsl,pins = <
> > > +			MX6QDL_PAD_EIM_D19__GPIO3_IO19		0x1b0b0
> > > +			MX6QDL_PAD_EIM_D20__GPIO3_IO20		0x1b0b0
> > > +			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x1b0b0
> > > +			MX6QDL_PAD_EIM_D23__GPIO3_IO23		0x1b0b0
> > +		>;
> > +	};
> +
> >  	pinctrl_i2c1: i2c1grp {
> >  		fsl,pins = <
> > >  			MX6QDL_PAD_CSI0_DAT8__I2C1_SDA		0x4001b8b1
> @@ -982,12 +1022,6 @@
> >  		>;
> >  	};
>  
> > -	pinctrl_reg_user_usb: usbotggrp {
> > -		fsl,pins = <
> > > -			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x40000038
> > -		>;
> > -	};
> -
> >  	pinctrl_rmii_phy_irq: phygrp {
> >  		fsl,pins = <
> > >  			MX6QDL_PAD_EIM_D30__GPIO3_IO30		0x40010000
> @@ -1047,6 +1081,13 @@
> >  		>;
> >  	};
>  
> > +	pinctrl_ucs1002_pins: ucs1002grp {
> > +		fsl,pins = <
> > > +			MX6QDL_PAD_EIM_A25__GPIO5_IO02  	0x1b0b0
> > > +			MX6QDL_PAD_EIM_D21__GPIO3_IO21  	0x1b0b0
> > +		>;
> > +	};
> +
> >  	pinctrl_usdhc2: usdhc2grp {
> >  		fsl,pins = <
> > >  			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x10059

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
@ 2019-05-29  8:27   ` Lucas Stach
  0 siblings, 0 replies; 24+ messages in thread
From: Lucas Stach @ 2019-05-29  8:27 UTC (permalink / raw)
  To: Andrey Smirnov, linux-arm-kernel
  Cc: Fabio Estevam, Shawn Guo, linux-kernel, Chris Healy

Am Mittwoch, den 29.05.2019, 00:18 -0700 schrieb Andrey Smirnov:
> Add node for UCS1002 USB charger chip connected to front panel USB and
> replace "regulator-fixed" previously used to control VBUS.
> 
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > Cc: Shawn Guo <shawnguo@kernel.org>
> > Cc: Chris Healy <cphealy@gmail.com>
> > Cc: Fabio Estevam <festevam@gmail.com>
> > Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org

FWIW:

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
> 
> Changes since [v1]:
> 
>     - Added GPIO hog configuration to put UCS1002 into correct mode
>       even before its driver takes over. The code for that is taken
>       from similar patch from Lucas, so I added his Signed-off-by as
>       well.
> 
> [v1] lore.kernel.org/r/20190522071227.31488-1-andrew.smirnov@gmail.com
> 
>  arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 77 +++++++++++++++++++------
>  1 file changed, 59 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> index 93be00a60c88..07e21d1e5b4c 100644
> --- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> @@ -60,18 +60,6 @@
> >  		regulator-always-on;
> >  	};
>  
> > -	reg_5p0v_user_usb: regulator-5p0v-user-usb {
> > -		compatible = "regulator-fixed";
> > -		pinctrl-names = "default";
> > -		pinctrl-0 = <&pinctrl_reg_user_usb>;
> > -		vin-supply = <&reg_5p0v_main>;
> > -		regulator-name = "5V_USER_USB";
> > -		regulator-min-microvolt = <5000000>;
> > -		regulator-max-microvolt = <5000000>;
> > -		gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
> > -		startup-delay-us = <1000>;
> > -	};
> -
> >  	reg_3p3v_pmic: regulator-3p3v-pmic {
> >  		compatible = "regulator-fixed";
> >  		vin-supply = <&reg_12p0v>;
> @@ -331,6 +319,39 @@
> >  	};
>  };
>  
> +&gpio3 {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pinctrl_gpio3_hog>;
> +
> > +	usb-emulation {
> > +		gpio-hog;
> > +		gpios = <19 GPIO_ACTIVE_HIGH>;
> > +		output-low;
> > +		line-name = "usb-emulation";
> > +	};
> +
> > +	usb-mode1 {
> > +		gpio-hog;
> > +		gpios = <20 GPIO_ACTIVE_HIGH>;
> > +		output-high;
> > +		line-name = "usb-mode1";
> > +	};
> +
> > +	usb-pwr {
> > +		gpio-hog;
> > +		gpios = <22 GPIO_ACTIVE_LOW>;
> > +		output-high;
> > +		line-name = "usb-pwr-ctrl-en-n";
> > +	};
> +
> > +	usb-mode2 {
> > +		gpio-hog;
> > +		gpios = <23 GPIO_ACTIVE_HIGH>;
> > +		output-high;
> > +		line-name = "usb-mode2";
> > +	};
> +};
> +
>  &i2c1 {
> >  	pinctrl-names = "default";
> >  	pinctrl-0 = <&pinctrl_i2c1>;
> @@ -590,6 +611,16 @@
> >  		status = "disabled";
> >  	};
>  
> > > +	reg_5p0v_user_usb: charger@32 {
> > +		compatible = "microchip,ucs1002";
> > +		pinctrl-names = "default";
> > +		pinctrl-0 = <&pinctrl_ucs1002_pins>;
> > +		reg = <0x32>;
> > +		interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
> > +				      <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
> > +		interrupt-names = "a_det", "alert";
> > +	};
> +
> > >  	hpa1: amp@60 {
> >  		compatible = "ti,tpa6130a2";
> >  		pinctrl-names = "default";
> @@ -935,6 +966,15 @@
> >  		>;
> >  	};
>  
> > +	pinctrl_gpio3_hog: gpio3hoggrp {
> > +		fsl,pins = <
> > > +			MX6QDL_PAD_EIM_D19__GPIO3_IO19		0x1b0b0
> > > +			MX6QDL_PAD_EIM_D20__GPIO3_IO20		0x1b0b0
> > > +			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x1b0b0
> > > +			MX6QDL_PAD_EIM_D23__GPIO3_IO23		0x1b0b0
> > +		>;
> > +	};
> +
> >  	pinctrl_i2c1: i2c1grp {
> >  		fsl,pins = <
> > >  			MX6QDL_PAD_CSI0_DAT8__I2C1_SDA		0x4001b8b1
> @@ -982,12 +1022,6 @@
> >  		>;
> >  	};
>  
> > -	pinctrl_reg_user_usb: usbotggrp {
> > -		fsl,pins = <
> > > -			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x40000038
> > -		>;
> > -	};
> -
> >  	pinctrl_rmii_phy_irq: phygrp {
> >  		fsl,pins = <
> > >  			MX6QDL_PAD_EIM_D30__GPIO3_IO30		0x40010000
> @@ -1047,6 +1081,13 @@
> >  		>;
> >  	};
>  
> > +	pinctrl_ucs1002_pins: ucs1002grp {
> > +		fsl,pins = <
> > > +			MX6QDL_PAD_EIM_A25__GPIO5_IO02  	0x1b0b0
> > > +			MX6QDL_PAD_EIM_D21__GPIO3_IO21  	0x1b0b0
> > +		>;
> > +	};
> +
> >  	pinctrl_usdhc2: usdhc2grp {
> >  		fsl,pins = <
> > >  			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x10059

_______________________________________________
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] 24+ messages in thread

* Re: [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
  2019-05-29  7:18 ` Andrey Smirnov
@ 2019-05-29  7:22   ` Andrey Smirnov
  -1 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-29  7:22 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Lucas Stach, Shawn Guo, Chris Healy, Fabio Estevam, linux-kernel

On Wed, May 29, 2019 at 12:18 AM Andrey Smirnov
<andrew.smirnov@gmail.com> wrote:
>
> Add node for UCS1002 USB charger chip connected to front panel USB and
> replace "regulator-fixed" previously used to control VBUS.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Chris Healy <cphealy@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org

Ugh, forgot to properly update reroll counter. This and the rest of
the series is a v2. Sorry about that.

Thanks,
Andrey Smirnov

> ---
>
> Changes since [v1]:
>
>     - Added GPIO hog configuration to put UCS1002 into correct mode
>       even before its driver takes over. The code for that is taken
>       from similar patch from Lucas, so I added his Signed-off-by as
>       well.
>
> [v1] lore.kernel.org/r/20190522071227.31488-1-andrew.smirnov@gmail.com
>
>  arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 77 +++++++++++++++++++------
>  1 file changed, 59 insertions(+), 18 deletions(-)
>
> diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> index 93be00a60c88..07e21d1e5b4c 100644
> --- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> @@ -60,18 +60,6 @@
>                 regulator-always-on;
>         };
>
> -       reg_5p0v_user_usb: regulator-5p0v-user-usb {
> -               compatible = "regulator-fixed";
> -               pinctrl-names = "default";
> -               pinctrl-0 = <&pinctrl_reg_user_usb>;
> -               vin-supply = <&reg_5p0v_main>;
> -               regulator-name = "5V_USER_USB";
> -               regulator-min-microvolt = <5000000>;
> -               regulator-max-microvolt = <5000000>;
> -               gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
> -               startup-delay-us = <1000>;
> -       };
> -
>         reg_3p3v_pmic: regulator-3p3v-pmic {
>                 compatible = "regulator-fixed";
>                 vin-supply = <&reg_12p0v>;
> @@ -331,6 +319,39 @@
>         };
>  };
>
> +&gpio3 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&pinctrl_gpio3_hog>;
> +
> +       usb-emulation {
> +               gpio-hog;
> +               gpios = <19 GPIO_ACTIVE_HIGH>;
> +               output-low;
> +               line-name = "usb-emulation";
> +       };
> +
> +       usb-mode1 {
> +               gpio-hog;
> +               gpios = <20 GPIO_ACTIVE_HIGH>;
> +               output-high;
> +               line-name = "usb-mode1";
> +       };
> +
> +       usb-pwr {
> +               gpio-hog;
> +               gpios = <22 GPIO_ACTIVE_LOW>;
> +               output-high;
> +               line-name = "usb-pwr-ctrl-en-n";
> +       };
> +
> +       usb-mode2 {
> +               gpio-hog;
> +               gpios = <23 GPIO_ACTIVE_HIGH>;
> +               output-high;
> +               line-name = "usb-mode2";
> +       };
> +};
> +
>  &i2c1 {
>         pinctrl-names = "default";
>         pinctrl-0 = <&pinctrl_i2c1>;
> @@ -590,6 +611,16 @@
>                 status = "disabled";
>         };
>
> +       reg_5p0v_user_usb: charger@32 {
> +               compatible = "microchip,ucs1002";
> +               pinctrl-names = "default";
> +               pinctrl-0 = <&pinctrl_ucs1002_pins>;
> +               reg = <0x32>;
> +               interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
> +                                     <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
> +               interrupt-names = "a_det", "alert";
> +       };
> +
>         hpa1: amp@60 {
>                 compatible = "ti,tpa6130a2";
>                 pinctrl-names = "default";
> @@ -935,6 +966,15 @@
>                 >;
>         };
>
> +       pinctrl_gpio3_hog: gpio3hoggrp {
> +               fsl,pins = <
> +                       MX6QDL_PAD_EIM_D19__GPIO3_IO19          0x1b0b0
> +                       MX6QDL_PAD_EIM_D20__GPIO3_IO20          0x1b0b0
> +                       MX6QDL_PAD_EIM_D22__GPIO3_IO22          0x1b0b0
> +                       MX6QDL_PAD_EIM_D23__GPIO3_IO23          0x1b0b0
> +               >;
> +       };
> +
>         pinctrl_i2c1: i2c1grp {
>                 fsl,pins = <
>                         MX6QDL_PAD_CSI0_DAT8__I2C1_SDA          0x4001b8b1
> @@ -982,12 +1022,6 @@
>                 >;
>         };
>
> -       pinctrl_reg_user_usb: usbotggrp {
> -               fsl,pins = <
> -                       MX6QDL_PAD_EIM_D22__GPIO3_IO22          0x40000038
> -               >;
> -       };
> -
>         pinctrl_rmii_phy_irq: phygrp {
>                 fsl,pins = <
>                         MX6QDL_PAD_EIM_D30__GPIO3_IO30          0x40010000
> @@ -1047,6 +1081,13 @@
>                 >;
>         };
>
> +       pinctrl_ucs1002_pins: ucs1002grp {
> +               fsl,pins = <
> +                       MX6QDL_PAD_EIM_A25__GPIO5_IO02          0x1b0b0
> +                       MX6QDL_PAD_EIM_D21__GPIO3_IO21          0x1b0b0
> +               >;
> +       };
> +
>         pinctrl_usdhc2: usdhc2grp {
>                 fsl,pins = <
>                         MX6QDL_PAD_SD2_CMD__SD2_CMD             0x10059
> --
> 2.21.0
>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
@ 2019-05-29  7:22   ` Andrey Smirnov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-29  7:22 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Fabio Estevam, Shawn Guo, linux-kernel, Chris Healy, Lucas Stach

On Wed, May 29, 2019 at 12:18 AM Andrey Smirnov
<andrew.smirnov@gmail.com> wrote:
>
> Add node for UCS1002 USB charger chip connected to front panel USB and
> replace "regulator-fixed" previously used to control VBUS.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Chris Healy <cphealy@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org

Ugh, forgot to properly update reroll counter. This and the rest of
the series is a v2. Sorry about that.

Thanks,
Andrey Smirnov

> ---
>
> Changes since [v1]:
>
>     - Added GPIO hog configuration to put UCS1002 into correct mode
>       even before its driver takes over. The code for that is taken
>       from similar patch from Lucas, so I added his Signed-off-by as
>       well.
>
> [v1] lore.kernel.org/r/20190522071227.31488-1-andrew.smirnov@gmail.com
>
>  arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 77 +++++++++++++++++++------
>  1 file changed, 59 insertions(+), 18 deletions(-)
>
> diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> index 93be00a60c88..07e21d1e5b4c 100644
> --- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
> @@ -60,18 +60,6 @@
>                 regulator-always-on;
>         };
>
> -       reg_5p0v_user_usb: regulator-5p0v-user-usb {
> -               compatible = "regulator-fixed";
> -               pinctrl-names = "default";
> -               pinctrl-0 = <&pinctrl_reg_user_usb>;
> -               vin-supply = <&reg_5p0v_main>;
> -               regulator-name = "5V_USER_USB";
> -               regulator-min-microvolt = <5000000>;
> -               regulator-max-microvolt = <5000000>;
> -               gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
> -               startup-delay-us = <1000>;
> -       };
> -
>         reg_3p3v_pmic: regulator-3p3v-pmic {
>                 compatible = "regulator-fixed";
>                 vin-supply = <&reg_12p0v>;
> @@ -331,6 +319,39 @@
>         };
>  };
>
> +&gpio3 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&pinctrl_gpio3_hog>;
> +
> +       usb-emulation {
> +               gpio-hog;
> +               gpios = <19 GPIO_ACTIVE_HIGH>;
> +               output-low;
> +               line-name = "usb-emulation";
> +       };
> +
> +       usb-mode1 {
> +               gpio-hog;
> +               gpios = <20 GPIO_ACTIVE_HIGH>;
> +               output-high;
> +               line-name = "usb-mode1";
> +       };
> +
> +       usb-pwr {
> +               gpio-hog;
> +               gpios = <22 GPIO_ACTIVE_LOW>;
> +               output-high;
> +               line-name = "usb-pwr-ctrl-en-n";
> +       };
> +
> +       usb-mode2 {
> +               gpio-hog;
> +               gpios = <23 GPIO_ACTIVE_HIGH>;
> +               output-high;
> +               line-name = "usb-mode2";
> +       };
> +};
> +
>  &i2c1 {
>         pinctrl-names = "default";
>         pinctrl-0 = <&pinctrl_i2c1>;
> @@ -590,6 +611,16 @@
>                 status = "disabled";
>         };
>
> +       reg_5p0v_user_usb: charger@32 {
> +               compatible = "microchip,ucs1002";
> +               pinctrl-names = "default";
> +               pinctrl-0 = <&pinctrl_ucs1002_pins>;
> +               reg = <0x32>;
> +               interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
> +                                     <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
> +               interrupt-names = "a_det", "alert";
> +       };
> +
>         hpa1: amp@60 {
>                 compatible = "ti,tpa6130a2";
>                 pinctrl-names = "default";
> @@ -935,6 +966,15 @@
>                 >;
>         };
>
> +       pinctrl_gpio3_hog: gpio3hoggrp {
> +               fsl,pins = <
> +                       MX6QDL_PAD_EIM_D19__GPIO3_IO19          0x1b0b0
> +                       MX6QDL_PAD_EIM_D20__GPIO3_IO20          0x1b0b0
> +                       MX6QDL_PAD_EIM_D22__GPIO3_IO22          0x1b0b0
> +                       MX6QDL_PAD_EIM_D23__GPIO3_IO23          0x1b0b0
> +               >;
> +       };
> +
>         pinctrl_i2c1: i2c1grp {
>                 fsl,pins = <
>                         MX6QDL_PAD_CSI0_DAT8__I2C1_SDA          0x4001b8b1
> @@ -982,12 +1022,6 @@
>                 >;
>         };
>
> -       pinctrl_reg_user_usb: usbotggrp {
> -               fsl,pins = <
> -                       MX6QDL_PAD_EIM_D22__GPIO3_IO22          0x40000038
> -               >;
> -       };
> -
>         pinctrl_rmii_phy_irq: phygrp {
>                 fsl,pins = <
>                         MX6QDL_PAD_EIM_D30__GPIO3_IO30          0x40010000
> @@ -1047,6 +1081,13 @@
>                 >;
>         };
>
> +       pinctrl_ucs1002_pins: ucs1002grp {
> +               fsl,pins = <
> +                       MX6QDL_PAD_EIM_A25__GPIO5_IO02          0x1b0b0
> +                       MX6QDL_PAD_EIM_D21__GPIO3_IO21          0x1b0b0
> +               >;
> +       };
> +
>         pinctrl_usdhc2: usdhc2grp {
>                 fsl,pins = <
>                         MX6QDL_PAD_SD2_CMD__SD2_CMD             0x10059
> --
> 2.21.0
>

_______________________________________________
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] 24+ messages in thread

* [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
@ 2019-05-29  7:18 ` Andrey Smirnov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-29  7:18 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrey Smirnov, Lucas Stach, Shawn Guo, Chris Healy,
	Fabio Estevam, linux-kernel

Add node for UCS1002 USB charger chip connected to front panel USB and
replace "regulator-fixed" previously used to control VBUS.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---

Changes since [v1]:

    - Added GPIO hog configuration to put UCS1002 into correct mode
      even before its driver takes over. The code for that is taken
      from similar patch from Lucas, so I added his Signed-off-by as
      well.

[v1] lore.kernel.org/r/20190522071227.31488-1-andrew.smirnov@gmail.com

 arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 77 +++++++++++++++++++------
 1 file changed, 59 insertions(+), 18 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 93be00a60c88..07e21d1e5b4c 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -60,18 +60,6 @@
 		regulator-always-on;
 	};
 
-	reg_5p0v_user_usb: regulator-5p0v-user-usb {
-		compatible = "regulator-fixed";
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_reg_user_usb>;
-		vin-supply = <&reg_5p0v_main>;
-		regulator-name = "5V_USER_USB";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
-		startup-delay-us = <1000>;
-	};
-
 	reg_3p3v_pmic: regulator-3p3v-pmic {
 		compatible = "regulator-fixed";
 		vin-supply = <&reg_12p0v>;
@@ -331,6 +319,39 @@
 	};
 };
 
+&gpio3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_gpio3_hog>;
+
+	usb-emulation {
+		gpio-hog;
+		gpios = <19 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "usb-emulation";
+	};
+
+	usb-mode1 {
+		gpio-hog;
+		gpios = <20 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "usb-mode1";
+	};
+
+	usb-pwr {
+		gpio-hog;
+		gpios = <22 GPIO_ACTIVE_LOW>;
+		output-high;
+		line-name = "usb-pwr-ctrl-en-n";
+	};
+
+	usb-mode2 {
+		gpio-hog;
+		gpios = <23 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "usb-mode2";
+	};
+};
+
 &i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_i2c1>;
@@ -590,6 +611,16 @@
 		status = "disabled";
 	};
 
+	reg_5p0v_user_usb: charger@32 {
+		compatible = "microchip,ucs1002";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_ucs1002_pins>;
+		reg = <0x32>;
+		interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
+				      <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
+		interrupt-names = "a_det", "alert";
+	};
+
 	hpa1: amp@60 {
 		compatible = "ti,tpa6130a2";
 		pinctrl-names = "default";
@@ -935,6 +966,15 @@
 		>;
 	};
 
+	pinctrl_gpio3_hog: gpio3hoggrp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D19__GPIO3_IO19		0x1b0b0
+			MX6QDL_PAD_EIM_D20__GPIO3_IO20		0x1b0b0
+			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x1b0b0
+			MX6QDL_PAD_EIM_D23__GPIO3_IO23		0x1b0b0
+		>;
+	};
+
 	pinctrl_i2c1: i2c1grp {
 		fsl,pins = <
 			MX6QDL_PAD_CSI0_DAT8__I2C1_SDA		0x4001b8b1
@@ -982,12 +1022,6 @@
 		>;
 	};
 
-	pinctrl_reg_user_usb: usbotggrp {
-		fsl,pins = <
-			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x40000038
-		>;
-	};
-
 	pinctrl_rmii_phy_irq: phygrp {
 		fsl,pins = <
 			MX6QDL_PAD_EIM_D30__GPIO3_IO30		0x40010000
@@ -1047,6 +1081,13 @@
 		>;
 	};
 
+	pinctrl_ucs1002_pins: ucs1002grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_A25__GPIO5_IO02  	0x1b0b0
+			MX6QDL_PAD_EIM_D21__GPIO3_IO21  	0x1b0b0
+		>;
+	};
+
 	pinctrl_usdhc2: usdhc2grp {
 		fsl,pins = <
 			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x10059
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip
@ 2019-05-29  7:18 ` Andrey Smirnov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Smirnov @ 2019-05-29  7:18 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrey Smirnov, Shawn Guo, linux-kernel, Fabio Estevam,
	Chris Healy, Lucas Stach

Add node for UCS1002 USB charger chip connected to front panel USB and
replace "regulator-fixed" previously used to control VBUS.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---

Changes since [v1]:

    - Added GPIO hog configuration to put UCS1002 into correct mode
      even before its driver takes over. The code for that is taken
      from similar patch from Lucas, so I added his Signed-off-by as
      well.

[v1] lore.kernel.org/r/20190522071227.31488-1-andrew.smirnov@gmail.com

 arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 77 +++++++++++++++++++------
 1 file changed, 59 insertions(+), 18 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 93be00a60c88..07e21d1e5b4c 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -60,18 +60,6 @@
 		regulator-always-on;
 	};
 
-	reg_5p0v_user_usb: regulator-5p0v-user-usb {
-		compatible = "regulator-fixed";
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_reg_user_usb>;
-		vin-supply = <&reg_5p0v_main>;
-		regulator-name = "5V_USER_USB";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		gpio = <&gpio3 22 GPIO_ACTIVE_LOW>;
-		startup-delay-us = <1000>;
-	};
-
 	reg_3p3v_pmic: regulator-3p3v-pmic {
 		compatible = "regulator-fixed";
 		vin-supply = <&reg_12p0v>;
@@ -331,6 +319,39 @@
 	};
 };
 
+&gpio3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_gpio3_hog>;
+
+	usb-emulation {
+		gpio-hog;
+		gpios = <19 GPIO_ACTIVE_HIGH>;
+		output-low;
+		line-name = "usb-emulation";
+	};
+
+	usb-mode1 {
+		gpio-hog;
+		gpios = <20 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "usb-mode1";
+	};
+
+	usb-pwr {
+		gpio-hog;
+		gpios = <22 GPIO_ACTIVE_LOW>;
+		output-high;
+		line-name = "usb-pwr-ctrl-en-n";
+	};
+
+	usb-mode2 {
+		gpio-hog;
+		gpios = <23 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "usb-mode2";
+	};
+};
+
 &i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_i2c1>;
@@ -590,6 +611,16 @@
 		status = "disabled";
 	};
 
+	reg_5p0v_user_usb: charger@32 {
+		compatible = "microchip,ucs1002";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_ucs1002_pins>;
+		reg = <0x32>;
+		interrupts-extended = <&gpio5 2 IRQ_TYPE_EDGE_BOTH>,
+				      <&gpio3 21 IRQ_TYPE_EDGE_BOTH>;
+		interrupt-names = "a_det", "alert";
+	};
+
 	hpa1: amp@60 {
 		compatible = "ti,tpa6130a2";
 		pinctrl-names = "default";
@@ -935,6 +966,15 @@
 		>;
 	};
 
+	pinctrl_gpio3_hog: gpio3hoggrp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D19__GPIO3_IO19		0x1b0b0
+			MX6QDL_PAD_EIM_D20__GPIO3_IO20		0x1b0b0
+			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x1b0b0
+			MX6QDL_PAD_EIM_D23__GPIO3_IO23		0x1b0b0
+		>;
+	};
+
 	pinctrl_i2c1: i2c1grp {
 		fsl,pins = <
 			MX6QDL_PAD_CSI0_DAT8__I2C1_SDA		0x4001b8b1
@@ -982,12 +1022,6 @@
 		>;
 	};
 
-	pinctrl_reg_user_usb: usbotggrp {
-		fsl,pins = <
-			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x40000038
-		>;
-	};
-
 	pinctrl_rmii_phy_irq: phygrp {
 		fsl,pins = <
 			MX6QDL_PAD_EIM_D30__GPIO3_IO30		0x40010000
@@ -1047,6 +1081,13 @@
 		>;
 	};
 
+	pinctrl_ucs1002_pins: ucs1002grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_A25__GPIO5_IO02  	0x1b0b0
+			MX6QDL_PAD_EIM_D21__GPIO3_IO21  	0x1b0b0
+		>;
+	};
+
 	pinctrl_usdhc2: usdhc2grp {
 		fsl,pins = <
 			MX6QDL_PAD_SD2_CMD__SD2_CMD		0x10059
-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-05-29  8:27 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22  7:12 [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip Andrey Smirnov
2019-05-22  7:12 ` Andrey Smirnov
2019-05-22  7:12 ` [PATCH 2/3] ARM: dts: imx6: rdu2: Disable WP for USDHC2 and USDHC3 Andrey Smirnov
2019-05-22  7:12   ` Andrey Smirnov
2019-05-23  0:27   ` Chris Healy
2019-05-23  0:27     ` Chris Healy
2019-05-22  7:12 ` [PATCH 3/3] ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed Andrey Smirnov
2019-05-22  7:12   ` Andrey Smirnov
2019-05-22  9:33   ` Lucas Stach
2019-05-22  9:33     ` Lucas Stach
2019-05-22 17:56     ` Andrey Smirnov
2019-05-22 17:56       ` Andrey Smirnov
2019-05-22 18:10       ` Chris Healy
2019-05-22 18:10         ` Chris Healy
2019-05-22  9:37 ` [PATCH 1/3] ARM: dts: imx6: rdu2: Add node for UCS1002 USB charger chip Lucas Stach
2019-05-22  9:37   ` Lucas Stach
2019-05-22 17:49   ` Andrey Smirnov
2019-05-22 17:49     ` Andrey Smirnov
2019-05-29  7:18 Andrey Smirnov
2019-05-29  7:18 ` Andrey Smirnov
2019-05-29  7:22 ` Andrey Smirnov
2019-05-29  7:22   ` Andrey Smirnov
2019-05-29  8:27 ` Lucas Stach
2019-05-29  8:27   ` Lucas Stach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.