@@ -50,6 +50,7 @@ obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o \
voltage.o
obj-$(CONFIG_PM_DEBUG) += pm-debug.o
obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o
+obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o
AFLAGS_sleep24xx.o :=-Wa,-march=armv6
AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a
@@ -48,6 +48,7 @@
#include "hsmmc.h"
#include "pm.h"
#include "omap3-opp.h"
+#include "smartreflex-class3.h"
#define CONFIG_DISABLE_HFCLK 1
@@ -804,6 +805,7 @@ static void __init omap_3430sdp_init(void)
sdp3430_display_init();
enable_board_wakeup_source();
usb_ehci_init(&ehci_pdata);
+ sr_class3_init();
}
static void __init omap_3430sdp_map_io(void)
@@ -27,6 +27,7 @@
#include "sdram-hynix-h8mbx00u0mer-0em.h"
#include "pm.h"
#include "omap3-opp.h"
+#include "smartreflex-class3.h"
#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
@@ -107,6 +108,7 @@ static void __init omap_sdp_init(void)
board_smc91x_init();
enable_board_wakeup_source();
usb_ehci_init(&ehci_pdata);
+ sr_class3_init();
}
MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
@@ -26,6 +26,7 @@
#include "sdram-hynix-h8mbx00u0mer-0em.h"
#include "pm.h"
#include "omap3-opp.h"
+#include "smartreflex-class3.h"
static void __init omap_zoom_map_io(void)
{
@@ -76,6 +77,7 @@ static void __init omap_zoom_init(void)
omap_mux_init_gpio(64, OMAP_PIN_OUTPUT);
usb_ehci_init(&ehci_pdata);
+ sr_class3_init();
}
MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
new file mode 100644
@@ -0,0 +1,62 @@
+/*
+ * Smart reflex Class 3 specific implementations
+ *
+ * Author: Thara Gopinath <thara@ti.com>
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ * Thara Gopinath <thara@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/smartreflex.h>
+
+#include "smartreflex-class3.h"
+#include "voltage.h"
+
+static int sr_class3_enable(int id)
+{
+ unsigned long volt = 0;
+
+ volt = get_curr_voltage(id);
+ if (!volt) {
+ pr_warning("%s: Current voltage unknown.Cannot enable SR%d\n",
+ __func__, id);
+ return -ENODATA;
+ }
+
+ omap_voltageprocessor_enable(id);
+ return sr_enable(id, volt);
+}
+
+static int sr_class3_disable(int id, int is_volt_reset)
+{
+ omap_voltageprocessor_disable(id);
+ sr_disable(id);
+ if (is_volt_reset)
+ omap_reset_voltage(id);
+
+ return 0;
+}
+
+static int sr_class3_configure(int id)
+{
+ return sr_configure_errgen(id);
+}
+
+/* SR class3 structure */
+struct omap_smartreflex_class_data class3_data = {
+ .enable = sr_class3_enable,
+ .disable = sr_class3_disable,
+ .configure = sr_class3_configure,
+ .class_type = SR_CLASS3,
+};
+
+/* Smartreflex CLASS3 init API to be called from board file */
+int __init sr_class3_init(void)
+{
+ pr_info("SmartReflex CLASS3 initialized\n");
+ return omap_sr_register_class(&class3_data);
+}
new file mode 100644
@@ -0,0 +1,23 @@
+/*
+ * Smartreflex Class 3 Routines
+ *
+ * Author: Thara Gopinath <thara@ti.com>
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ * Thara Gopinath <thara@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_SMARTREFLEXCLASS3_H
+#define __ARCH_ARM_MACH_OMAP2_SMARTREFLEXCLASS3_H
+
+#ifdef CONFIG_OMAP_SMARTREFLEX_CLASS3
+int sr_class3_init(void);
+#else
+static int sr_class3_init(void) { return 0; }
+#endif
+
+#endif
@@ -85,6 +85,15 @@ config OMAP_SMARTREFLEX_TESTING
WARNING: Enabling this option may cause your device to hang!
+config OMAP_SMARTREFLEX_CLASS3
+ bool "Class 3 mode of Smartreflex Implementation"
+ depends on OMAP_SMARTREFLEX && TWL4030_CORE
+ help
+ Say Y to enable Class 3 implementation of Smartreflex
+
+ Class 3 implementation of Smartreflex employs continuous hardware
+ voltage caliberation.
+
config OMAP_RESET_CLOCKS
bool "Reset unused clocks during boot"
depends on ARCH_OMAP