diff options
author | Gaëtan Carlier <gcembed@gmail.com> | 2012-08-28 07:09:10 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-28 14:00:30 -0400 |
commit | ba02dfd205a9c54ac6f9db119d9328d9609615bb (patch) | |
tree | 5bdcc0e93364f437fdb1b5b246edcbf339860087 /drivers | |
parent | d154f0a61760c55dd5351e01893ffaf7b62a8eb8 (diff) |
regulator: mc13783: add regulators sw1x and sw2x
Signed-off-by: Gaëtan Carlier <gcembed@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/mc13783-regulator.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c index 4977b199c86b..0801a6d0c122 100644 --- a/drivers/regulator/mc13783-regulator.c +++ b/drivers/regulator/mc13783-regulator.c | |||
@@ -21,6 +21,30 @@ | |||
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include "mc13xxx.h" | 22 | #include "mc13xxx.h" |
23 | 23 | ||
24 | #define MC13783_REG_SWITCHERS0 24 | ||
25 | /* Enable does not exist for SW1A */ | ||
26 | #define MC13783_REG_SWITCHERS0_SW1AEN 0 | ||
27 | #define MC13783_REG_SWITCHERS0_SW1AVSEL 0 | ||
28 | #define MC13783_REG_SWITCHERS0_SW1AVSEL_M (63 << 0) | ||
29 | |||
30 | #define MC13783_REG_SWITCHERS1 25 | ||
31 | /* Enable does not exist for SW1B */ | ||
32 | #define MC13783_REG_SWITCHERS1_SW1BEN 0 | ||
33 | #define MC13783_REG_SWITCHERS1_SW1BVSEL 0 | ||
34 | #define MC13783_REG_SWITCHERS1_SW1BVSEL_M (63 << 0) | ||
35 | |||
36 | #define MC13783_REG_SWITCHERS2 26 | ||
37 | /* Enable does not exist for SW2A */ | ||
38 | #define MC13783_REG_SWITCHERS2_SW2AEN 0 | ||
39 | #define MC13783_REG_SWITCHERS2_SW2AVSEL 0 | ||
40 | #define MC13783_REG_SWITCHERS2_SW2AVSEL_M (63 << 0) | ||
41 | |||
42 | #define MC13783_REG_SWITCHERS3 27 | ||
43 | /* Enable does not exist for SW2B */ | ||
44 | #define MC13783_REG_SWITCHERS3_SW2BEN 0 | ||
45 | #define MC13783_REG_SWITCHERS3_SW2BVSEL 0 | ||
46 | #define MC13783_REG_SWITCHERS3_SW2BVSEL_M (63 << 0) | ||
47 | |||
24 | #define MC13783_REG_SWITCHERS5 29 | 48 | #define MC13783_REG_SWITCHERS5 29 |
25 | #define MC13783_REG_SWITCHERS5_SW3EN (1 << 20) | 49 | #define MC13783_REG_SWITCHERS5_SW3EN (1 << 20) |
26 | #define MC13783_REG_SWITCHERS5_SW3VSEL 18 | 50 | #define MC13783_REG_SWITCHERS5_SW3VSEL 18 |
@@ -93,6 +117,44 @@ | |||
93 | 117 | ||
94 | 118 | ||
95 | /* Voltage Values */ | 119 | /* Voltage Values */ |
120 | static const int mc13783_sw1x_val[] = { | ||
121 | 900000, 925000, 950000, 975000, | ||
122 | 1000000, 1025000, 1050000, 1075000, | ||
123 | 1100000, 1125000, 1150000, 1175000, | ||
124 | 1200000, 1225000, 1250000, 1275000, | ||
125 | 1300000, 1325000, 1350000, 1375000, | ||
126 | 1400000, 1425000, 1450000, 1475000, | ||
127 | 1500000, 1525000, 1550000, 1575000, | ||
128 | 1600000, 1625000, 1650000, 1675000, | ||
129 | 1700000, 1700000, 1700000, 1700000, | ||
130 | 1800000, 1800000, 1800000, 1800000, | ||
131 | 1850000, 1850000, 1850000, 1850000, | ||
132 | 2000000, 2000000, 2000000, 2000000, | ||
133 | 2100000, 2100000, 2100000, 2100000, | ||
134 | 2200000, 2200000, 2200000, 2200000, | ||
135 | 2200000, 2200000, 2200000, 2200000, | ||
136 | 2200000, 2200000, 2200000, 2200000, | ||
137 | }; | ||
138 | |||
139 | static const int mc13783_sw2x_val[] = { | ||
140 | 900000, 925000, 950000, 975000, | ||
141 | 1000000, 1025000, 1050000, 1075000, | ||
142 | 1100000, 1125000, 1150000, 1175000, | ||
143 | 1200000, 1225000, 1250000, 1275000, | ||
144 | 1300000, 1325000, 1350000, 1375000, | ||
145 | 1400000, 1425000, 1450000, 1475000, | ||
146 | 1500000, 1525000, 1550000, 1575000, | ||
147 | 1600000, 1625000, 1650000, 1675000, | ||
148 | 1700000, 1700000, 1700000, 1700000, | ||
149 | 1800000, 1800000, 1800000, 1800000, | ||
150 | 1900000, 1900000, 1900000, 1900000, | ||
151 | 2000000, 2000000, 2000000, 2000000, | ||
152 | 2100000, 2100000, 2100000, 2100000, | ||
153 | 2200000, 2200000, 2200000, 2200000, | ||
154 | 2200000, 2200000, 2200000, 2200000, | ||
155 | 2200000, 2200000, 2200000, 2200000, | ||
156 | }; | ||
157 | |||
96 | static const unsigned int mc13783_sw3_val[] = { | 158 | static const unsigned int mc13783_sw3_val[] = { |
97 | 5000000, 5000000, 5000000, 5500000, | 159 | 5000000, 5000000, 5000000, 5500000, |
98 | }; | 160 | }; |
@@ -188,6 +250,10 @@ static struct regulator_ops mc13783_gpo_regulator_ops; | |||
188 | MC13783_DEFINE(REG, _name, _reg, _vsel_reg, _voltages) | 250 | MC13783_DEFINE(REG, _name, _reg, _vsel_reg, _voltages) |
189 | 251 | ||
190 | static struct mc13xxx_regulator mc13783_regulators[] = { | 252 | static struct mc13xxx_regulator mc13783_regulators[] = { |
253 | MC13783_DEFINE_SW(SW1A, SWITCHERS0, SWITCHERS0, mc13783_sw1x_val), | ||
254 | MC13783_DEFINE_SW(SW1B, SWITCHERS1, SWITCHERS1, mc13783_sw1x_val), | ||
255 | MC13783_DEFINE_SW(SW2A, SWITCHERS2, SWITCHERS2, mc13783_sw2x_val), | ||
256 | MC13783_DEFINE_SW(SW2B, SWITCHERS3, SWITCHERS3, mc13783_sw2x_val), | ||
191 | MC13783_DEFINE_SW(SW3, SWITCHERS5, SWITCHERS5, mc13783_sw3_val), | 257 | MC13783_DEFINE_SW(SW3, SWITCHERS5, SWITCHERS5, mc13783_sw3_val), |
192 | 258 | ||
193 | MC13783_FIXED_DEFINE(REG, VAUDIO, REGULATORMODE0, mc13783_vaudio_val), | 259 | MC13783_FIXED_DEFINE(REG, VAUDIO, REGULATORMODE0, mc13783_vaudio_val), |