linux-mips
[Top] [All Lists]

[PATCH 08/18] MIPS: ath79: add common watchdog device

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 08/18] MIPS: ath79: add common watchdog device
From: Gabor Juhos <juhosg@openwrt.org>
Date: Tue, 23 Nov 2010 16:06:30 +0100
Cc: linux-mips@linux-mips.org, kaloz@openwrt.org, "Luis R. Rodriguez" <lrodriguez@atheros.com>, Cliff Holden <Cliff.Holden@Atheros.com>, Gabor Juhos <juhosg@openwrt.org>
In-reply-to: <1290524800-21419-1-git-send-email-juhosg@openwrt.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1290524800-21419-1-git-send-email-juhosg@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
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>
---

Changes since RFC:
    - remove the ATH79_DEV_WDT Kconfig option, and move the watchdog platform
      code into dev-common.[ch]

 arch/mips/ath79/dev-common.c |   10 ++++++++++
 arch/mips/ath79/dev-common.h |    1 +
 arch/mips/ath79/setup.c      |    1 +
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/mips/ath79/dev-common.c b/arch/mips/ath79/dev-common.c
index 897522c..74b1e3b 100644
--- a/arch/mips/ath79/dev-common.c
+++ b/arch/mips/ath79/dev-common.c
@@ -57,3 +57,13 @@ void __init ath79_register_uart(void)
        ath79_uart_data[0].uartclk = ath79_ahb_freq;
        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);
+}
diff --git a/arch/mips/ath79/dev-common.h b/arch/mips/ath79/dev-common.h
index 1cec894..65bf400 100644
--- a/arch/mips/ath79/dev-common.h
+++ b/arch/mips/ath79/dev-common.h
@@ -13,5 +13,6 @@
 #define _ATH79_DEV_COMMON_H
 
 void ath79_register_uart(void) __init;
+void ath79_register_wdt(void) __init;
 
 #endif /* _ATH79_DEV_COMMON_H */
diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
index 8600044..5abe56c 100644
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
@@ -259,6 +259,7 @@ static int __init ath79_setup(void)
 {
        ath79_gpio_init();
        ath79_register_uart();
+       ath79_register_wdt();
 
        mips_machine_setup();
 
-- 
1.7.2.1


<Prev in Thread] Current Thread [Next in Thread>