Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1739828

[PATCH v2 05/10] pinctrl: axp209: add programmable gpio_status_offset

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Quentin Schulz <quentin.schulz@free-electrons.com>
Newsgroups linux.kernel
Subject [PATCH v2 05/10] pinctrl: axp209: add programmable gpio_status_offset
Date Tue, 26 Sep 2017 14:20:02 +0200
Message-ID <utX0e-4FS-23@gated-at.bofh.it> (permalink)
References <utX0e-4FS-7@gated-at.bofh.it>
X-Mailer git-send-email 2.11.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, thomas.petazzoni@free-electrons.com, Quentin Schulz <quentin.schulz@free-electrons.com>
X-Original-Date Tue, 26 Sep 2017 14:17:15 +0200
X-Original-Message-ID <e9385e366da18057aaa1e1d5d751839cde4343fa.1506428208.git-series.quentin.schulz@free-electrons.com>
X-Original-References <cover.1c314f4154a6d27354625f03d0a5269eee55a9c5.1506428208.git-series.quentin.schulz@free-electrons.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1739828

Show key headers only | View raw


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 <quentin.schulz@free-electrons.com>
---
 drivers/pinctrl/pinctrl-axp209.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-axp209.c b/drivers/pinctrl/pinctrl-axp209.c
index 4be1aca..11f871e 100644
--- a/drivers/pinctrl/pinctrl-axp209.c
+++ b/drivers/pinctrl/pinctrl-axp209.c
@@ -89,6 +89,7 @@ struct axp20x_pctl {
 	unsigned int				ngroups;
 	struct axp20x_pinctrl_function		*functions;
 	unsigned int				nfunctions;
+	unsigned int				gpio_status_offset;
 };
 
 static const struct axp20x_desc_pin axp209_pins[] = {
@@ -127,7 +128,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->gpio_status_offset));
 }
 
 static int axp20x_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
@@ -509,6 +510,7 @@ static int axp20x_pctl_probe(struct platform_device *pdev)
 	pctl->regmap = axp20x->regmap;
 
 	pctl->desc = &axp20x_pinctrl_data;
+	pctl->gpio_status_offset = 4;
 	pctl->dev = &pdev->dev;
 
 	platform_set_drvdata(pdev, pctl);
-- 
git-series 0.9.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v2 05/10] pinctrl: axp209: add programmable gpio_status_offset Quentin Schulz <quentin.schulz@free-electrons.com> - 2017-09-26 14:20 +0200

csiph-web