[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241126184307.0a675530@jic23-huawei>
Date: Tue, 26 Nov 2024 18:43:07 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Guillaume Stols <gstols@...libre.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>, Michael Hennerich
<Michael.Hennerich@...log.com>, Nuno Sa <nuno.sa@...log.com>, Rob Herring
<robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Jonathan Cameron <Jonathan.Cameron@...wei.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, dlechner@...libre.com, jstephan@...libre.com,
aardelean@...libre.com, adureghello@...libre.com
Subject: Re: [PATCH 6/9] iio: adc: adi-axi-adc: Add support for AD7606
register writing
On Thu, 21 Nov 2024 10:18:28 +0000
Guillaume Stols <gstols@...libre.com> wrote:
> Since we must access the bus parallel bus using a custom procedure,
> let's add a specialized compatible, and define specialized callbacks for
> writing the registers using the parallel interface.
>
> Signed-off-by: Guillaume Stols <gstols@...libre.com>
Trivial comments inline.
Thanks,
J
> +
> +static int ad7606_bi_reg_write(struct iio_backend *back, u32 reg, u32 val)
> +{
> + struct adi_axi_adc_state *st = iio_backend_get_priv(back);
> + u32 buf;
> +
> + guard(mutex)(&st->lock);
> +
> + /* Read any register to switch to register mode */
> + buf = 0xaf00;
> + axi_adc_raw_write(back, &buf, 4);
sizeof(buf) for these.
> static void axi_adc_free_buffer(struct iio_backend *back,
> struct iio_buffer *buffer)
> {
> @@ -487,9 +573,22 @@ static const struct axi_adc_info adc_generic = {
> .backend_info = &adi_axi_adc_generic,
> };
>
> +static const struct ad7606_platform_data ad7606_pdata = {
> + .bus_reg_read = ad7606_bi_reg_read,
> + .bus_reg_write = ad7606_bi_reg_write,
One less tab on indent.
> +};
Powered by blists - more mailing lists