public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Olivier Moysan <olivier.moysan@foss.st.com>
Cc: <fabrice.gasnier@foss.st.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	<linux-iio@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6 7/9] iio: adc: stm32-dfsdm: adopt generic channels bindings
Date: Sat, 3 Aug 2024 16:12:22 +0100	[thread overview]
Message-ID: <20240803161222.1f320fcc@jic23-huawei> (raw)
In-Reply-To: <20240730084640.1307938-8-olivier.moysan@foss.st.com>

On Tue, 30 Jul 2024 10:46:37 +0200
Olivier Moysan <olivier.moysan@foss.st.com> wrote:

> Move to generic channels binding to ease new backend framework adoption
> and prepare the convergence with MDF IP support on STM32MP2 SoC family.
> 
> Legacy binding:
> DFSDM is an IIO channel consumer.
> SD modulator is an IIO channels provider.
> The channel phandles are provided in DT through io-channels property
> and channel indexes through st,adc-channels property.
> 
> New binding:
> DFSDM is an IIO channel provider.
> The channel indexes are given by reg property in channel child node.
> 
> This new binding is intended to be used with SD modulator IIO backends.
> It does not support SD modulator legacy IIO devices.
> The st,adc-channels property presence is used to discriminate
> between legacy and backend bindings.
> 
> The support of the DFSDM legacy channels and SD modulator IIO devices
> is kept for backward compatibility.
> 
> Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>

One trivial thing noted inline.  If you spin a v7 for other reasons
tidy it up, if not I 'might' (if I remember and can be bothered)
tweak it whilst applying, but probably not.

Jonathan

>  
> +static int stm32_dfsdm_chan_init(struct iio_dev *indio_dev, struct iio_chan_spec *channels)
> +{
> +	int num_ch = indio_dev->num_channels;
> +	int chan_idx = 0;
> +	int ret;
> +
> +	for (chan_idx = 0; chan_idx < num_ch; chan_idx++) {
> +		channels[chan_idx].scan_index = chan_idx;
> +		ret = stm32_dfsdm_adc_chan_init_one(indio_dev, &channels[chan_idx], NULL);
> +		if (ret < 0)
> +			return dev_err_probe(&indio_dev->dev, ret, "Channels init failed\n");
> +	}
> +
> +	return 0;
> +}
> +
> +static int stm32_dfsdm_generic_chan_init(struct iio_dev *indio_dev, struct iio_chan_spec *channels)
> +{
> +	int chan_idx = 0, ret;

As in the above function, I'd have slightly preferred these on separate lines.
If that's all that comes up, I might tweak it whilst applying.

> +
> +	device_for_each_child_node_scoped(&indio_dev->dev, child) {
> +		/* Skip DAI node in DFSDM audio nodes */
> +		if (fwnode_property_present(child, "compatible"))
> +			continue;
> +
> +		channels[chan_idx].scan_index = chan_idx;
> +		ret = stm32_dfsdm_adc_chan_init_one(indio_dev, &channels[chan_idx], child);
> +		if (ret < 0)
> +			return dev_err_probe(&indio_dev->dev, ret, "Channels init failed\n");
> +
> +		chan_idx++;
> +	}
> +
> +	return chan_idx;
> +}
> +


  reply	other threads:[~2024-08-03 15:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30  8:46 [PATCH v6 0/9] iio: adc: dfsdm: add scaling support Olivier Moysan
2024-07-30  8:46 ` [PATCH v6 4/9] dt-bindings: iio: dfsdm: move to backend framework Olivier Moysan
2024-07-30  8:46 ` [PATCH v6 7/9] iio: adc: stm32-dfsdm: adopt generic channels bindings Olivier Moysan
2024-08-03 15:12   ` Jonathan Cameron [this message]
2024-07-30  8:46 ` [PATCH v6 9/9] iio: adc: stm32-dfsdm: add scaling support to dfsdm Olivier Moysan
2024-08-03 15:13 ` [PATCH v6 0/9] iio: adc: dfsdm: add scaling support Jonathan Cameron
2024-08-06 16:39   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240803161222.1f320fcc@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=olivier.moysan@foss.st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox