[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aKxpxVJTRO90Tz-W@smile.fi.intel.com>
Date: Mon, 25 Aug 2025 16:48:53 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Ioana Risteiu <Ioana.Risteiu@...log.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Ramona Nechita <ramona.nechita@...log.com>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 4/4] iio: adc: update ad7779 to use IIO backend
On Mon, Aug 25, 2025 at 01:51:19PM +0300, Ioana Risteiu wrote:
> Add a new functionality to ad7779 driver that streams data through data
> output interface using IIO backend interface.
...
> +static int ad7779_set_data_lines(struct iio_dev *indio_dev, u32 num_lanes)
> +{
> + struct ad7779_state *st = iio_priv(indio_dev);
> + int ret;
> +
> + if (num_lanes != AD7779_1LINE &&
> + num_lanes != AD7779_2LINES &&
> + num_lanes != AD7779_4LINES)
Wrong indentation.
> + return -EINVAL;
> +
> + ret = ad7779_set_sampling_frequency(st, num_lanes * AD7779_DEFAULT_SAMPLING_1LINE);
> + if (ret)
> + return ret;
> +
> + ret = iio_backend_num_lanes_set(st->back, num_lanes);
> + if (ret)
> + return ret;
> +
> + return ad7779_spi_write_mask(st, AD7779_REG_DOUT_FORMAT,
> + AD7779_DOUT_FORMAT_MSK,
> + FIELD_PREP(AD7779_DOUT_FORMAT_MSK, 2 - ilog2(num_lanes)));
> +}
...
> +static int ad7779_setup_channels(struct iio_dev *indio_dev, const struct ad7779_state *st)
> +{
> + struct iio_chan_spec *channels;
> + struct device *dev = &st->spi->dev;
> +
> + channels = devm_kmemdup_array(dev, st->chip_info->channels,
> + ARRAY_SIZE(ad7779_channels),
> + sizeof(*channels), GFP_KERNEL);
> + if (!channels)
> + return -ENOMEM;
> +
> + for (unsigned int i = 0; i < ARRAY_SIZE(ad7779_channels); i++)
> + channels[i].scan_type.endianness = IIO_CPU;
> +
> + indio_dev->channels = channels;
So, here I expect to see num_channels assignment as well as near to any other
channels assignment.
> +
> + return 0;
> +}
Otherwise LGTM.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...el.com>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists