devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] ARM: dts: sun5i: Enable USB DRC on A10s OLinuxIno Micro
@ 2015-07-31 12:53 Hans de Goede
       [not found] ` <1438347218-8158-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2015-07-31 12:53 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Hans de Goede

Enable the otg/drc usb controller on the A10s OLinuxIno Micro.

Note the A10s OlinuxIno Micro always has some voltage on its otg power
pin, even if the usb-vbus0-regulator is disabled, the leaked voltage is
enough to make vbus-det always report 1, so we do not use vbus-det on
this board.

Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
Changes in v2:
-Address usb0_vbus_pin_a node by reference instead of by full path
---
 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 30 +++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
index 7b26e17..5a422c1 100644
--- a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
@@ -196,6 +196,10 @@
 	status = "okay";
 };
 
+&otg_sram {
+	status = "okay";
+};
+
 &pio {
 	mmc0_cd_pin_olinuxino_micro: mmc0_cd_pin@0 {
 		allwinner,pins = "PG1";
@@ -224,6 +228,18 @@
 		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
 		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 	};
+
+	usb0_id_detect_pin: usb0_id_detect_pin@0 {
+		allwinner,pins = "PG12";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	};
+};
+
+&reg_usb0_vbus {
+	gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
+	status = "okay";
 };
 
 &reg_usb1_vbus {
@@ -250,8 +266,20 @@
 	status = "okay";
 };
 
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usb0_vbus_pin_a {
+	allwinner,pins = "PG11";
+};
+
 &usbphy {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb0_id_detect_pin>;
+	usb0_id_det-gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+	usb0_vbus-supply = <&reg_usb0_vbus>;
 	usb1_vbus-supply = <&reg_usb1_vbus>;
 	status = "okay";
 };
-
-- 
2.4.3

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

* [PATCH v2 2/3] ARM: dts: sun5i: Enable USB DRC on A13 OLinuxIno
       [not found] ` <1438347218-8158-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2015-07-31 12:53   ` Hans de Goede
       [not found]     ` <1438347218-8158-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2015-07-31 12:53   ` [PATCH v2 3/3] ARM: dts: sun8i: Enable USB DRC on Ippo Q8H-A33 tablet Hans de Goede
  2015-07-31 16:57   ` [PATCH v2 1/3] ARM: dts: sun5i: Enable USB DRC on A10s OLinuxIno Micro Maxime Ripard
  2 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2015-07-31 12:53 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Mark Janssen, Hans de Goede

From: Mark Janssen <mark-5WUJjqWNSpBmR6Xm/wNWPw@public.gmane.org>

Enable the otg/drc usb controller on the A13 OLinuxIno.

Signed-off-by: Mark Janssen <mark-5WUJjqWNSpBmR6Xm/wNWPw@public.gmane.org>
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
Changes in v2:
-Address usb0_vbus_pin_a node by reference instead of by full path
---
 arch/arm/boot/dts/sun5i-a13-olinuxino.dts | 37 +++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
index 4232400..b3c234c 100644
--- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
+++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
@@ -159,6 +159,10 @@
 	status = "okay";
 };
 
+&otg_sram {
+	status = "okay";
+};
+
 &pio {
 	mmc0_cd_pin_olinuxino: mmc0_cd_pin@0 {
 		allwinner,pins = "PG0";
@@ -174,6 +178,20 @@
 		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 	};
 
+	usb0_id_detect_pin: usb0_id_detect_pin@0 {
+		allwinner,pins = "PG2";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	};
+
+	usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+		allwinner,pins = "PG1";
+		allwinner,function = "gpio_in";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+	};
+
 	usb1_vbus_pin_olinuxino: usb1_vbus_pin@0 {
 		allwinner,pins = "PG11";
 		allwinner,function = "gpio_out";
@@ -182,6 +200,11 @@
 	};
 };
 
+&reg_usb0_vbus {
+	status = "okay";
+	gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+};
+
 &reg_usb1_vbus {
 	pinctrl-0 = <&usb1_vbus_pin_olinuxino>;
 	gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
@@ -194,7 +217,21 @@
 	status = "okay";
 };
 
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usb0_vbus_pin_a {
+	allwinner,pins = "PG12";
+};
+
 &usbphy {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+	usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
+	usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+	usb0_vbus-supply = <&reg_usb0_vbus>;
 	usb1_vbus-supply = <&reg_usb1_vbus>;
 	status = "okay";
 };
-- 
2.4.3

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

* [PATCH v2 3/3] ARM: dts: sun8i: Enable USB DRC on Ippo Q8H-A33 tablet
       [not found] ` <1438347218-8158-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2015-07-31 12:53   ` [PATCH v2 2/3] ARM: dts: sun5i: Enable USB DRC on A13 OLinuxIno Hans de Goede
