Commit deb8d50e authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Wim Van Sebroeck

watchdog: imgpdc: Fix max timeout

Maximum timeout is currently set in clock cycles, but the watchdog
core expects it to be in seconds. Fix it.
Signed-off-by: default avatarEzequiel Garcia <ezequiel.garcia@imgtec.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent c631f200
...@@ -152,6 +152,7 @@ static int pdc_wdt_restart(struct notifier_block *this, unsigned long mode, ...@@ -152,6 +152,7 @@ static int pdc_wdt_restart(struct notifier_block *this, unsigned long mode,
static int pdc_wdt_probe(struct platform_device *pdev) static int pdc_wdt_probe(struct platform_device *pdev)
{ {
u64 div;
int ret, val; int ret, val;
unsigned long clk_rate; unsigned long clk_rate;
struct resource *res; struct resource *res;
...@@ -211,7 +212,10 @@ static int pdc_wdt_probe(struct platform_device *pdev) ...@@ -211,7 +212,10 @@ static int pdc_wdt_probe(struct platform_device *pdev)
pdc_wdt->wdt_dev.info = &pdc_wdt_info; pdc_wdt->wdt_dev.info = &pdc_wdt_info;
pdc_wdt->wdt_dev.ops = &pdc_wdt_ops; pdc_wdt->wdt_dev.ops = &pdc_wdt_ops;
pdc_wdt->wdt_dev.max_timeout = 1 << PDC_WDT_CONFIG_DELAY_MASK;
div = 1ULL << (PDC_WDT_CONFIG_DELAY_MASK + 1);
do_div(div, clk_rate);
pdc_wdt->wdt_dev.max_timeout = div;
pdc_wdt->wdt_dev.timeout = PDC_WDT_DEF_TIMEOUT; pdc_wdt->wdt_dev.timeout = PDC_WDT_DEF_TIMEOUT;
pdc_wdt->wdt_dev.parent = &pdev->dev; pdc_wdt->wdt_dev.parent = &pdev->dev;
watchdog_set_drvdata(&pdc_wdt->wdt_dev, pdc_wdt); watchdog_set_drvdata(&pdc_wdt->wdt_dev, pdc_wdt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment