From patchwork Wed Jul 2 15:41:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 4466461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5541A9F390 for ; Wed, 2 Jul 2014 15:44:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67702203DC for ; Wed, 2 Jul 2014 15:44:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9E419203AA for ; Wed, 2 Jul 2014 15:44:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2Mft-0006wQ-Ha; Wed, 02 Jul 2014 15:42:21 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2Mfb-0006kl-4e for linux-arm-kernel@lists.infradead.org; Wed, 02 Jul 2014 15:42:03 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N830097NCWX2S50@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 02 Jul 2014 16:41:21 +0100 (BST) X-AuditID: cbfec7f5-b7f626d000004b39-99-53b42830b9c6 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 08.B8.19257.03824B35; Wed, 02 Jul 2014 16:41:36 +0100 (BST) Received: from AMDC1227.digital.local ([106.116.147.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N8300DO3CX9L0B0@eusync1.samsung.com>; Wed, 02 Jul 2014 16:41:36 +0100 (BST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 2/6] pinctrl: samsung: Handle GPIO request and free using pinctrl helpers Date: Wed, 02 Jul 2014 17:41:00 +0200 Message-id: <1404315664-3174-3-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.9.3 In-reply-to: <1404315664-3174-1-git-send-email-t.figa@samsung.com> References: <1404315664-3174-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPJMWRmVeSWpSXmKPExsVy+t/xy7oGGluCDY7e07c4u+wgm0Xvgqts FlP+LGey2PT4GqvFjPP7mCzWz3jN4sDmMbvhIovHnWt72Dw2L6n36NuyitHj8ya5ANYoLpuU 1JzMstQifbsEroxDi1ezF3TxVnQtS2xgnMDdxcjJISFgIvHn1QR2CFtM4sK99WxdjFwcQgJL GSW2vPvPAuH0MUlsWN7IBlLFJqAm8bnhEZgtIqAq8bltATtIEbPAYUaJQwsPsIAkhAWiJZr/ rGIFsVmAin5sOwG2glfAUeJz/wkWiHVyEr3b3jB3MXJwcAo4STx74Q0SFgIqefhuEdMERt4F jAyrGEVTS5MLipPSc430ihNzi0vz0vWS83M3MUIC6esOxqXHrA4xCnAwKvHwvtDfFCzEmlhW XJl7iFGCg1lJhPeEwJZgId6UxMqq1KL8+KLSnNTiQ4xMHJxSDYwr1Cp6tp6QW1xveX1d1f0o 1gSxZZK5KS43JFcHGFfePrHOdPocWf8j9g6PSiyeSnm1iW59to5bkE3wQJ9p4nGF7S5eLa/1 zrVt9Xv6Z0NxcEXSUjHJhf8/Td16/c5+3V3KzzxcVs7YU+R3r3jDnJt7rIRTPZIWXDfb9nbX H4OPSdquEZtV5pkqsRRnJBpqMRcVJwIA+YEvPgICAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140702_084203_324377_B3C53D99 X-CRM114-Status: UNSURE ( 9.03 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: Tomasz Figa , Linus Walleij , Kukjin Kim , Doug Anderson , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds .request() and .free() operations to gpio_chip of pinctrl-samsung driver, which call pinctrl request and free helpers to request and free pinctrl pin along with GPIO pin. Signed-off-by: Tomasz Figa --- drivers/pinctrl/pinctrl-samsung.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c index 779c8bc..6e099d6 100644 --- a/drivers/pinctrl/pinctrl-samsung.c +++ b/drivers/pinctrl/pinctrl-samsung.c @@ -779,7 +779,8 @@ static int samsung_pinctrl_register(struct platform_device *pdev, pin_bank = &drvdata->ctrl->pin_banks[bank]; pin_bank->grange.name = pin_bank->name; pin_bank->grange.id = bank; - pin_bank->grange.pin_base = pin_bank->pin_base; + pin_bank->grange.pin_base = drvdata->ctrl->base + + pin_bank->pin_base; pin_bank->grange.base = pin_bank->gpio_chip.base; pin_bank->grange.npins = pin_bank->gpio_chip.ngpio; pin_bank->grange.gc = &pin_bank->gpio_chip; @@ -789,7 +790,19 @@ static int samsung_pinctrl_register(struct platform_device *pdev, return 0; } +static int samsung_gpio_request(struct gpio_chip *chip, unsigned offset) +{ + return pinctrl_request_gpio(chip->base + offset); +} + +static void samsung_gpio_free(struct gpio_chip *chip, unsigned offset) +{ + pinctrl_free_gpio(chip->base + offset); +} + static const struct gpio_chip samsung_gpiolib_chip = { + .request = samsung_gpio_request, + .free = samsung_gpio_free, .set = samsung_gpio_set, .get = samsung_gpio_get, .direction_input = samsung_gpio_direction_input,