From patchwork Mon Oct 2 12:08:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 114579 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp605567qgn; Mon, 2 Oct 2017 05:10:06 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCWk9fTA2XgLjHffYPgBm1r/7F89dgs90gX8Bso3HAPzysP3i/FAw97MQqyKr20tHkWpddQ X-Received: by 10.101.73.4 with SMTP id p4mr12539335pgs.215.1506946206627; Mon, 02 Oct 2017 05:10:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506946206; cv=none; d=google.com; s=arc-20160816; b=xKNjMJHk2az9cgLshQxU0wyEyxBNMeZWXpdNeAbDoFDcd1jMBMemrZvtAM6u9bhQDd q6Vudxy5niGyW+PAEtO79hD3s1QAePLVuKAtW/3hRJ+Ze60x9Cf0diTJjw0zFc9GiJbn HbOlEVCDqFBv00e5AKIFprp8DxRsI6pzmrNdqeRd0s1gvNsnA2kizg6OyRJ4vVtCv6fk T9ZLHNBSEUmSrhiGWSgT01b/WRU3HT6WYnEjDPILX08j8s6RVSv/NxV0VjXjzvra9kP9 FcONo9b7BLDqnGZZHpWUrpBkTIBPrrtc1XewkXQo9oh7qHzZcHmO0D51bElIOyHRJY5h XoRw== 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:arc-authentication-results; bh=3mlXKIheinYu1//9K4YGyIZu63QtXeCoqJWYm0AFMUk=; b=yzomwlt9X/Vv8OvXDJnbM5o24MuWKrF+V/UTsl5AIS1pWhklKSH3+uJ3eM8ZhOpXWT H9+ECzBi23mipTBeqBPNqkm37j5mzW3mb0kGoFfpVTVNd1FIO4aBw8Mjwav6g51D+DBu /h61kcENZ6SJGS6HIPPjVyBSzYHqVQlIwe2ZbIyzjTHckDBNB24WIkQ0BbER59cUvzVE E5msrYMuaB4RRzs6lkNIw0ZhWrcI4gic2tVfpb1fhieiRlWo8IGOvLiVygEOoIDJv13A wsx/VY0v6eOb4JLoysggKzLaPoXTLScXMI/aPTcKpcGuOm/syyzPLNNv4JQ2nO+l0KTA 857Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 194si7739319pfv.136.2017.10.02.05.10.06; Mon, 02 Oct 2017 05:10:06 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751199AbdJBMKF (ORCPT + 5 others); Mon, 2 Oct 2017 08:10:05 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:45516 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751174AbdJBMKE (ORCPT ); Mon, 2 Oct 2017 08:10:04 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id 65E4320A18; Mon, 2 Oct 2017 14:10:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 0FB0C20824; Mon, 2 Oct 2017 14:10:01 +0200 (CEST) From: Quentin Schulz To: linus.walleij@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, Quentin Schulz Subject: [PATCH v3 01/12] pinctrl: move gpio-axp209 to pinctrl Date: Mon, 2 Oct 2017 14:08:43 +0200 Message-Id: <20171002120854.5212-2-quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171002120854.5212-1-quentin.schulz@free-electrons.com> References: <20171002120854.5212-1-quentin.schulz@free-electrons.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org To prepare the driver for the upcoming pinctrl features, move the GPIO driver AXP209 from GPIO to pinctrl subsystem. Signed-off-by: Quentin Schulz --- .../bindings/{gpio/gpio-axp209.txt => pinctrl/pinctrl-axp209.txt} | 0 drivers/gpio/Kconfig | 6 ------ drivers/gpio/Makefile | 1 - drivers/pinctrl/Kconfig | 6 ++++++ drivers/pinctrl/Makefile | 1 + drivers/{gpio/gpio-axp209.c => pinctrl/pinctrl-axp209.c} | 0 6 files changed, 7 insertions(+), 7 deletions(-) rename Documentation/devicetree/bindings/{gpio/gpio-axp209.txt => pinctrl/pinctrl-axp209.txt} (100%) rename drivers/{gpio/gpio-axp209.c => pinctrl/pinctrl-axp209.c} (100%) -- 2.11.0 -- 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/devicetree/bindings/gpio/gpio-axp209.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-axp209.txt similarity index 100% rename from Documentation/devicetree/bindings/gpio/gpio-axp209.txt rename to Documentation/devicetree/bindings/pinctrl/pinctrl-axp209.txt diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 796b11c489ae..aae33f7d82ef 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -122,12 +122,6 @@ config GPIO_ATH79 Select this option to enable GPIO driver for Atheros AR71XX/AR724X/AR913X SoC devices. -config GPIO_AXP209 - tristate "X-Powers AXP209 PMIC GPIO Support" - depends on MFD_AXP20X - help - Say yes to enable GPIO support for the AXP209 PMIC - config GPIO_BCM_KONA bool "Broadcom Kona GPIO" depends on OF_GPIO && (ARCH_BCM_MOBILE || COMPILE_TEST) diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index aeb70e9de6f2..f63631a63b09 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -31,7 +31,6 @@ obj-$(CONFIG_GPIO_AMDPT) += gpio-amdpt.o obj-$(CONFIG_GPIO_ARIZONA) += gpio-arizona.o obj-$(CONFIG_GPIO_ATH79) += gpio-ath79.o obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o -obj-$(CONFIG_GPIO_AXP209) += gpio-axp209.o obj-$(CONFIG_GPIO_BCM_KONA) += gpio-bcm-kona.o obj-$(CONFIG_GPIO_BD9571MWV) += gpio-bd9571mwv.o obj-$(CONFIG_GPIO_BRCMSTB) += gpio-brcmstb.o diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 82cd8b08d71f..acda2e29167c 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -63,6 +63,12 @@ config PINCTRL_AS3722 open drain configuration for the GPIO pins of AS3722 devices. It also supports the GPIO functionality through gpiolib. +config PINCTRL_AXP209 + tristate "X-Powers AXP209 PMIC pinctrl and GPIO Support" + depends on MFD_AXP20X + help + Say yes to enable pinctrl and GPIO support for the AXP209 PMIC + config PINCTRL_BF54x def_bool y if BF54x select PINCTRL_ADI2 diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index c16e27900dbb..9f621e542f59 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_GENERIC_PINCONF) += pinconf-generic.o obj-$(CONFIG_PINCTRL_ADI2) += pinctrl-adi2.o obj-$(CONFIG_PINCTRL_ARTPEC6) += pinctrl-artpec6.o obj-$(CONFIG_PINCTRL_AS3722) += pinctrl-as3722.o +obj-$(CONFIG_PINCTRL_AXP209) += pinctrl-axp209.o obj-$(CONFIG_PINCTRL_BF54x) += pinctrl-adi2-bf54x.o obj-$(CONFIG_PINCTRL_BF60x) += pinctrl-adi2-bf60x.o obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o diff --git a/drivers/gpio/gpio-axp209.c b/drivers/pinctrl/pinctrl-axp209.c similarity index 100% rename from drivers/gpio/gpio-axp209.c rename to drivers/pinctrl/pinctrl-axp209.c From patchwork Mon Oct 2 12:08:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 114590 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp608553qgn; Mon, 2 Oct 2017 05:13:01 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBQPWOnTZBGVtTmlIGMyi8JJzmOsjUAZh2LwzkAHx7/KOBE/q1WS7+ckjhS1dL2bCqkMCyi X-Received: by 10.98.55.5 with SMTP id e5mr5030826pfa.21.1506946380910; Mon, 02 Oct 2017 05:13:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506946380; cv=none; d=google.com; s=arc-20160816; b=jAzQ4R/Y6zyw2XwADVCoSc4Ocmu7i+/2RstOREnXVY+QUQkSItvvZsUMhRxfcs62li +RFgncODtyAgEXCVrOETL1QtRprGW4eQUxfCu3c0Cre90y+/SP9LLKXXHyW5vgyzCBBp FTQJyt7tSiTnjm54OAyxdvR2RNoznePkghEbxvikEKhd1btFCt7O5/P40K+qQYLANj0O OG1sAC49NqL1uSZBq7lMBC/HD6RF+/gLT99V4kXODbGYMJyQcSZT6J3Np2CPkaD7Ik4x 9t1IKvsumDNuHvobbrph/v6osT8G8i8SZ8//CkyYZnjfQ6brl9q4qY9bveM/NUQGXF53 V6GA== 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:arc-authentication-results; bh=wjX2hyY9gE/oBM540TLjhpXbuIpLnmdojAyFryJ5k6A=; b=BrDFvN6iob+gaUnwsGUIMaeq6j2U56ueJFHUiHq3Ck2KJzj7JfNhofol7bKXeiWW5m C8fM+lAHAUGSszPZFaZ/1KKiQwq8H+s8PW3WTDA3CBc2DqKz9EWLHGtdY86A2I3bP1rQ n19MUo9HcRSg2qrZEdmMCooERhgBSkA3HW5x7t5s0lWVpnI0UWIRWpN/Iia8kNf/Bco2 qSM6/+sLm2h9nj4K1jX/gFKM6pgaMqAwSZQptI5nFkflasGjeIb3SEZC5S0WInu/L2hf 1w69n+P6Jm2CUbKxOYq7hqT3/6UBmBm5fiLSjA/spjKRCWaxRP8Y0J05PxNBDMMfCTuz nxZA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si7538000pgs.767.2017.10.02.05.13.00; Mon, 02 Oct 2017 05:13:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750957AbdJBMM7 (ORCPT + 5 others); Mon, 2 Oct 2017 08:12:59 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:45551 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbdJBMKE (ORCPT ); Mon, 2 Oct 2017 08:10:04 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id 4DA7720A16; Mon, 2 Oct 2017 14:10:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id EF61A20A16; Mon, 2 Oct 2017 14:10:01 +0200 (CEST) From: Quentin Schulz To: linus.walleij@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org, linux@armlinux.org.uk, maxime.ripard@free-electrons.com, lee.jones@linaro.org Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com, Quentin Schulz Subject: [PATCH v3 04/12] pinctrl: axp209: add programmable gpio_status_offset Date: Mon, 2 Oct 2017 14:08:46 +0200 Message-Id: <20171002120854.5212-5-quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171002120854.5212-1-quentin.schulz@free-electrons.com> References: <20171002120854.5212-1-quentin.schulz@free-electrons.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org To prepare for patches that will add support for a new PMIC that has a different GPIO input status register, add a gpio_status_offset within axp20x_pctl structure and use it. Signed-off-by: Quentin Schulz --- drivers/pinctrl/pinctrl-axp209.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.11.0 -- 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: Maxime Ripard diff --git a/drivers/pinctrl/pinctrl-axp209.c b/drivers/pinctrl/pinctrl-axp209.c index 3ddeba45feed..17146496b22a 100644 --- a/drivers/pinctrl/pinctrl-axp209.c +++ b/drivers/pinctrl/pinctrl-axp209.c @@ -45,6 +45,7 @@ struct axp20x_pctrl_desc { unsigned int ldo_mask; /* Stores the pins supporting ADC function. Bit offset is pin number. */ unsigned int adc_mask; + unsigned int gpio_status_offset; }; struct axp20x_pinctrl_function { @@ -74,6 +75,7 @@ static const struct axp20x_pctrl_desc axp20x_data = { .npins = ARRAY_SIZE(axp209_pins), .ldo_mask = BIT(0) | BIT(1), .adc_mask = BIT(0) | BIT(1), + .gpio_status_offset = 4, }; static int axp20x_gpio_get_reg(unsigned offset) @@ -105,7 +107,7 @@ static int axp20x_gpio_get(struct gpio_chip *chip, unsigned offset) if (ret) return ret; - return !!(val & BIT(offset + 4)); + return !!(val & BIT(offset + pctl->desc->gpio_status_offset)); } static int axp20x_gpio_get_direction(struct gpio_chip *chip, unsigned offset)