* [PATCH v5 0/9] iio: adc: dfsdm: add scaling support
@ 2024-07-24 15:36 Olivier Moysan
2024-07-24 15:36 ` [PATCH v5 4/9] dt-bindings: iio: dfsdm: move to backend framework Olivier Moysan
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Olivier Moysan @ 2024-07-24 15:36 UTC (permalink / raw)
To: fabrice.gasnier, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Olivier Moysan,
Arnaud Pouliquen, Maxime Coquelin, Alexandre Torgue, Nuno Sa,
Liam Girdwood, Mark Brown
Cc: linux-iio, devicetree, linux-kernel, alsa-devel, linux-stm32,
linux-arm-kernel
The aim of this serie is to add scaling support to STM32 DFSDM
peripheral in the analog context.
The DFSDM currently operates as a consumer of IIO channels
provided by a generic SD modulator. As previously discussed in RFC [1],
this topology is not suitable for implementing scaling.
This series brings the integration of the DFSDM driver with the new
IIO backend framework [2], enabling the DFSDM IIO device to offer
scaling feature based on reference voltage data obtained from the
IIO SD modulator backend. This generic SD modulator backend takes the
place of the former SD modulator, used with legacy implementation.
The DFSDM driver has been updated to adopt the generic ADC channel
binding [3]. The reasons for this include:
- Reducing the use of proprietary properties
- Simplifying the coexistence of legacy and new backend bindings
- Prepare the support of the MDF peripheral on STM32MP25 SoC
Backward compatibility is maintained through legacy support.
This series extends the backend framework with the following APIs:
- iio_backend_read_raw:
This API is intented to retrieve channel attributes from the
backend. It is based on IIO framework read_raw API.
- iio_backend_read_scale / iio_backend_read_offset
Dedicated APIs to read scale and offset channel values.
- iio_backend_disable / iio_backend_enable:
backend enable/disable to be used for PM management
- devm_iio_backend_fwnode_get
Intended for parsing DT subnodes to allow generic channel binding
support, as generic channel DT nodes are not populated as devices.
[1]: https://lore.kernel.org/lkml/20200204101008.11411-1-olivier.moysan@st.com/
[2]: https://lore.kernel.org/all/20240206-iio-backend-v9-0-df66d159c000@analog.com/
[3]: devicetree/bindings/iio/adc/adc.yaml
Changes in v2:
- Update enable/disable backend API
- Rename devm_iio_backend_subnode_get(), as devm_iio_backend_fwnode_get()
- Update iio_backend_read_raw() prototype to fully match IIO framework
read_raw callback prototype.
- Change st,adc-channel-type property name and type in DFSDM binding
- Remove sd-backend and rename ads1201 compatibles in SD binding
Changes in v3:
- Add iio_backend_read_scale and iio_backend_read_offset
- Remove sd-backend compatible. Adapt existing sd modulator driver and
binding to support backend topology.
- Misc corrections in DFSDM binding & minor changes in DFSDM driver
Changes in v4:
- Remove allOf and rework examples in SD modulator binding
- Wrap lines to 80 characters in IIO code
Changes in v5:
- Move iio_backend_read_scale and iio_backend_read_offset to inline
and update prototype
- Fix channel number & remove legacy binding example in DFSDM binding
- Rearrange DFSDM patches to fix build issue in serie
- Split SD modulator binding patch.
Move reference voltage change in a separate patch
Olivier Moysan (9):
iio: add read scale and offset services to iio backend framework
iio: add enable and disable services to iio backend framework
iio: add child nodes support in iio backend framework
dt-bindings: iio: dfsdm: move to backend framework
dt-bindings: iio: add backend support to sd modulator
dt-bindings: iio: add vref support to sd modulator
iio: adc: stm32-dfsdm: adopt generic channels bindings
iio: add iio backend support to sd modulator
iio: adc: stm32-dfsdm: add scaling support to dfsdm
.../iio/adc/sigma-delta-modulator.yaml | 25 +-
.../bindings/iio/adc/st,stm32-dfsdm-adc.yaml | 124 +++++++-
drivers/iio/adc/Kconfig | 2 +
drivers/iio/adc/sd_adc_modulator.c | 92 +++++-
drivers/iio/adc/stm32-dfsdm-adc.c | 293 +++++++++++++++---
drivers/iio/industrialio-backend.c | 101 +++++-
include/linux/iio/backend.h | 29 +-
7 files changed, 593 insertions(+), 73 deletions(-)
base-commit: 472438c7e0e2261c6737a8321f46ef176eef1c8f
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v5 4/9] dt-bindings: iio: dfsdm: move to backend framework
2024-07-24 15:36 [PATCH v5 0/9] iio: adc: dfsdm: add scaling support Olivier Moysan
@ 2024-07-24 15:36 ` Olivier Moysan
2024-07-24 16:43 ` Rob Herring (Arm)
2024-07-25 12:23 ` Rob Herring
2024-07-24 15:36 ` [PATCH v5 5/9] dt-bindings: iio: add backend support to sd modulator Olivier Moysan
2024-07-24 15:36 ` [PATCH v5 6/9] dt-bindings: iio: add vref " Olivier Moysan
2 siblings, 2 replies; 8+ messages in thread
From: Olivier Moysan @ 2024-07-24 15:36 UTC (permalink / raw)
To: fabrice.gasnier, Olivier Moysan, Arnaud Pouliquen,
Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue
Cc: alsa-devel, linux-iio, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
Change the DFSDM binding to use the new IIO backend framework,
along with the adoption of IIO generic channels.
This binding change allows to add scaling support to the DFSDM.
Keep the legacy binding as deprecated for backward compatibility.
The io-backends property is supported only in generic IIO channel
binding.
- Channel description with the generic binding (Audio and Analog):
Properties superseded by generic properties:
st,adc-channels: becomes "reg" property in channel node
st,adc-channel-names: becomes "label" property in channel node
Properties moved to channel child node:
st,adc-channel-types: becomes st,adc-channel-type
st,adc-channel-clk-src, st,adc-alt-channel
- Analog binding:
DFSDM filter channel is configured as an IIO backend consumer.
Add io-backends property in channel child nodes.
DFSDM is no more configured as a channel consumer from SD modulator.
Use of io-channels in DFSDM node is deprecated.
- Audio binding:
DFSDM audio DAI is configured as a channel consumer from DFSDM filter.
No change compare to legacy.
Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
.../bindings/iio/adc/st,stm32-dfsdm-adc.yaml | 124 +++++++++++++++---
1 file changed, 108 insertions(+), 16 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml
index 2722edab1d9a..ceadd73504a4 100644
--- a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml
@@ -102,9 +102,11 @@ patternProperties:
items:
minimum: 0
maximum: 7
+ deprecated: true
st,adc-channel-names:
description: List of single-ended channel names.
+ deprecated: true
st,filter-order:
description: |
@@ -118,6 +120,12 @@ patternProperties:
"#io-channel-cells":
const: 1
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
st,adc-channel-types:
description: |
Single-ended channel input type.
@@ -128,6 +136,7 @@ patternProperties:
items:
enum: [ SPI_R, SPI_F, MANCH_R, MANCH_F ]
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
+ deprecated: true
st,adc-channel-clk-src:
description: |
@@ -139,6 +148,7 @@ patternProperties:
items:
enum: [ CLKIN, CLKOUT, CLKOUT_F, CLKOUT_R ]
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
+ deprecated: true
st,adc-alt-channel:
description:
@@ -147,6 +157,7 @@ patternProperties:
If not set, channel n is connected to SPI input n.
If set, channel n is connected to SPI input n + 1.
type: boolean
+ deprecated: true
st,filter0-sync:
description:
@@ -165,11 +176,60 @@ patternProperties:
- compatible
- reg
- interrupts
- - st,adc-channels
- - st,adc-channel-names
- st,filter-order
- "#io-channel-cells"
+ patternProperties:
+ "^channel@([0-7])$":
+ type: object
+ $ref: adc.yaml
+ unevaluatedProperties: false
+ description: Represents the external channels which are connected to the DFSDM.
+
+ properties:
+ reg:
+ maximum: 7
+
+ label:
+ description:
+ Unique name to identify which channel this is.
+
+ st,adc-channel-type:
+ description: |
+ Single-ended channel input type.
+ - "SPI_R": SPI with data on rising edge (default)
+ - "SPI_F": SPI with data on falling edge
+ - "MANCH_R": manchester codec, rising edge = logic 0, falling edge = logic 1
+ - "MANCH_F": manchester codec, rising edge = logic 1, falling edge = logic 0
+ $ref: /schemas/types.yaml#/definitions/string
+ enum: [ SPI_R, SPI_F, MANCH_R, MANCH_F ]
+
+ st,adc-channel-clk-src:
+ description: |
+ Conversion clock source.
+ - "CLKIN": external SPI clock (CLKIN x)
+ - "CLKOUT": internal SPI clock (CLKOUT) (default)
+ - "CLKOUT_F": internal SPI clock divided by 2 (falling edge).
+ - "CLKOUT_R": internal SPI clock divided by 2 (rising edge).
+ $ref: /schemas/types.yaml#/definitions/string
+ enum: [ CLKIN, CLKOUT, CLKOUT_F, CLKOUT_R ]
+
+ st,adc-alt-channel:
+ description:
+ Must be defined if two sigma delta modulators are
+ connected on same SPI input.
+ If not set, channel n is connected to SPI input n.
+ If set, channel n is connected to SPI input n + 1.
+ type: boolean
+
+ io-backends:
+ description:
+ Used to pipe external sigma delta modulator or internal ADC backend to DFSDM channel.
+ maxItems: 1
+
+ required:
+ - reg
+
allOf:
- if:
properties:
@@ -199,9 +259,19 @@ patternProperties:
description:
From common IIO binding. Used to pipe external sigma delta
modulator or internal ADC output to DFSDM channel.
+ deprecated: true
- required:
- - io-channels
+ if:
+ required:
+ - st,adc-channels
+ then:
+ required:
+ - io-channels
+
+ patternProperties:
+ "^channel@([0-7])$":
+ required:
+ - io-backends
- if:
properties:
@@ -298,6 +368,7 @@ examples:
#address-cells = <1>;
#size-cells = <0>;
+ // Example 1: Audio use case with generic binding
dfsdm0: filter@0 {
compatible = "st,stm32-dfsdm-dmic";
reg = <0>;
@@ -305,12 +376,18 @@ examples:
dmas = <&dmamux1 101 0x400 0x01>;
dma-names = "rx";
#io-channel-cells = <1>;
- st,adc-channels = <1>;
- st,adc-channel-names = "dmic0";
- st,adc-channel-types = "SPI_R";
- st,adc-channel-clk-src = "CLKOUT";
+ #address-cells = <1>;
+ #size-cells = <0>;
st,filter-order = <5>;
+ channel@1 {
+ reg = <1>;
+ label = "dmic0";
+ st,adc-channel-type = "SPI_R";
+ st,adc-channel-clk-src = "CLKOUT";
+ st,adc-alt-channel;
+ };
+
asoc_pdm0: dfsdm-dai {
compatible = "st,stm32h7-dfsdm-dai";
#sound-dai-cells = <0>;
@@ -318,20 +395,35 @@ examples:
};
};
- dfsdm_pdm1: filter@1 {
+ // Example 2: Analog use case with generic binding
+ dfsdm1: filter@1 {
compatible = "st,stm32-dfsdm-adc";
reg = <1>;
interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&dmamux1 102 0x400 0x01>;
dma-names = "rx";
- #io-channel-cells = <1>;
- st,adc-channels = <2 3>;
- st,adc-channel-names = "in2", "in3";
- st,adc-channel-types = "SPI_R", "SPI_R";
- st,adc-channel-clk-src = "CLKOUT_F", "CLKOUT_F";
- io-channels = <&sd_adc2 &sd_adc3>;
st,filter-order = <1>;
+ #io-channel-cells = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ channel@2 {
+ reg = <2>;
+ label = "in2";
+ st,adc-channel-type = "SPI_F";
+ st,adc-channel-clk-src = "CLKOUT";
+ st,adc-alt-channel;
+ io-backends = <&sd_adc2>;
+ };
+
+ channel@3 {
+ reg = <3>;
+ label = "in3";
+ st,adc-channel-type = "SPI_R";
+ st,adc-channel-clk-src = "CLKOUT";
+ io-backends = <&sd_adc3>;
+ };
};
};
-...
+...
\ No newline at end of file
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v5 5/9] dt-bindings: iio: add backend support to sd modulator
2024-07-24 15:36 [PATCH v5 0/9] iio: adc: dfsdm: add scaling support Olivier Moysan
2024-07-24 15:36 ` [PATCH v5 4/9] dt-bindings: iio: dfsdm: move to backend framework Olivier Moysan
@ 2024-07-24 15:36 ` Olivier Moysan
2024-07-25 13:37 ` Rob Herring
2024-07-24 15:36 ` [PATCH v5 6/9] dt-bindings: iio: add vref " Olivier Moysan
2 siblings, 1 reply; 8+ messages in thread
From: Olivier Moysan @ 2024-07-24 15:36 UTC (permalink / raw)
To: fabrice.gasnier, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Arnaud Pouliquen
Cc: Olivier Moysan, linux-iio, devicetree, linux-kernel
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.moysan@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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v5 6/9] dt-bindings: iio: add vref support to sd modulator
2024-07-24 15:36 [PATCH v5 0/9] iio: adc: dfsdm: add scaling support Olivier Moysan
2024-07-24 15:36 ` [PATCH v5 4/9] dt-bindings: iio: dfsdm: move to backend framework Olivier Moysan
2024-07-24 15:36 ` [PATCH v5 5/9] dt-bindings: iio: add backend support to sd modulator Olivier Moysan
@ 2024-07-24 15:36 ` Olivier Moysan
2024-07-25 13:44 ` Rob Herring
2 siblings, 1 reply; 8+ messages in thread
From: Olivier Moysan @ 2024-07-24 15:36 UTC (permalink / raw)
To: fabrice.gasnier, Jonathan Cameron, Lars-Peter Clausen,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Arnaud Pouliquen
Cc: Olivier Moysan, linux-iio, devicetree, linux-kernel
Allow to specify the reference voltage used by the SD modulator.
When the SD modulator is defined as an IIO backend, the reference
voltage can be used to evaluate scaling information of the IIO device.
The reference voltage is not used otherwise.
Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
.../bindings/iio/adc/sigma-delta-modulator.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
index b245971fecb0..ff04ae08f264 100644
--- a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
@@ -31,6 +31,14 @@ anyOf:
- required: ['#io-backend-cells']
- required: ['#io-channel-cells']
+if:
+ required:
+ - '#io-backend-cells'
+then:
+ properties:
+ vref-supply:
+ description: Phandle to the vref input analog reference voltage.
+
additionalProperties: false
examples:
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v5 4/9] dt-bindings: iio: dfsdm: move to backend framework
2024-07-24 15:36 ` [PATCH v5 4/9] dt-bindings: iio: dfsdm: move to backend framework Olivier Moysan
@ 2024-07-24 16:43 ` Rob Herring (Arm)
2024-07-25 12:23 ` Rob Herring
1 sibling, 0 replies; 8+ messages in thread
From: Rob Herring (Arm) @ 2024-07-24 16:43 UTC (permalink / raw)
To: Olivier Moysan
Cc: fabrice.gasnier, Arnaud Pouliquen, Conor Dooley, linux-kernel,
Alexandre Torgue, Lars-Peter Clausen, alsa-devel,
Jonathan Cameron, linux-stm32, linux-arm-kernel, devicetree,
Maxime Coquelin, linux-iio, Krzysztof Kozlowski
On Wed, 24 Jul 2024 17:36:32 +0200, Olivier Moysan wrote:
> Change the DFSDM binding to use the new IIO backend framework,
> along with the adoption of IIO generic channels.
> This binding change allows to add scaling support to the DFSDM.
>
> Keep the legacy binding as deprecated for backward compatibility.
>
> The io-backends property is supported only in generic IIO channel
> binding.
>
> - Channel description with the generic binding (Audio and Analog):
>
> Properties superseded by generic properties:
> st,adc-channels: becomes "reg" property in channel node
> st,adc-channel-names: becomes "label" property in channel node
> Properties moved to channel child node:
> st,adc-channel-types: becomes st,adc-channel-type
> st,adc-channel-clk-src, st,adc-alt-channel
>
> - Analog binding:
>
> DFSDM filter channel is configured as an IIO backend consumer.
> Add io-backends property in channel child nodes.
>
> DFSDM is no more configured as a channel consumer from SD modulator.
> Use of io-channels in DFSDM node is deprecated.
>
> - Audio binding:
>
> DFSDM audio DAI is configured as a channel consumer from DFSDM filter.
> No change compare to legacy.
>
> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> ---
> .../bindings/iio/adc/st,stm32-dfsdm-adc.yaml | 124 +++++++++++++++---
> 1 file changed, 108 insertions(+), 16 deletions(-)
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
./Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml:421:4: [error] no new line character at the end of file (new-line-at-end-of-file)
dtschema/dtc warnings/errors:
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240724153639.803263-5-olivier.moysan@foss.st.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v5 4/9] dt-bindings: iio: dfsdm: move to backend framework
2024-07-24 15:36 ` [PATCH v5 4/9] dt-bindings: iio: dfsdm: move to backend framework Olivier Moysan
2024-07-24 16:43 ` Rob Herring (Arm)
@ 2024-07-25 12:23 ` Rob Herring
1 sibling, 0 replies; 8+ messages in thread
From: Rob Herring @ 2024-07-25 12:23 UTC (permalink / raw)
To: Olivier Moysan
Cc: fabrice.gasnier, Arnaud Pouliquen, Jonathan Cameron,
Lars-Peter Clausen, Krzysztof Kozlowski, Conor Dooley,
Maxime Coquelin, Alexandre Torgue, alsa-devel, linux-iio,
devicetree, linux-stm32, linux-arm-kernel, linux-kernel
On Wed, Jul 24, 2024 at 05:36:32PM +0200, Olivier Moysan wrote:
> Change the DFSDM binding to use the new IIO backend framework,
> along with the adoption of IIO generic channels.
> This binding change allows to add scaling support to the DFSDM.
>
> Keep the legacy binding as deprecated for backward compatibility.
>
> The io-backends property is supported only in generic IIO channel
> binding.
>
> - Channel description with the generic binding (Audio and Analog):
>
> Properties superseded by generic properties:
> st,adc-channels: becomes "reg" property in channel node
> st,adc-channel-names: becomes "label" property in channel node
> Properties moved to channel child node:
> st,adc-channel-types: becomes st,adc-channel-type
> st,adc-channel-clk-src, st,adc-alt-channel
>
> - Analog binding:
>
> DFSDM filter channel is configured as an IIO backend consumer.
> Add io-backends property in channel child nodes.
>
> DFSDM is no more configured as a channel consumer from SD modulator.
> Use of io-channels in DFSDM node is deprecated.
>
> - Audio binding:
>
> DFSDM audio DAI is configured as a channel consumer from DFSDM filter.
> No change compare to legacy.
>
> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> ---
> .../bindings/iio/adc/st,stm32-dfsdm-adc.yaml | 124 +++++++++++++++---
> 1 file changed, 108 insertions(+), 16 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml
> index 2722edab1d9a..ceadd73504a4 100644
> --- a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml
> @@ -102,9 +102,11 @@ patternProperties:
> items:
> minimum: 0
> maximum: 7
> + deprecated: true
>
> st,adc-channel-names:
> description: List of single-ended channel names.
> + deprecated: true
>
> st,filter-order:
> description: |
> @@ -118,6 +120,12 @@ patternProperties:
> "#io-channel-cells":
> const: 1
>
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> st,adc-channel-types:
> description: |
> Single-ended channel input type.
> @@ -128,6 +136,7 @@ patternProperties:
> items:
> enum: [ SPI_R, SPI_F, MANCH_R, MANCH_F ]
> $ref: /schemas/types.yaml#/definitions/non-unique-string-array
> + deprecated: true
>
> st,adc-channel-clk-src:
> description: |
> @@ -139,6 +148,7 @@ patternProperties:
> items:
> enum: [ CLKIN, CLKOUT, CLKOUT_F, CLKOUT_R ]
> $ref: /schemas/types.yaml#/definitions/non-unique-string-array
> + deprecated: true
>
> st,adc-alt-channel:
> description:
> @@ -147,6 +157,7 @@ patternProperties:
> If not set, channel n is connected to SPI input n.
> If set, channel n is connected to SPI input n + 1.
> type: boolean
> + deprecated: true
>
> st,filter0-sync:
> description:
> @@ -165,11 +176,60 @@ patternProperties:
> - compatible
> - reg
> - interrupts
> - - st,adc-channels
> - - st,adc-channel-names
> - st,filter-order
> - "#io-channel-cells"
>
> + patternProperties:
> + "^channel@([0-7])$":
Don't need ().
> + type: object
> + $ref: adc.yaml
> + unevaluatedProperties: false
> + description: Represents the external channels which are connected to the DFSDM.
> +
> + properties:
> + reg:
> + maximum: 7
> +
> + label:
> + description:
> + Unique name to identify which channel this is.
> +
> + st,adc-channel-type:
> + description: |
> + Single-ended channel input type.
> + - "SPI_R": SPI with data on rising edge (default)
> + - "SPI_F": SPI with data on falling edge
> + - "MANCH_R": manchester codec, rising edge = logic 0, falling edge = logic 1
> + - "MANCH_F": manchester codec, rising edge = logic 1, falling edge = logic 0
> + $ref: /schemas/types.yaml#/definitions/string
> + enum: [ SPI_R, SPI_F, MANCH_R, MANCH_F ]
> +
> + st,adc-channel-clk-src:
> + description: |
> + Conversion clock source.
> + - "CLKIN": external SPI clock (CLKIN x)
> + - "CLKOUT": internal SPI clock (CLKOUT) (default)
> + - "CLKOUT_F": internal SPI clock divided by 2 (falling edge).
> + - "CLKOUT_R": internal SPI clock divided by 2 (rising edge).
> + $ref: /schemas/types.yaml#/definitions/string
> + enum: [ CLKIN, CLKOUT, CLKOUT_F, CLKOUT_R ]
> +
> + st,adc-alt-channel:
> + description:
> + Must be defined if two sigma delta modulators are
> + connected on same SPI input.
> + If not set, channel n is connected to SPI input n.
> + If set, channel n is connected to SPI input n + 1.
> + type: boolean
> +
> + io-backends:
> + description:
> + Used to pipe external sigma delta modulator or internal ADC backend to DFSDM channel.
> + maxItems: 1
> +
> + required:
> + - reg
> +
> allOf:
> - if:
> properties:
> @@ -199,9 +259,19 @@ patternProperties:
> description:
> From common IIO binding. Used to pipe external sigma delta
> modulator or internal ADC output to DFSDM channel.
> + deprecated: true
>
> - required:
> - - io-channels
> + if:
> + required:
> + - st,adc-channels
> + then:
> + required:
> + - io-channels
> +
> + patternProperties:
> + "^channel@([0-7])$":
And here.
With that and the newline fixed,
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v5 5/9] dt-bindings: iio: add backend support to sd modulator
2024-07-24 15:36 ` [PATCH v5 5/9] dt-bindings: iio: add backend support to sd modulator Olivier Moysan
@ 2024-07-25 13:37 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2024-07-25 13:37 UTC (permalink / raw)
To: Olivier Moysan
Cc: fabrice.gasnier, Jonathan Cameron, Lars-Peter Clausen,
Krzysztof Kozlowski, Conor Dooley, Arnaud Pouliquen, linux-iio,
devicetree, linux-kernel
On Wed, Jul 24, 2024 at 05:36:33PM +0200, Olivier Moysan wrote:
> 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.moysan@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 {
Why the node name change? 'adc' is generic and was correct.
This should be a separate example. (Add '- |').
> compatible = "sd-modulator";
> #io-channel-cells = <0>;
> };
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v5 6/9] dt-bindings: iio: add vref support to sd modulator
2024-07-24 15:36 ` [PATCH v5 6/9] dt-bindings: iio: add vref " Olivier Moysan
@ 2024-07-25 13:44 ` Rob Herring
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2024-07-25 13:44 UTC (permalink / raw)
To: Olivier Moysan
Cc: fabrice.gasnier, Jonathan Cameron, Lars-Peter Clausen,
Krzysztof Kozlowski, Conor Dooley, Arnaud Pouliquen, linux-iio,
devicetree, linux-kernel
On Wed, Jul 24, 2024 at 05:36:34PM +0200, Olivier Moysan wrote:
> Allow to specify the reference voltage used by the SD modulator.
> When the SD modulator is defined as an IIO backend, the reference
> voltage can be used to evaluate scaling information of the IIO device.
> The reference voltage is not used otherwise.
You haven't tested that this works. Add 'vref-supply' to the example.
>
> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> ---
> .../bindings/iio/adc/sigma-delta-modulator.yaml | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
> index b245971fecb0..ff04ae08f264 100644
> --- a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
> @@ -31,6 +31,14 @@ anyOf:
> - required: ['#io-backend-cells']
> - required: ['#io-channel-cells']
>
> +if:
> + required:
> + - '#io-backend-cells'
> +then:
> + properties:
> + vref-supply:
> + description: Phandle to the vref input analog reference voltage.
> +
Do this instead:
properties:
vref-supply:
...
dependencies:
vref-supply: [ '#io-backend-cells' ]
> additionalProperties: false
>
> examples:
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-07-25 13:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-24 15:36 [PATCH v5 0/9] iio: adc: dfsdm: add scaling support Olivier Moysan
2024-07-24 15:36 ` [PATCH v5 4/9] dt-bindings: iio: dfsdm: move to backend framework Olivier Moysan
2024-07-24 16:43 ` Rob Herring (Arm)
2024-07-25 12:23 ` Rob Herring
2024-07-24 15:36 ` [PATCH v5 5/9] dt-bindings: iio: add backend support to sd modulator Olivier Moysan
2024-07-25 13:37 ` Rob Herring
2024-07-24 15:36 ` [PATCH v5 6/9] dt-bindings: iio: add vref " Olivier Moysan
2024-07-25 13:44 ` Rob Herring
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).