[PATCH v5 5/9] dt-bindings: iio: add backend support to sd modulator

0 views
Skip to first unread message

Olivier Moysan

unread,
Jul 24, 2024, 11:39:47 AM (6 days ago) Jul 24
to fabrice...@foss.st.com, Jonathan Cameron, Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Arnaud Pouliquen, Olivier Moysan, linu...@vger.kernel.org, devic...@vger.kernel.org, linux-...@vger.kernel.org
The legacy sd modulator driver registers the sigma delta modulator as
an IIO channel provider. This implementation is not convenient when the
SD modulator has to be cascaded with another IIO device. The scaling
information is distributed across devices, which makes it difficult to
report consistent scaling data on IIO devices.

The solution is to expose these cascaded IIO devices as an aggregate
device, which report global scaling information.
Add IIO backend support to SD modulator to allow scaling information
management.

Signed-off-by: Olivier Moysan <olivier...@foss.st.com>
---
.../bindings/iio/adc/sigma-delta-modulator.yaml | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
index cab0d425eaa4..b245971fecb0 100644
--- a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
@@ -18,18 +18,31 @@ properties:
- sd-modulator
- ads1201

+ '#io-backend-cells':
+ const: 0
+
'#io-channel-cells':
const: 0

required:
- compatible
- - '#io-channel-cells'
+
+anyOf:
+ - required: ['#io-backend-cells']
+ - required: ['#io-channel-cells']

additionalProperties: false

examples:
- |
- ads1202: adc {
+ // Backend binding example. SD modulator configured as an IIO backend device
+ ads1201_0 {
+ compatible = "sd-modulator";
+ #io-backend-cells = <0>;
+ };
+
+ // Legacy binding example. SD modulator configured as an IIO channel provider
+ ads1201_1 {
compatible = "sd-modulator";
#io-channel-cells = <0>;
};
--
2.25.1


Olivier Moysan

unread,
4:49 AM (4 hours ago) 4:49 AM
to fabrice...@foss.st.com, Jonathan Cameron, Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Arnaud Pouliquen, Olivier Moysan, linu...@vger.kernel.org, devic...@vger.kernel.org, linux-...@vger.kernel.org
The legacy sd modulator driver registers the sigma delta modulator as
an IIO channel provider. This implementation is not convenient when the
SD modulator has to be cascaded with another IIO device. The scaling
information is distributed across devices, which makes it difficult to
report consistent scaling data on IIO devices.

The solution is to expose these cascaded IIO devices as an aggregate
device, which report global scaling information.
Add IIO backend support to SD modulator to allow scaling information
management.

Signed-off-by: Olivier Moysan <olivier...@foss.st.com>
---
.../iio/adc/sigma-delta-modulator.yaml | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
index cab0d425eaa4..7d33c4e09905 100644
--- a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
@@ -18,18 +18,32 @@ properties:
- sd-modulator
- ads1201

+ '#io-backend-cells':
+ const: 0
+
'#io-channel-cells':
const: 0

required:
- compatible
- - '#io-channel-cells'
+
+anyOf:
+ - required: ['#io-backend-cells']
+ - required: ['#io-channel-cells']

additionalProperties: false

examples:
- |
- ads1202: adc {
+ // Backend binding example. SD modulator configured as an IIO backend device
+ ads1201_0: adc {
+ compatible = "sd-modulator";
+ #io-backend-cells = <0>;
+ };
+
+ - |
+ // Legacy binding example. SD modulator configured as an IIO channel provider
+ ads1201_1: adc {
Reply all
Reply to author
Forward
0 new messages