diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-12-27 15:38:26 +0100 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2013-03-01 12:22:38 +0100 |
commit | 09f5100a592d11dad06b218f41d560ff1f87f666 (patch) | |
tree | 61dc65a90c6344b8273f8d383f3ad34d3054e2f3 /arch/mips/ath79 | |
parent | 0f2ad9ed7c6fecb008372e8a709595a2a21059aa (diff) |
watchdog: ath79_wdt: get register base from platform device's resources
The ath79_wdt driver uses a fixed memory address
currently. Although this is working with each
currently supported SoCs, but this may change
in the future. Additionally, the driver includes
platform specific header files in order to be
able to get the memory base of the watchdog
device.
The patch adds a memory resource to the platform
device, and converts the driver to get the base
address of the watchdog device from that.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'arch/mips/ath79')
-rw-r--r-- | arch/mips/ath79/dev-common.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/mips/ath79/dev-common.c b/arch/mips/ath79/dev-common.c index 2093b1b2a1d1..ea3a8140e728 100644 --- a/arch/mips/ath79/dev-common.c +++ b/arch/mips/ath79/dev-common.c @@ -103,5 +103,13 @@ void __init ath79_register_uart(void) void __init ath79_register_wdt(void) { - platform_device_register_simple("ath79-wdt", -1, NULL, 0); + struct resource res; + + memset(&res, 0, sizeof(res)); + + res.flags = IORESOURCE_MEM; + res.start = AR71XX_RESET_BASE + AR71XX_RESET_REG_WDOG_CTRL; + res.end = res.start + 0x8 - 1; + + platform_device_register_simple("ath79-wdt", -1, &res, 1); } |