From patchwork Wed Jun 15 19:38:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 883372 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5FJcWPn024323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 15 Jun 2011 19:38:54 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QWvuu-0005iC-Ob; Wed, 15 Jun 2011 19:38:21 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QWvuu-0005YA-BQ; Wed, 15 Jun 2011 19:38:20 +0000 Received: from mail-pz0-f49.google.com ([209.85.210.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QWvui-0005Vh-K1 for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2011 19:38:09 +0000 Received: by pzk28 with SMTP id 28so631353pzk.36 for ; Wed, 15 Jun 2011 12:38:05 -0700 (PDT) Received: by 10.68.39.38 with SMTP id m6mr64148pbk.150.1308166685804; Wed, 15 Jun 2011 12:38:05 -0700 (PDT) Received: from localhost (S01060002b3d79728.cg.shawcable.net [70.72.87.49]) by mx.google.com with ESMTPS id p5sm414905pbk.4.2011.06.15.12.38.04 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2011 12:38:05 -0700 (PDT) Received: from [127.0.1.1] (localhost [127.0.0.1]) by localhost (Postfix) with ESMTP id 23439180C37; Wed, 15 Jun 2011 13:38:04 -0600 (MDT) Subject: [PATCH 2/2] gpio/tegra: add devicetree support To: Erik Gilling , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, Colin Cross , Olof Johansson , spi-devel-general@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org From: Grant Likely Date: Wed, 15 Jun 2011 13:38:04 -0600 Message-ID: <20110615193759.23641.26212.stgit@ponder> In-Reply-To: <20110615193734.23641.8004.stgit@ponder> References: <20110615193734.23641.8004.stgit@ponder> User-Agent: StGit/0.15 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110615_153808_931471_3B674BE9 X-CRM114-Status: GOOD ( 17.76 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.49 listed in list.dnswl.org] Cc: Stephen Warren X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 15 Jun 2011 19:38:54 +0000 (UTC) Add support for decoding gpios from the device tree Signed-off-by: Grant Likely Acked-by: Olof Johansson --- .../devicetree/bindings/gpio/gpio_nvidia.txt | 7 +++++++ drivers/gpio/gpio-tegra.c | 10 ++++++++++ 2 files changed, 17 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/gpio_nvidia.txt diff --git a/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt b/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt new file mode 100644 index 0000000..afb3ff3 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt @@ -0,0 +1,7 @@ +NVIDIA Tegra 2 GPIO controller + +Required properties: +- compatible : "nvidia,tegra250-gpio" +- #gpio-cells : Should be two. The first cell is the pin number and the + second cell is used to specify optional parameters (currently unused). +- gpio-controller : Marks the device node as a GPIO controller. diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 919d638..13afb88 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -23,6 +23,7 @@ #include #include +#include #include @@ -340,6 +341,15 @@ static int __init tegra_gpio_init(void) } } +#ifdef CONFIG_OF_GPIO + /* + * This isn't ideal, but it gets things hooked up until this + * driver is converted into a platform_device + */ + tegra_gpio_chip.of_node = of_find_compatible_node(NULL, NULL, + "nvidia,tegra250-gpio"); +#endif /* CONFIG_OF_GPIO */ + gpiochip_add(&tegra_gpio_chip); for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {