summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBengt Jonsson <bengt.g.jonsson@stericsson.com>2011-10-31 17:33:55 +0100
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 10:59:19 +0200
commitd3be611d7c9f400ac738a0e1a0103237a1fdf2c7 (patch)
treed8e1f7c37efcb4b17daa02ff126cea25cb81814d
parent47c3ceb93a8cb8b2ba0dd7b940d7142f3844da18 (diff)
regulator: ab8500-ext: Add VextSupply1 regulator
Remove suspend-force settings of VextSupply1 and add VextSupply1 in the external regulator driver. ST-Ericsson Linux next: - ST-Ericsson ID: 374223 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I0a8b8c813159dcf44e24bc4a0bfd36beb954a459 Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/37702
-rw-r--r--arch/arm/mach-ux500/board-mop500-regulators.c32
-rw-r--r--arch/arm/mach-ux500/board-mop500-regulators.h2
-rw-r--r--drivers/regulator/ab8500-debug.c9
-rw-r--r--drivers/regulator/ab8500-ext.c18
-rw-r--r--include/linux/regulator/ab8500.h1
5 files changed, 55 insertions, 7 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
index 988c825e441..be90ea6c486 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.c
+++ b/arch/arm/mach-ux500/board-mop500-regulators.c
@@ -11,6 +11,7 @@
#include <linux/kernel.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/ab8500.h>
+#include <mach/id.h> /* to identify older boards for fixes */
#include "board-mop500-regulators.h"
#ifdef CONFIG_REGULATOR_FIXED_VOLTAGE
@@ -337,13 +338,13 @@ static struct ab8500_regulator_reg_init ab8500_reg_init[] = {
*/
INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x03, 0x00),
/*
- * VextSupply1Regu = HW control
+ * VextSupply1Regu = force LP
* VextSupply2Regu = HW control
* VextSupply3Regu = force HP (-> STBB2=LP and TPS=LP)
* ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0
* ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0
*/
- INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x1a),
+ INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x1b),
/*
* Vaux1Regu = force HP
* Vaux2Regu = force off
@@ -549,6 +550,17 @@ static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = {
* AB8500 external regulators
*/
static struct regulator_init_data ab8500_ext_regulators[] = {
+ /* fixed Vbat supplies VSMPS1_EXT_1V8 */
+ [AB8500_EXT_SUPPLY1] = {
+ .constraints = {
+ .name = "ab8500-ext-supply1",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .initial_mode = REGULATOR_MODE_IDLE,
+ .boot_on = 1,
+ .always_on = 1,
+ },
+ },
/* fixed Vbat supplies VSMPS3_EXT_3V4 and VSMPS4_EXT_3V4 */
[AB8500_EXT_SUPPLY3] = {
.constraints = {
@@ -572,3 +584,19 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = {
.ext_regulator = ab8500_ext_regulators,
.num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators),
};
+
+void mop500_regulator_init(void)
+{
+ struct regulator_init_data *regulator;
+
+ /*
+ * Handle VextSupply1 on older boards than HREFP_V22_V1x
+ * (turn off in suspend)
+ */
+ if (cpu_is_u8500v20() || cpu_is_u8500v21()) {
+ /* disable VextSupply1 in suspend */
+ regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY1];
+ regulator->constraints.state_mem.disabled = 1;
+ regulator->constraints.state_standby.disabled = 1;
+ }
+}
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
index ed309081e14..b5fc81a3649 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.h
+++ b/arch/arm/mach-ux500/board-mop500-regulators.h
@@ -19,4 +19,6 @@ extern struct regulator_init_data tps61052_regulator;
extern struct regulator_init_data gpio_wlan_vbat_regulator;
extern struct regulator_init_data gpio_en_3v3_regulator;
+void mop500_regulator_init(void);
+
#endif
diff --git a/drivers/regulator/ab8500-debug.c b/drivers/regulator/ab8500-debug.c
index da182641b2c..50789258654 100644
--- a/drivers/regulator/ab8500-debug.c
+++ b/drivers/regulator/ab8500-debug.c
@@ -1526,12 +1526,11 @@ static struct ab8500_force_reg ab8500_force_reg[] = {
* ExtSupplyRegu (HSI: 0x2a on v2-v40?)
* OTP: 0x15, HSI: 0x28, suspend: 0x28/0x3f (value/mask)
* [3:2] VExtSupply2Regu[1:0] = 10 = Vext2 in HW control
- * [1:0] VExtSupply1Regu[1:0] = 00 = Vext1 off
*/
.name = "ExtSupplyRegu",
.bank = 0x04,
.addr = 0x08,
- .mask = 0x0f,
+ .mask = 0x0c,
.val = 0x08,
},
{
@@ -1736,15 +1735,15 @@ static int __devinit ab8500_regulator_debug_probe(struct platform_device *plf)
if ((abx500_get_chip_id(&pdev->dev) >= 0x30) && cpu_is_u8500v22()) {
/*
* find ExtSupplyRegu register (bank 0x04, addr 0x08)
- * and update value (Vext1 in low-power, Vext2 off).
+ * and update value (Vext2 off).
*/
for (i = 0; i < ARRAY_SIZE(ab8500_force_reg); i++) {
if (ab8500_force_reg[i].bank == 0x04 &&
ab8500_force_reg[i].addr == 0x08) {
- u8 val, val_mask = 0x0f;
+ u8 val, val_mask = 0x0c;
val = ab8500_force_reg[i].val;
- val = (val & ~val_mask) | (0x03 & val_mask);
+ val = (val & ~val_mask) | (0x00 & val_mask);
ab8500_force_reg[i].val = val;
}
}
diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c
index 347b3b5752a..f6ce6623460 100644
--- a/drivers/regulator/ab8500-ext.c
+++ b/drivers/regulator/ab8500-ext.c
@@ -300,6 +300,24 @@ static struct regulator_ops ab8500_ext_regulator_ops = {
static struct ab8500_ext_regulator_info
ab8500_ext_regulator_info[AB8500_NUM_EXT_REGULATORS] = {
+ [AB8500_EXT_SUPPLY1] = {
+ .desc = {
+ .name = "VEXTSUPPLY1",
+ .ops = &ab8500_ext_regulator_ops,
+ .type = REGULATOR_VOLTAGE,
+ .id = AB8500_EXT_SUPPLY1,
+ .owner = THIS_MODULE,
+ .n_voltages = 1,
+ },
+ .fixed_uV = 1800000,
+ .update_bank = 0x04,
+ .update_reg = 0x08,
+ .update_mask = 0x03,
+ .update_val = 0x01,
+ .update_val_hp = 0x01,
+ .update_val_lp = 0x03,
+ .update_val_hw = 0x02,
+ },
[AB8500_EXT_SUPPLY3] = {
.desc = {
.name = "VEXTSUPPLY3",
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
index 6f82ab3c444..49d5df43d22 100644
--- a/include/linux/regulator/ab8500.h
+++ b/include/linux/regulator/ab8500.h
@@ -162,6 +162,7 @@ struct ab8500_ext_regulator_cfg {
};
enum ab8500_ext_regulator_id {
+ AB8500_EXT_SUPPLY1,
AB8500_EXT_SUPPLY3,
AB8500_NUM_EXT_REGULATORS,
};