summaryrefslogtreecommitdiff
path: root/target/linux/gemini/patches-4.4/111-arm-gemini-add-watchdog-device.patch
blob: ab32e9e844414baa79195b3862eb3408afd5e461 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- a/arch/arm/mach-gemini/devices.c
+++ b/arch/arm/mach-gemini/devices.c
@@ -116,3 +116,20 @@ int __init platform_register_rtc(void)
 	return platform_device_register(&gemini_rtc_device);
 }
 
+static struct resource wdt_resource = {
+	.start	= GEMINI_WAQTCHDOG_BASE,
+	.end	= GEMINI_WAQTCHDOG_BASE + 0x18,
+	.flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device wdt_device = {
+	.name		= "gemini-wdt",
+	.id		= 0,
+	.resource	= &wdt_resource,
+	.num_resources	= 1,
+};
+
+int __init platform_register_watchdog(void)
+{
+	return platform_device_register(&wdt_device);
+}
--- a/arch/arm/mach-gemini/common.h
+++ b/arch/arm/mach-gemini/common.h
@@ -27,6 +27,7 @@ extern int platform_register_uart(void);
 extern int platform_register_pflash(unsigned int size,
 				    struct mtd_partition *parts,
 				    unsigned int nr_parts);
+extern int platform_register_watchdog(void);
 
 extern void gemini_restart(enum reboot_mode mode, const char *cmd);