diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2010-10-01 13:24:09 -0700 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-10-01 13:24:09 -0700 |
commit | 963bfb0939232e415c7bfb19b08dce300eb148d9 (patch) | |
tree | 2efd04dc2afbc46c97d1c3327e6f7830acafb250 /arch/arm/mach-omap2/devices.c | |
parent | 7ad0e386d46e9edff64705ab25337ad9130baf63 (diff) | |
parent | 7ec5ad0f3c1e28b693185c35f768953c5db32291 (diff) | |
download | op-kernel-dev-963bfb0939232e415c7bfb19b08dce300eb148d9.zip op-kernel-dev-963bfb0939232e415c7bfb19b08dce300eb148d9.tar.gz |
Merge branch 'pm-hwmod-wdog' into pm-hwmods
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 9e5d51b..8e2f0aa 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -15,6 +15,7 @@ #include <linux/platform_device.h> #include <linux/io.h> #include <linux/clk.h> +#include <linux/err.h> #include <mach/hardware.h> #include <mach/irqs.h> @@ -28,6 +29,8 @@ #include <mach/gpio.h> #include <plat/mmc.h> #include <plat/dma.h> +#include <plat/omap_hwmod.h> +#include <plat/omap_device.h> #include "mux.h" @@ -932,3 +935,39 @@ static int __init omap2_init_devices(void) return 0; } arch_initcall(omap2_init_devices); + +#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE) +struct omap_device_pm_latency omap_wdt_latency[] = { + [0] = { + .deactivate_func = omap_device_idle_hwmods, + .activate_func = omap_device_enable_hwmods, + .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, + }, +}; + +static int __init omap_init_wdt(void) +{ + int id = -1; + struct omap_device *od; + struct omap_hwmod *oh; + char *oh_name = "wd_timer2"; + char *dev_name = "omap_wdt"; + + if (!cpu_class_is_omap2()) + return 0; + + oh = omap_hwmod_lookup(oh_name); + if (!oh) { + pr_err("Could not look up wd_timer%d hwmod\n", id); + return -EINVAL; + } + + od = omap_device_build(dev_name, id, oh, NULL, 0, + omap_wdt_latency, + ARRAY_SIZE(omap_wdt_latency), 0); + WARN(IS_ERR(od), "Cant build omap_device for %s:%s.\n", + dev_name, oh->name); + return 0; +} +subsys_initcall(omap_init_wdt); +#endif |