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: 2022881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id DD5B1DF280 for ; Wed, 23 Jan 2013 08:31:42 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Txvhx-00026G-TK; Wed, 23 Jan 2013 08:29:21 +0000 Received: from mail-pb0-f50.google.com ([209.85.160.50]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TxvfK-0000Nt-Bl for linux-arm-kernel@lists.infradead.org; Wed, 23 Jan 2013 08:26:39 +0000 Received: by mail-pb0-f50.google.com with SMTP id wz7so4542219pbc.9 for ; Wed, 23 Jan 2013 00:26:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=zYm9fSdQf9breJl1wObm83lFj0A9a+V7cPPbSpyAX/M=; b=mYKsQRFAk72AdgmkI3QlcdpcjMfAn9HT0XGafOFs/nepLS45K6cGuJG964APK1o4ad EvtQH9KFneGd2dLz90n3LhYJfOf9otmoBYN9aj2c9BVbZRSoTg0aaDMbGiewOpJW1qIT MJwqAvC2wOOfqrSApvPR4npJnKxW+Ty8/piKMGWikCKvUGkvkGaIuy2gs6mXXMjiWndX RiTnxhE4HI1d86coJGtolR9UJQhpLhZMYny+LSLTUr6WEg2iGkvtL7QPjHjrU6a+eAsT CG5SufDXTmXEblZOsCTZ7V9nTzolQ9Xr8+fONhwgRFEL5FvufanMYGwziwZFjn8RJQ/F oOHg== 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 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: ALoCoQnTOVVCa5gYZKmXN6rndLBABlIuX2ET5C1TSaQ8BCk+m3NMPcIpu88rkYelj0I8K8lTq6vA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130123_032638_520271_490E9114 X-CRM114-Status: GOOD ( 11.03 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.50 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Haojian Zhuang , patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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;