Skip to contentSkip to conversation

arm64: dts: qcom: pm8998: Add ADC node and die temperature channel

PATCH Applied Matthias Kaehlcke 3 participants 9 messages Sep 6, 2018 – Sep 8, 2018

Subsystems (4)

v2 of 6 Applied Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover arm64: dts: qcom: pm8998: Add ADC node and die temperature channel

This series adds the DT node for the QCOM SPMI PMIC5 ADC and a channel for the die temperature.

The die temperature is going to be used by the temperature alarm driver
(https://lore.kernel.org/patchwork/project/lkml/list/?series=361416).

My understanding is that some of the ADC channels are/can be universally useful on devices with a pm8998, while the use of others is device specific (e.g. AMUX). Siddartha / QCA folks, are there other generally useful ADC channels that should be added here?

The driver for the QCOM SPMI PMIC5 ADC landed in the 'testing' branch of the 'iio' tree:

https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=testing&id=e13d757279bbc59776c8435fb94e54b5a58bdd0b

Matthias Kaehlcke (3):
dt-bindings: iio: vadc: Fix documentation of 'reg'
arm64: dts: qcom: pm8998: Add adc node
arm64: dts: qcom: pm8998: Add die temperature channel node to the ADC

 .../bindings/iio/adc/qcom,spmi-vadc.txt         |  4 ++--
 arch/arm64/boot/dts/qcom/pm8998.dtsi            | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)
Signature · 1 line
2.19.0.rc2.392.g5ba43deb5a-goog
#1 lore raw

PATCH v2 1/3 dt-bindings: iio: vadc: Fix documentation of 'reg'

The documentation of Qualcomm's SPMI PMIC voltage ADC claims that the 'reg' property consists of two values, the SPMI address and the length of the controller's registers. However the SPMI bus to which it is added specifies "#size-cells = <0>;". Remove the controller register length from the documentation of the field and the example.

--
Changes in v2:
- none

---
 Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt +2 -2
index 0fb46137f936..d0c188e5c922 100644
@@ -13,7 +13,7 @@ VADC node:
 - reg:
     Usage: required
     Value type: <prop-encoded-array>
-    Definition: VADC base address and length in the SPMI PMIC register map.
+    Definition: VADC base address in the SPMI PMIC register map.
 
 - #address-cells:
     Usage: required
