From d45f5c215223fbd37ddfe42f7a7a3e7c5a5872c0 Mon Sep 17 00:00:00 2001 From: hhb Date: Mon, 27 Aug 2012 17:54:52 +0800 Subject: [PATCH] watch dog timer: add wdt platform to rk30 device.c --- arch/arm/mach-rk30/devices.c | 32 +++++++++++++++++++++++++++++++- drivers/watchdog/Kconfig | 1 - 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rk30/devices.c b/arch/arm/mach-rk30/devices.c index 8d0315a70510..fddd9a09ea4f 100755 --- a/arch/arm/mach-rk30/devices.c +++ b/arch/arm/mach-rk30/devices.c @@ -1304,6 +1304,34 @@ static struct platform_device device_vmac = { }; #endif +/* + * rk29 wdt device ADDED BY HHB@ROCK-CHIPS.COM + */ + +#ifdef CONFIG_RK29_WATCHDOG + +static struct resource resources_wdt[] = { + { + .start = IRQ_WDT, + .end = IRQ_WDT, + .flags = IORESOURCE_IRQ, + }, + { + .start = RK30_WDT_PHYS, + .end = RK30_WDT_PHYS + RK30_WDT_SIZE - 1, + .flags = IORESOURCE_MEM, + }, +}; + +struct platform_device rk29_device_wdt = { + .name = "rk29-wdt", + .id = 0, + .num_resources = ARRAY_SIZE(resources_wdt), + .resource = resources_wdt, +}; + +#endif + static int __init rk30_init_devices(void) { rk30_init_dma(); @@ -1349,7 +1377,9 @@ static int __init rk30_init_devices(void) #ifdef CONFIG_RK29_VMAC platform_device_register(&device_vmac); #endif - +#ifdef CONFIG_RK29_WATCHDOG + platform_device_register(&rk29_device_wdt); +#endif return 0; } arch_initcall(rk30_init_devices); diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 2b3e49609d70..8e1f9f8fbbae 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -75,7 +75,6 @@ config WM8350_WATCHDOG config RK29_WATCHDOG tristate "RK29 watchdog" - depends on ARCH_RK29 help Watchdog timer embedded into RK29xx chips. This will reboot your system when the timeout is reached. -- 2.34.1