Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1739828 > unrolled thread
| Started by | Quentin Schulz <quentin.schulz@free-electrons.com> |
|---|---|
| First post | 2017-09-26 14:20 +0200 |
| Last post | 2017-09-26 14:20 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 05/10] pinctrl: axp209: add programmable gpio_status_offset Quentin Schulz <quentin.schulz@free-electrons.com> - 2017-09-26 14:20 +0200
| From | Quentin Schulz <quentin.schulz@free-electrons.com> |
|---|---|
| Date | 2017-09-26 14:20 +0200 |
| Subject | [PATCH v2 05/10] pinctrl: axp209: add programmable gpio_status_offset |
| Message-ID | <utX0e-4FS-23@gated-at.bofh.it> |
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 top | Article view | linux.kernel
csiph-web