@@ -104,7 +104,7 @@ Example:
 	/* VADC node */
 	pmic_vadc: vadc at 3100 {
 		compatible = "qcom,spmi-vadc";
-		reg = <0x3100 0x100>;
+		reg = <0x3100>;
 		interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
 		#address-cells = <1>;
 		#size-cells = <0>;
Signature · 1 line
2.19.0.rc2.392.g5ba43deb5a-goog
#3 lore raw

PATCH v2 2/3 arm64: dts: qcom: pm8998: Add adc node

In reply to Matthias Kaehlcke

This adds the adc node to pm8998 based on the examples in the bindings. It also fixes the order of the included headers.

--
Changes in v2:
- removed io-channel-ranges attribute

---
 arch/arm64/boot/dts/qcom/pm8998.dtsi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/pm8998.dtsi +11 -1
index 92bed1e7d4bb..41593ebbea2c 100644
@@ -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 at 0 {
@@ -11,6 +12,15 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		pm8998_adc: adc at 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>;
+		};
+
 		pm8998_gpio: gpios at c000 {
 			compatible = "qcom,pm8998-gpio", "qcom,spmi-gpio";
 			reg = <0xc000>;
Signature · 1 line
2.19.0.rc2.392.g5ba43deb5a-goog
#5 lore raw

PATCH v2 3/3 arm64: dts: qcom: pm8998: Add die temperature channel node to the ADC

In reply to Matthias Kaehlcke

Add a channel node for the die temperature to the ADC.

--
Changes in v2:
- none

---
 arch/arm64/boot/dts/qcom/pm8998.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/qcom/pm8998.dtsi +5 -0
index 41593ebbea2c..d18d4f260fbe 100644
@@ -19,6 +19,11 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 			#io-channel-cells = <1>;
+
+			die-temp {
+				reg = <ADC5_DIE_TEMP>;
+				label = "die_temp";
+			};
 		};
 
 		pm8998_gpio: gpios at c000 {
Signature · 1 line
2.19.0.rc2.392.g5ba43deb5a-goog
Reviewed-by on v2 2/3
#4 lore raw

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

In reply to Matthias Kaehlcke

Hi,

Quoted 10 lines · Matthias Kaehlcke

This adds the adc node to pm8998 based on the examples in the bindings. It also fixes the order of the included headers.

--
Changes in v2:
- removed io-channel-ranges attribute

---
 arch/arm64/boot/dts/qcom/pm8998.dtsi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
#6 lore raw

Re: [PATCH v2 3/3] arm64: dts: qcom: pm8998: Add die temperature channel node to the ADC

In reply to Matthias Kaehlcke

Hi,

Quoted 5 lines · Matthias Kaehlcke

Add a channel node for the die temperature to the ADC.

Double-SoB?

...presumably Andy can remove that when he lands and doesn't need a re-post...

-Doug

#7 lore raw

Re: [PATCH v2 3/3] arm64: dts: qcom: pm8998: Add die temperature channel node to the ADC

Quoted 10 lines · Doug Anderson

Hi,

Quoted 5 lines · Matthias Kaehlcke

Add a channel node for the die temperature to the ADC.

Double-SoB?

I must have run 'amend' with '-s' out of habit, which wasn't the right thing to do in this case :/

Quoted 1 line

...presumably Andy can remove that when he lands and doesn't need a re-post...

Andy, in case you need me to repost let me know.

Thanks

Matthias

maintainer Applied
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: iio: vadc: Fix documentation of 'reg'

In reply to Matthias Kaehlcke
Quoted 10 lines · On Thu, 6 Sep 2018 14:04:52 -0700 Matthias Kaehlcke <[email protected]> wrote:

The documentation of Qualcomm's SPMI PMIC voltage ADC claims that the 'reg' property consists of two values, the SPMI address and the length of the controller's registers. However the SPMI bus to which it is added specifies "#size-cells = <0>;". Remove the controller register length from the documentation of the field and the example.

Applied to the togreg branch of iio.git.

Thanks,

Jonathan

Quoted 29 lines

--
Changes in v2:
- none

---
 Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.txt +2 -2
index 0fb46137f936..d0c188e5c922 100644
@@ -13,7 +13,7 @@ VADC node:
 - reg:
     Usage: required
     Value type: <prop-encoded-array>
-    Definition: VADC base address and length in the SPMI PMIC register map.
+    Definition: VADC base address in the SPMI PMIC register map.
 
 - #address-cells:
     Usage: required
@@ -104,7 +104,7 @@ Example:
 	/* VADC node */
 	pmic_vadc: vadc at 3100 {
 		compatible = "qcom,spmi-vadc";
-		reg = <0x3100 0x100>;
+		reg = <0x3100>;
 		interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
 		#address-cells = <1>;
 		#size-cells = <0>;
maintainer
#8 lore raw

Re: [PATCH v2 3/3] arm64: dts: qcom: pm8998: Add die temperature channel node to the ADC

In reply to Matthias Kaehlcke
Quoted 10 lines · On Thu, 6 Sep 2018 14:22:06 -0700 Matthias Kaehlcke <[email protected]> wrote:
Quoted 9 lines · Doug Anderson

Hi,

Quoted 5 lines · Matthias Kaehlcke

Add a channel node for the die temperature to the ADC.

Quoted 8 lines
Quoted 1 line

Double-SoB?

I must have run 'amend' with '-s' out of habit, which wasn't the right thing to do in this case :/

Quoted 1 line

...presumably Andy can remove that when he lands and doesn't need a re-post...

Andy, in case you need me to repost let me know.

Slightly worse than that (as was patch 1). You accidentally used -- rather than --- to separate the change log. So I ended up with

Signed-off-by: M..
Reviewed-by: ..
Signed-off-by: M..
--
Changelog

Signed-off-by J....

Good think the double signed off was raised as chances are I wouldn't have notice it.

Jonathan

Quoted 4 lines

Thanks

Matthias