diff options
author | Axel Lin <axel.lin@ingics.com> | 2012-10-11 22:03:51 +0800 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2012-12-05 10:55:55 -0800 |
commit | d9b24e373d160ffd56633cc9a4b2e4013c2682d1 (patch) | |
tree | b6b3ff4d07309a29f8cad97e673ff04bbeb10513 /drivers/hwmon | |
parent | 72cbdddcc158fa52056619b81624df0cd9125a26 (diff) | |
download | linux-d9b24e373d160ffd56633cc9a4b2e4013c2682d1.tar.bz2 |
hwmon: da9052: Use da9052_reg_update for rmw operations
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/da9052-hwmon.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/hwmon/da9052-hwmon.c b/drivers/hwmon/da9052-hwmon.c index b8d01c5f5713..19704948801c 100644 --- a/drivers/hwmon/da9052-hwmon.c +++ b/drivers/hwmon/da9052-hwmon.c @@ -60,30 +60,17 @@ static inline int vbbat_reg_to_mV(int value) return DIV_ROUND_CLOSEST(value * 2500, 512); } -static int da9052_enable_vddout_channel(struct da9052 *da9052) +static inline int da9052_enable_vddout_channel(struct da9052 *da9052) { - int ret; - - ret = da9052_reg_read(da9052, DA9052_ADC_CONT_REG); - if (ret < 0) - return ret; - - ret |= DA9052_ADCCONT_AUTOVDDEN; - - return da9052_reg_write(da9052, DA9052_ADC_CONT_REG, ret); + return da9052_reg_update(da9052, DA9052_ADC_CONT_REG, + DA9052_ADCCONT_AUTOVDDEN, + DA9052_ADCCONT_AUTOVDDEN); } -static int da9052_disable_vddout_channel(struct da9052 *da9052) +static inline int da9052_disable_vddout_channel(struct da9052 *da9052) { - int ret; - - ret = da9052_reg_read(da9052, DA9052_ADC_CONT_REG); - if (ret < 0) - return ret; - - ret &= ~DA9052_ADCCONT_AUTOVDDEN; - - return da9052_reg_write(da9052, DA9052_ADC_CONT_REG, ret); + return da9052_reg_update(da9052, DA9052_ADC_CONT_REG, + DA9052_ADCCONT_AUTOVDDEN, 0); } static ssize_t da9052_read_vddout(struct device *dev, |