From: Jonathan Cameron <jic23@kernel.org>
To: Ioana Risteiu <Ioana.Risteiu@analog.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Ramona Nechita" <ramona.nechita@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 4/4] iio: adc: update ad7779 to use IIO backend
Date: Mon, 25 Aug 2025 15:47:23 +0100 [thread overview]
Message-ID: <20250825154723.2ba512d0@jic23-huawei> (raw)
In-Reply-To: <20250825105121.19848-5-Ioana.Risteiu@analog.com>
On Mon, 25 Aug 2025 13:51:19 +0300
Ioana Risteiu <Ioana.Risteiu@analog.com> wrote:
> Add a new functionality to ad7779 driver that streams data through data
> output interface using IIO backend interface.
>
> Signed-off-by: Ioana Risteiu <Ioana.Risteiu@analog.com>
> ---
> changes in v5:
> - fix indentation
> - change num_lanes variable from int to u32 type
> - use unsigned int in for loop declaration
> drivers/iio/adc/ad7779.c | 115 ++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 114 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ad7779.c b/drivers/iio/adc/ad7779.c
> index b4e56983201c..3776af1c65e9 100644
> --- a/drivers/iio/adc/ad7779.c
> +++ b/drivers/iio/adc/ad7779.c
> @@ -25,6 +25,7 @@
> #include <linux/units.h>
>
> #include <linux/iio/iio.h>
> +#include <linux/iio/backend.h>
> #include <linux/iio/buffer.h>
> #include <linux/iio/sysfs.h>
> #include <linux/iio/trigger.h>
> @@ -116,6 +117,12 @@
> #define AD7779_CRC8_POLY 0x07
> DECLARE_CRC8_TABLE(ad7779_crc8_table);
>
> +enum ad7779_data_lines {
> + AD7779_1LINE = 1,
> + AD7779_2LINES = 2,
> + AD7779_4LINES = 4,
Probably crossed with the review I did earlier.
This enum doesn't add anything that I can see over just using the value inline.
If anything it hurts readability.
> +};
> +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)
> + return -EINVAL;
if (num_lanes != 4 && num_lanes != 2 && num_lanes != 1)
is much clearer to my eyes without the macros.
prev parent reply other threads:[~2025-08-25 14:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 10:51 [PATCH v5 0/4] Add IIO backend support for AD7779 Ioana Risteiu
2025-08-25 10:51 ` [PATCH v5 1/4] iio: adc: adi-axi-adc: add axi_adc_num_lanes_set Ioana Risteiu
2025-08-25 13:42 ` Andy Shevchenko
2025-08-25 10:51 ` [PATCH v5 2/4] dt-bindings: iio: adc: add IIO backend support Ioana Risteiu
2025-08-25 10:51 ` [PATCH v5 3/4] iio: adc: extract setup function without backend Ioana Risteiu
2025-08-25 13:45 ` Andy Shevchenko
2025-08-25 10:51 ` [PATCH v5 4/4] iio: adc: update ad7779 to use IIO backend Ioana Risteiu
2025-08-25 13:48 ` Andy Shevchenko
2025-08-25 14:47 ` Jonathan Cameron [this message]
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=20250825154723.2ba512d0@jic23-huawei \
--to=jic23@kernel.org \
--cc=Ioana.Risteiu@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=ramona.nechita@analog.com \
--cc=robh@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).