Skip to content

Commit 575f100

Browse files
185264646Wim Van Sebroeck
authored andcommitted
watchdog: sp805_wdt: deassert the reset if available
According to the datasheet, the core has an WDOGRESn input signal that needs to be deasserted before being operational. Implement it in the driver. Signed-off-by: Yang Xiwen <forbidden405@outlook.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20240221-hisi-wdt-v3-1-9642613dc2e6@outlook.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent 12b8ab4 commit 575f100

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/watchdog/sp805_wdt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/moduleparam.h>
2626
#include <linux/pm.h>
2727
#include <linux/property.h>
28+
#include <linux/reset.h>
2829
#include <linux/slab.h>
2930
#include <linux/spinlock.h>
3031
#include <linux/types.h>
@@ -232,6 +233,7 @@ static int
232233
sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
233234
{
234235
struct sp805_wdt *wdt;
236+
struct reset_control *rst;
235237
u64 rate = 0;
236238
int ret = 0;
237239

@@ -264,6 +266,12 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
264266
return -ENODEV;
265267
}
266268

269+
rst = devm_reset_control_get_optional_exclusive(&adev->dev, NULL);
270+
if (IS_ERR(rst))
271+
return dev_err_probe(&adev->dev, PTR_ERR(rst), "Can not get reset\n");
272+
273+
reset_control_deassert(rst);
274+
267275
wdt->adev = adev;
268276
wdt->wdd.info = &wdt_info;
269277
wdt->wdd.ops = &wdt_ops;

0 commit comments

Comments
 (0)