lkml.org 
[lkml]   [2021]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH] watchdog: da9062: Correct the timeout values
From
Date
On 12/3/21 8:35 AM, Christoph Niedermaier wrote:
> I measured the timeout values of my DA9061 chip. According to the
> information in the data sheet the formula should be:
>
> timeout = 2.048 * 2^(regval - 1)
>
> But my measured values differ from that.
> Accoring to my measured values the formula must be:
>
> timeout = 3.2 * 2^(regval - 1)
>
> Is there something wrong with my chip, or has anyone else noticed this as well?

The driver assumes a static and well defined clock rate. Maybe that rate
is different in your system (if that is possible) ?

Guenter

>
> Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
> Cc: Support Opensource <support.opensource@diasemi.com>
> Cc: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
> Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Andrej Picej <andrej.picej@norik.com>
> Cc: linux-watchdog@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> To: linux-arm-kernel@lists.infradead.org
> ---
> drivers/watchdog/da9062_wdt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c
> index f02cbd530538..d2576aba9ca5 100644
> --- a/drivers/watchdog/da9062_wdt.c
> +++ b/drivers/watchdog/da9062_wdt.c
> @@ -20,7 +20,8 @@
> #include <linux/regmap.h>
> #include <linux/of.h>
>
> -static const unsigned int wdt_timeout[] = { 0, 2, 4, 8, 16, 32, 65, 131 };
> +static const unsigned int wdt_timeout[] = { 0, 3, 6, 12, 25, 51, 102, 204 };
> +
> #define DA9062_TWDSCALE_DISABLE 0
> #define DA9062_TWDSCALE_MIN 1
> #define DA9062_TWDSCALE_MAX (ARRAY_SIZE(wdt_timeout) - 1)
>

\
 
 \ /
  Last update: 2021-12-03 17:52    [W:0.061 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site