From 572640fb1615f279ef1530839479dc49012d502c Mon Sep 17 00:00:00 2001 From: Virupax Sadashivpetimath Date: Thu, 19 Jan 2012 12:04:01 +0530 Subject: regulator:ab5500: Add MBIAS1 regulator support ST-Ericsson ID: 411009 ST-Ericsson Linux next: Not tested ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ic8fb17e4ecb09b0b5d5cdf213d67217f01ff84d8 Signed-off-by: Virupax Sadashivpetimath Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/45908 Reviewed-by: QABUILD Reviewed-by: Jonas ABERG --- drivers/regulator/ab5500.c | 27 ++++++++++++++++++++++++++- include/linux/regulator/ab5500.h | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/ab5500.c b/drivers/regulator/ab5500.c index a3de7701923..99676f7ad8e 100644 --- a/drivers/regulator/ab5500.c +++ b/drivers/regulator/ab5500.c @@ -40,6 +40,7 @@ /* In SIM bank */ #define AB5500_SIM_SUP 0x14 +#define AB5500_MBIAS1 0x00 #define AB5500_MBIAS2 0x01 #define AB5500_LDO_MODE_MASK (0x3 << 4) @@ -49,6 +50,8 @@ #define AB5500_LDO_MODE_OFF (0x0 << 4) #define AB5500_LDO_VOLT_MASK 0x07 +#define AB5500_MBIAS1_ENABLE (0x1 << 1) +#define AB5500_MBIAS1_MODE_MASK (0x1 << 1) #define AB5500_MBIAS2_ENABLE (0x1 << 1) #define AB5500_MBIAS2_VOLT_MASK (0x1 << 2) #define AB5500_MBIAS2_MODE_MASK (0x1 << 1) @@ -383,6 +386,10 @@ static const int ab5500_bias2_voltages[] = { [0x01] = 2200000, }; +static const int ab5500_bias1_voltages[] = { + [0x00] = 2000000, +}; + static struct ab5500_regulator ab5500_regulators[] = { [AB5500_LDO_L] = { .desc = { @@ -509,7 +516,7 @@ static struct ab5500_regulator ab5500_regulators[] = { }, [AB5500_BIAS2] = { .desc = { - .name = "BIAS2", + .name = "MBIAS2", .id = AB5500_BIAS2, .ops = &ab5500_regulator_variable_ops, .type = REGULATOR_VOLTAGE, @@ -526,6 +533,24 @@ static struct ab5500_regulator ab5500_regulators[] = { .update_val_idle = AB5500_MBIAS2_ENABLE, .voltage_mask = AB5500_MBIAS2_VOLT_MASK, }, + [AB5500_BIAS1] = { + .desc = { + .name = "MBIAS1", + .id = AB5500_BIAS1, + .ops = &ab5500_regulator_fixed_ops, + .type = REGULATOR_VOLTAGE, + .owner = THIS_MODULE, + .n_voltages = ARRAY_SIZE(ab5500_bias1_voltages), + }, + .bank = AB5500_BANK_AUDIO_HEADSETUSB, + .reg = AB5500_MBIAS1, + .voltages = ab5500_bias1_voltages, + .enable_time = 1000, + .mode = AB5500_MBIAS1_ENABLE, + .update_mask = AB5500_MBIAS1_MODE_MASK, + .update_val_normal = AB5500_MBIAS1_ENABLE, + .update_val_idle = AB5500_MBIAS1_ENABLE, + }, }; diff --git a/include/linux/regulator/ab5500.h b/include/linux/regulator/ab5500.h index b5a8dec0be6..04673d3494f 100644 --- a/include/linux/regulator/ab5500.h +++ b/include/linux/regulator/ab5500.h @@ -14,6 +14,7 @@ enum ab5500_regulator_id { AB5500_LDO_L, AB5500_LDO_VDIGMIC, AB5500_LDO_SIM, + AB5500_BIAS1, AB5500_BIAS2, AB5500_NUM_REGULATORS, }; -- cgit v1.2.3