aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/Makefile1
-rw-r--r--arch/arm/mach-omap2/smartreflex-class3.c59
-rw-r--r--arch/arm/plat-omap/Kconfig9
3 files changed, 69 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index aedb3e77908..ec48c4cf8ae 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -63,6 +63,7 @@ obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \
63obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o 63obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o
64obj-$(CONFIG_PM_DEBUG) += pm-debug.o 64obj-$(CONFIG_PM_DEBUG) += pm-debug.o
65obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o 65obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o
66obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o
66 67
67AFLAGS_sleep24xx.o :=-Wa,-march=armv6 68AFLAGS_sleep24xx.o :=-Wa,-march=armv6
68AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a 69AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a
diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c
new file mode 100644
index 00000000000..60e70552b4c
--- /dev/null
+++ b/arch/arm/mach-omap2/smartreflex-class3.c
@@ -0,0 +1,59 @@
1/*
2 * Smart reflex Class 3 specific implementations
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Copyright (C) 2010 Texas Instruments, Inc.
7 * Thara Gopinath <thara@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <plat/smartreflex.h>
15
16static int sr_class3_enable(struct voltagedomain *voltdm)
17{
18 unsigned long volt = omap_voltage_get_nom_volt(voltdm);
19
20 if (!volt) {
21 pr_warning("%s: Curr voltage unknown. Cannot enable sr_%s\n",
22 __func__, voltdm->name);
23 return -ENODATA;
24 }
25
26 omap_vp_enable(voltdm);
27 return sr_enable(voltdm, volt);
28}
29
30static int sr_class3_disable(struct voltagedomain *voltdm, int is_volt_reset)
31{
32 omap_vp_disable(voltdm);
33 sr_disable(voltdm);
34 if (is_volt_reset)
35 omap_voltage_reset(voltdm);
36
37 return 0;
38}
39
40static int sr_class3_configure(struct voltagedomain *voltdm)
41{
42 return sr_configure_errgen(voltdm);
43}
44
45/* SR class3 structure */
46static struct omap_sr_class_data class3_data = {
47 .enable = sr_class3_enable,
48 .disable = sr_class3_disable,
49 .configure = sr_class3_configure,
50 .class_type = SR_CLASS3,
51};
52
53/* Smartreflex Class3 init API to be called from board file */
54static int __init sr_class3_init(void)
55{
56 pr_info("SmartReflex Class3 initialized\n");
57 return sr_register_class(&class3_data);
58}
59late_initcall(sr_class3_init);
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index f1673fb96fe..f4e05134aaf 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -57,6 +57,15 @@ config OMAP_SMARTREFLEX
57 by default during system init via the enable_on_init flag 57 by default during system init via the enable_on_init flag
58 which an be passed as platform data to the smartreflex driver. 58 which an be passed as platform data to the smartreflex driver.
59 59
60config OMAP_SMARTREFLEX_CLASS3
61 bool "Class 3 mode of Smartreflex Implementation"
62 depends on OMAP_SMARTREFLEX && TWL4030_CORE
63 help
64 Say Y to enable Class 3 implementation of Smartreflex
65
66 Class 3 implementation of Smartreflex employs continuous hardware
67 voltage calibration.
68
60config OMAP_RESET_CLOCKS 69config OMAP_RESET_CLOCKS
61 bool "Reset unused clocks during boot" 70 bool "Reset unused clocks during boot"
62 depends on ARCH_OMAP 71 depends on ARCH_OMAP