mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] da9053: reset FAULTLOG after read
@ 2016-12-14 12:52 Michael Grzeschik
  2017-01-09 10:37 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Grzeschik @ 2016-12-14 12:52 UTC (permalink / raw)
  To: barebox

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

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

* Re: [PATCH] da9053: reset FAULTLOG after read
  2016-12-14 12:52 [PATCH] da9053: reset FAULTLOG after read Michael Grzeschik
@ 2017-01-09 10:37 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2017-01-09 10:37 UTC (permalink / raw)
  To: Michael Grzeschik; +Cc: barebox

On Wed, Dec 14, 2016 at 01:52:52PM +0100, Michael Grzeschik wrote:
> 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(+)

Applied, thanks

Sascha

> 
> 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
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

end of thread, other threads:[~2017-01-09 10:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-14 12:52 [PATCH] da9053: reset FAULTLOG after read Michael Grzeschik
2017-01-09 10:37 ` Sascha Hauer

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