Skip to content

Commit 858f763

Browse files
juhosgralfbaechle
authored andcommitted
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>
1 parent d8fec1f commit 858f763

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎arch/mips/ath79/dev-common.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,13 @@ void __init ath79_register_uart(void)
6565
ath79_uart_data[0].uartclk = clk_get_rate(clk);
6666
platform_device_register(&ath79_uart_device);
6767
}
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+
}

‎arch/mips/ath79/dev-common.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
#define _ATH79_DEV_COMMON_H
1414

1515
void ath79_register_uart(void);
16+
void ath79_register_wdt(void);
1617

1718
#endif /* _ATH79_DEV_COMMON_H */

‎arch/mips/ath79/setup.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ static int __init ath79_setup(void)
186186
{
187187
ath79_gpio_init();
188188
ath79_register_uart();
189+
ath79_register_wdt();
189190

190191
mips_machine_setup();
191192

0 commit comments

Comments
 (0)