From patchwork Fri Sep 22 09:22:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 113995 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3058520qgf; Fri, 22 Sep 2017 02:22:52 -0700 (PDT) X-Received: by 10.101.74.207 with SMTP id c15mr8624829pgu.259.1506072172700; Fri, 22 Sep 2017 02:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506072172; cv=none; d=google.com; s=arc-20160816; b=yFI9oYawgI5ebmXvO+xq6EWHQj4Ix60B0LkIOqoakq1hniBrs6fqg1X8AbTxKFKxJL d5RfnOdQl5fIp8v1H3PX4iJ0lhOCKp8Ck/hLsrZDSRmnIjgAHOhXqzIwWO+8uE9p/UOY BFI2v9FwtrlqcvnvizTxnsFpbMLyK53cwVz2P62DHpks7mdYQ9wVyiVdkWVE3w1ovrxj BisfnaRr+QYZjU5M2zWccSmF+mQu9UqkDUT61T0dv8hSMDz72h/Zq/9QHxtEj5cPufPB Awm9mTGomHq9xXajNocNqCd7EHyZrRNYCdAN7XTUhyGTbPTYsHgEDIdgY1akI3Gbs1x9 32Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=2rdsQ6qWg10HCEwfUJu93QHNYh6vpLlu/CInpekHKr4=; b=DLplx2C2cFmy6GqvClqMuZBx0FVFA9Q8i7yvhOfel3vSTTJ6/GY+gUEZuXT0MwnFwF xmaAq2F2Fl5mDy1VYpCvsEWXnLgkDkjdyAXgm1q7gKHUFB1Dgktb02B8h9HEmKhhfJFW ljVhi8cDo+o2SUUJz471+yYaq22cAAvcOc0cGOH/w1RDOUQbI9rEQZhPpLuqYzs1SOD0 9fVH8IXPTVxqVOi9HR1krMSEmuBSi+vpStsuJwqAhodC7eoKhZ8ZoxdUXnVhM0Ux2x61 ChOO1DkwIH0MSElcDna9rzV3Y1XUNGHNWrsoRe2C6gx97rqvXZLgozote/AePp+XW3El Y2Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NSPjdOTl; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b83si2491988pfj.113.2017.09.22.02.22.52; Fri, 22 Sep 2017 02:22:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NSPjdOTl; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751832AbdIVJWw (ORCPT + 5 others); Fri, 22 Sep 2017 05:22:52 -0400 Received: from mail-lf0-f53.google.com ([209.85.215.53]:56533 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbdIVJWu (ORCPT ); Fri, 22 Sep 2017 05:22:50 -0400 Received: by mail-lf0-f53.google.com with SMTP id a18so544254lfl.13 for ; Fri, 22 Sep 2017 02:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JpUx+5HgxEMmRO3ezt4d0CK+98gcK0SsC8DCdbQao6c=; b=NSPjdOTlznL0Lht+Qh33QO2a5Q1Qji4f152xhTttRZMSvjCttB4M0toajWX36HGr9B A9gFa6P6iw7m/sPZTEgBP2sh9bl1a+Xf9cFQ1fuS16y64q39i38VoQpU+FTeRmYATBSY GCsz6Z7CZH+aokhYYWmDrYC443pDSzbSkkGhg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JpUx+5HgxEMmRO3ezt4d0CK+98gcK0SsC8DCdbQao6c=; b=akJ16sVTnBaglFHzXCovNDkwZNlNjonqhV7lywwCzN/gQmnYgFgHpfPJIWPX/qd1f0 9x8vvsZfMbNcoQS3kncfQ3TBKVjNloF1iwFHKKRiVFIdES/AJXXIit1YwSohaU+M2ulb F9aH7orrvyjjervzy9s+CFoOMEhy/Au/y+K+NX52EorpmSAImFDkEPXGw/CQVH7ldPIv OtfkqrUZ/MFrrkwLYWBM6skGEaZg65W0/XnJ5LvBL9e/3gfrTt3+d3RuIWtq62oowv08 2tegaRx87eFXOZJ88qgIDV9Od5QJiuseC8LdJ3axQwQAYI/0H9VT5DegLIum8D+2uvP6 PyPQ== X-Gm-Message-State: AHPjjUhs65QOL/Gl6rXd7futzan4cXGvK8shPk6AYn1UU48Ad8ynXCKj dcnARWJ4Mp1TWe1t38ve0pyVmAZ8jd0= X-Google-Smtp-Source: AOwi7QD9TgQ0u2+FW35K2TIM/JHS61cvYPVvcWrMALkfc6QTcGuI+/9TLdslznGWK7Qtu/i0Rp2s4g== X-Received: by 10.25.16.208 with SMTP id 77mr1698000lfq.156.1506072168222; Fri, 22 Sep 2017 02:22:48 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id o193sm542914lfo.11.2017.09.22.02.22.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Sep 2017 02:22:47 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij Subject: [PATCH 1/4] pinctrl/gpio: Unify namespace for cross-calls Date: Fri, 22 Sep 2017 11:22:40 +0200 Message-Id: <20170922092243.7546-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The pinctrl_request_gpio() and pinctrl_free_gpio() break the nice namespacing in the other cross-calls like pinctrl_gpio_foo(). Just rename them and all references so we have one namespace with all cross-calls under pinctrl_gpio_*(). Signed-off-by: Linus Walleij --- Documentation/driver-api/pinctl.rst | 6 +++--- Documentation/gpio/gpio-legacy.txt | 10 +++++----- Documentation/translations/zh_CN/gpio.txt | 6 +++--- drivers/gpio/gpio-aspeed.c | 4 ++-- drivers/gpio/gpio-em.c | 4 ++-- drivers/gpio/gpio-pxa.c | 4 ++-- drivers/gpio/gpio-rcar.c | 4 ++-- drivers/gpio/gpio-tegra.c | 4 ++-- drivers/gpio/gpio-tz1090.c | 4 ++-- drivers/gpio/gpiolib.c | 4 ++-- drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 4 ++-- drivers/pinctrl/bcm/pinctrl-nsp-gpio.c | 4 ++-- drivers/pinctrl/core.c | 12 ++++++------ drivers/pinctrl/core.h | 2 +- drivers/pinctrl/meson/pinctrl-meson.c | 4 ++-- drivers/pinctrl/sh-pfc/gpio.c | 4 ++-- drivers/pinctrl/sirf/pinctrl-atlas7.c | 4 ++-- drivers/pinctrl/sirf/pinctrl-sirf.c | 4 ++-- drivers/pinctrl/spear/pinctrl-plgpio.c | 6 +++--- drivers/pinctrl/stm32/pinctrl-stm32.c | 4 ++-- include/linux/pinctrl/consumer.h | 8 ++++---- 21 files changed, 53 insertions(+), 53 deletions(-) -- 2.13.5 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/driver-api/pinctl.rst b/Documentation/driver-api/pinctl.rst index 48f15b4f9d3e..6cb68d67fa75 100644 --- a/Documentation/driver-api/pinctl.rst +++ b/Documentation/driver-api/pinctl.rst @@ -757,8 +757,8 @@ that your datasheet calls "GPIO mode", but actually is just an electrical configuration for a certain device. See the section below named "GPIO mode pitfalls" for more details on this scenario. -The public pinmux API contains two functions named pinctrl_request_gpio() -and pinctrl_free_gpio(). These two functions shall *ONLY* be called from +The public pinmux API contains two functions named pinctrl_gpio_request() +and pinctrl_gpio_free(). These two functions shall *ONLY* be called from gpiolib-based drivers as part of their gpio_request() and gpio_free() semantics. Likewise the pinctrl_gpio_direction_[input|output] shall only be called from within respective gpio_direction_[input|output] @@ -790,7 +790,7 @@ gpiolib driver and the affected GPIO range, pin offset and desired direction will be passed along to this function. Alternatively to using these special functions, it is fully allowed to use -named functions for each GPIO pin, the pinctrl_request_gpio() will attempt to +named functions for each GPIO pin, the pinctrl_gpio_request() will attempt to obtain the function "gpioN" where "N" is the global GPIO pin number if no special GPIO-handler is registered. diff --git a/Documentation/gpio/gpio-legacy.txt b/Documentation/gpio/gpio-legacy.txt index 5eacc147ea87..8356d0e78f67 100644 --- a/Documentation/gpio/gpio-legacy.txt +++ b/Documentation/gpio/gpio-legacy.txt @@ -273,8 +273,8 @@ easily, gating off unused clocks. For GPIOs that use pins known to the pinctrl subsystem, that subsystem should be informed of their use; a gpiolib driver's .request() operation may call -pinctrl_request_gpio(), and a gpiolib driver's .free() operation may call -pinctrl_free_gpio(). The pinctrl subsystem allows a pinctrl_request_gpio() +pinctrl_gpio_request(), and a gpiolib driver's .free() operation may call +pinctrl_gpio_free(). The pinctrl subsystem allows a pinctrl_gpio_request() to succeed concurrently with a pin or pingroup being "owned" by a device for pin multiplexing. @@ -448,8 +448,8 @@ together with an optional gpio feature. We have already covered the case where e.g. a GPIO controller need to reserve a pin or set the direction of a pin by calling any of: -pinctrl_request_gpio() -pinctrl_free_gpio() +pinctrl_gpio_request() +pinctrl_gpio_free() pinctrl_gpio_direction_input() pinctrl_gpio_direction_output() @@ -466,7 +466,7 @@ gpio (under gpiolib) is still maintained by gpio drivers. It may happen that different pin ranges in a SoC is managed by different gpio drivers. This makes it logical to let gpio drivers announce their pin ranges to -the pin ctrl subsystem before it will call 'pinctrl_request_gpio' in order +the pin ctrl subsystem before it will call 'pinctrl_gpio_request' in order to request the corresponding pin to be prepared by the pinctrl subsystem before any gpio usage. diff --git a/Documentation/translations/zh_CN/gpio.txt b/Documentation/translations/zh_CN/gpio.txt index bce972521065..4f8bf30a41dc 100644 --- a/Documentation/translations/zh_CN/gpio.txt +++ b/Documentation/translations/zh_CN/gpio.txt @@ -257,9 +257,9 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其 简单地关闭未使用时钟)。 对于 GPIO 使用 pinctrl 子系统已知的引脚,子系统应该被告知其使用情况; -一个 gpiolib 驱动的 .request()操作应调用 pinctrl_request_gpio(), -而 gpiolib 驱动的 .free()操作应调用 pinctrl_free_gpio()。pinctrl -子系统允许 pinctrl_request_gpio()在某个引脚或引脚组以复用形式“属于” +一个 gpiolib 驱动的 .request()操作应调用 pinctrl_gpio_request(), +而 gpiolib 驱动的 .free()操作应调用 pinctrl_gpio_free()。pinctrl +子系统允许 pinctrl_gpio_request()在某个引脚或引脚组以复用形式“属于” 一个设备时都成功返回。 任何须将 GPIO 信号导向适当引脚的引脚复用硬件的编程应该发生在 GPIO diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index bfc53995064a..c269cc199707 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -536,12 +536,12 @@ static int aspeed_gpio_request(struct gpio_chip *chip, unsigned int offset) if (!have_gpio(gpiochip_get_data(chip), offset)) return -ENODEV; - return pinctrl_request_gpio(chip->base + offset); + return pinctrl_gpio_request(chip->base + offset); } static void aspeed_gpio_free(struct gpio_chip *chip, unsigned int offset) { - pinctrl_free_gpio(chip->base + offset); + pinctrl_gpio_free(chip->base + offset); } static inline void __iomem *bank_debounce_reg(struct aspeed_gpio *gpio, diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index 8d32ccc980d9..b86e09e1b13b 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c @@ -239,12 +239,12 @@ static int em_gio_to_irq(struct gpio_chip *chip, unsigned offset) static int em_gio_request(struct gpio_chip *chip, unsigned offset) { - return pinctrl_request_gpio(chip->base + offset); + return pinctrl_gpio_request(chip->base + offset); } static void em_gio_free(struct gpio_chip *chip, unsigned offset) { - pinctrl_free_gpio(chip->base + offset); + pinctrl_gpio_free(chip->base + offset); /* Set the GPIO as an input to ensure that the next GPIO request won't * drive the GPIO pin as an output. diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index 6029899789f3..da68d6cbc1e4 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -332,12 +332,12 @@ static int pxa_gpio_of_xlate(struct gpio_chip *gc, static int pxa_gpio_request(struct gpio_chip *chip, unsigned int offset) { - return pinctrl_request_gpio(chip->base + offset); + return pinctrl_gpio_request(chip->base + offset); } static void pxa_gpio_free(struct gpio_chip *chip, unsigned int offset) { - pinctrl_free_gpio(chip->base + offset); + pinctrl_gpio_free(chip->base + offset); } static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 1f0871553fd2..43b51045aa47 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -249,7 +249,7 @@ static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset) if (error < 0) return error; - error = pinctrl_request_gpio(chip->base + offset); + error = pinctrl_gpio_request(chip->base + offset); if (error) pm_runtime_put(&p->pdev->dev); @@ -260,7 +260,7 @@ static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset) { struct gpio_rcar_priv *p = gpiochip_get_data(chip); - pinctrl_free_gpio(chip->base + offset); + pinctrl_gpio_free(chip->base + offset); /* * Set the GPIO as an input to ensure that the next GPIO request won't diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index fbaf974277df..8db47f671708 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -141,14 +141,14 @@ static void tegra_gpio_disable(struct tegra_gpio_info *tgi, unsigned int gpio) static int tegra_gpio_request(struct gpio_chip *chip, unsigned int offset) { - return pinctrl_request_gpio(offset); + return pinctrl_gpio_request(offset); } static void tegra_gpio_free(struct gpio_chip *chip, unsigned int offset) { struct tegra_gpio_info *tgi = gpiochip_get_data(chip); - pinctrl_free_gpio(offset); + pinctrl_gpio_free(offset); tegra_gpio_disable(tgi, offset); } diff --git a/drivers/gpio/gpio-tz1090.c b/drivers/gpio/gpio-tz1090.c index 22c5be65051f..0bb9bb583889 100644 --- a/drivers/gpio/gpio-tz1090.c +++ b/drivers/gpio/gpio-tz1090.c @@ -232,7 +232,7 @@ static int tz1090_gpio_request(struct gpio_chip *chip, unsigned int offset) struct tz1090_gpio_bank *bank = gpiochip_get_data(chip); int ret; - ret = pinctrl_request_gpio(chip->base + offset); + ret = pinctrl_gpio_request(chip->base + offset); if (ret) return ret; @@ -246,7 +246,7 @@ static void tz1090_gpio_free(struct gpio_chip *chip, unsigned int offset) { struct tz1090_gpio_bank *bank = gpiochip_get_data(chip); - pinctrl_free_gpio(chip->base + offset); + pinctrl_gpio_free(chip->base + offset); tz1090_gpio_clear_bit(bank, REG_GPIO_BIT_EN, offset); } diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index eb80dac4e26a..a9cb825ef335 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1859,7 +1859,7 @@ static inline void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip) */ int gpiochip_generic_request(struct gpio_chip *chip, unsigned offset) { - return pinctrl_request_gpio(chip->gpiodev->base + offset); + return pinctrl_gpio_request(chip->gpiodev->base + offset); } EXPORT_SYMBOL_GPL(gpiochip_generic_request); @@ -1870,7 +1870,7 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_request); */ void gpiochip_generic_free(struct gpio_chip *chip, unsigned offset) { - pinctrl_free_gpio(chip->gpiodev->base + offset); + pinctrl_gpio_free(chip->gpiodev->base + offset); } EXPORT_SYMBOL_GPL(gpiochip_generic_free); diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c index 85a8c97d9dfe..5d08d989b1d0 100644 --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c @@ -311,7 +311,7 @@ static int iproc_gpio_request(struct gpio_chip *gc, unsigned offset) if (!chip->pinmux_is_supported) return 0; - return pinctrl_request_gpio(gpio); + return pinctrl_gpio_request(gpio); } static void iproc_gpio_free(struct gpio_chip *gc, unsigned offset) @@ -322,7 +322,7 @@ static void iproc_gpio_free(struct gpio_chip *gc, unsigned offset) if (!chip->pinmux_is_supported) return; - pinctrl_free_gpio(gpio); + pinctrl_gpio_free(gpio); } static int iproc_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) diff --git a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c index 1cfe45fd391f..c1887072936e 100644 --- a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c @@ -282,14 +282,14 @@ static int nsp_gpio_request(struct gpio_chip *gc, unsigned offset) { unsigned gpio = gc->base + offset; - return pinctrl_request_gpio(gpio); + return pinctrl_gpio_request(gpio); } static void nsp_gpio_free(struct gpio_chip *gc, unsigned offset) { unsigned gpio = gc->base + offset; - pinctrl_free_gpio(gpio); + pinctrl_gpio_free(gpio); } static int nsp_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 56fbe4c3e800..4c8d5b23e4d0 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -733,14 +733,14 @@ int pinctrl_get_group_selector(struct pinctrl_dev *pctldev, } /** - * pinctrl_request_gpio() - request a single pin to be used as GPIO + * pinctrl_gpio_request() - request a single pin to be used as GPIO * @gpio: the GPIO pin number from the GPIO subsystem number space * * This function should *ONLY* be used from gpiolib-based GPIO drivers, * as part of their gpio_request() semantics, platforms and individual drivers * shall *NOT* request GPIO pins to be muxed in. */ -int pinctrl_request_gpio(unsigned gpio) +int pinctrl_gpio_request(unsigned gpio) { struct pinctrl_dev *pctldev; struct pinctrl_gpio_range *range; @@ -765,17 +765,17 @@ int pinctrl_request_gpio(unsigned gpio) return ret; } -EXPORT_SYMBOL_GPL(pinctrl_request_gpio); +EXPORT_SYMBOL_GPL(pinctrl_gpio_request); /** - * pinctrl_free_gpio() - free control on a single pin, currently used as GPIO + * pinctrl_gpio_free() - free control on a single pin, currently used as GPIO * @gpio: the GPIO pin number from the GPIO subsystem number space * * This function should *ONLY* be used from gpiolib-based GPIO drivers, * as part of their gpio_free() semantics, platforms and individual drivers * shall *NOT* request GPIO pins to be muxed out. */ -void pinctrl_free_gpio(unsigned gpio) +void pinctrl_gpio_free(unsigned gpio) { struct pinctrl_dev *pctldev; struct pinctrl_gpio_range *range; @@ -795,7 +795,7 @@ void pinctrl_free_gpio(unsigned gpio) mutex_unlock(&pctldev->mutex); } -EXPORT_SYMBOL_GPL(pinctrl_free_gpio); +EXPORT_SYMBOL_GPL(pinctrl_gpio_free); static int pinctrl_gpio_direction(unsigned gpio, bool input) { diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index 7880c3adc450..8cf2eba17c8c 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -154,7 +154,7 @@ struct pinctrl_setting { * or pin, and each of these will increment the @usecount. * @mux_owner: The name of device that called pinctrl_get(). * @mux_setting: The most recent selected mux setting for this pin, if any. - * @gpio_owner: If pinctrl_request_gpio() was called for this pin, this is + * @gpio_owner: If pinctrl_gpio_request() was called for this pin, this is * the name of the GPIO that "owns" this pin. */ struct pin_desc { diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index 66ed70c12733..e6e12a7b21e0 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -412,14 +412,14 @@ static const struct pinconf_ops meson_pinconf_ops = { static int meson_gpio_request(struct gpio_chip *chip, unsigned gpio) { - return pinctrl_request_gpio(chip->base + gpio); + return pinctrl_gpio_request(chip->base + gpio); } static void meson_gpio_free(struct gpio_chip *chip, unsigned gpio) { struct meson_pinctrl *pc = gpiochip_get_data(chip); - pinctrl_free_gpio(pc->data->pin_base + gpio); + pinctrl_gpio_free(pc->data->pin_base + gpio); } static int meson_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c index 6b5422766f13..946d9be50b62 100644 --- a/drivers/pinctrl/sh-pfc/gpio.c +++ b/drivers/pinctrl/sh-pfc/gpio.c @@ -139,12 +139,12 @@ static int gpio_pin_request(struct gpio_chip *gc, unsigned offset) if (idx < 0 || pfc->info->pins[idx].enum_id == 0) return -EINVAL; - return pinctrl_request_gpio(offset); + return pinctrl_gpio_request(offset); } static void gpio_pin_free(struct gpio_chip *gc, unsigned offset) { - return pinctrl_free_gpio(offset); + return pinctrl_gpio_free(offset); } static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset, diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c index 4db9323251e3..f4b192b493a0 100644 --- a/drivers/pinctrl/sirf/pinctrl-atlas7.c +++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c @@ -5860,7 +5860,7 @@ static int atlas7_gpio_request(struct gpio_chip *chip, if (ret < 0) return ret; - if (pinctrl_request_gpio(chip->base + gpio)) + if (pinctrl_gpio_request(chip->base + gpio)) return -ENODEV; raw_spin_lock_irqsave(&a7gc->lock, flags); @@ -5890,7 +5890,7 @@ static void atlas7_gpio_free(struct gpio_chip *chip, raw_spin_unlock_irqrestore(&a7gc->lock, flags); - pinctrl_free_gpio(chip->base + gpio); + pinctrl_gpio_free(chip->base + gpio); } static int atlas7_gpio_direction_input(struct gpio_chip *chip, diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c index d3ef05973901..d64add0b84cc 100644 --- a/drivers/pinctrl/sirf/pinctrl-sirf.c +++ b/drivers/pinctrl/sirf/pinctrl-sirf.c @@ -614,7 +614,7 @@ static int sirfsoc_gpio_request(struct gpio_chip *chip, unsigned offset) struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); unsigned long flags; - if (pinctrl_request_gpio(chip->base + offset)) + if (pinctrl_gpio_request(chip->base + offset)) return -ENODEV; spin_lock_irqsave(&bank->lock, flags); @@ -644,7 +644,7 @@ static void sirfsoc_gpio_free(struct gpio_chip *chip, unsigned offset) spin_unlock_irqrestore(&bank->lock, flags); - pinctrl_free_gpio(chip->base + offset); + pinctrl_gpio_free(chip->base + offset); } static int sirfsoc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c index cf6d68c7345b..7a33e2e1e3e7 100644 --- a/drivers/pinctrl/spear/pinctrl-plgpio.c +++ b/drivers/pinctrl/spear/pinctrl-plgpio.c @@ -204,7 +204,7 @@ static int plgpio_request(struct gpio_chip *chip, unsigned offset) if (offset >= chip->ngpio) return -EINVAL; - ret = pinctrl_request_gpio(gpio); + ret = pinctrl_gpio_request(gpio); if (ret) return ret; @@ -242,7 +242,7 @@ static int plgpio_request(struct gpio_chip *chip, unsigned offset) if (!IS_ERR(plgpio->clk)) clk_disable(plgpio->clk); err0: - pinctrl_free_gpio(gpio); + pinctrl_gpio_free(gpio); return ret; } @@ -273,7 +273,7 @@ static void plgpio_free(struct gpio_chip *chip, unsigned offset) if (!IS_ERR(plgpio->clk)) clk_disable(plgpio->clk); - pinctrl_free_gpio(gpio); + pinctrl_gpio_free(gpio); } /* PLGPIO IRQ */ diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c index 50299ad96659..a954d25bac4e 100644 --- a/drivers/pinctrl/stm32/pinctrl-stm32.c +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c @@ -150,12 +150,12 @@ static int stm32_gpio_request(struct gpio_chip *chip, unsigned offset) return -EINVAL; } - return pinctrl_request_gpio(chip->base + offset); + return pinctrl_gpio_request(chip->base + offset); } static void stm32_gpio_free(struct gpio_chip *chip, unsigned offset) { - pinctrl_free_gpio(chip->base + offset); + pinctrl_gpio_free(chip->base + offset); } static int stm32_gpio_get(struct gpio_chip *chip, unsigned offset) diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h index a0f2aba72fa9..0412cc9833e9 100644 --- a/include/linux/pinctrl/consumer.h +++ b/include/linux/pinctrl/consumer.h @@ -25,8 +25,8 @@ struct device; #ifdef CONFIG_PINCTRL /* External interface to pin control */ -extern int pinctrl_request_gpio(unsigned gpio); -extern void pinctrl_free_gpio(unsigned gpio); +extern int pinctrl_gpio_request(unsigned gpio); +extern void pinctrl_gpio_free(unsigned gpio); extern int pinctrl_gpio_direction_input(unsigned gpio); extern int pinctrl_gpio_direction_output(unsigned gpio); extern int pinctrl_gpio_set_config(unsigned gpio, unsigned long config); @@ -62,12 +62,12 @@ static inline int pinctrl_pm_select_idle_state(struct device *dev) #else /* !CONFIG_PINCTRL */ -static inline int pinctrl_request_gpio(unsigned gpio) +static inline int pinctrl_gpio_request(unsigned gpio) { return 0; } -static inline void pinctrl_free_gpio(unsigned gpio) +static inline void pinctrl_gpio_free(unsigned gpio) { } From patchwork Fri Sep 22 09:22:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 113996 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3058546qgf; Fri, 22 Sep 2017 02:22:54 -0700 (PDT) X-Received: by 10.99.121.141 with SMTP id u135mr8451344pgc.86.1506072174650; Fri, 22 Sep 2017 02:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506072174; cv=none; d=google.com; s=arc-20160816; b=pRL3LsjJIdFkl+GJHNEXPAlwRzqpROrEs4jMp33UgStBh2+5z4EGVHOfRt15SESXGu JPDcZvek/E/PjK1FVWfC4hLu6zT+v4u4k5qLUtKtdn+URWAjl+BuwloS4eq/QAzRkUBt OT0usvdpeOE7MK6FNDtc/vr1UgLYq4RiPj71G+c+7w8Qs7X1cYSZpQM9RpYZcszR3wA4 /nhPDQ/7d2qZ4PDtsbNRb66oWlVijNOPP9/CxmKj6L+zSAEhDlVvugYRcv8ONg8m07IT wAyDC9weMxyCixMcAlT+pO+XDEieGDciF2jyWM46BcdHljPwqU8aqC8mUgJn3mCEFpcN E8ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=UqkRY2xjAFipkpe1RB8x0aQguvGaR6Xhk3vqqZQuZIE=; b=Xlua/0lnCNfprQUYtIV0CPGde5+Mc3ZEcGfYDXr3kAiWrHiHVnZIVzr3B/S0cbWjad AOsQa8Cs203q432gtZIFdd22khK4Hi3QxF3NfFuvWOjfZsVW168LHx64p1INi3uyBYvu qMAjjEa+2SbfyJyelr9f2AEXeA3jlOZVAGOxaXpAKS9WCNul/2VRL3Su4HX1EHdxLthw tgJij+6X1PA8zYG4CEb35WfGY8Azd0RNWbpTPy6hn3C/JWCOiYLpqVRZedkGfjWy73Py N9GFRZFkKHVSEkDvGucfaRznWylDwJO6p+u+Um5yWi8Q3WmKmrAL6ZMg2Icbn1uwWxur xyFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=W6GvtLKq; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v26si2502469pfg.111.2017.09.22.02.22.54; Fri, 22 Sep 2017 02:22:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=W6GvtLKq; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751833AbdIVJWx (ORCPT + 5 others); Fri, 22 Sep 2017 05:22:53 -0400 Received: from mail-lf0-f46.google.com ([209.85.215.46]:56539 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbdIVJWx (ORCPT ); Fri, 22 Sep 2017 05:22:53 -0400 Received: by mail-lf0-f46.google.com with SMTP id a18so544361lfl.13 for ; Fri, 22 Sep 2017 02:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ekn8M/8XpvoK+7YqnsOgM+UgrSB371YDZKBeWJdZhoc=; b=W6GvtLKqFQic2fkLNPMXb8cFn75Q3y46qW9azeX7x4ChubTLXm4kHd4t5DBUz7mk9a /r0vpFJ8PRhxwWN7xqvTm73zPk1fZy4iyH7/XL8UF+m1pVPZG1MWjIs7TTnu6C9s5Cjo 1/dV9C8mnEticMIvRQO1vwKUYUTHdB9Gkvxi8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ekn8M/8XpvoK+7YqnsOgM+UgrSB371YDZKBeWJdZhoc=; b=YAqCcSIJt4BNnXk6YFjtbQHagkResgozKb4lkVDKh2rbBzI6Sje2DsEg4aqavS7er5 xzRw4A2bo9Hd0oACcZb1KgJI7ebXgoOQcbmOIySGP75IdgnQ7+4qmoJK/iHLTJR8rb21 W6OCd0dfH+d9oW76M//fnmeLuruplh1MyL2WSm/O3CDXGnennxw3fcNxUxNT0sjYtMhw ENYK/iymgwrmfbLVnqqE+gWxf7TRlGDat+qncxnZ62u2I6afca2UKmpz9NZuta/mPwPO I9bl+kJHquB8xOqfah6KymPdHJleoHhQjlsubHS7JE56gh6z04wqfp5yd82FSkanbK5E PWmQ== X-Gm-Message-State: AHPjjUgqR3Q60icFC2UCAhKzaFLH4FdzYzdMJwWF5WeAjq79b5MFt4jP QIIpyHPiWa36lXSVvxujn3OHSh7qLyI= X-Google-Smtp-Source: AOwi7QAp5v51iyokF8dNhHnbn0ciGQ3APShEiVmGvoTHhUi/Czq1QwpwjrR1KLBbP2VI55EZm9VUgg== X-Received: by 10.25.210.131 with SMTP id j125mr1863886lfg.135.1506072171481; Fri, 22 Sep 2017 02:22:51 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id o193sm542914lfo.11.2017.09.22.02.22.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Sep 2017 02:22:50 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Scott Branden Subject: [PATCH 2/4] pinctrl: bcm: nsp: Use library functions Date: Fri, 22 Sep 2017 11:22:41 +0200 Message-Id: <20170922092243.7546-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170922092243.7546-1-linus.walleij@linaro.org> References: <20170922092243.7546-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org These request/free functions are just reimplementations of the standard helpers in gpiolib. Delete them and replace with the helpers. Cc: Scott Branden Signed-off-by: Linus Walleij --- drivers/pinctrl/bcm/pinctrl-nsp-gpio.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) -- 2.13.5 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c index c1887072936e..e67ae52023ad 100644 --- a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c @@ -275,23 +275,6 @@ static struct irq_chip nsp_gpio_irq_chip = { .irq_set_type = nsp_gpio_irq_set_type, }; -/* - * Request the nsp IOMUX pinmux controller to mux individual pins to GPIO - */ -static int nsp_gpio_request(struct gpio_chip *gc, unsigned offset) -{ - unsigned gpio = gc->base + offset; - - return pinctrl_gpio_request(gpio); -} - -static void nsp_gpio_free(struct gpio_chip *gc, unsigned offset) -{ - unsigned gpio = gc->base + offset; - - pinctrl_gpio_free(gpio); -} - static int nsp_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) { struct nsp_gpio *chip = gpiochip_get_data(gc); @@ -670,8 +653,8 @@ static int nsp_gpio_probe(struct platform_device *pdev) gc->label = dev_name(dev); gc->parent = dev; gc->of_node = dev->of_node; - gc->request = nsp_gpio_request; - gc->free = nsp_gpio_free; + gc->request = gpiochip_generic_request; + gc->free = gpiochip_generic_free; gc->direction_input = nsp_gpio_direction_input; gc->direction_output = nsp_gpio_direction_output; gc->set = nsp_gpio_set; From patchwork Fri Sep 22 09:22:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 113997 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3058568qgf; Fri, 22 Sep 2017 02:22:56 -0700 (PDT) X-Received: by 10.101.66.205 with SMTP id l13mr8616135pgp.278.1506072176597; Fri, 22 Sep 2017 02:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506072176; cv=none; d=google.com; s=arc-20160816; b=ZNqwnxKzn5XpmNv0ImMtGk7J5KYykV0++LlUCpfo7DU05AzAjTVwdMUw7cwQzElb3h pQpiZNj46kFh7zrLQsGKBHWLuU489bMixrQdAhqNXd+UIBW4QxhJHeRECLdnovwrn3Bw KQ1PKF0MII4fTyFHzWWE769NHQLfUaJHPDOFCF6oFGsLIGYFJO9Ma7CkcN3uz7N+2XTr yVtpQ6QlPVti7zkbVEIneHVhTG4iQwj2lPJFk7liK4MYSHOTyski7+xbAszzvHJMKylV ZkfMgx8lMFAytdTrlj8qGMMZuOcf9ZNgngcESuiOfhVVNvF+ASERNtnoQ4Rx8S/XVJki pdwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=/0pYYQ5BoclLlt4txQ9FzV1zA4GunBdaVg0qCGC7gDo=; b=QnK0r2GAmrEYhvyJ7VvB9fnRyvPn2FiH5vmX4kFvpBzeMv4XtgIPfx1FirXKd3LD13 OSEV/JmwQjLb437rFPPyDmAIJpI4T2XHfhOebUZvcudQlXhm4wLqnjpVIu/3BPsrCjvb R26heFgNkKdW0S2u661gJyBhDztGulSqwxuT8GNf+qQ455EKDHoN5WLhETtwDf5I+G4o 2WeWRyiVSpCZ1lzauMLjUc41Rhxd9ylPsiL13gigaK4VcSiTOg1R8/QV4doNYRuJp5B4 hRcPrSNlTJXbN1CJQwFwx54nPMSY1z7dH0S1pwaDgEMk4vEue2rPAvC8uTwFn0oSAZZQ Kycg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XN1SgFss; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v26si2502469pfg.111.2017.09.22.02.22.56; Fri, 22 Sep 2017 02:22:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XN1SgFss; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751838AbdIVJW4 (ORCPT + 5 others); Fri, 22 Sep 2017 05:22:56 -0400 Received: from mail-lf0-f53.google.com ([209.85.215.53]:43763 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbdIVJWz (ORCPT ); Fri, 22 Sep 2017 05:22:55 -0400 Received: by mail-lf0-f53.google.com with SMTP id c80so559803lfh.0 for ; Fri, 22 Sep 2017 02:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lVSK//XE5PavDyjHG1jBXac4V6TjU51hWpW+Io5ue2M=; b=XN1SgFssAz9ytEqBsSnHrOmQaCJzVr2yMh679e5XCFpRdA4l6912CU4CGQ+gzURvnl uOj0O/URoHeXBX8pRq/TOlnONCrJiZ5zc62Ait+He0o5hkZDZRG5/kBWBQS0lG0tygXl OepFq7OnBRA7zsgayBK4sLzWf9FOwmg/hBnXI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lVSK//XE5PavDyjHG1jBXac4V6TjU51hWpW+Io5ue2M=; b=N5jADsrwmQwESI9qfA0n5UNtIPN9t3xo8dahDe4x31mVuIlofdCkHnamrKfDHZjM99 oZ2jTy+Murv8KQEUi5wxcH/UZWrghXZNuofok9t0Bdrxeur5rr61gIiw5qpEAI/v6WfP 4NEQEBCZDzVaXqwUjCAkLt7vI66p3xirKdsXsC5/kEHRoavu7kskz9pKcBC1xTuHz3B4 iF/ARXqlBPG55gevpLgaiLGH1NCyfF5uBYLGdSRbEVYrKQrIxdGA+lbJvY73yv0VWAZE qwu/0F99fJRz2oGppyiCqBzm4MBzB2DHzgAFDdP+O7PberEq5Gdcb+7P7BOy36+xGJH6 KBlw== X-Gm-Message-State: AHPjjUhymClU4LrcqP91897/L1RSEhMrrCkxUn6srs9qxypmmli0yuot /HdmrAyIH4T0D3hSf6Y/1Rhz5RxWiU4= X-Google-Smtp-Source: AOwi7QDa802tl/ajEARS8e+gDR/iH7vocl7PoQ2JvxNuo5GSRoVWqOtCkdGDzvek+tx35iThrdk2SA== X-Received: by 10.25.195.71 with SMTP id t68mr1839342lff.40.1506072173776; Fri, 22 Sep 2017 02:22:53 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id o193sm542914lfo.11.2017.09.22.02.22.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Sep 2017 02:22:52 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Neil Armstrong Subject: [PATCH 3/4] pinctrl: meson: Use library functions Date: Fri, 22 Sep 2017 11:22:42 +0200 Message-Id: <20170922092243.7546-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170922092243.7546-1-linus.walleij@linaro.org> References: <20170922092243.7546-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org These request/free functions are just reimplementations of the standard helpers in gpiolib. Delete them and replace with the helpers. Cc: Neil Armstrong Signed-off-by: Linus Walleij --- drivers/pinctrl/meson/pinctrl-meson.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.13.5 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index e6e12a7b21e0..da2c41e23f10 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -410,18 +410,6 @@ static const struct pinconf_ops meson_pinconf_ops = { .is_generic = true, }; -static int meson_gpio_request(struct gpio_chip *chip, unsigned gpio) -{ - return pinctrl_gpio_request(chip->base + gpio); -} - -static void meson_gpio_free(struct gpio_chip *chip, unsigned gpio) -{ - struct meson_pinctrl *pc = gpiochip_get_data(chip); - - pinctrl_gpio_free(pc->data->pin_base + gpio); -} - static int meson_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) { struct meson_pinctrl *pc = gpiochip_get_data(chip); @@ -539,8 +527,8 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc) pc->chip.label = pc->data->name; pc->chip.parent = pc->dev; - pc->chip.request = meson_gpio_request; - pc->chip.free = meson_gpio_free; + pc->chip.request = gpiochip_generic_request; + pc->chip.free = gpiochip_generic_free; pc->chip.direction_input = meson_gpio_direction_input; pc->chip.direction_output = meson_gpio_direction_output; pc->chip.get = meson_gpio_get; From patchwork Fri Sep 22 09:22:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 113998 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3058598qgf; Fri, 22 Sep 2017 02:22:58 -0700 (PDT) X-Received: by 10.101.92.196 with SMTP id b4mr5298376pgt.85.1506072178547; Fri, 22 Sep 2017 02:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506072178; cv=none; d=google.com; s=arc-20160816; b=hOgUE6dQtwjXi/sOpE0Ps9x6LRjfpuL/Vx3dwuGSQMaVta0FGaakZgaubKx0DVhIGd 0yQ21WJT9eNQGTlrsC70shlz4IwLcn0n6s+rbRX8VgcE8/THkkzy+ziPK7Xh2cIpav/M xh8q3QA2tArL7bIKm6v2sU5pYYQRu6X53pIGSTxqGO346EX2yPR0qmrbp/UKccUWSZt6 yw6BlGyOd3cCRtrWVy6e/TOclhj88J22+Y5zRi1gI+AOR1EZYLa19pTNZMx+KaETtB5S 0VPO2NryBViQtHHUkS0dmUytNyALC0LQmz3aa4UKqdXtDaP9eJmp7L4V3eDQUgXDWMma enQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Bo3XihbJTHFIgghvBD5j75UrC3svLiOYGp3fLoKbA+E=; b=djEKugwKN6DALOzqniWtMLAlOmxUEAK7SKPJr0Pwdq3YGFdH7C4WB9ABgKL3uM6sdl Nh75heyxnIDiZeC6OGkiO3znfSFFXFiYNG1cBG41jr5mRhgnYI91FYURqASrELansDGI RJ9zHqsTpNPLaVAZxis+berYOCkhkF8IrT2aKsJj34XWal0HeArvmSwl21Rj0F2e0eKC 65GCeHB7//041bRF+6QJMILs0MQXExj1MBcwRPi8GP+id21EhVHLg4zvLaFQ7zHorIuR +ZLHyKkWtn8RkyZ0RjLysxVukmxbWYKJK4QAqdMJc/jVuaLlAN7uNGcZ0/q/CL28lfjL 4mNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KDCDTAH+; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v26si2502469pfg.111.2017.09.22.02.22.58; Fri, 22 Sep 2017 02:22:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KDCDTAH+; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751847AbdIVJW6 (ORCPT + 5 others); Fri, 22 Sep 2017 05:22:58 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:50028 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbdIVJW5 (ORCPT ); Fri, 22 Sep 2017 05:22:57 -0400 Received: by mail-lf0-f41.google.com with SMTP id r17so557221lff.6 for ; Fri, 22 Sep 2017 02:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=k2n3uX2elo0ER5Yz4MmCPry7KV4rSiZ2E+MswEd5hlo=; b=KDCDTAH+IhpUOTy+TPEUNLUMfInApGyOLX4eCTJAP1TxHu5dzTKFqD/uesFlFeJEKx Y/2T/AovirbXyvsnrbRrizvQ+G41ZTXIX4ga0EC6DBIHT6ENqxpyGqxWuEnAXPCgAQ3z Vi5K355+DChbt+E5GPssE2ux3N7Y0iYXzlqYQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=k2n3uX2elo0ER5Yz4MmCPry7KV4rSiZ2E+MswEd5hlo=; b=kqd60dRW3q7AKSI77fKU/RB0rNoZmQK+qg2PzlQVjGStIdRMhJwUCn+MPNXd5RemyI OYtWoWIZytNaFAzXRSNOgEeZRwd5u9AMc6NZSVj2VOGnTjX9NYkC0fIk9ovKRhz3gpjZ qFUlQ7Sl9vKHlHnoXz2ATwKgeD/+ACbmJVhJIn/B7b1wzCu2FpbIBTEr0VYbQvvWQwcJ jGO8M4dVEHYcEhtRLZaP42HFT8q61bmZBiBWgyv++/kLFYULb8iUKquZLQQcDVpA77dX 1j5hialk/5UiJny+1YrXGIdNcF076CIm5Fxlou0tX5gbZWz1ScA0KU/8A5nXSIDIoMSn yi7g== X-Gm-Message-State: AHPjjUj7NZUVQkXizKbol1izCYNpsDjZlIz8nfSochPf7RrQ6ndcmWLY rIopOhSo1lx5ALh/jIw2DwbcSbBkgFw= X-Google-Smtp-Source: AOwi7QD9+XO/WXW8p0SixbQZMsmOELWwvqahsAbR6asE7geCfcVkyfaazan9j5X//wqL5oc9s4y84g== X-Received: by 10.25.24.234 with SMTP id 103mr1593917lfy.243.1506072175743; Fri, 22 Sep 2017 02:22:55 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id o193sm542914lfo.11.2017.09.22.02.22.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Sep 2017 02:22:54 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Robert Jarzmik Subject: [PATCH 4/4] gpio: pxa: Use library functions Date: Fri, 22 Sep 2017 11:22:43 +0200 Message-Id: <20170922092243.7546-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170922092243.7546-1-linus.walleij@linaro.org> References: <20170922092243.7546-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org These request/free functions are just reimplementations of the standard helpers in gpiolib. Delete them and replace with the helpers. Cc: Robert Jarzmik Signed-off-by: Linus Walleij --- drivers/gpio/gpio-pxa.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 2.13.5 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Robert Jarzmik diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index da68d6cbc1e4..f480fb896963 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -330,16 +330,6 @@ static int pxa_gpio_of_xlate(struct gpio_chip *gc, } #endif -static int pxa_gpio_request(struct gpio_chip *chip, unsigned int offset) -{ - return pinctrl_gpio_request(chip->base + offset); -} - -static void pxa_gpio_free(struct gpio_chip *chip, unsigned int offset) -{ - pinctrl_gpio_free(chip->base + offset); -} - static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, struct device_node *np, void __iomem *regbase) { @@ -358,8 +348,8 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, pchip->chip.set = pxa_gpio_set; pchip->chip.to_irq = pxa_gpio_to_irq; pchip->chip.ngpio = ngpio; - pchip->chip.request = pxa_gpio_request; - pchip->chip.free = pxa_gpio_free; + pchip->chip.request = gpiochip_generic_request; + pchip->chip.free = gpiochip_generic_free; #ifdef CONFIG_OF_GPIO pchip->chip.of_node = np; pchip->chip.of_xlate = pxa_gpio_of_xlate;