Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v2] iio: dac: ad3552r: clear reset status flag
@ 2025-01-25 16:24 Angelo Dureghello
  2025-02-01 11:20 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Angelo Dureghello @ 2025-01-25 16:24 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Nuno Sá,
	Jonathan Cameron, Mihail Chindris
  Cc: Jonathan Cameron, linux-iio, linux-kernel, Angelo Dureghello

From: Angelo Dureghello <adureghello@baylibre.com>

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: 8f2b54824b28 ("drivers:iio:dac: Add AD3552R driver support")
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
---
 drivers/iio/dac/ad3552r.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
index 9d28e06b80c0..a44b163f3183 100644
--- a/drivers/iio/dac/ad3552r.c
+++ b/drivers/iio/dac/ad3552r.c
@@ -410,6 +410,12 @@ static int ad3552r_reset(struct ad3552r_desc *dac)
 		return ret;
 	}
 
+	/* Clear reset error flag, see ad3552r manual, rev B table 38. */
+	ret = ad3552r_write_reg(dac, AD3552R_REG_ADDR_ERR_STATUS,
+				AD3552R_MASK_RESET_STATUS);
+	if (ret)
+		return ret;
+
 	return ad3552r_update_reg_field(dac,
 					AD3552R_REG_ADDR_INTERFACE_CONFIG_A,
 					AD3552R_MASK_ADDR_ASCENSION,

---
base-commit: 0e5dc6cf754b65ee7f945a100ee2984a1c591239
change-id: 20250125-wip-bl-ad3552r-clear-reset-12aba63a08e9

Best regards,
-- 
Angelo Dureghello <adureghello@baylibre.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] iio: dac: ad3552r: clear reset status flag
  2025-01-25 16:24 [PATCH v2] iio: dac: ad3552r: clear reset status flag Angelo Dureghello
@ 2025-02-01 11:20 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2025-02-01 11:20 UTC (permalink / raw)
  To: Angelo Dureghello
  Cc: Lars-Peter Clausen, Michael Hennerich, Nuno Sá,
	Mihail Chindris, Jonathan Cameron, linux-iio, linux-kernel

On Sat, 25 Jan 2025 17:24:32 +0100
Angelo Dureghello <adureghello@baylibre.com> wrote:

> From: Angelo Dureghello <adureghello@baylibre.com>
> 
> 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: 8f2b54824b28 ("drivers:iio:dac: Add AD3552R driver support")
> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Applied to the fixes-togreg branch of iio.git and marked for stable
inclusion.

Thanks,

Jonathan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-01 11:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-25 16:24 [PATCH v2] iio: dac: ad3552r: clear reset status flag Angelo Dureghello
2025-02-01 11:20 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox