diff options
author | Haojian Zhuang <haojian.zhuang@marvell.com> | 2011-04-18 10:04:09 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-05-26 13:45:33 -0400 |
commit | db13c04002e0d896f89657f9b2837a8ecfbb19b6 (patch) | |
tree | ca0e8f702d7485c49fee8e8a843be78789505f09 /drivers/regulator | |
parent | 2402ca5e300db0d88fce9e0b3a5218863c71b694 (diff) |
regulator: Enable max8925 i2c sequence for control
Force to enable i2c as power up/down sequence. Otherwise, SD/LDO can't
be enabled or disabled via accessing i2c bus.
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/max8925-regulator.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c index 8ae147549c6a..e4dbd667c043 100644 --- a/drivers/regulator/max8925-regulator.c +++ b/drivers/regulator/max8925-regulator.c | |||
@@ -23,6 +23,10 @@ | |||
23 | #define SD1_DVM_SHIFT 5 /* SDCTL1 bit5 */ | 23 | #define SD1_DVM_SHIFT 5 /* SDCTL1 bit5 */ |
24 | #define SD1_DVM_EN 6 /* SDV1 bit 6 */ | 24 | #define SD1_DVM_EN 6 /* SDV1 bit 6 */ |
25 | 25 | ||
26 | /* bit definitions in SD & LDO control registers */ | ||
27 | #define OUT_ENABLE 0x1f /* Power U/D sequence as I2C */ | ||
28 | #define OUT_DISABLE 0x1e /* Power U/D sequence as I2C */ | ||
29 | |||
26 | struct max8925_regulator_info { | 30 | struct max8925_regulator_info { |
27 | struct regulator_desc desc; | 31 | struct regulator_desc desc; |
28 | struct regulator_dev *regulator; | 32 | struct regulator_dev *regulator; |
@@ -93,8 +97,8 @@ static int max8925_enable(struct regulator_dev *rdev) | |||
93 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | 97 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); |
94 | 98 | ||
95 | return max8925_set_bits(info->i2c, info->enable_reg, | 99 | return max8925_set_bits(info->i2c, info->enable_reg, |
96 | 1 << info->enable_bit, | 100 | OUT_ENABLE << info->enable_bit, |
97 | 1 << info->enable_bit); | 101 | OUT_ENABLE << info->enable_bit); |
98 | } | 102 | } |
99 | 103 | ||
100 | static int max8925_disable(struct regulator_dev *rdev) | 104 | static int max8925_disable(struct regulator_dev *rdev) |
@@ -102,7 +106,8 @@ static int max8925_disable(struct regulator_dev *rdev) | |||
102 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); | 106 | struct max8925_regulator_info *info = rdev_get_drvdata(rdev); |
103 | 107 | ||
104 | return max8925_set_bits(info->i2c, info->enable_reg, | 108 | return max8925_set_bits(info->i2c, info->enable_reg, |
105 | 1 << info->enable_bit, 0); | 109 | OUT_ENABLE << info->enable_bit, |
110 | OUT_DISABLE << info->enable_bit); | ||
106 | } | 111 | } |
107 | 112 | ||
108 | static int max8925_is_enabled(struct regulator_dev *rdev) | 113 | static int max8925_is_enabled(struct regulator_dev *rdev) |