* [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings
@ 2015-11-18 1:00 Stephen Boyd
2015-11-18 4:09 ` Andy Gross
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Stephen Boyd @ 2015-11-18 1:00 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, linux-gpio,
devicetree, Ivan T. Ivanov, Bjorn Andersson
The drivers don't really need to know which PMIC they're for, so
make a generic binding for them. This alleviates us from updating
the drivers every time a new PMIC comes out. It's still
recommended that we update the binding with new PMIC models and
always specify the specific model for the MPPs and gpios before
the generic compatible string in devicetree, but this at least
cuts down on adding more and more compatible strings to the
drivers until we actually need them.
Cc: <devicetree@vger.kernel.org>
Cc: "Ivan T. Ivanov" <iivanov@mm-sol.com>
Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
We can also figure out the number of the pins from the number
of interrupts, so we really don't need to even look at the size of the
reg property or model number for the spmi and ssbi modules. I'll propose
that change as well tomorrow.
Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt | 5 ++++-
Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt | 5 ++++-
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 +
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 1 +
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
index a90c812ad642..f1e4643f4132 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
@@ -17,6 +17,9 @@ PMIC's from Qualcomm.
"qcom,pm8994-gpio"
"qcom,pma8084-gpio"
+ And must contain either "qcom,spmi-gpio" or "qcom,ssbi-gpio"
+ if the device is on an spmi bus or an ssbi bus respectively
+
- reg:
Usage: required
Value type: <prop-encoded-array>
@@ -183,7 +186,7 @@ to specify in a pin configuration subnode:
Example:
pm8921_gpio: gpio@150 {
- compatible = "qcom,pm8921-gpio";
+ compatible = "qcom,pm8921-gpio", "qcom,ssbi-gpio";
reg = <0x150 0x160>;
interrupts = <192 1>, <193 1>, <194 1>,
<195 1>, <196 1>, <197 1>,
diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt
index d74e631e10da..e28320b18ecb 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt
@@ -18,6 +18,9 @@ of PMIC's from Qualcomm.
"qcom,pm8994-mpp",
"qcom,pma8084-mpp",
+ And must contain either "qcom,spmi-mpp" or "qcom,ssbi-mpp"
+ if the device is on an spmi bus or an ssbi bus respectively.
+
- reg:
Usage: required
Value type: <prop-encoded-array>
@@ -157,7 +160,7 @@ to specify in a pin configuration subnode:
Example:
mpps@a000 {
- compatible = "qcom,pm8841-mpp";
+ compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
reg = <0xa000>;
gpio-controller;
#gpio-cells = <2>;
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index df4413023e21..9f9979903fcb 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -806,6 +806,7 @@ static const struct of_device_id pmic_gpio_of_match[] = {
{ .compatible = "qcom,pm8941-gpio" }, /* 36 GPIO's */
{ .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */
{ .compatible = "qcom,pma8084-gpio" }, /* 22 GPIO's */
+ { .compatible = "qcom,spmi-gpio" }, /* Generic */
{ },
};
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
index 7b4136a22c5b..5a4373dd9c61 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
@@ -909,6 +909,7 @@ static const struct of_device_id pmic_mpp_of_match[] = {
{ .compatible = "qcom,pm8941-mpp" }, /* 8 MPP's */
{ .compatible = "qcom,pm8994-mpp" }, /* 8 MPP's */
{ .compatible = "qcom,pma8084-mpp" }, /* 8 MPP's */
+ { .compatible = "qcom,spmi-mpp" }, /* Generic */
{ },
};
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings
2015-11-18 1:00 [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings Stephen Boyd
@ 2015-11-18 4:09 ` Andy Gross
2015-11-19 14:50 ` Rob Herring
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Andy Gross @ 2015-11-18 4:09 UTC (permalink / raw)
To: Stephen Boyd
Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel,
linux-gpio, devicetree, Ivan T. Ivanov, Bjorn Andersson
On Tue, Nov 17, 2015 at 05:00:26PM -0800, Stephen Boyd wrote:
> The drivers don't really need to know which PMIC they're for, so
> make a generic binding for them. This alleviates us from updating
> the drivers every time a new PMIC comes out. It's still
> recommended that we update the binding with new PMIC models and
> always specify the specific model for the MPPs and gpios before
> the generic compatible string in devicetree, but this at least
> cuts down on adding more and more compatible strings to the
> drivers until we actually need them.
>
> Cc: <devicetree@vger.kernel.org>
> Cc: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Andy Gross <agross@codeaurora.org>
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings
2015-11-18 1:00 [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings Stephen Boyd
2015-11-18 4:09 ` Andy Gross
@ 2015-11-19 14:50 ` Rob Herring
2015-11-20 17:53 ` Stephen Boyd
2015-11-23 6:37 ` Ivan T. Ivanov
2015-11-23 18:22 ` Bjorn Andersson
3 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2015-11-19 14:50 UTC (permalink / raw)
To: Stephen Boyd
Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel,
linux-gpio, devicetree, Ivan T. Ivanov, Bjorn Andersson
On Tue, Nov 17, 2015 at 05:00:26PM -0800, Stephen Boyd wrote:
> The drivers don't really need to know which PMIC they're for, so
> make a generic binding for them. This alleviates us from updating
> the drivers every time a new PMIC comes out. It's still
> recommended that we update the binding with new PMIC models and
> always specify the specific model for the MPPs and gpios before
> the generic compatible string in devicetree, but this at least
> cuts down on adding more and more compatible strings to the
> drivers until we actually need them.
>
> Cc: <devicetree@vger.kernel.org>
> Cc: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
Seems okay to me. I assume you are going to update all the dts files?
Rob
>
> We can also figure out the number of the pins from the number
> of interrupts, so we really don't need to even look at the size of the
> reg property or model number for the spmi and ssbi modules. I'll propose
> that change as well tomorrow.
>
> Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt | 5 ++++-
> Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt | 5 ++++-
> drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 +
> drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 1 +
> 4 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
> index a90c812ad642..f1e4643f4132 100644
> --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
> +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
> @@ -17,6 +17,9 @@ PMIC's from Qualcomm.
> "qcom,pm8994-gpio"
> "qcom,pma8084-gpio"
>
> + And must contain either "qcom,spmi-gpio" or "qcom,ssbi-gpio"
> + if the device is on an spmi bus or an ssbi bus respectively
> +
> - reg:
> Usage: required
> Value type: <prop-encoded-array>
> @@ -183,7 +186,7 @@ to specify in a pin configuration subnode:
> Example:
>
> pm8921_gpio: gpio@150 {
> - compatible = "qcom,pm8921-gpio";
> + compatible = "qcom,pm8921-gpio", "qcom,ssbi-gpio";
> reg = <0x150 0x160>;
> interrupts = <192 1>, <193 1>, <194 1>,
> <195 1>, <196 1>, <197 1>,
> diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt
> index d74e631e10da..e28320b18ecb 100644
> --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt
> +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-mpp.txt
> @@ -18,6 +18,9 @@ of PMIC's from Qualcomm.
> "qcom,pm8994-mpp",
> "qcom,pma8084-mpp",
>
> + And must contain either "qcom,spmi-mpp" or "qcom,ssbi-mpp"
> + if the device is on an spmi bus or an ssbi bus respectively.
> +
> - reg:
> Usage: required
> Value type: <prop-encoded-array>
> @@ -157,7 +160,7 @@ to specify in a pin configuration subnode:
> Example:
>
> mpps@a000 {
> - compatible = "qcom,pm8841-mpp";
> + compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
> reg = <0xa000>;
> gpio-controller;
> #gpio-cells = <2>;
> diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
> index df4413023e21..9f9979903fcb 100644
> --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
> +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
> @@ -806,6 +806,7 @@ static const struct of_device_id pmic_gpio_of_match[] = {
> { .compatible = "qcom,pm8941-gpio" }, /* 36 GPIO's */
> { .compatible = "qcom,pm8994-gpio" }, /* 22 GPIO's */
> { .compatible = "qcom,pma8084-gpio" }, /* 22 GPIO's */
> + { .compatible = "qcom,spmi-gpio" }, /* Generic */
> { },
> };
>
> diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
> index 7b4136a22c5b..5a4373dd9c61 100644
> --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
> +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
> @@ -909,6 +909,7 @@ static const struct of_device_id pmic_mpp_of_match[] = {
> { .compatible = "qcom,pm8941-mpp" }, /* 8 MPP's */
> { .compatible = "qcom,pm8994-mpp" }, /* 8 MPP's */
> { .compatible = "qcom,pma8084-mpp" }, /* 8 MPP's */
> + { .compatible = "qcom,spmi-mpp" }, /* Generic */
> { },
> };
>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings
2015-11-19 14:50 ` Rob Herring
@ 2015-11-20 17:53 ` Stephen Boyd
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2015-11-20 17:53 UTC (permalink / raw)
To: Rob Herring
Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel,
linux-gpio, devicetree, Ivan T. Ivanov, Bjorn Andersson
On 11/19, Rob Herring wrote:
> On Tue, Nov 17, 2015 at 05:00:26PM -0800, Stephen Boyd wrote:
> > The drivers don't really need to know which PMIC they're for, so
> > make a generic binding for them. This alleviates us from updating
> > the drivers every time a new PMIC comes out. It's still
> > recommended that we update the binding with new PMIC models and
> > always specify the specific model for the MPPs and gpios before
> > the generic compatible string in devicetree, but this at least
> > cuts down on adding more and more compatible strings to the
> > drivers until we actually need them.
> >
> > Cc: <devicetree@vger.kernel.org>
> > Cc: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> > Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> > ---
>
> Seems okay to me. I assume you are going to update all the dts files?
Yep, I'll send out patches to do that.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings
2015-11-18 1:00 [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings Stephen Boyd
2015-11-18 4:09 ` Andy Gross
2015-11-19 14:50 ` Rob Herring
@ 2015-11-23 6:37 ` Ivan T. Ivanov
2015-11-23 18:22 ` Bjorn Andersson
3 siblings, 0 replies; 6+ messages in thread
From: Ivan T. Ivanov @ 2015-11-23 6:37 UTC (permalink / raw)
To: Stephen Boyd
Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel,
linux-gpio, devicetree, Ivan T. Ivanov, Bjorn Andersson
> On Nov 18, 2015, at 3:00 AM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>
> The drivers don't really need to know which PMIC they're for, so
> make a generic binding for them. This alleviates us from updating
> the drivers every time a new PMIC comes out. It's still
> recommended that we update the binding with new PMIC models and
> always specify the specific model for the MPPs and gpios before
> the generic compatible string in devicetree, but this at least
> cuts down on adding more and more compatible strings to the
> drivers until we actually need them.
>
> Cc: <devicetree@vger.kernel.org>
> Cc: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Thanks.
Acked-by: Ivan T. Ivanov <iivanov.xz@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings
2015-11-18 1:00 [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings Stephen Boyd
` (2 preceding siblings ...)
2015-11-23 6:37 ` Ivan T. Ivanov
@ 2015-11-23 18:22 ` Bjorn Andersson
3 siblings, 0 replies; 6+ messages in thread
From: Bjorn Andersson @ 2015-11-23 18:22 UTC (permalink / raw)
To: Stephen Boyd
Cc: Linus Walleij, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
devicetree@vger.kernel.org, Ivan T. Ivanov
On Tue 17 Nov 17:00 PST 2015, Stephen Boyd wrote:
> The drivers don't really need to know which PMIC they're for, so
> make a generic binding for them. This alleviates us from updating
> the drivers every time a new PMIC comes out. It's still
> recommended that we update the binding with new PMIC models and
> always specify the specific model for the MPPs and gpios before
> the generic compatible string in devicetree, but this at least
> cuts down on adding more and more compatible strings to the
> drivers until we actually need them.
>
> Cc: <devicetree@vger.kernel.org>
> Cc: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
>
I must say that when it comes to writing dts files I much prefer the msm
way of denoting functions over the pmic one. But because of that
decision this makes perfect sense!
Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Regards,
Bjorn
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-11-23 18:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-18 1:00 [RFC/PATCH] pinctrl: qcom: Add generic ssbi and spmi GPIO/MPP bindings Stephen Boyd
2015-11-18 4:09 ` Andy Gross
2015-11-19 14:50 ` Rob Herring
2015-11-20 17:53 ` Stephen Boyd
2015-11-23 6:37 ` Ivan T. Ivanov
2015-11-23 18:22 ` Bjorn Andersson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).