@ 2015-07-31 12:53   ` Hans de Goede
       [not found]     ` <1438347218-8158-3-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2015-07-31 16:57   ` [PATCH v2 1/3] ARM: dts: sun5i: Enable USB DRC on A10s OLinuxIno Micro Maxime Ripard
  2 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2015-07-31 12:53 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Hans de Goede

Enable the otg/drc usb controller on the Ippo Q8H-A33 tablet, for now it
is enabled in host-only mode, because true OTG support requires support
for detecting and enabling Vbus through the axp221 pmic.

For this to work the Vbus on the port must be enabled by u-boot,
or a powered hub must be used.

Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
Changes in v2:
-Add a FIXME comment to the usb_otg block in the dts, pointing out the need
 to add full otg support once we get axp22x pmic support for a33 based devices
---
 arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dts b/arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dts
index 8bb75ee..a438975 100644
--- a/arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dts
+++ b/arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dts
@@ -116,3 +116,18 @@
 	pinctrl-0 = <&r_uart_pins_a>;
 	status = "okay";
 };
+
+/*
+ * FIXME for now we only support host mode and rely on u-boot to have
+ * turned on Vbus which is controlled by the axp223 pmic on the board.
+ *
+ * Once we have axp223 support we should switch to fully supporting otg.
+ */
+&usb_otg {
+	dr_mode = "host";
+	status = "okay";
+};
+
+&usbphy {
+	status = "okay";
+};
-- 
2.4.3

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

* Re: [PATCH v2 1/3] ARM: dts: sun5i: Enable USB DRC on A10s OLinuxIno Micro
       [not found] ` <1438347218-8158-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2015-07-31 12:53   ` [PATCH v2 2/3] ARM: dts: sun5i: Enable USB DRC on A13 OLinuxIno Hans de Goede
  2015-07-31 12:53   ` [PATCH v2 3/3] ARM: dts: sun8i: Enable USB DRC on Ippo Q8H-A33 tablet Hans de Goede
@ 2015-07-31 16:57   ` Maxime Ripard
  2 siblings, 0 replies; 6+ messages in thread
From: Maxime Ripard @ 2015-07-31 16:57 UTC (permalink / raw)
  To: Hans de Goede
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

On Fri, Jul 31, 2015 at 02:53:36PM +0200, Hans de Goede wrote:
> Enable the otg/drc usb controller on the A10s OLinuxIno Micro.
> 
> Note the A10s OlinuxIno Micro always has some voltage on its otg power
> pin, even if the usb-vbus0-regulator is disabled, the leaked voltage is
> enough to make vbus-det always report 1, so we do not use vbus-det on
> this board.
> 
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* Re: [PATCH v2 2/3] ARM: dts: sun5i: Enable USB DRC on A13 OLinuxIno
       [not found]     ` <1438347218-8158-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2015-07-31 16:58       ` Maxime Ripard
  0 siblings, 0 replies; 6+ messages in thread
From: Maxime Ripard @ 2015-07-31 16:58 UTC (permalink / raw)
  To: Hans de Goede
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Mark Janssen

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

On Fri, Jul 31, 2015 at 02:53:37PM +0200, Hans de Goede wrote:
> From: Mark Janssen <mark-5WUJjqWNSpBmR6Xm/wNWPw@public.gmane.org>
> 
> Enable the otg/drc usb controller on the A13 OLinuxIno.
> 
> Signed-off-by: Mark Janssen <mark-5WUJjqWNSpBmR6Xm/wNWPw@public.gmane.org>
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* Re: [PATCH v2 3/3] ARM: dts: sun8i: Enable USB DRC on Ippo Q8H-A33 tablet
       [not found]     ` <1438347218-8158-3-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2015-07-31 16:58       ` Maxime Ripard
  0 siblings, 0 replies; 6+ messages in thread
From: Maxime Ripard @ 2015-07-31 16:58 UTC (permalink / raw)
  To: Hans de Goede
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

On Fri, Jul 31, 2015 at 02:53:38PM +0200, Hans de Goede wrote:
> Enable the otg/drc usb controller on the Ippo Q8H-A33 tablet, for now it
> is enabled in host-only mode, because true OTG support requires support
> for detecting and enabling Vbus through the axp221 pmic.
> 
> For this to work the Vbus on the port must be enabled by u-boot,
> or a powered hub must be used.
> 
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2015-07-31 16:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-31 12:53 [PATCH v2 1/3] ARM: dts: sun5i: Enable USB DRC on A10s OLinuxIno Micro Hans de Goede
     [not found] ` <1438347218-8158-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-31 12:53   ` [PATCH v2 2/3] ARM: dts: sun5i: Enable USB DRC on A13 OLinuxIno Hans de Goede
     [not found]     ` <1438347218-8158-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-31 16:58       ` Maxime Ripard
2015-07-31 12:53   ` [PATCH v2 3/3] ARM: dts: sun8i: Enable USB DRC on Ippo Q8H-A33 tablet Hans de Goede
     [not found]     ` <1438347218-8158-3-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-31 16:58       ` Maxime Ripard
2015-07-31 16:57   ` [PATCH v2 1/3] ARM: dts: sun5i: Enable USB DRC on A10s OLinuxIno Micro Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).