diff mbox series

[2/3] arm64: dts: qcom: pm8998: Add adc node

Message ID 20180808191339.16875-3-mka@chromium.org (mailing list archive)
State New, archived
Headers show
Series arm64: dts: qcom: pm8998: Add ADC node and die temperature channel | expand

Commit Message

Matthias Kaehlcke Aug. 8, 2018, 7:13 p.m. UTC
This adds the adc node to pm8998 based on the examples in the
bindings. It also fixes the order of the included headers.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 arch/arm64/boot/dts/qcom/pm8998.dtsi | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

Doug Anderson Aug. 11, 2018, 12:09 a.m. UTC | #1
Hi,

On Wed, Aug 8, 2018 at 12:13 PM, Matthias Kaehlcke <mka@chromium.org> wrote:
> This adds the adc node to pm8998 based on the examples in the
> bindings. It also fixes the order of the included headers.
>
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---
>  arch/arm64/boot/dts/qcom/pm8998.dtsi | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/pm8998.dtsi b/arch/arm64/boot/dts/qcom/pm8998.dtsi
> index 92bed1e7d4bb..f70f6101bceb 100644
> --- a/arch/arm64/boot/dts/qcom/pm8998.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm8998.dtsi
> @@ -1,8 +1,9 @@
>  // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>  /* Copyright 2018 Google LLC. */
>
> -#include <dt-bindings/spmi/spmi.h>
> +#include <dt-bindings/iio/qcom,spmi-vadc.h>
>  #include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/spmi/spmi.h>
>
>  &spmi_bus {
>         pm8998_lsid0: pmic@0 {
> @@ -11,6 +12,16 @@
>                 #address-cells = <1>;
>                 #size-cells = <0>;
>
> +               pm8998_adc: adc@3100 {
> +                       compatible = "qcom,spmi-adc-rev2";
> +                       reg = <0x3100>;
> +                       interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +                       #io-channel-cells = <1>;
> +                       io-channel-ranges;
> +               };

I'm a little confused about what the "io-channel-ranges" does here.
The documentation isn't clear at all to me for it.  If I'm reading it
right it's also supposed to be for iio-consumers, but you're using it
in a provider.  I see you copied this from the example.  Maybe the
example is wrong?  ...or I'm just confused...

Other than that question, this looks fine to me.


-Doug
Matthias Kaehlcke Aug. 27, 2018, 5:10 p.m. UTC | #2
On Fri, Aug 10, 2018 at 05:09:17PM -0700, Doug Anderson wrote:
> Hi,
> 
> On Wed, Aug 8, 2018 at 12:13 PM, Matthias Kaehlcke <mka@chromium.org> wrote:
> > This adds the adc node to pm8998 based on the examples in the
> > bindings. It also fixes the order of the included headers.
> >
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > ---
> >  arch/arm64/boot/dts/qcom/pm8998.dtsi | 13 ++++++++++++-
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/pm8998.dtsi b/arch/arm64/boot/dts/qcom/pm8998.dtsi
> > index 92bed1e7d4bb..f70f6101bceb 100644
> > --- a/arch/arm64/boot/dts/qcom/pm8998.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/pm8998.dtsi
> > @@ -1,8 +1,9 @@
> >  // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> >  /* Copyright 2018 Google LLC. */
> >
> > -#include <dt-bindings/spmi/spmi.h>
> > +#include <dt-bindings/iio/qcom,spmi-vadc.h>
> >  #include <dt-bindings/interrupt-controller/irq.h>
> > +#include <dt-bindings/spmi/spmi.h>
> >
> >  &spmi_bus {
> >         pm8998_lsid0: pmic@0 {
> > @@ -11,6 +12,16 @@
> >                 #address-cells = <1>;
> >                 #size-cells = <0>;
> >
> > +               pm8998_adc: adc@3100 {
> > +                       compatible = "qcom,spmi-adc-rev2";
> > +                       reg = <0x3100>;
> > +                       interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
> > +                       #address-cells = <1>;
> > +                       #size-cells = <0>;
> > +                       #io-channel-cells = <1>;
> > +                       io-channel-ranges;
> > +               };
> 
> I'm a little confused about what the "io-channel-ranges" does here.
> The documentation isn't clear at all to me for it.  If I'm reading it
> right it's also supposed to be for iio-consumers, but you're using it
> in a provider.  I see you copied this from the example.  Maybe the
> example is wrong?  ...or I'm just confused...

Yes, I copied it from the example, its use here is also not clear to
me, other ADC providers like adc@126c0000 in exynos3250.dtsi or
adc@180a6000 in bcm-cygnus.dtsi also specify it ...

Siddartha/Jonathan, could you help to clarify if "io-channel-ranges"
should really be specified here as the DT example suggests?

Thanks

Matthias
Doug Anderson Sept. 6, 2018, 6:34 p.m. UTC | #3
Hi,

On Mon, Aug 27, 2018 at 10:10 AM, Matthias Kaehlcke <mka@chromium.org> wrote:
> On Fri, Aug 10, 2018 at 05:09:17PM -0700, Doug Anderson wrote:
>> Hi,
>>
>> On Wed, Aug 8, 2018 at 12:13 PM, Matthias Kaehlcke <mka@chromium.org> wrote:
>> > This adds the adc node to pm8998 based on the examples in the
>> > bindings. It also fixes the order of the included headers.
>> >
>> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
>> > ---
>> >  arch/arm64/boot/dts/qcom/pm8998.dtsi | 13 ++++++++++++-
>> >  1 file changed, 12 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/arch/arm64/boot/dts/qcom/pm8998.dtsi b/arch/arm64/boot/dts/qcom/pm8998.dtsi
>> > index 92bed1e7d4bb..f70f6101bceb 100644
>> > --- a/arch/arm64/boot/dts/qcom/pm8998.dtsi
>> > +++ b/arch/arm64/boot/dts/qcom/pm8998.dtsi
>> > @@ -1,8 +1,9 @@
>> >  // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>> >  /* Copyright 2018 Google LLC. */
>> >
>> > -#include <dt-bindings/spmi/spmi.h>
>> > +#include <dt-bindings/iio/qcom,spmi-vadc.h>
>> >  #include <dt-bindings/interrupt-controller/irq.h>
>> > +#include <dt-bindings/spmi/spmi.h>
>> >
>> >  &spmi_bus {
>> >         pm8998_lsid0: pmic@0 {
>> > @@ -11,6 +12,16 @@
>> >                 #address-cells = <1>;
>> >                 #size-cells = <0>;
>> >
>> > +               pm8998_adc: adc@3100 {
>> > +                       compatible = "qcom,spmi-adc-rev2";
>> > +                       reg = <0x3100>;
>> > +                       interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
>> > +                       #address-cells = <1>;
>> > +                       #size-cells = <0>;
>> > +                       #io-channel-cells = <1>;
>> > +                       io-channel-ranges;
>> > +               };
>>
>> I'm a little confused about what the "io-channel-ranges" does here.
>> The documentation isn't clear at all to me for it.  If I'm reading it
>> right it's also supposed to be for iio-consumers, but you're using it
>> in a provider.  I see you copied this from the example.  Maybe the
>> example is wrong?  ...or I'm just confused...
>
> Yes, I copied it from the example, its use here is also not clear to
> me, other ADC providers like adc@126c0000 in exynos3250.dtsi or
> adc@180a6000 in bcm-cygnus.dtsi also specify it ...
>
> Siddartha/Jonathan, could you help to clarify if "io-channel-ranges"
> should really be specified here as the DT example suggests?

Does everything work if you just remove the "io-channel-ranges"?  We
could remove it and always add it back in later if someone could
explain what it's for or if we find a reason why it was needed?  ...or
we have any other ideas for how to get this resolved?  :(

-Doug
Matthias Kaehlcke Sept. 6, 2018, 8:36 p.m. UTC | #4
On Thu, Sep 06, 2018 at 11:34:32AM -0700, Doug Anderson wrote:
> Hi,
> 
> On Mon, Aug 27, 2018 at 10:10 AM, Matthias Kaehlcke <mka@chromium.org> wrote:
> > On Fri, Aug 10, 2018 at 05:09:17PM -0700, Doug Anderson wrote:
> >> Hi,
> >>
> >> On Wed, Aug 8, 2018 at 12:13 PM, Matthias Kaehlcke <mka@chromium.org> wrote:
> >> > This adds the adc node to pm8998 based on the examples in the
> >> > bindings. It also fixes the order of the included headers.
> >> >
> >> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> >> > ---
> >> >  arch/arm64/boot/dts/qcom/pm8998.dtsi | 13 ++++++++++++-
> >> >  1 file changed, 12 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/arch/arm64/boot/dts/qcom/pm8998.dtsi b/arch/arm64/boot/dts/qcom/pm8998.dtsi
> >> > index 92bed1e7d4bb..f70f6101bceb 100644
> >> > --- a/arch/arm64/boot/dts/qcom/pm8998.dtsi
> >> > +++ b/arch/arm64/boot/dts/qcom/pm8998.dtsi
> >> > @@ -1,8 +1,9 @@
> >> >  // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> >> >  /* Copyright 2018 Google LLC. */
> >> >
> >> > -#include <dt-bindings/spmi/spmi.h>
> >> > +#include <dt-bindings/iio/qcom,spmi-vadc.h>
> >> >  #include <dt-bindings/interrupt-controller/irq.h>
> >> > +#include <dt-bindings/spmi/spmi.h>
> >> >
> >> >  &spmi_bus {
> >> >         pm8998_lsid0: pmic@0 {
> >> > @@ -11,6 +12,16 @@
> >> >                 #address-cells = <1>;
> >> >                 #size-cells = <0>;
> >> >
> >> > +               pm8998_adc: adc@3100 {
> >> > +                       compatible = "qcom,spmi-adc-rev2";
> >> > +                       reg = <0x3100>;
> >> > +                       interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
> >> > +                       #address-cells = <1>;
> >> > +                       #size-cells = <0>;
> >> > +                       #io-channel-cells = <1>;
> >> > +                       io-channel-ranges;
> >> > +               };
> >>
> >> I'm a little confused about what the "io-channel-ranges" does here.
> >> The documentation isn't clear at all to me for it.  If I'm reading it
> >> right it's also supposed to be for iio-consumers, but you're using it
> >> in a provider.  I see you copied this from the example.  Maybe the
> >> example is wrong?  ...or I'm just confused...
> >
> > Yes, I copied it from the example, its use here is also not clear to
> > me, other ADC providers like adc@126c0000 in exynos3250.dtsi or
> > adc@180a6000 in bcm-cygnus.dtsi also specify it ...
> >
> > Siddartha/Jonathan, could you help to clarify if "io-channel-ranges"
> > should really be specified here as the DT example suggests?
> 
> Does everything work if you just remove the "io-channel-ranges"?

Yes, the ADC channels are still available within the kernel and
through sysfs and provide reasonable values.

> We could remove it and always add it back in later if someone could
> explain what it's for or if we find a reason why it was needed?  ...or
> we have any other ideas for how to get this resolved?  :(

Sounds good, I'll respin with 'io-channel-ranges' removed.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/pm8998.dtsi b/arch/arm64/boot/dts/qcom/pm8998.dtsi
index 92bed1e7d4bb..f70f6101bceb 100644
--- a/arch/arm64/boot/dts/qcom/pm8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8998.dtsi
@@ -1,8 +1,9 @@ 
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /* Copyright 2018 Google LLC. */
 
-#include <dt-bindings/spmi/spmi.h>
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/spmi/spmi.h>
 
 &spmi_bus {
 	pm8998_lsid0: pmic@0 {
@@ -11,6 +12,16 @@ 
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		pm8998_adc: adc@3100 {
+			compatible = "qcom,spmi-adc-rev2";
+			reg = <0x3100>;
+			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			#io-channel-cells = <1>;
+			io-channel-ranges;
+		};
+
 		pm8998_gpio: gpios@c000 {
 			compatible = "qcom,pm8998-gpio", "qcom,spmi-gpio";
 			reg = <0xc000>;