From c0b391daf9fe6161bd5565eea4e711500b416840 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Fri, 14 Apr 2023 01:17:49 +0200 Subject: [PATCH 1/2] dt-bindings: iio: adc: qcom,spmi-vadc: Allow 1/16 for pre-scaling The channel ADC5_USB_IN_V_16 is using 1/16 pre-scaling on at least pm7250b and pmi632. Allow that in the schema. Change-Id: I4c673338fd9c3ed1544863fc073abfd91ec721b3 Signed-off-by: Luca Weiss Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230414-pmi632-v1-5-fe94dc414832@z3ntu.xyz Signed-off-by: Jonathan Cameron Git-commit: ef513aa7aa5038d2f53e9f2932af5006f37ed0b6 Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Anjelique Melendez --- bindings/iio/adc/qcom,spmi-vadc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/iio/adc/qcom,spmi-vadc.yaml b/bindings/iio/adc/qcom,spmi-vadc.yaml index bd6e0d6f..365aa352 100644 --- a/bindings/iio/adc/qcom,spmi-vadc.yaml +++ b/bindings/iio/adc/qcom,spmi-vadc.yaml @@ -101,7 +101,7 @@ patternProperties: oneOf: - items: - const: 1 - - enum: [ 1, 3, 4, 6, 20, 8, 10 ] + - enum: [ 1, 3, 4, 6, 20, 8, 10, 16 ] - items: - const: 10 - const: 81 From 236d18167a099e039dd38214b2185b15226b8225 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Mon, 10 Apr 2023 22:29:17 +0200 Subject: [PATCH 2/2] dt-bindings: iio: adc: Require generic `channel` name for channel nodes As discussed in [1] it is more convenient to use a generic `channel` node name for ADC channels while storing a friendly - board-specific instead of PMIC-specific - name in the label, if/when desired to overwrite the channel description already contained (but previously unused) in the driver [2]. The same `channel` node name pattern has also been set in iio/adc/adc.yaml, but this generic binding is not inherited as base for qcom,spmi-vadc bindings due to not having any other generic elements in common, besides the node name rule and reg property. Replace the .* name pattern with the `channel` literal, but leave the label property optional for bindings to choose to fall back a channel label hardcoded in the driver [2] instead. [1]: https://lore.kernel.org/linux-arm-msm/20221106193018.270106-1-marijn.suijten@somainline.org/T/#u [2]: https://lore.kernel.org/linux-arm-msm/20230116220909.196926-4-marijn.suijten@somainline.org/ Change-Id: I89932db23da961995c921ef58e0c60a92018bb27 Signed-off-by: Marijn Suijten Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230410202917.247666-6-marijn.suijten@somainline.org Signed-off-by: Jonathan Cameron Git-commit: e0b7972461b082be7168deb217ab7daaa8d425f0 Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Anjelique Melendez --- bindings/iio/adc/qcom,spmi-vadc.yaml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/bindings/iio/adc/qcom,spmi-vadc.yaml b/bindings/iio/adc/qcom,spmi-vadc.yaml index 365aa352..ad7d6fc4 100644 --- a/bindings/iio/adc/qcom,spmi-vadc.yaml +++ b/bindings/iio/adc/qcom,spmi-vadc.yaml @@ -54,7 +54,7 @@ required: - '#io-channel-cells' patternProperties: - "^.*@[0-9a-f]+$": + "^channel@[0-9a-f]+$": type: object additionalProperties: false description: | @@ -148,7 +148,7 @@ allOf: then: patternProperties: - "^.*@[0-9a-f]+$": + "^channel@[0-9a-f]+$": properties: qcom,decimation: enum: [ 512, 1024, 2048, 4096 ] @@ -171,7 +171,7 @@ allOf: then: patternProperties: - "^.*@[0-9a-f]+$": + "^channel@[0-9a-f]+$": properties: qcom,decimation: enum: [ 256, 512, 1024 ] @@ -194,7 +194,7 @@ allOf: then: patternProperties: - "^.*@[0-9a-f]+$": + "^channel@[0-9a-f]+$": properties: qcom,decimation: enum: [ 250, 420, 840 ] @@ -217,7 +217,7 @@ allOf: then: patternProperties: - "^.*@[0-9a-f]+$": + "^channel@[0-9a-f]+$": properties: qcom,decimation: enum: [ 85, 340, 1360 ] @@ -249,7 +249,7 @@ examples: #io-channel-cells = <1>; /* Channel node */ - adc-chan@39 { + channel@39 { reg = <0x39>; qcom,decimation = <512>; qcom,ratiometric; @@ -258,19 +258,19 @@ examples: qcom,pre-scaling = <1 3>; }; - adc-chan@9 { + channel@9 { reg = <0x9>; }; - adc-chan@a { + channel@a { reg = <0xa>; }; - adc-chan@e { + channel@e { reg = <0xe>; }; - adc-chan@f { + channel@f { reg = <0xf>; }; }; @@ -292,16 +292,18 @@ examples: #io-channel-cells = <1>; /* Other properties are omitted */ - xo-therm@44 { + channel@44 { reg = ; qcom,ratiometric; qcom,hw-settle-time = <200>; + label = "xo_therm"; }; - conn-therm@47 { + channel@47 { reg = ; qcom,ratiometric; qcom,hw-settle-time = <200>; + label = "conn_therm"; }; }; };