public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@baylibre.com>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: carlo@caione.org, linus.walleij@linaro.org,
	linux-amlogic@lists.infradead.org, linux-gpio@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFT PATCH 0/6] pinctrl: meson: Fix gpio-ranged for GPIO Hog
Date: Fri, 24 Mar 2017 13:11:32 -0700	[thread overview]
Message-ID: <m2poh6h1u3.fsf@baylibre.com> (raw)
In-Reply-To: <1490286449-19448-1-git-send-email-narmstrong@baylibre.com> (Neil Armstrong's message of "Thu, 23 Mar 2017 17:27:23 +0100")

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";
+       };
 };

      parent reply	other threads:[~2017-03-24 20:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 16:27 [RFT PATCH 0/6] pinctrl: meson: Fix gpio-ranged for GPIO Hog Neil Armstrong
2017-03-23 16:27 ` [RFT PATCH 1/6] ARM64: dts: meson-gxbb: Add gpio-ranges properties Neil Armstrong
2017-03-28  9:28   ` Linus Walleij
2017-03-23 16:27 ` [RFT PATCH 2/6] ARM64: dts: meson-gxl: " Neil Armstrong
2017-03-28  9:28   ` Linus Walleij
2017-03-23 16:27 ` [RFT PATCH 3/6] ARM: dts: meson8: " Neil Armstrong
2017-03-28  9:29   ` Linus Walleij
2017-03-23 16:27 ` [RFT PATCH 4/6] ARM: dts: meson8b: " Neil Armstrong
2017-03-28  9:29   ` Linus Walleij
2017-03-23 16:27 ` [RFT PATCH 5/6] pinctrl: meson: use gpio-ranges from DT Neil Armstrong
2017-03-23 20:09   ` Martin Blumenstingl
2017-03-24 16:52     ` Neil Armstrong
2017-03-28  9:30   ` Linus Walleij
2017-03-28  9:38     ` Neil Armstrong
2017-03-28 14:57       ` Kevin Hilman
2017-03-28  9:40   ` Linus Walleij
2017-03-23 16:27 ` [RFT PATCH 6/6] ARM64: dts: meson-gxbb: Add USB Hub GPIO hog Neil Armstrong
2017-03-28  9:31   ` Linus Walleij
2017-03-24 20:11 ` Kevin Hilman [this message]

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=m2poh6h1u3.fsf@baylibre.com \
    --to=khilman@baylibre.com \
    --cc=carlo@caione.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=narmstrong@baylibre.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox