aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-10-29 22:49:44 -0400
committerPaul Walmsley <paul@pwsan.com>2012-10-29 22:49:44 -0400
commit37c67d03989eca60b28d67398d9388f653454c5d (patch)
treecd23dc86d705b85aad3983122b32b78d0b01b3cd /arch/arm/mach-omap1
parent508c0d47736023fdcb491fd55ad64f7e08f6f32f (diff)
ARM: OMAP2+: WDT: move init; add read_reset_sources pdata function pointer
The OMAP watchdog timer driver directly calls a function exported by code in arch/arm/mach-omap2. This is not good; it tightly couples this driver to the mach-omap2 integration code. Instead, add a temporary platform_data function pointer to abstract this function call. A subsequent patch will convert the watchdog driver to use this function pointer. This patch also moves the device creation code out of arch/arm/mach-omap2/devices.c and into arch/arm/mach-omap2/wd_timer.c. This is another step towards the removal of arch/arm/mach-omap2/devices.c. Cc: Wim Van Sebroeck <wim@iguana.be> Acked-by: Wim Van Sebroeck <wim@iguana.be> [paul@pwsan.com: skip wd_timer device creation when DT blob is present] Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/devices.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 645668e2b1d5..745031870ce4 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -17,6 +17,8 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/spi/spi.h> 18#include <linux/spi/spi.h>
19 19
20#include <linux/platform_data/omap-wd-timer.h>
21
20#include <asm/mach/map.h> 22#include <asm/mach/map.h>
21 23
22#include <mach/tc.h> 24#include <mach/tc.h>
@@ -448,18 +450,31 @@ static struct resource wdt_resources[] = {
448}; 450};
449 451
450static struct platform_device omap_wdt_device = { 452static struct platform_device omap_wdt_device = {
451 .name = "omap_wdt", 453 .name = "omap_wdt",
452 .id = -1, 454 .id = -1,
453 .num_resources = ARRAY_SIZE(wdt_resources), 455 .num_resources = ARRAY_SIZE(wdt_resources),
454 .resource = wdt_resources, 456 .resource = wdt_resources,
455}; 457};
456 458
457static int __init omap_init_wdt(void) 459static int __init omap_init_wdt(void)
458{ 460{
461 struct omap_wd_timer_platform_data pdata;
462 int ret;
463
459 if (!cpu_is_omap16xx()) 464 if (!cpu_is_omap16xx())
460 return -ENODEV; 465 return -ENODEV;
461 466
462 return platform_device_register(&omap_wdt_device); 467 pdata.read_reset_sources = omap1_get_reset_sources;
468
469 ret = platform_device_register(&omap_wdt_device);
470 if (!ret) {
471 ret = platform_device_add_data(&omap_wdt_device, &pdata,
472 sizeof(pdata));
473 if (ret)
474 platform_device_del(&omap_wdt_device);
475 }
476
477 return ret;
463} 478}
464subsys_initcall(omap_init_wdt); 479subsys_initcall(omap_init_wdt);
465#endif 480#endif