2011-04-18 14:11:05

by Haojian Zhuang

[permalink] [raw]
Subject: [PATCH 12/14] regulator: max8925: enable 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 <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
---
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 8ae1475..e4dbd66 100644
--- a/drivers/regulator/max8925-regulator.c
+++ b/drivers/regulator/max8925-regulator.c
@@ -23,6 +23,10 @@
#define SD1_DVM_SHIFT 5 /* SDCTL1 bit5 */
#define SD1_DVM_EN 6 /* SDV1 bit 6 */

+/* bit definitions in SD & LDO control registers */
+#define OUT_ENABLE 0x1f /* Power U/D sequence as I2C */
+#define OUT_DISABLE 0x1e /* Power U/D sequence as I2C */
+
struct max8925_regulator_info {
struct regulator_desc desc;
struct regulator_dev *regulator;
@@ -93,8 +97,8 @@ static int max8925_enable(struct regulator_dev *rdev)
struct max8925_regulator_info *info = rdev_get_drvdata(rdev);

return max8925_set_bits(info->i2c, info->enable_reg,
- 1 << info->enable_bit,
- 1 << info->enable_bit);
+ OUT_ENABLE << info->enable_bit,
+ OUT_ENABLE << info->enable_bit);
}

static int max8925_disable(struct regulator_dev *rdev)
@@ -102,7 +106,8 @@ static int max8925_disable(struct regulator_dev *rdev)
struct max8925_regulator_info *info = rdev_get_drvdata(rdev);

return max8925_set_bits(info->i2c, info->enable_reg,
- 1 << info->enable_bit, 0);
+ OUT_ENABLE << info->enable_bit,
+ OUT_DISABLE << info->enable_bit);
}

static int max8925_is_enabled(struct regulator_dev *rdev)
--
1.5.6.5


2011-04-18 14:27:16

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 12/14] regulator: max8925: enable i2c sequence for control

On Mon, Apr 18, 2011 at 10:04:09PM +0800, Haojian Zhuang wrote:
> Force to enable i2c as power up/down sequence. Otherwise, SD/LDO can't
> be enabled or disabled via accessing i2c bus.

Acked-by: Mark Brown <[email protected]>

but please work on the quality of your changelogs.

2011-05-02 15:16:49

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH 12/14] regulator: max8925: enable i2c sequence for control

Hi Haojian,

On Mon, Apr 18, 2011 at 10:04:09PM +0800, Haojian Zhuang wrote:
> Force to enable i2c as power up/down sequence. Otherwise, SD/LDO can't
> be enabled or disabled via accessing i2c bus.
>
Patch applied to my for-next branch, thanks.

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/