aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-10-08 13:20:40 -0400
committerTony Lindgren <tony@atomide.com>2010-10-08 13:20:40 -0400
commitbc3caae8a191c712d8ae666d0b8d18807bfe2b14 (patch)
tree7b338ebba2f1fdbcee3785789bf9f4a74d93aa94 /arch/arm/mach-omap2/devices.c
parent73c5ef126f40b0b872e5964ff65dbe792eeec493 (diff)
parent69758ab7a1e2de5636a2188d5357dd03140bf1d8 (diff)
Merge branch 'pm-hwmods' of ssh://master.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-linus
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 9bd4b3452453..5eb0b58b2e95 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
@@ -930,3 +933,39 @@ static int __init omap2_init_devices(void)
930 return 0; 933 return 0;
931} 934}
932arch_initcall(omap2_init_devices); 935arch_initcall(omap2_init_devices);
936
937#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
938struct omap_device_pm_latency omap_wdt_latency[] = {
939 [0] = {
940 .deactivate_func = omap_device_idle_hwmods,
941 .activate_func = omap_device_enable_hwmods,
942 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
943 },
944};
945
946static int __init omap_init_wdt(void)
947{
948 int id = -1;
949 struct omap_device *od;
950 struct omap_hwmod *oh;
951 char *oh_name = "wd_timer2";
952 char *dev_name = "omap_wdt";
953
954 if (!cpu_class_is_omap2())
955 return 0;
956
957 oh = omap_hwmod_lookup(oh_name);
958 if (!oh) {
959 pr_err("Could not look up wd_timer%d hwmod\n", id);
960 return -EINVAL;
961 }
962
963 od = omap_device_build(dev_name, id, oh, NULL, 0,
964 omap_wdt_latency,
965 ARRAY_SIZE(omap_wdt_latency), 0);
966 WARN(IS_ERR(od), "Cant build omap_device for %s:%s.\n",
967 dev_name, oh->name);
968 return 0;
969}
970subsys_initcall(omap_init_wdt);
971#endif