From patchwork Wed Jan 23 08:25:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 14236 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6A4E323E1A for ; Wed, 23 Jan 2013 08:26:39 +0000 (UTC) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by fiordland.canonical.com (Postfix) with ESMTP id 14BFFA18D2A for ; Wed, 23 Jan 2013 08:26:38 +0000 (UTC) Received: by mail-vc0-f181.google.com with SMTP id d16so5052050vcd.26 for ; Wed, 23 Jan 2013 00:26:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=zYm9fSdQf9breJl1wObm83lFj0A9a+V7cPPbSpyAX/M=; b=UbwxxhV26yv6uLsVYjVAf3Y88PdPSEaahTqY/YC1BGtJThDhwuNyuNGB5DE62fLbG8 0s3kz6Qhfu2oU6UAd+yfbb395Scaur83xPdRlAesgUuu7QCuldhpnfLt3XUHRyWdmFnG yWzSWCg5hUjWriwNYICvu9UtbXLK751gtRH6cFPmOe5q/Pb+h+E1Bmi8TMc2I654OI+M AorBF9fJ1AXiog4VdxlWvI0bPmIWro0EAmx0ZT6hrZYhFy00h1HKvAOs1mHL2lM/jZh0 55/E672xxTtbW7VLFl7bJmFNIX5vaejiOB7M+gCRXzovQcSnzYzlLv9Yx54tnuFu3cJk mEuQ== X-Received: by 10.52.34.108 with SMTP id y12mr421519vdi.8.1358929598605; Wed, 23 Jan 2013 00:26:38 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp292088veb; Wed, 23 Jan 2013 00:26:38 -0800 (PST) X-Received: by 10.68.138.195 with SMTP id qs3mr1379049pbb.62.1358929597824; Wed, 23 Jan 2013 00:26:37 -0800 (PST) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by mx.google.com with ESMTPS id g1si20074974paw.129.2013.01.23.00.26.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 00:26:37 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.43 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=209.85.220.43; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.43 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) smtp.mail=haojian.zhuang@linaro.org Received: by mail-pa0-f43.google.com with SMTP id fb10so4627899pad.16 for ; Wed, 23 Jan 2013 00:26:37 -0800 (PST) X-Received: by 10.68.237.42 with SMTP id uz10mr1255497pbc.118.1358929597463; Wed, 23 Jan 2013 00:26:37 -0800 (PST) Received: from localhost.localdomain ([98.126.173.75]) by mx.google.com with ESMTPS id qf7sm12392126pbb.49.2013.01.23.00.26.34 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 00:26:36 -0800 (PST) From: Haojian Zhuang To: linux@arm.linux.org.uk, marek.vasut@gmail.com, robert.jarzmik@free.fr, daniel@caiaq.de, linux-arm-kernel@lists.infradead.org, linus.walleij@linaro.org, grant.likely@secretlab.ca, cxie4@marvell.com Cc: patches@linaro.org, Haojian Zhuang Subject: [PATCH 10/10] gpio: pxa: bind to pinctrl by request Date: Wed, 23 Jan 2013 16:25:54 +0800 Message-Id: <1358929554-32265-11-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1358929554-32265-1-git-send-email-haojian.zhuang@linaro.org> References: <1358929554-32265-1-git-send-email-haojian.zhuang@linaro.org> X-Gm-Message-State: ALoCoQl5GGu3HlHAyTmngo7RCT5zyQPTdooBdplXiqq0dmcTh9dYnnd2pDOCuoZVy1QbnPOqCXVi While gpio pins is requested, request the pin of pinctrl driver first. Signed-off-by: Haojian Zhuang --- drivers/gpio/gpio-pxa.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index 528f742..d64ec8c 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -159,6 +160,17 @@ int pxa_irq_to_gpio(struct irq_data *d) return gpio; } +static int pxa_gpio_request(struct gpio_chip *gc, unsigned offset) +{ + /* + * Map back to global GPIO space and request muxing, the direction + * parameter does not matter for this controller. + */ + int gpio = gc->base + offset; + + return pinctrl_request_gpio(gpio); +} + static int pxa_gpio_direction_input(struct gpio_chip *gc, unsigned offset) { struct pxa_gpio_chip *chip = NULL; @@ -469,6 +481,7 @@ static int pxa_init_gpio_chip(struct platform_device *pdev, int gpio_end, gc->base = gpio; gc->label = chips[i].label; + gc->request = pxa_gpio_request; gc->direction_input = pxa_gpio_direction_input; gc->direction_output = pxa_gpio_direction_output; gc->get = pxa_gpio_get;