Initial Contribution
msm-2.6.38: tag AU_LINUX_ANDROID_GINGERBREAD.02.03.04.00.142
Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
diff --git a/arch/arm/mach-msm/vreg.c b/arch/arm/mach-msm/vreg.c
index a9103bc..8f782a9 100644
--- a/arch/arm/mach-msm/vreg.c
+++ b/arch/arm/mach-msm/vreg.c
@@ -1,7 +1,7 @@
/* arch/arm/mach-msm/vreg.c
*
* Copyright (C) 2008 Google, Inc.
- * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2009-2011 Code Aurora Forum. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
@@ -24,6 +24,14 @@
#include "proc_comm.h"
+#if defined(CONFIG_MSM_VREG_SWITCH_INVERTED)
+#define VREG_SWITCH_ENABLE 0
+#define VREG_SWITCH_DISABLE 1
+#else
+#define VREG_SWITCH_ENABLE 1
+#define VREG_SWITCH_DISABLE 0
+#endif
+
struct vreg {
const char *name;
unsigned id;
@@ -83,6 +91,15 @@
VREG("xo_out", 46, 0, 0),
VREG("lvsw0", 47, 0, 0),
VREG("lvsw1", 48, 0, 0),
+ VREG("mddi", 49, 0, 0),
+ VREG("pllx", 50, 0, 0),
+ VREG("wlan3", 51, 0, 0),
+ VREG("emmc", 52, 0, 0),
+ VREG("wlan_tcx0", 53, 0, 0),
+ VREG("usim2", 54, 0, 0),
+ VREG("usim", 55, 0, 0),
+ VREG("bt", 56, 0, 0),
+ VREG("wlan4", 57, 0, 0),
};
struct vreg *vreg_get(struct device *dev, const char *id)
@@ -94,6 +111,7 @@
}
return ERR_PTR(-ENOENT);
}
+EXPORT_SYMBOL(vreg_get);
void vreg_put(struct vreg *vreg)
{
@@ -102,7 +120,7 @@
int vreg_enable(struct vreg *vreg)
{
unsigned id = vreg->id;
- unsigned enable = 1;
+ int enable = VREG_SWITCH_ENABLE;
if (vreg->refcnt == 0)
vreg->status = msm_proc_comm(PCOM_VREG_SWITCH, &id, &enable);
@@ -112,23 +130,25 @@
return vreg->status;
}
+EXPORT_SYMBOL(vreg_enable);
int vreg_disable(struct vreg *vreg)
{
unsigned id = vreg->id;
- unsigned enable = 0;
+ int disable = VREG_SWITCH_DISABLE;
if (!vreg->refcnt)
return 0;
if (vreg->refcnt == 1)
- vreg->status = msm_proc_comm(PCOM_VREG_SWITCH, &id, &enable);
+ vreg->status = msm_proc_comm(PCOM_VREG_SWITCH, &id, &disable);
if (!vreg->status)
vreg->refcnt--;
return vreg->status;
}
+EXPORT_SYMBOL(vreg_disable);
int vreg_set_level(struct vreg *vreg, unsigned mv)
{
@@ -137,6 +157,7 @@
vreg->status = msm_proc_comm(PCOM_VREG_SET_LEVEL, &id, &mv);
return vreg->status;
}
+EXPORT_SYMBOL(vreg_set_level);
#if defined(CONFIG_DEBUG_FS)