* [PATCH] iio: adc: stm32-dfsdm: fix st,adc-alt-channel property handling
@ 2025-10-02 11:22 Olivier Moysan
2025-10-03 6:15 ` Nuno Sá
0 siblings, 1 reply; 3+ messages in thread
From: Olivier Moysan @ 2025-10-02 11:22 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Maxime Coquelin, Alexandre Torgue, Olivier Moysan
Cc: Jonathan Cameron, linux-iio, linux-stm32, linux-arm-kernel,
linux-kernel
Initially st,adc-alt-channel property was defined as an enum in the DFSDM
binding. The DFSDM binding has been changed to use the new IIO backend
framework, along with the adoption of IIO generic channels.
In this new binding st,adc-alt-channel is defined as a boolean property,
but it is still handled has an enum in DFSDM driver.
Fix st,adc-alt-channel property handling in DFSDM driver.
Fixes: 3208fa0cd919 ("iio: adc: stm32-dfsdm: adopt generic channels bindings")
Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
drivers/iio/adc/stm32-dfsdm-adc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
index 74b1b4dc6e81..9664b9bd75d4 100644
--- a/drivers/iio/adc/stm32-dfsdm-adc.c
+++ b/drivers/iio/adc/stm32-dfsdm-adc.c
@@ -725,9 +725,8 @@ static int stm32_dfsdm_generic_channel_parse_of(struct stm32_dfsdm *dfsdm,
}
df_ch->src = val;
- ret = fwnode_property_read_u32(node, "st,adc-alt-channel", &df_ch->alt_si);
- if (ret != -EINVAL)
- df_ch->alt_si = 0;
+ if (fwnode_property_present(node, "st,adc-alt-channel"))
+ df_ch->alt_si = 1;
if (adc->dev_data->type == DFSDM_IIO) {
backend = devm_iio_backend_fwnode_get(&indio_dev->dev, NULL, node);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] iio: adc: stm32-dfsdm: fix st,adc-alt-channel property handling
2025-10-02 11:22 [PATCH] iio: adc: stm32-dfsdm: fix st,adc-alt-channel property handling Olivier Moysan
@ 2025-10-03 6:15 ` Nuno Sá
2025-10-04 13:25 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Nuno Sá @ 2025-10-03 6:15 UTC (permalink / raw)
To: Olivier Moysan, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Maxime Coquelin, Alexandre Torgue
Cc: Jonathan Cameron, linux-iio, linux-stm32, linux-arm-kernel,
linux-kernel
On Thu, 2025-10-02 at 13:22 +0200, Olivier Moysan wrote:
> Initially st,adc-alt-channel property was defined as an enum in the DFSDM
> binding. The DFSDM binding has been changed to use the new IIO backend
> framework, along with the adoption of IIO generic channels.
> In this new binding st,adc-alt-channel is defined as a boolean property,
> but it is still handled has an enum in DFSDM driver.
> Fix st,adc-alt-channel property handling in DFSDM driver.
>
> Fixes: 3208fa0cd919 ("iio: adc: stm32-dfsdm: adopt generic channels bindings")
> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> ---
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> drivers/iio/adc/stm32-dfsdm-adc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
> index 74b1b4dc6e81..9664b9bd75d4 100644
> --- a/drivers/iio/adc/stm32-dfsdm-adc.c
> +++ b/drivers/iio/adc/stm32-dfsdm-adc.c
> @@ -725,9 +725,8 @@ static int stm32_dfsdm_generic_channel_parse_of(struct
> stm32_dfsdm *dfsdm,
> }
> df_ch->src = val;
>
> - ret = fwnode_property_read_u32(node, "st,adc-alt-channel", &df_ch-
> >alt_si);
> - if (ret != -EINVAL)
> - df_ch->alt_si = 0;
> + if (fwnode_property_present(node, "st,adc-alt-channel"))
> + df_ch->alt_si = 1;
>
> if (adc->dev_data->type == DFSDM_IIO) {
> backend = devm_iio_backend_fwnode_get(&indio_dev->dev, NULL,
> node);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iio: adc: stm32-dfsdm: fix st,adc-alt-channel property handling
2025-10-03 6:15 ` Nuno Sá
@ 2025-10-04 13:25 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2025-10-04 13:25 UTC (permalink / raw)
To: Nuno Sá
Cc: Olivier Moysan, David Lechner, Nuno Sá, Andy Shevchenko,
Maxime Coquelin, Alexandre Torgue, Jonathan Cameron, linux-iio,
linux-stm32, linux-arm-kernel, linux-kernel
On Fri, 03 Oct 2025 07:15:56 +0100
Nuno Sá <noname.nuno@gmail.com> wrote:
> On Thu, 2025-10-02 at 13:22 +0200, Olivier Moysan wrote:
> > Initially st,adc-alt-channel property was defined as an enum in the DFSDM
> > binding. The DFSDM binding has been changed to use the new IIO backend
> > framework, along with the adoption of IIO generic channels.
> > In this new binding st,adc-alt-channel is defined as a boolean property,
> > but it is still handled has an enum in DFSDM driver.
> > Fix st,adc-alt-channel property handling in DFSDM driver.
> >
> > Fixes: 3208fa0cd919 ("iio: adc: stm32-dfsdm: adopt generic channels bindings")
> > Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
> > ---
>
> Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Applied to my temporary fixes branch that I'll rebase on rc1 once available.
Also marked for stable.
thanks,
Jonathan
>
> > drivers/iio/adc/stm32-dfsdm-adc.c | 5 ++---
> > 1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
> > index 74b1b4dc6e81..9664b9bd75d4 100644
> > --- a/drivers/iio/adc/stm32-dfsdm-adc.c
> > +++ b/drivers/iio/adc/stm32-dfsdm-adc.c
> > @@ -725,9 +725,8 @@ static int stm32_dfsdm_generic_channel_parse_of(struct
> > stm32_dfsdm *dfsdm,
> > }
> > df_ch->src = val;
> >
> > - ret = fwnode_property_read_u32(node, "st,adc-alt-channel", &df_ch-
> > >alt_si);
> > - if (ret != -EINVAL)
> > - df_ch->alt_si = 0;
> > + if (fwnode_property_present(node, "st,adc-alt-channel"))
> > + df_ch->alt_si = 1;
> >
> > if (adc->dev_data->type == DFSDM_IIO) {
> > backend = devm_iio_backend_fwnode_get(&indio_dev->dev, NULL,
> > node);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-04 13:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02 11:22 [PATCH] iio: adc: stm32-dfsdm: fix st,adc-alt-channel property handling Olivier Moysan
2025-10-03 6:15 ` Nuno Sá
2025-10-04 13:25 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox