All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: <linux-arm-kernel@lists.infradead.org>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>,
	Ludovic Desroches <ludovic.desroches@atmel.com>,
	Cyrille Pitchen <cyrille.pitchen@atmel.com>,
	Wenyou Yang <wenyou.yang@atmel.com>,
	Songjun Wu <songjun.wu@atmel.com>, <linux-kernel@vger.kernel.org>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: [PATCH 1/3] ARM: dts: at91: sama5d2 Xplained: set pin muxing for usb gadget and usb host
Date: Tue, 1 Mar 2016 15:02:35 +0100	[thread overview]
Message-ID: <1993c13ec2351fa16c16c660c1023075b7870e20.1456840819.git.nicolas.ferre@atmel.com> (raw)
In-Reply-To: <cover.1456840819.git.nicolas.ferre@atmel.com>

From: Cyrille Pitchen <cyrille.pitchen@atmel.com>

For USB gadget on port A (device mode):
- pin PA31 is configured as an input GPIO which triggers an interrupt when
  vbus is detected on USB port A.
- pin PB9 is configured as an output GPIO and set to low level so the
  board doesn't supply vbus to USB port A.

For USB host:
- pin PB10 is configured as an output GPIO and is active at high level.
  The ohci driver will activate this pin so the board supplies vbus to USB
  port B.
- pin PB9 should be configured as an output GPIO and active at high level
  to use to USB port A in host mode (conflicts with USB gadget).

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/boot/dts/at91-sama5d2_xplained.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index 75341eec2dfd..382ccfb4a2b6 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -46,6 +46,7 @@
 #include "sama5d2.dtsi"
 #include "sama5d2-pinfunc.h"
 #include <dt-bindings/mfd/atmel-flexcom.h>
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	model = "Atmel SAMA5D2 Xplained";
@@ -71,11 +72,20 @@
 
 	ahb {
 		usb0: gadget@00300000 {
+			atmel,vbus-gpio = <&pioA 31 GPIO_ACTIVE_HIGH>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usba_vbus>;
 			status = "okay";
 		};
 
 		usb1: ohci@00400000 {
 			num-ports = <3>;
+			atmel,vbus-gpio = <0 /* &pioA 41 GPIO_ACTIVE_HIGH */
+					   &pioA 42 GPIO_ACTIVE_HIGH
+					   0
+					  >;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usb_default>;
 			status = "okay";
 		};
 
@@ -376,6 +386,17 @@
 						 <PIN_PB12__UTXD3>;
 					bias-disable;
 				};
+
+				pinctrl_usb_default: usb_default {
+					pinmux = <PIN_PB10__GPIO>;
+					bias-disable;
+				};
+
+				pinctrl_usba_vbus: usba_vbus {
+					pinmux = <PIN_PA31__GPIO>;
+					bias-disable;
+				};
+
 			};
 		};
 	};
-- 
2.1.3

WARNING: multiple messages have this Message-ID (diff)
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] ARM: dts: at91: sama5d2 Xplained: set pin muxing for usb gadget and usb host
Date: Tue, 1 Mar 2016 15:02:35 +0100	[thread overview]
Message-ID: <1993c13ec2351fa16c16c660c1023075b7870e20.1456840819.git.nicolas.ferre@atmel.com> (raw)
In-Reply-To: <cover.1456840819.git.nicolas.ferre@atmel.com>

From: Cyrille Pitchen <cyrille.pitchen@atmel.com>

For USB gadget on port A (device mode):
- pin PA31 is configured as an input GPIO which triggers an interrupt when
  vbus is detected on USB port A.
- pin PB9 is configured as an output GPIO and set to low level so the
  board doesn't supply vbus to USB port A.

For USB host:
- pin PB10 is configured as an output GPIO and is active at high level.
  The ohci driver will activate this pin so the board supplies vbus to USB
  port B.
- pin PB9 should be configured as an output GPIO and active at high level
  to use to USB port A in host mode (conflicts with USB gadget).

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/boot/dts/at91-sama5d2_xplained.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index 75341eec2dfd..382ccfb4a2b6 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -46,6 +46,7 @@
 #include "sama5d2.dtsi"
 #include "sama5d2-pinfunc.h"
 #include <dt-bindings/mfd/atmel-flexcom.h>
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	model = "Atmel SAMA5D2 Xplained";
@@ -71,11 +72,20 @@
 
 	ahb {
 		usb0: gadget at 00300000 {
+			atmel,vbus-gpio = <&pioA 31 GPIO_ACTIVE_HIGH>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usba_vbus>;
 			status = "okay";
 		};
 
 		usb1: ohci at 00400000 {
 			num-ports = <3>;
+			atmel,vbus-gpio = <0 /* &pioA 41 GPIO_ACTIVE_HIGH */
+					   &pioA 42 GPIO_ACTIVE_HIGH
+					   0
+					  >;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usb_default>;
 			status = "okay";
 		};
 
@@ -376,6 +386,17 @@
 						 <PIN_PB12__UTXD3>;
 					bias-disable;
 				};
+
+				pinctrl_usb_default: usb_default {
+					pinmux = <PIN_PB10__GPIO>;
+					bias-disable;
+				};
+
+				pinctrl_usba_vbus: usba_vbus {
+					pinmux = <PIN_PA31__GPIO>;
+					bias-disable;
+				};
+
 			};
 		};
 	};
-- 
2.1.3

  reply	other threads:[~2016-03-01 14:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 14:02 [PATCH 0/3] ARM: dts: at91: add more devices to sama5d2 Xplained Nicolas Ferre
2016-03-01 14:02 ` Nicolas Ferre
2016-03-01 14:02 ` Nicolas Ferre [this message]
2016-03-01 14:02   ` [PATCH 1/3] ARM: dts: at91: sama5d2 Xplained: set pin muxing for usb gadget and usb host Nicolas Ferre
2016-03-01 14:02 ` [PATCH 2/3] ARM: dts: at91: sama5d2 Xplained: add user push button Nicolas Ferre
2016-03-01 14:02   ` Nicolas Ferre
2016-03-01 14:02 ` [PATCH 3/3] ARM: dts: at91: sama5d2 Xplained: add leds node Nicolas Ferre
2016-03-01 14:02   ` Nicolas Ferre
2016-03-02 14:28 ` [PATCH 0/3] ARM: dts: at91: add more devices to sama5d2 Xplained Alexandre Belloni
2016-03-02 14:28   ` Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1993c13ec2351fa16c16c660c1023075b7870e20.1456840819.git.nicolas.ferre@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludovic.desroches@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=songjun.wu@atmel.com \
    --cc=wenyou.yang@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.