MIPS: ath79: add common watchdog device

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>

authored by Gabor Juhos and committed by Ralf Baechle 858f763c d8fec1fc

+12
+10
arch/mips/ath79/dev-common.c
··· 65 ath79_uart_data[0].uartclk = clk_get_rate(clk); 66 platform_device_register(&ath79_uart_device); 67 }
··· 65 ath79_uart_data[0].uartclk = clk_get_rate(clk); 66 platform_device_register(&ath79_uart_device); 67 } 68 + 69 + static struct platform_device ath79_wdt_device = { 70 + .name = "ath79-wdt", 71 + .id = -1, 72 + }; 73 + 74 + void __init ath79_register_wdt(void) 75 + { 76 + platform_device_register(&ath79_wdt_device); 77 + }
+1
arch/mips/ath79/dev-common.h
··· 13 #define _ATH79_DEV_COMMON_H 14 15 void ath79_register_uart(void); 16 17 #endif /* _ATH79_DEV_COMMON_H */
··· 13 #define _ATH79_DEV_COMMON_H 14 15 void ath79_register_uart(void); 16 + void ath79_register_wdt(void); 17 18 #endif /* _ATH79_DEV_COMMON_H */
+1
arch/mips/ath79/setup.c
··· 186 { 187 ath79_gpio_init(); 188 ath79_register_uart(); 189 190 mips_machine_setup(); 191
··· 186 { 187 ath79_gpio_init(); 188 ath79_register_uart(); 189 + ath79_register_wdt(); 190 191 mips_machine_setup(); 192