Re: [PATCH 6/9] iio: adc: adi-axi-adc: Add support for AD7606 register writing
From: Jonathan Cameron
Date: Tue Nov 26 2024 - 13:59:53 EST
On Thu, 21 Nov 2024 10:18:28 +0000
Guillaume Stols <gstols@xxxxxxxxxxxx> 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@xxxxxxxxxxxx>
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.
> +};