aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/ab8500.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-04-02 08:24:09 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-02 18:01:42 -0400
commit8a3b1b8703fed16c6b796e87c34e2bc0311fe305 (patch)
tree9655afd4060f00de32421d783c51e21fd34b7589 /drivers/regulator/ab8500.c
parentf7eae37fcc6e4bdc404692a3e94fc9c51e9c5cb2 (diff)
regulator: ab8500: Add voltage selection for AUDIO and ANA on AB8505
Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/ab8500.c')
-rw-r--r--drivers/regulator/ab8500.c55
1 files changed, 49 insertions, 6 deletions
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 65f9365885a8..bf9139784670 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -160,6 +160,28 @@ static const unsigned int fixed_3300000_voltage[] = {
160 3300000, 160 3300000,
161}; 161};
162 162
163static const unsigned int ldo_vana_voltages[] = {
164 1050000,
165 1075000,
166 1100000,
167 1125000,
168 1150000,
169 1175000,
170 1200000,
171 1225000,
172};
173
174static const unsigned int ldo_vaudio_voltages[] = {
175 2000000,
176 2100000,
177 2200000,
178 2300000,
179 2400000,
180 2500000,
181 2600000,
182 2600000, /* Duplicated in Vaudio and IsoUicc Control register. */
183};
184
163static int ab8500_regulator_enable(struct regulator_dev *rdev) 185static int ab8500_regulator_enable(struct regulator_dev *rdev)
164{ 186{
165 int ret; 187 int ret;
@@ -416,6 +438,16 @@ static struct regulator_ops ab8500_regulator_volt_mode_ops = {
416 .list_voltage = regulator_list_voltage_table, 438 .list_voltage = regulator_list_voltage_table,
417}; 439};
418 440
441static struct regulator_ops ab8500_regulator_volt_ops = {
442 .enable = ab8500_regulator_enable,
443 .disable = ab8500_regulator_disable,
444 .is_enabled = ab8500_regulator_is_enabled,
445 .get_voltage_sel = ab8500_regulator_get_voltage_sel,
446 .set_voltage_sel = ab8500_regulator_set_voltage_sel,
447 .list_voltage = regulator_list_voltage_table,
448 .set_voltage_time_sel = ab8500_regulator_set_voltage_time_sel,
449};
450
419static struct regulator_ops ab8500_regulator_mode_ops = { 451static struct regulator_ops ab8500_regulator_mode_ops = {
420 .enable = ab8500_regulator_enable, 452 .enable = ab8500_regulator_enable,
421 .disable = ab8500_regulator_disable, 453 .disable = ab8500_regulator_disable,
@@ -851,17 +883,23 @@ static struct ab8500_regulator_info
851 [AB8505_LDO_AUDIO] = { 883 [AB8505_LDO_AUDIO] = {
852 .desc = { 884 .desc = {
853 .name = "LDO-AUDIO", 885 .name = "LDO-AUDIO",
854 .ops = &ab8500_regulator_ops, 886 .ops = &ab8500_regulator_volt_ops,
855 .type = REGULATOR_VOLTAGE, 887 .type = REGULATOR_VOLTAGE,
856 .id = AB8505_LDO_AUDIO, 888 .id = AB8505_LDO_AUDIO,
857 .owner = THIS_MODULE, 889 .owner = THIS_MODULE,
858 .n_voltages = 1, 890 .n_voltages = ARRAY_SIZE(ldo_vaudio_voltages),
859 .volt_table = fixed_2000000_voltage, 891 .volt_table = ldo_vaudio_voltages,
860 }, 892 },
861 .update_bank = 0x03, 893 .update_bank = 0x03,
862 .update_reg = 0x83, 894 .update_reg = 0x83,
863 .update_mask = 0x02, 895 .update_mask = 0x02,
864 .update_val = 0x02, 896 .update_val = 0x02,
897 .voltage_bank = 0x01,
898 .voltage_reg = 0x57,
899 .voltage_mask = 0x7,
900 .voltage_shift = 4,
901 .voltages = ldo_vaudio_voltages,
902 .voltages_len = ARRAY_SIZE(ldo_vaudio_voltages),
865 }, 903 },
866 [AB8505_LDO_ANAMIC1] = { 904 [AB8505_LDO_ANAMIC1] = {
867 .desc = { 905 .desc = {
@@ -914,12 +952,12 @@ static struct ab8500_regulator_info
914 [AB8505_LDO_ANA] = { 952 [AB8505_LDO_ANA] = {
915 .desc = { 953 .desc = {
916 .name = "LDO-ANA", 954 .name = "LDO-ANA",
917 .ops = &ab8500_regulator_mode_ops, 955 .ops = &ab8500_regulator_volt_mode_ops,
918 .type = REGULATOR_VOLTAGE, 956 .type = REGULATOR_VOLTAGE,
919 .id = AB8505_LDO_ANA, 957 .id = AB8505_LDO_ANA,
920 .owner = THIS_MODULE, 958 .owner = THIS_MODULE,
921 .n_voltages = 1, 959 .n_voltages = ARRAY_SIZE(ldo_vana_voltages),
922 .volt_table = fixed_1200000_voltage, 960 .volt_table = ldo_vana_voltages,
923 }, 961 },
924 .load_lp_uA = 1000, 962 .load_lp_uA = 1000,
925 .update_bank = 0x04, 963 .update_bank = 0x04,
@@ -928,6 +966,11 @@ static struct ab8500_regulator_info
928 .update_val = 0x04, 966 .update_val = 0x04,
929 .update_val_idle = 0x0c, 967 .update_val_idle = 0x0c,
930 .update_val_normal = 0x04, 968 .update_val_normal = 0x04,
969 .voltage_bank = 0x04,
970 .voltage_reg = 0x29,
971 .voltage_mask = 0x7,
972 .voltages = ldo_vana_voltages,
973 .voltages_len = ARRAY_SIZE(ldo_vana_voltages),
931 }, 974 },
932}; 975};
933 976