mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
watchdog: coh901327: devicetree support
This adds support for probing the COH 901 327 watchdog from the device tree and also adds associated bindings. Acked-by: Wim Van Sebroeck <wim@iguana.be> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
c023b8b295
commit
c83c199199
2 changed files with 28 additions and 3 deletions
|
@ -0,0 +1,19 @@
|
||||||
|
ST-Ericsson COH 901 327 Watchdog timer
|
||||||
|
|
||||||
|
Required properties:
|
||||||
|
- compatible: must be "stericsson,coh901327".
|
||||||
|
- reg: physical base address of the controller and length of memory mapped
|
||||||
|
region.
|
||||||
|
- interrupts: the interrupt used for the watchdog timeout warning.
|
||||||
|
|
||||||
|
Optional properties:
|
||||||
|
- timeout-sec: contains the watchdog timeout in seconds.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
watchdog: watchdog@c0012000 {
|
||||||
|
compatible = "stericsson,coh901327";
|
||||||
|
reg = <0xc0012000 0x1000>;
|
||||||
|
interrupts = <3>;
|
||||||
|
timeout-sec = <60>;
|
||||||
|
};
|
|
@ -354,9 +354,9 @@ static int __init coh901327_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
clk_disable(clk);
|
clk_disable(clk);
|
||||||
|
|
||||||
if (margin < 1 || margin > 327)
|
ret = watchdog_init_timeout(&coh901327_wdt, margin, &pdev->dev);
|
||||||
margin = 60;
|
if (ret < 0)
|
||||||
coh901327_wdt.timeout = margin;
|
coh901327_wdt.timeout = 60;
|
||||||
|
|
||||||
ret = watchdog_register_device(&coh901327_wdt);
|
ret = watchdog_register_device(&coh901327_wdt);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
|
@ -441,10 +441,16 @@ void coh901327_watchdog_reset(void)
|
||||||
/* Return and await doom */
|
/* Return and await doom */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct of_device_id coh901327_dt_match[] = {
|
||||||
|
{ .compatible = "stericsson,coh901327" },
|
||||||
|
{},
|
||||||
|
};
|
||||||
|
|
||||||
static struct platform_driver coh901327_driver = {
|
static struct platform_driver coh901327_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.name = "coh901327_wdog",
|
.name = "coh901327_wdog",
|
||||||
|
.of_match_table = coh901327_dt_match,
|
||||||
},
|
},
|
||||||
.remove = __exit_p(coh901327_remove),
|
.remove = __exit_p(coh901327_remove),
|
||||||
.suspend = coh901327_suspend,
|
.suspend = coh901327_suspend,
|
||||||
|
|
Loading…
Reference in a new issue