From 422db8d229affd429b5a7389600877aa7dea2704 Mon Sep 17 00:00:00 2001 From: Dale Farnsworth Date: Tue, 24 Jul 2007 11:07:38 -0700 Subject: [WATCHDOG] mv64x60_wdt: set up platform_device in platform code The driver previously registered its platform device data in its own init function--that's bogus. Move that code to platform-specific code in arch/ppc. This is being done so that the platform code can decide at runtime whether to initialize this driver or not. Signed-off-by: Dale Farnsworth Signed-off-by: Wim Van Sebroeck --- arch/ppc/syslib/mv64x60.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'arch') diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c index d212b1c..2744b8a 100644 --- a/arch/ppc/syslib/mv64x60.c +++ b/arch/ppc/syslib/mv64x60.c @@ -441,6 +441,32 @@ static struct platform_device i2c_device = { }; #endif +#ifdef CONFIG_WATCHDOG +static struct mv64x60_wdt_pdata mv64x60_wdt_pdata = { + .timeout = 10, /* default watchdog expiry in seconds */ + .bus_clk = 133, /* default bus clock in MHz */ +}; + +static struct resource mv64x60_wdt_resources[] = { + [0] = { + .name = "mv64x60 wdt base", + .start = MV64x60_WDT_WDC, + .end = MV64x60_WDT_WDC + 8 - 1, /* two 32-bit registers */ + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device wdt_device = { + .name = MV64x60_WDT_NAME, + .id = 0, + .num_resources = ARRAY_SIZE(mv64x60_wdt_resources), + .resource = mv64x60_wdt_resources, + .dev = { + .platform_data = &mv64x60_wdt_pdata, + }, +}; +#endif + #if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260) static struct mv64xxx_pdata mv64xxx_pdata = { .hs_reg_valid = 0, @@ -476,6 +502,9 @@ static struct platform_device *mv64x60_pd_devs[] __initdata = { #ifdef CONFIG_I2C_MV64XXX &i2c_device, #endif +#ifdef CONFIG_MV64X60_WDT + &wdt_device, +#endif #if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260) &mv64xxx_device, #endif -- cgit v1.1