diff options
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r-- | arch/arm/mach-omap2/devices.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 9e5d51bee94a..8e2f0aa310b5 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/err.h> | ||
18 | 19 | ||
19 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
20 | #include <mach/irqs.h> | 21 | #include <mach/irqs.h> |
@@ -28,6 +29,8 @@ | |||
28 | #include <mach/gpio.h> | 29 | #include <mach/gpio.h> |
29 | #include <plat/mmc.h> | 30 | #include <plat/mmc.h> |
30 | #include <plat/dma.h> | 31 | #include <plat/dma.h> |
32 | #include <plat/omap_hwmod.h> | ||
33 | #include <plat/omap_device.h> | ||
31 | 34 | ||
32 | #include "mux.h" | 35 | #include "mux.h" |
33 | 36 | ||
@@ -932,3 +935,39 @@ static int __init omap2_init_devices(void) | |||
932 | return 0; | 935 | return 0; |
933 | } | 936 | } |
934 | arch_initcall(omap2_init_devices); | 937 | arch_initcall(omap2_init_devices); |
938 | |||
939 | #if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE) | ||
940 | struct omap_device_pm_latency omap_wdt_latency[] = { | ||
941 | [0] = { | ||
942 | .deactivate_func = omap_device_idle_hwmods, | ||
943 | .activate_func = omap_device_enable_hwmods, | ||
944 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
945 | }, | ||
946 | }; | ||
947 | |||
948 | static int __init omap_init_wdt(void) | ||
949 | { | ||
950 | int id = -1; | ||
951 | struct omap_device *od; | ||
952 | struct omap_hwmod *oh; | ||
953 | char *oh_name = "wd_timer2"; | ||
954 | char *dev_name = "omap_wdt"; | ||
955 | |||
956 | if (!cpu_class_is_omap2()) | ||
957 | return 0; | ||
958 | |||
959 | oh = omap_hwmod_lookup(oh_name); | ||
960 | if (!oh) { | ||
961 | pr_err("Could not look up wd_timer%d hwmod\n", id); | ||
962 | return -EINVAL; | ||
963 | } | ||
964 | |||
965 | od = omap_device_build(dev_name, id, oh, NULL, 0, | ||
966 | omap_wdt_latency, | ||
967 | ARRAY_SIZE(omap_wdt_latency), 0); | ||
968 | WARN(IS_ERR(od), "Cant build omap_device for %s:%s.\n", | ||
969 | dev_name, oh->name); | ||
970 | return 0; | ||
971 | } | ||
972 | subsys_initcall(omap_init_wdt); | ||
973 | #endif | ||