summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelo Dureghello <adureghello@baylibre.com>2025-01-08 20:29:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-17 13:36:45 +0300
commitb9bff6b8b722f430a45d165d252ffd995ed489af (patch)
tree039d733e46916b9767eefe50bcfe5e88cb6dfbac
parent90d401c36d0259757850c0e6267a5d664e985708 (diff)
downloadlinux-b9bff6b8b722f430a45d165d252ffd995ed489af.tar.xz
iio: dac: ad3552r-hs: clear reset status flag
commit 012b8276f08a67b9f2e2fd0f35363ae4a75e5267 upstream. Clear reset status flag, to keep error status register clean after reset (ad3552r manual, rev B table 38). Reset error flag was left to 1, so debugging registers, the "Error Status Register" was dirty (0x01). It is important to clear this bit, so if there is any reset event over normal working mode, it is possible to detect it. Fixes: 0b4d9fe58be8 ("iio: dac: ad3552r: add high-speed platform driver") Signed-off-by: Angelo Dureghello <adureghello@baylibre.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250108-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v2-2-2dac02f04638@baylibre.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/iio/dac/ad3552r-hs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iio/dac/ad3552r-hs.c b/drivers/iio/dac/ad3552r-hs.c
index 216c634f3eaf..8974df625670 100644
--- a/drivers/iio/dac/ad3552r-hs.c
+++ b/drivers/iio/dac/ad3552r-hs.c
@@ -329,6 +329,12 @@ static int ad3552r_hs_setup(struct ad3552r_hs_state *st)
dev_info(st->dev, "Chip ID error. Expected 0x%x, Read 0x%x\n",
AD3552R_ID, id);
+ /* Clear reset error flag, see ad3552r manual, rev B table 38. */
+ ret = st->data->bus_reg_write(st->back, AD3552R_REG_ADDR_ERR_STATUS,
+ AD3552R_MASK_RESET_STATUS, 1);
+ if (ret)
+ return ret;
+
ret = st->data->bus_reg_write(st->back,
AD3552R_REG_ADDR_SH_REFERENCE_CONFIG,
0, 1);