[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240618160836.945242-1-olivier.moysan@foss.st.com>
Date: Tue, 18 Jun 2024 18:08:26 +0200
From: Olivier Moysan <olivier.moysan@...s.st.com>
To: Jonathan Cameron <jic23@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Olivier Moysan
<olivier.moysan@...s.st.com>,
Arnaud Pouliquen
<arnaud.pouliquen@...s.st.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Nuno Sa
<nuno.sa@...log.com>, Liam Girdwood <lgirdwood@...il.com>,
Mark Brown
<broonie@...nel.org>,
Fabrice Gasnier <fabrice.gasnier@...s.st.com>
CC: <linux-iio@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <alsa-devel@...a-project.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>
Subject: [PATCH 0/8] iio: adc: dfsdm: add scaling support
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
(which may need further refinement):
- read_raw:
This API is intented to retrieve the voltage information from the
backend. It is based on IIO read_raw API, but maybe we need
a more specialized API here.
- iio_backend_disable / iio_backend_enable:
backend enable/disable to be used for PM management
- devm_iio_backend_subnode_get
Intended for parsing DT subnodes to allow generic channel binding
support, as generic channel DT nodes are not populated as devices.
Ideally, a single API would be better, but I could not
identify a suitable alternative that doesn't affect the existing API
(devm_iio_backend_get).
[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
Olivier Moysan (8):
iio: add read raw service 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 sigma delta modulator backend
iio: adc: stm32-dfsdm: adopt generic channels bindings
iio: add sd modulator generic iio backend
iio: adc: stm32-dfsdm: add scaling support to dfsdm
.../iio/adc/sd-modulator-backend.yaml | 43 +++
.../bindings/iio/adc/st,stm32-dfsdm-adc.yaml | 158 ++++++++-
drivers/iio/adc/Kconfig | 11 +
drivers/iio/adc/Makefile | 1 +
drivers/iio/adc/sd_adc_backend.c | 110 +++++++
drivers/iio/adc/stm32-dfsdm-adc.c | 302 +++++++++++++++---
drivers/iio/industrialio-backend.c | 90 +++++-
include/linux/iio/backend.h | 7 +
8 files changed, 664 insertions(+), 58 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/adc/sd-modulator-backend.yaml
create mode 100644 drivers/iio/adc/sd_adc_backend.c
base-commit: 7db8a847f98caae68c70bdab9ba92d1af38e5656
--
2.25.1
Powered by blists - more mailing lists