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: 883352 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5FJc8Qv024066 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 15 Jun 2011 19:38:29 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QWvuh-0004Ut-VZ; Wed, 15 Jun 2011 19:38:07 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QWvug-0004Uo-TG for spi-devel-general@lists.sourceforge.net; Wed, 15 Jun 2011 19:38:06 +0000 X-ACL-Warn: Received: from mail-pz0-f47.google.com ([209.85.210.47]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1QWvug-0004Yc-8B for spi-devel-general@lists.sourceforge.net; Wed, 15 Jun 2011 19:38:06 +0000 Received: by mail-pz0-f47.google.com with SMTP id 36so757730pzk.34 for ; Wed, 15 Jun 2011 12:38:06 -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-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1QWvug-0004Yc-8B Cc: Stephen Warren X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net 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:29 +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 ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev 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++) {