Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1607680 > unrolled thread

[RFT PATCH 0/6] pinctrl: meson: Fix gpio-ranged for GPIO Hog

Started byNeil Armstrong <narmstrong@baylibre.com>
First post2017-03-23 17:30 +0100
Last post2017-03-24 21:20 +0100
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [RFT PATCH 0/6] pinctrl: meson: Fix gpio-ranged for GPIO Hog Neil Armstrong <narmstrong@baylibre.com> - 2017-03-23 17:30 +0100
    [RFT PATCH 6/6] ARM64: dts: meson-gxbb: Add USB Hub GPIO hog Neil Armstrong <narmstrong@baylibre.com> - 2017-03-23 17:30 +0100
    [RFT PATCH 2/6] ARM64: dts: meson-gxl: Add gpio-ranges properties Neil Armstrong <narmstrong@baylibre.com> - 2017-03-23 17:30 +0100
    [RFT PATCH 1/6] ARM64: dts: meson-gxbb: Add gpio-ranges properties Neil Armstrong <narmstrong@baylibre.com> - 2017-03-23 17:30 +0100
    Re: [RFT PATCH 0/6] pinctrl: meson: Fix gpio-ranged for GPIO Hog Kevin Hilman <khilman@baylibre.com> - 2017-03-24 21:20 +0100

#1607680 — [RFT PATCH 0/6] pinctrl: meson: Fix gpio-ranged for GPIO Hog

FromNeil Armstrong <narmstrong@baylibre.com>
Date2017-03-23 17:30 +0100
Subject[RFT PATCH 0/6] pinctrl: meson: Fix gpio-ranged for GPIO Hog
Message-ID<todMB-4Je-3@gated-at.bofh.it>
Whem trying to add a gpio hog to enable the USB Hub on the Odroid-C2, I
encountered a strange bug where when calling gpiochip_add_data() the gpiolib
code was trying to add the Hog but failed because the gpio ranges were missing.

In the meson-pinctrl driver, the gpio ranges are added manually /after/ the
call to gpiochip_add_data().
The arch/arm meson8 and meson8b patches has not been tested, this is why this
patchset is an RFT.

So this patchset uses the DT gpio-ranges attribute instead and solves the issue.

The final patch is the actual GPIO Hog for the Odroid-C2 board, which is an ugly
hack but is necessary to have USB Ports working on the board until the generic
power sequence framework is merged.

Neil Armstrong (6):
  ARM64: dts: meson-gxbb: Add gpio-ranges properties
  ARM64: dts: meson-gxl: Add gpio-ranges properties
  ARM: dts: meson8: Add gpio-ranges properties
  ARM: dts: meson8b: Add gpio-ranges properties
  pinctrl: meson: use gpio-ranges from DT
  ARM64: dts: meson-gxbb: Add USB Hub GPIO hog

 arch/arm/boot/dts/meson8.dtsi                       |  2 ++
 arch/arm/boot/dts/meson8b.dtsi                      |  2 ++
 arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 15 +++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi         |  2 ++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi          |  2 ++
 drivers/pinctrl/meson/pinctrl-meson.c               | 14 +-------------
 6 files changed, 24 insertions(+), 13 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1607681 — [RFT PATCH 6/6] ARM64: dts: meson-gxbb: Add USB Hub GPIO hog

FromNeil Armstrong <narmstrong@baylibre.com>
Date2017-03-23 17:30 +0100
Subject[RFT PATCH 6/6] ARM64: dts: meson-gxbb: Add USB Hub GPIO hog
Message-ID<todMC-4Je-13@gated-at.bofh.it>
In reply to#1607680
The ODroid-C2 on-board USB Hub needs to to have it's reset signal set to
high level in order to be enumerated by the USB Host Controller.

But this management must be part of the currently in-development Generic
Power Sequence patch that will allow a USB Controller driver to start and stop
a power sequence associated to the USB Bus.

In the meantime, a simple USB Hog will work to enable the USB Hub.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index c59403a..6288538 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -177,6 +177,21 @@
 	pinctrl-names = "default";
 };
 
