From patchwork Fri Mar 24 20:11:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9644003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A60660328 for ; Fri, 24 Mar 2017 20:12:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C94E20564 for ; Fri, 24 Mar 2017 20:12:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60EC4205F6; Fri, 24 Mar 2017 20:12:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2283F20564 for ; Fri, 24 Mar 2017 20:12:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To: Date:References:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=duhjcnZRzga+mCEChzGZVRa/qG9ceZOoH8JFbkIu+B4=; b=kqCwepbUqc6sGw QgJHhWUpSzD8/fTIqXJU3xDTSzArWikmWpmciKbwztNgVmHy4Xo5Sy87+01gUrncp1hGjmjNoJExl GQAFx7dW0Eo8RXg6aghFuurNEBHdwuDrJY3AerT53apYiJQejFCJPY2TCqhA2FrZzSYk5WCy+TAQv n4gPxnY05a1R1/REuf43Gw8c/nS8tm0zGwKA0n022o0Wi+/PWlMr3MWwUWpQ5CsfqlmePAFYjUUi/ HDalYr0fJmRqz4JHMEeeyDAYp+/zIQSQBwGqcYhnCXqHfD3Ygd1FAAX1M3O5vURhdo8QgWCKlTSWL RMrw0jXzbHBcEgSZUGvQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1crVZ1-0001mi-4f; Fri, 24 Mar 2017 20:11:59 +0000 Received: from mail-pf0-x233.google.com ([2607:f8b0:400e:c00::233]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1crVYy-0001kn-1d for linux-amlogic@lists.infradead.org; Fri, 24 Mar 2017 20:11:58 +0000 Received: by mail-pf0-x233.google.com with SMTP id o190so322702pfo.0 for ; Fri, 24 Mar 2017 13:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version; bh=6NYIYTJxfK6sxk0Jrz3Jd87wCRPBxKyFbj7aFttzbX8=; b=llTaSlxfZR1WnFks67e8tVzCaRoufKcwwLdx+FHll2mmQQHDluEKrdvGq/5Ojav594 UZGDK3/KSvUwwqUSYgE403dEMspkcm8FGbUyXjM4la24yNWTQVItqDV9E4D+4tzuztSr axNWGGiMOrD5OqD+dG3+nPd93aNlBP+AHD4FX40EbfjpCpnjBJ2kQq80tw7eXjfpYkJ3 6E+IhMxtiLVBIqKXimAaINa8yfYYeWTUXvErnez5llMm7et0y8XgHSTC+iuT2s279on6 fLmg7vyTv7RAt1Q9AxEI1hI7IRuvtU7l6yT+DpbspbSsICs9KD9IKm28kZyHck6Vuz8S QYbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version; bh=6NYIYTJxfK6sxk0Jrz3Jd87wCRPBxKyFbj7aFttzbX8=; b=q3rVCjfRtdMZVlJSVOHfzT2f6iFgzWe772eCf42J9UIkfnvC1b+jsRaYamyfyO1229 xk1TbaEPlhVUI3iRV8u+qXzQBDmpavj17jBCO3N47Jvgjw7sNEHQShesbZjBtRic26R/ 4bka5gNRFAW4xxlhTUC8Kcua37Q/YFAqaYHgQjCarCP1sLMbOmpDIXusogoemy3n6Jug C4WyK1InZPOfQeGlrlU5RCnX+DMANu7YpWw413BZmZfkw+Z0SQuGBe0rFm70T7CmjoSj kLAI66wllOWswDIjZzg+sjzwrtbZM2VQZ2+bsrQYKgRkLkZEJL76IaJP1m5FcXangMkN nxIQ== X-Gm-Message-State: AFeK/H08IC+8v90fZyrxn8DqHYx4u249eMaS0Ov6JzGgtMLSHcaFQRBGo/l6S92R+k9ouzGR X-Received: by 10.84.176.100 with SMTP id u91mr13462734plb.112.1490386294182; Fri, 24 Mar 2017 13:11:34 -0700 (PDT) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id p9sm6286336pfe.22.2017.03.24.13.11.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 13:11:33 -0700 (PDT) From: Kevin Hilman To: Neil Armstrong Subject: Re: [RFT PATCH 0/6] pinctrl: meson: Fix gpio-ranged for GPIO Hog Organization: BayLibre References: <1490286449-19448-1-git-send-email-narmstrong@baylibre.com> Date: Fri, 24 Mar 2017 13:11:32 -0700 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") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170324_131156_164912_3BD73BDE X-CRM114-Status: GOOD ( 15.02 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, carlo@caione.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Neil Armstrong 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 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 = ; + output-high; + line-name = "usb-hub-reset"; + }; };