Skip to content

Commit

Permalink
iio: dac: adi-axi-dac: modify stream enable
Browse files Browse the repository at this point in the history
[ Upstream commit 6cc60bc ]

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: e61d717 ("iio: dac: adi-axi-dac: extend features")
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Link: https://patch.msgid.link/20250114-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v4-3-979402e33545@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Angelo Dureghello authored and Greg Kroah-Hartman committed Apr 10, 2025
1 parent 46efdf8 commit fc49b1d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/iio/dac/adi-axi-dac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fc49b1d

Please sign in to comment.