+&gpio_ao {
+	/*
+	 * WARNING: The USB Hub on the Odroid-C2 needs a reset signal
+	 * to be turned high in order to be detected by the USB Controller
+	 * This signal should be handled by a USB specific power sequence
+	 * in order to reset the Hub when USB bus is powered down.
+	 */
+	usb-hub {
+		gpio-hog;
+		gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "usb-hub-reset";
+	};
+};
+
 &usb0_phy {
 	status = "okay";
 	phy-supply = <&usb_otg_pwr>;
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1607682 — [RFT PATCH 2/6] ARM64: dts: meson-gxl: Add gpio-ranges properties

FromNeil Armstrong <narmstrong@baylibre.com>
Date2017-03-23 17:30 +0100
Subject[RFT PATCH 2/6] ARM64: dts: meson-gxl: Add gpio-ranges properties
Message-ID<todMC-4Je-25@gated-at.bofh.it>
In reply to#1607680
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
index fe11b5f..64f4b6e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
@@ -79,6 +79,7 @@
 			reg-names = "mux", "pull", "gpio";
 			gpio-controller;
 			#gpio-cells = <2>;
+			gpio-ranges = <&pinctrl_aobus 0 0 14>;
 		};
 
 		uart_ao_a_pins: uart_ao_a {
@@ -142,6 +143,7 @@
 			reg-names = "mux", "pull", "pull-enable", "gpio";
 			gpio-controller;
 			#gpio-cells = <2>;
+			gpio-ranges = <&pinctrl_periphs 0 14 101>;
 		};
 
 		emmc_pins: emmc {
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1607685 — [RFT PATCH 1/6] ARM64: dts: meson-gxbb: Add gpio-ranges properties

FromNeil Armstrong <narmstrong@baylibre.com>
Date2017-03-23 17:30 +0100
Subject[RFT PATCH 1/6] ARM64: dts: meson-gxbb: Add gpio-ranges properties
Message-ID<todMC-4Je-21@gated-at.bofh.it>
In reply to#1607680
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 04b3324..84c590b 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -129,6 +129,7 @@
 			reg-names = "mux", "pull", "gpio";
 			gpio-controller;
 			#gpio-cells = <2>;
+			gpio-ranges = <&pinctrl_aobus 0 0 14>;
 		};
 
 		uart_ao_a_pins: uart_ao_a {
@@ -245,6 +246,7 @@
 			reg-names = "mux", "pull", "pull-enable", "gpio";
 			gpio-controller;
 			#gpio-cells = <2>;
+			gpio-ranges = <&pinctrl_periphs 0 14 120>;
 		};
 
 		emmc_pins: emmc {
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1608952

FromKevin Hilman <khilman@baylibre.com>
Date2017-03-24 21:20 +0100
Message-ID<toDQK-6Kj-25@gated-at.bofh.it>
In reply to#1607680
Neil Armstrong <narmstrong@baylibre.com> writes:

> Whem trying to add a gpio hog to enable the USB Hub on the Odroid-C2, I
> encountered a strange bug where when calling gpiochip_add_data() the gpiolib
> code was trying to add the Hog but failed because the gpio ranges were missing.
>
> In the meson-pinctrl driver, the gpio ranges are added manually /after/ the
> call to gpiochip_add_data().
> The arch/arm meson8 and meson8b patches has not been tested, this is why this
> patchset is an RFT.
>
> So this patchset uses the DT gpio-ranges attribute instead and solves the issue.
>
> The final patch is the actual GPIO Hog for the Odroid-C2 board, which is an ugly
> hack but is necessary to have USB Ports working on the board until the generic
> power sequence framework is merged.
>
> Neil Armstrong (6):
>   ARM64: dts: meson-gxbb: Add gpio-ranges properties
>   ARM64: dts: meson-gxl: Add gpio-ranges properties
>   ARM: dts: meson8: Add gpio-ranges properties
>   ARM: dts: meson8b: Add gpio-ranges properties
>   pinctrl: meson: use gpio-ranges from DT
>   ARM64: dts: meson-gxbb: Add USB Hub GPIO hog

Not sure what kind of extra testing is needed on meson8*, but I tested
on meson8b-odroidc1 by replacing the heartbeat LED GPIO with a GPIO
hog[1] and see the LED turn on and stay on, so it seems good to me.

Tested-by: Kevin Hilman <khilman@baylibre.com>

Kevin

[1]
diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
index e50f1a1fdbc7..d750d6b4c9f1 100644
--- a/arch/arm/boot/dts/meson8b-odroidc1.dts
+++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
@@ -60,6 +60,7 @@
 		reg = <0x40000000 0x40000000>;
 	};
 
+/*
 	leds {
 		compatible = "gpio-leds";
 		blue {
@@ -69,10 +70,18 @@
 			default-state = "off";
 		};
 	};
+*/
 };
 
 &uart_AO {
 	status = "okay";
 	pinctrl-0 = <&uart_ao_a_pins>;
 	pinctrl-names = "default";
+
+       usb-hub {
+               gpio-hog;
+               gpios = <GPIOAO_13 GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "usb-hub-reset";
+       };
 };

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web