summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/sysfs-cluster.c
diff options
context:
space:
mode:
authorScott Williams <scwilliams@nvidia.com>2011-01-07 10:48:48 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:42:09 -0800
commit651f32b43330d536ada1db67cbca454e37e7816b (patch)
treeeaabdd980e1d909f542f8ea07d3ac129ba64321b /arch/arm/mach-tegra/sysfs-cluster.c
parent0312253d179e4d65f7a4fc698a3cc843420111bf (diff)
arm: tegra: Enable Tegra3 cluster control
Original-Change-Id: I162c061f8a1851394d6390bc1234910cdf0972b3 Reviewed-on: http://git-master/r/15269 Reviewed-by: Scott Williams <scwilliams@nvidia.com> Tested-by: Scott Williams <scwilliams@nvidia.com> Original-Change-Id: I0dc20ab81db7456c0faf3a81984f2821e7d565ae Rebase-Id: R880097280de4f9691f689ab8ab25f08020e98e23
Diffstat (limited to 'arch/arm/mach-tegra/sysfs-cluster.c')
-rw-r--r--arch/arm/mach-tegra/sysfs-cluster.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/arch/arm/mach-tegra/sysfs-cluster.c b/arch/arm/mach-tegra/sysfs-cluster.c
index 50f9535cb4d9..72ca344493ff 100644
--- a/arch/arm/mach-tegra/sysfs-cluster.c
+++ b/arch/arm/mach-tegra/sysfs-cluster.c
@@ -90,7 +90,7 @@
#define SYSFS_CLUSTER_PRINTS 1 /* Nonzero: enable status prints */
#define SYSFS_CLUSTER_DEBUG_PRINTS 0 /* Nonzero: enable debug prints */
-#define SYSFS_CLUSTER_POWER_MODE 1 /* Nonzero: use power modes other than LP2*/
+#define SYSFS_CLUSTER_POWER_MODE 0 /* Nonzero: use power modes other than LP2*/
#if SYSFS_CLUSTER_DEBUG_PRINTS
#define DEBUG_CLUSTER(x) printk x
@@ -106,13 +106,10 @@
#define FLOW_CTRL_CLUSTER_CONTROL \
(IO_ADDRESS(TEGRA_FLOW_CTRL_BASE) + 0x2c)
-#define FLOW_CTRL_CPUx_CSR(cpu) \
- (IO_ADDRESS(TEGRA_FLOW_CTRL_BASE + ((cpu)?(((cpu)-1)*8 + 0x18) : 0x8)))
static struct kobject *cluster_kobj;
static spinlock_t cluster_lock;
static unsigned int flags = 0;
-static unsigned int power_mode = 2;
static unsigned int wake_ms = 0;
static ssize_t sysfscluster_show(struct kobject *kobj,
@@ -137,8 +134,9 @@ static struct kobj_attribute cluster_force_attr =
static struct kobj_attribute cluster_wake_ms_attr =
__ATTR(wake_ms, 0640, sysfscluster_show, sysfscluster_store);
-#if SYSFS_CLUSTER_POWER_MODE
-/* LPx power mode to use when switching CPUs: 1, 2 */
+#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
+/* LPx power mode to use when switching CPUs: 1=LP1, 2=LP2 */
+static unsigned int power_mode = 2;
static struct kobj_attribute cluster_powermode_attr =
__ATTR(power_mode, 0640, sysfscluster_show, sysfscluster_store);
#endif
@@ -150,7 +148,7 @@ typedef enum
ClusterAttr_Immediate,
ClusterAttr_Force,
ClusterAttr_WakeMs,
-#if SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
ClusterAttr_PowerMode
#endif
} ClusterAttr;
@@ -165,7 +163,7 @@ static ClusterAttr GetClusterAttr(const char *name)
return ClusterAttr_Force;
if (!strcmp(name, "wake_ms"))
return ClusterAttr_WakeMs;
-#if SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
if (!strcmp(name, "power_mode"))
return ClusterAttr_PowerMode;
#endif
@@ -201,7 +199,7 @@ static ssize_t sysfscluster_show(struct kobject *kobj,
len = sprintf(buf, "%d\n", wake_ms);
break;
-#if SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
case ClusterAttr_PowerMode:
len = sprintf(buf, "%d\n", power_mode);
break;
@@ -263,7 +261,7 @@ static ssize_t sysfscluster_store(struct kobject *kobj,
(flags & TEGRA_POWER_CLUSTER_G) ? "G" : "LP"));
request = flags;
-#if SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
if (power_mode == 1) {
request |= TEGRA_POWER_SDRAM_SELFREFRESH;
}
@@ -319,7 +317,7 @@ static ssize_t sysfscluster_store(struct kobject *kobj,
PRINT_CLUSTER(("cluster/wake_ms -> %d\n", wake_ms));
break;
-#if SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
case ClusterAttr_PowerMode:
if ((count == 1) && (*buf == '2'))
power_mode = 2;
@@ -370,7 +368,7 @@ static int __init sysfscluster_init(void)
CREATE_FILE(immediate);
CREATE_FILE(force);
CREATE_FILE(wake_ms);
-#if SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
CREATE_FILE(powermode);
#endif
@@ -392,7 +390,7 @@ fail:
static void __exit sysfscluster_exit(void)
{
DEBUG_CLUSTER(("+sysfscluster_exit\n"));
-#if SYSFS_CLUSTER_POWER_MODE
+#if defined(CONFIG_PM) && SYSFS_CLUSTER_POWER_MODE
REMOVE_FILE(powermode);
#endif
REMOVE_FILE(wake_ms);