[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e8d440af44842507b100fb6c66b7c456175c517b.camel@gmail.com>
Date: Mon, 13 Jan 2025 16:00:37 +0000
From: Nuno Sá <noname.nuno@...il.com>
To: Angelo Dureghello <adureghello@...libre.com>, Lars-Peter Clausen
<lars@...afoo.de>, Michael Hennerich <Michael.Hennerich@...log.com>,
Jonathan Cameron
<jic23@...nel.org>, David Lechner <dlechner@...libre.com>, Nuno Sa
<nuno.sa@...log.com>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/9] iio: dac: adi-axi-dac: modify stream enable
On Fri, 2025-01-10 at 11:24 +0100, Angelo Dureghello wrote:
> From: Angelo Dureghello <adureghello@...libre.com>
>
> Change suggested from the AXI HDL team, modify the function
> axi_dac_data_stream_enable() to check for interface busy, to avoid
> possible issues when starting the stream.
>
> Fixes: e61d7178429a ("iio: dac: adi-axi-dac: extend features")
> Signed-off-by: Angelo Dureghello <adureghello@...libre.com>
> ---
LGTM... One minor thing that come to mind is that if it wouldn't be more
intuitive to return -EBUSY in case of a timeout? Anyways:
Reviewed-by: Nuno Sa <nuno.sa@...log.com>
> drivers/iio/dac/adi-axi-dac.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/iio/dac/adi-axi-dac.c b/drivers/iio/dac/adi-axi-dac.c
> index b143f7ed6847..ac871deb8063 100644
> --- a/drivers/iio/dac/adi-axi-dac.c
> +++ b/drivers/iio/dac/adi-axi-dac.c
> @@ -585,6 +585,14 @@ static int axi_dac_ddr_disable(struct iio_backend *back)
> static int axi_dac_data_stream_enable(struct iio_backend *back)
> {
> struct axi_dac_state *st = iio_backend_get_priv(back);
> + int ret, val;
> +
> + ret = regmap_read_poll_timeout(st->regmap,
> + AXI_DAC_UI_STATUS_REG, val,
> + FIELD_GET(AXI_DAC_UI_STATUS_IF_BUSY, val) ==
> 0,
> + 10, 100 * KILO);
> + if (ret)
> + return ret;
>
> return regmap_set_bits(st->regmap, AXI_DAC_CUSTOM_CTRL_REG,
> AXI_DAC_CUSTOM_CTRL_STREAM_ENABLE);
>
Powered by blists - more mailing lists