From: Quentin Schulz <quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
wens-jdAy2FN1RRM@public.gmane.org,
linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org,
maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Cc: linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
Quentin Schulz
<quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Subject: [PATCH v3 04/12] pinctrl: axp209: add programmable gpio_status_offset
Date: Mon, 2 Oct 2017 14:08:46 +0200 [thread overview]
Message-ID: <20171002120854.5212-5-quentin.schulz@free-electrons.com> (raw)
In-Reply-To: <20171002120854.5212-1-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.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 <quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
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 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)
--
2.11.0
WARNING: multiple messages have this Message-ID (diff)
From: quentin.schulz@free-electrons.com (Quentin Schulz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 04/12] pinctrl: axp209: add programmable gpio_status_offset
Date: Mon, 2 Oct 2017 14:08:46 +0200 [thread overview]
Message-ID: <20171002120854.5212-5-quentin.schulz@free-electrons.com> (raw)
In-Reply-To: <20171002120854.5212-1-quentin.schulz@free-electrons.com>
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 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)
--
2.11.0
WARNING: multiple messages have this Message-ID (diff)
From: Quentin Schulz <quentin.schulz@free-electrons.com>
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 <quentin.schulz@free-electrons.com>
Subject: [PATCH v3 04/12] pinctrl: axp209: add programmable gpio_status_offset
Date: Mon, 2 Oct 2017 14:08:46 +0200 [thread overview]
Message-ID: <20171002120854.5212-5-quentin.schulz@free-electrons.com> (raw)
In-Reply-To: <20171002120854.5212-1-quentin.schulz@free-electrons.com>
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 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)
--
2.11.0
next prev parent reply other threads:[~2017-10-02 12:08 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 12:08 [PATCH v3 00/12] add pinmuxing support for pins in AXP209 and AXP813 PMICs Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
[not found] ` <20171002120854.5212-1-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-10-02 12:08 ` [PATCH v3 01/12] pinctrl: move gpio-axp209 to pinctrl Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
[not found] ` <20171002120854.5212-2-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-10-02 20:18 ` Maxime Ripard
2017-10-02 20:18 ` Maxime Ripard
2017-10-02 20:18 ` Maxime Ripard
2017-10-03 9:01 ` Chen-Yu Tsai
2017-10-03 9:01 ` Chen-Yu Tsai
2017-10-03 9:01 ` Chen-Yu Tsai
2017-10-02 12:08 ` [PATCH v3 02/12] pinctrl: axp209: add pinctrl features Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
[not found] ` <20171002120854.5212-3-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-10-02 20:37 ` Maxime Ripard
2017-10-02 20:37 ` Maxime Ripard
2017-10-02 20:37 ` Maxime Ripard
2017-10-10 18:15 ` Rob Herring
2017-10-10 18:15 ` Rob Herring
2017-10-10 18:15 ` Rob Herring
2017-10-02 12:08 ` [PATCH v3 03/12] pinctrl: axp209: rename everything from gpio to pctl Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz [this message]
2017-10-02 12:08 ` [PATCH v3 04/12] pinctrl: axp209: add programmable gpio_status_offset Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
[not found] ` <20171002120854.5212-5-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-10-02 20:38 ` Maxime Ripard
2017-10-02 20:38 ` Maxime Ripard
2017-10-02 20:38 ` Maxime Ripard
2017-10-03 9:01 ` Chen-Yu Tsai
2017-10-03 9:01 ` Chen-Yu Tsai
2017-10-03 9:01 ` Chen-Yu Tsai
2017-10-02 12:08 ` [PATCH v3 05/12] pinctrl: axp209: add support for AXP813 GPIOs Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
[not found] ` <20171002120854.5212-6-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-10-02 20:38 ` Maxime Ripard
2017-10-02 20:38 ` Maxime Ripard
2017-10-02 20:38 ` Maxime Ripard
2017-10-10 18:33 ` Rob Herring
2017-10-10 18:33 ` Rob Herring
2017-10-10 18:33 ` Rob Herring
2017-10-02 12:08 ` [PATCH v3 06/12] mfd: axp20x: add pinctrl cell for AXP813 Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
[not found] ` <20171002120854.5212-7-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-10-02 20:39 ` Maxime Ripard
2017-10-02 20:39 ` Maxime Ripard
2017-10-02 20:39 ` Maxime Ripard
2017-10-02 12:08 ` [PATCH v3 07/12] ARM: dts: sun8i: a711: include axp81x dtsi Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
[not found] ` <20171002120854.5212-8-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-10-02 20:40 ` Maxime Ripard
2017-10-02 20:40 ` Maxime Ripard
2017-10-02 20:40 ` Maxime Ripard
2017-10-02 12:08 ` [PATCH v3 08/12] ARM: dts: sun8i: bananapi-m3: " Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` [PATCH v3 09/12] ARM: dts: sun8i: h8homlet-v2: " Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` [PATCH v3 10/12] ARM: dts: sun8i: cubietruck-plus: " Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` [PATCH v3 11/12] ARM: dtsi: axp81x: add GPIO DT node Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` [PATCH v3 12/12] ARM: dtsi: axp81x: set pinmux for GPIO0/1 when used as LDOs Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 12:08 ` Quentin Schulz
2017-10-02 20:42 ` Maxime Ripard
2017-10-02 20:42 ` Maxime Ripard
2017-10-03 2:06 ` Chen-Yu Tsai
2017-10-03 2:06 ` Chen-Yu Tsai
2017-10-03 2:06 ` Chen-Yu Tsai
2017-10-03 9:18 ` Russell King - ARM Linux
2017-10-03 9:18 ` Russell King - ARM Linux
[not found] ` <20171003091837.GK20805-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
2017-10-03 14:43 ` Maxime Ripard
2017-10-03 14:43 ` Maxime Ripard
2017-10-03 14:43 ` Maxime Ripard
[not found] ` <20171002120854.5212-13-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-10-03 9:27 ` Linus Walleij
2017-10-03 9:27 ` Linus Walleij
2017-10-03 9:27 ` Linus Walleij
[not found] ` <CACRpkdZYcSuhvn0b0qa0k1PQHoyXjNyjoyhR2sPme_t1pF12Dg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-03 14:47 ` Maxime Ripard
2017-10-03 14:47 ` Maxime Ripard
2017-10-03 14:47 ` Maxime Ripard
2017-10-03 15:08 ` Chen-Yu Tsai
2017-10-03 15:08 ` Chen-Yu Tsai
2017-10-03 15:08 ` Chen-Yu Tsai
[not found] ` <CAGb2v64=XL34x7iGJcEmmVnmzkA5wmyZJd-g827bY=kdHcZOMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-04 7:35 ` Quentin Schulz
2017-10-04 7:35 ` Quentin Schulz
2017-10-04 7:35 ` Quentin Schulz
[not found] ` <8be22e47-8071-be4c-0bd4-38fa51cbe3ff-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-10-10 3:09 ` Chen-Yu Tsai
2017-10-10 3:09 ` Chen-Yu Tsai
2017-10-10 3:09 ` Chen-Yu Tsai
[not found] ` <CAGb2v65-_MjUsfTHMoyzvczs_280p7NXEsStSaoR6wnvTCq5+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-11 12:00 ` Maxime Ripard
2017-10-11 12:00 ` Maxime Ripard
2017-10-11 12:00 ` Maxime Ripard
2017-10-11 19:09 ` Linus Walleij
2017-10-11 19:09 ` Linus Walleij
[not found] ` <CACRpkdY0GWqjkbxm=OBfRsTmkQ7kc86Dw96XUT08azSbD57Xrw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-12 2:22 ` Chen-Yu Tsai
2017-10-12 2:22 ` Chen-Yu Tsai
2017-10-12 2:22 ` Chen-Yu Tsai
2017-10-11 7:43 ` Linus Walleij
2017-10-11 7:43 ` Linus Walleij
2017-10-11 7:43 ` Linus Walleij
2017-10-07 10:48 ` [PATCH v3 00/12] add pinmuxing support for pins in AXP209 and AXP813 PMICs Linus Walleij
2017-10-07 10:48 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171002120854.5212-5-quentin.schulz@free-electrons.com \
--to=quentin.schulz-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=wens-jdAy2FN1RRM@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.