aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@marvell.com>2009-06-26 07:20:59 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-09-22 08:32:37 -0400
commit0198d1163b3e0313b3f073b62384abfab1a17cff (patch)
treea1ce26a69a8eeb7939eaeb87774659588cb35355
parent9c19bc0444490e76197f47316c649590dc6f10a4 (diff)
regulator: add buck3 in da903x driver
BUCK3 is the new component in DA9035. So there're three BUCKs in DA9035. And there're two BUCKs in DA9034. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--drivers/regulator/da903x.c32
-rw-r--r--include/linux/mfd/da903x.h4
2 files changed, 35 insertions, 1 deletions
diff --git a/drivers/regulator/da903x.c b/drivers/regulator/da903x.c
index b8b89ef10a84..33dfeeb9407c 100644
--- a/drivers/regulator/da903x.c
+++ b/drivers/regulator/da903x.c
@@ -64,6 +64,14 @@
64#define DA9034_MDTV2 (0x33) 64#define DA9034_MDTV2 (0x33)
65#define DA9034_MVRC (0x34) 65#define DA9034_MVRC (0x34)
66 66
67/* DA9035 Registers. DA9034 Registers are comptabile to DA9035. */
68#define DA9035_OVER3 (0x12)
69#define DA9035_VCC2 (0x1f)
70#define DA9035_3DTV1 (0x2c)
71#define DA9035_3DTV2 (0x2d)
72#define DA9035_3VRC (0x2e)
73#define DA9035_AUTOSKIP (0x2f)
74
67struct da903x_regulator_info { 75struct da903x_regulator_info {
68 struct regulator_desc desc; 76 struct regulator_desc desc;
69 77
@@ -388,6 +396,27 @@ static struct regulator_ops da9034_regulator_ldo12_ops = {
388 .enable_bit = (ebit), \ 396 .enable_bit = (ebit), \
389} 397}
390 398
399#define DA9035_DVC(_id, min, max, step, vreg, nbits, ureg, ubit, ereg, ebit) \
400{ \
401 .desc = { \
402 .name = #_id, \
403 .ops = &da9034_regulator_dvc_ops, \
404 .type = REGULATOR_VOLTAGE, \
405 .id = DA9035_ID_##_id, \
406 .owner = THIS_MODULE, \
407 }, \
408 .min_uV = (min) * 1000, \
409 .max_uV = (max) * 1000, \
410 .step_uV = (step) * 1000, \
411 .vol_reg = DA9035_##vreg, \
412 .vol_shift = (0), \
413 .vol_nbits = (nbits), \
414 .update_reg = DA9035_##ureg, \
415 .update_bit = (ubit), \
416 .enable_reg = DA9035_##ereg, \
417 .enable_bit = (ebit), \
418}
419
391#define DA9034_LDO(_id, min, max, step, vreg, shift, nbits, ereg, ebit) \ 420#define DA9034_LDO(_id, min, max, step, vreg, shift, nbits, ereg, ebit) \
392 DA903x_LDO(DA9034, _id, min, max, step, vreg, shift, nbits, ereg, ebit) 421 DA903x_LDO(DA9034, _id, min, max, step, vreg, shift, nbits, ereg, ebit)
393 422
@@ -435,6 +464,9 @@ static struct da903x_regulator_info da903x_regulator_info[] = {
435 DA9034_LDO(14, 1800, 3300, 100, LDO1514, 0, 4, OVER3, 0), 464 DA9034_LDO(14, 1800, 3300, 100, LDO1514, 0, 4, OVER3, 0),
436 DA9034_LDO(15, 1800, 3300, 100, LDO1514, 4, 4, OVER3, 1), 465 DA9034_LDO(15, 1800, 3300, 100, LDO1514, 4, 4, OVER3, 1),
437 DA9034_LDO(5, 3100, 3100, 0, INVAL, 0, 0, OVER3, 7), /* fixed @3.1V */ 466 DA9034_LDO(5, 3100, 3100, 0, INVAL, 0, 0, OVER3, 7), /* fixed @3.1V */
467
468 /* DA9035 */
469 DA9035_DVC(BUCK3, 1800, 2200, 100, 3DTV1, 3, VCC2, 0, OVER3, 3),
438}; 470};
439 471
440static inline struct da903x_regulator_info *find_regulator_info(int id) 472static inline struct da903x_regulator_info *find_regulator_info(int id)
diff --git a/include/linux/mfd/da903x.h b/include/linux/mfd/da903x.h
index 115dbe965082..c63b65c94429 100644
--- a/include/linux/mfd/da903x.h
+++ b/include/linux/mfd/da903x.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_PMIC_DA903X_H 1#ifndef __LINUX_PMIC_DA903X_H
2#define __LINUX_PMIC_DA903X_H 2#define __LINUX_PMIC_DA903X_H
3 3
4/* Unified sub device IDs for DA9030/DA9034 */ 4/* Unified sub device IDs for DA9030/DA9034/DA9035 */
5enum { 5enum {
6 DA9030_ID_LED_1, 6 DA9030_ID_LED_1,
7 DA9030_ID_LED_2, 7 DA9030_ID_LED_2,
@@ -57,6 +57,8 @@ enum {
57 DA9034_ID_LDO13, 57 DA9034_ID_LDO13,
58 DA9034_ID_LDO14, 58 DA9034_ID_LDO14,
59 DA9034_ID_LDO15, 59 DA9034_ID_LDO15,
60
61 DA9035_ID_BUCK3,
60}; 62};
61 63
62/* 64/*