aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/devices-da8xx.c
diff options
context:
space:
mode:
authorKumar, Anil <anilkumar.v@ti.com>2013-02-05 23:00:04 -0500
committerSekhar Nori <nsekhar@ti.com>2013-02-09 12:08:26 -0500
commit19c7c0d81a9b1fe7342d0208b629b5e085e4f3ae (patch)
treee4cb237a865be1b94115cd8afc836009f14b5928 /arch/arm/mach-davinci/devices-da8xx.c
parent518f97dbb8d047f54c9f9f9b970fb42e1a6c8184 (diff)
ARM: davinci: da850 DT: add support for machine reboot
Update the da8xx_restart() function to support machine reboot when booting using DT. Have the function search for the watchdog platform device instead of always using "da8xx_wdt_device" which is never registered in DT case. While at it, also make da8xx_wdt_device static since there is no need for it to be globally visible. Tested machine reboot with both DT and non-DT boot on DA850 EVM. Signed-off-by: Kumar, Anil <anilkumar.v@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'arch/arm/mach-davinci/devices-da8xx.c')
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 2d5502d84a22..cc6916dc4629 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -359,7 +359,7 @@ static struct resource da8xx_watchdog_resources[] = {
359 }, 359 },
360}; 360};
361 361
362struct platform_device da8xx_wdt_device = { 362static struct platform_device da8xx_wdt_device = {
363 .name = "watchdog", 363 .name = "watchdog",
364 .id = -1, 364 .id = -1,
365 .num_resources = ARRAY_SIZE(da8xx_watchdog_resources), 365 .num_resources = ARRAY_SIZE(da8xx_watchdog_resources),
@@ -368,7 +368,15 @@ struct platform_device da8xx_wdt_device = {
368 368
369void da8xx_restart(char mode, const char *cmd) 369void da8xx_restart(char mode, const char *cmd)
370{ 370{
371 davinci_watchdog_reset(&da8xx_wdt_device); 371 struct device *dev;
372
373 dev = bus_find_device_by_name(&platform_bus_type, NULL, "watchdog");
374 if (!dev) {
375 pr_err("%s: failed to find watchdog device\n", __func__);
376 return;
377 }
378
379 davinci_watchdog_reset(to_platform_device(dev));
372} 380}
373 381
374int __init da8xx_register_watchdog(void) 382int __init da8xx_register_watchdog(void)