MIPS: ath79: add common watchdog device
authorGabor Juhos <juhosg@openwrt.org>
Tue, 4 Jan 2011 20:28:20 +0000 (21:28 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 18 Jan 2011 18:30:26 +0000 (19:30 +0100)
All supported SoCs have a built-in hardware watchdog driver. This patch
registers a platform_device for that to make it usable.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
Cc: Cliff Holden <Cliff.Holden@Atheros.com>
Cc: Kathy Giori <Kathy.Giori@Atheros.com>
Patchwork: https://patchwork.linux-mips.org/patch/1955/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/ath79/dev-common.c
arch/mips/ath79/dev-common.h
arch/mips/ath79/setup.c

index 3cfa10065d68133aa5d8c3430208c649573ea790..3b82e325bebfbe552e07cedb1b30a66ba6eb90be 100644 (file)
@@ -65,3 +65,13 @@ void __init ath79_register_uart(void)
        ath79_uart_data[0].uartclk = clk_get_rate(clk);
        platform_device_register(&ath79_uart_device);
 }
+
+static struct platform_device ath79_wdt_device = {
+       .name           = "ath79-wdt",
+       .id             = -1,
+};
+
+void __init ath79_register_wdt(void)
+{
+       platform_device_register(&ath79_wdt_device);
+}
index 248622cc7cd630bc53916fdf1f6071ec6993bd89..0f514e1affcec4f290fca1f91711d56c209e8474 100644 (file)
@@ -13,5 +13,6 @@
 #define _ATH79_DEV_COMMON_H
 
 void ath79_register_uart(void);
+void ath79_register_wdt(void);
 
 #endif /* _ATH79_DEV_COMMON_H */
index 5e574029870902b350071498ced4664f864837a2..159b42f106b098185b908eae7efc85b245f8bb52 100644 (file)
@@ -186,6 +186,7 @@ static int __init ath79_setup(void)
 {
        ath79_gpio_init();
        ath79_register_uart();
+       ath79_register_wdt();
 
        mips_machine_setup();