mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] da9053: reset FAULTLOG after read
Date: Wed, 14 Dec 2016 13:52:52 +0100	[thread overview]
Message-ID: <20161214125252.2039-1-m.grzeschik@pengutronix.de> (raw)

The driver has to reset the FAULTLOG register after every read by
writing the value back. In the current case the FALUTLOG register keep
its value over every software reset and will only reset on power-off.
This drives the reset-source value unreliable.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/mfd/da9053.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mfd/da9053.c b/drivers/mfd/da9053.c
index 0de8c66..9adab8c 100644
--- a/drivers/mfd/da9053.c
+++ b/drivers/mfd/da9053.c
@@ -240,6 +240,10 @@ static void da9053_detect_reset_source(struct da9053_priv *da9053)
 	priority = of_get_reset_source_priority(da9053->dev->device_node);
 
 	reset_source_set_priority(type, priority);
+
+	ret = da9053_reg_write(da9053, DA9053_FAULTLOG_REG, val);
+	if (ret < 0)
+		return;
 }
 
 static void __noreturn da9053_force_system_reset(struct restart_handler *rst)
-- 
2.10.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2016-12-14 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14 12:52 Michael Grzeschik [this message]
2017-01-09 10:37 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161214125252.2039-1-m.grzeschik@pengutronix.de \
    --to=m.grzeschik@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox