From a7524ab7bff09a8705c533ffef2fd29f5fd9ce28 Mon Sep 17 00:00:00 2001 From: Xin Xie Date: Tue, 16 Aug 2011 14:24:31 -0700 Subject: regulator: max8952: force PWM mode BUG 860982 Change-Id: I7ffaa6825ed873364143784d9939bea8224d8200 Reviewed-on: http://git-master/r/47385 Reviewed-by: Hyong Bin Kim Tested-by: Hyong Bin Kim Reviewed-by: Bharat Nihalani Reviewed-by: Simon Je Tested-by: Simon Je --- drivers/regulator/max8952.c | 11 +++++++++++ include/linux/regulator/max8952.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c index bc0c8b8835c5..9ff509d01f55 100644 --- a/drivers/regulator/max8952.c +++ b/drivers/regulator/max8952.c @@ -211,6 +211,15 @@ static int max8952_set_voltage(struct regulator_dev *rdev, int min_uV, val); } +static int max8952_set_fpwm(struct regulator_dev *rdev, int en) +{ + struct max8952 *max8952 = rdev_get_drvdata(rdev); + const struct max8952_info *reg = &max8952_regulators[rdev_get_id(rdev)]; + + return max8952_set_bits(max8952, reg->reg_base, MAX8952_MASK_FPWM_EN, + en ? MAX8952_MASK_FPWM_EN : 0); +} + static int max8952_get_voltage(struct regulator_dev *rdev) { struct max8952 *max8952 = rdev_get_drvdata(rdev); @@ -256,6 +265,8 @@ static int __devinit max8952_probe(struct i2c_client *i2c, } i2c_set_clientdata(i2c, max8952); + /* force PWM mode */ + max8952_set_fpwm(rdev, 1); return 0; error: diff --git a/include/linux/regulator/max8952.h b/include/linux/regulator/max8952.h index abe50beb1b55..f5362275e5ae 100644 --- a/include/linux/regulator/max8952.h +++ b/include/linux/regulator/max8952.h @@ -24,6 +24,7 @@ #define MAX8952_REG_CHIP_ID2 0x09 /* Register bit-mask */ +#define MAX8952_MASK_FPWM_EN 0x80 #define MAX8952_MASK_OUTMODE 0x3F /* IDs */ -- cgit v1.2.3