Skip to content

Commit eab8da8

Browse files
spectrum70gregkh
authored andcommitted
iio: dac: adi-axi-dac: modify stream enable
[ 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 <[email protected]> Signed-off-by: Angelo Dureghello <[email protected]> Link: https://patch.msgid.link/20250114-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v4-3-979402e33545@baylibre.com Signed-off-by: Jonathan Cameron <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d83ab77 commit eab8da8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/iio/dac/adi-axi-dac.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,14 @@ static int axi_dac_ddr_disable(struct iio_backend *back)
585585
static int axi_dac_data_stream_enable(struct iio_backend *back)
586586
{
587587
struct axi_dac_state *st = iio_backend_get_priv(back);
588+
int ret, val;
589+
590+
ret = regmap_read_poll_timeout(st->regmap,
591+
AXI_DAC_UI_STATUS_REG, val,
592+
FIELD_GET(AXI_DAC_UI_STATUS_IF_BUSY, val) == 0,
593+
10, 100 * KILO);
594+
if (ret)
595+
return ret;
588596

589597
return regmap_set_bits(st->regmap, AXI_DAC_CUSTOM_CTRL_REG,
590598
AXI_DAC_CUSTOM_CTRL_STREAM_ENABLE);

0 commit comments

Comments
 (0)