From patchwork Mon Aug 15 01:35:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Cooper X-Patchwork-Id: 9280239 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 83EE9600CB for ; Mon, 15 Aug 2016 01:38:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74FEB28B41 for ; Mon, 15 Aug 2016 01:38:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69BFD28B45; Mon, 15 Aug 2016 01:38:24 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DD27328B41 for ; Mon, 15 Aug 2016 01:38:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZ6pE-00086x-0o; Mon, 15 Aug 2016 01:36:24 +0000 Received: from outbound1a.ore.mailhop.org ([54.213.22.21]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZ6p6-00085s-PP for linux-arm-kernel@lists.infradead.org; Mon, 15 Aug 2016 01:36:17 +0000 X-MHO-User: c8aad6bf-6288-11e6-a0ff-e511cd071b9b X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 74.99.77.15 X-Mail-Handler: DuoCircle Outbound SMTP Received: from io (unknown [74.99.77.15]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 15 Aug 2016 01:37:10 +0000 (UTC) Received: from triton.lakedaemon.net (triton.lakedaemon.net [10.16.5.27]) by io (Postfix) with ESMTP id DD6C280064; Mon, 15 Aug 2016 01:35:51 +0000 (UTC) From: Jason Cooper To: Andrew Lunn , Gregory CLEMENT , Thomas Petazzoni , Sebastian Hesselbarth Subject: [RFC PATCH] DT: kirkwood: Fix Openblock A6 external GPIO pins Date: Mon, 15 Aug 2016 01:35:38 +0000 Message-Id: <20160815013538.8056-1-jason@lakedaemon.net> X-Mailer: git-send-email 2.9.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160814_183616_914150_A6F26D6B X-CRM114-Status: UNSURE ( 8.48 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Cooper , Linux ARM Kernel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP By assigning the pin hog to the pinctrl node, we correctly configure the MPPs. However, they are not available to userspace. Fix this by assigning the hogs to the gpio node. After this, the following works as expected: # echo 28 >/sys/class/gpio/export # echo low >/sys/class/gpio/gpio28/direction Signed-off-by: Jason Cooper --- I'm submitting this as RFC because it's clear no one is using this, so I'm not sure how far we need to take this. The dip switches should probably be under gpio-keys to make them input only. Thoughts? thx, Jason. arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts index 0db0e3edc88f..ddb17b1cdfe0 100644 --- a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts +++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts @@ -41,9 +41,6 @@ }; pinctrl: pin-controller@10000 { - pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header>; - pinctrl-names = "default"; - pmx_uart0: pmx-uart0 { marvell,pins = "mpp10", "mpp11", "mpp15", "mpp16"; @@ -174,3 +171,10 @@ phy-handle = <ðphy0>; }; }; + +&gpio0 { + status = "okay"; + + pinctrl-0 = <&pmx_dip_switches &pmx_gpio_header>; + pinctrl-names = "default"; +};