diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2014-05-21 02:52:47 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-06-17 10:16:10 -0400 |
commit | d0540f91cf74fab90e1143d8d40da8a5b5fabc8a (patch) | |
tree | 92f7a18906c67cbc598a4e2b182eea34699fcd97 /drivers/extcon | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) |
mfd: max77693: Remove unnecessary wrapper functions
This patch removes wrapper functions used to access regmap, and
make driver using regmap_*() functions instead.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Mark Brown <broonie@linaro.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/extcon-max77693.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c index 2c7c3e191591..ba84a6e77e03 100644 --- a/drivers/extcon/extcon-max77693.c +++ b/drivers/extcon/extcon-max77693.c | |||
@@ -255,10 +255,10 @@ static int max77693_muic_set_debounce_time(struct max77693_muic_info *info, | |||
255 | case ADC_DEBOUNCE_TIME_10MS: | 255 | case ADC_DEBOUNCE_TIME_10MS: |
256 | case ADC_DEBOUNCE_TIME_25MS: | 256 | case ADC_DEBOUNCE_TIME_25MS: |
257 | case ADC_DEBOUNCE_TIME_38_62MS: | 257 | case ADC_DEBOUNCE_TIME_38_62MS: |
258 | ret = max77693_update_reg(info->max77693->regmap_muic, | 258 | ret = regmap_update_bits(info->max77693->regmap_muic, |
259 | MAX77693_MUIC_REG_CTRL3, | 259 | MAX77693_MUIC_REG_CTRL3, |
260 | time << CONTROL3_ADCDBSET_SHIFT, | 260 | CONTROL3_ADCDBSET_MASK, |
261 | CONTROL3_ADCDBSET_MASK); | 261 | time << CONTROL3_ADCDBSET_SHIFT); |
262 | if (ret) { | 262 | if (ret) { |
263 | dev_err(info->dev, "failed to set ADC debounce time\n"); | 263 | dev_err(info->dev, "failed to set ADC debounce time\n"); |
264 | return ret; | 264 | return ret; |
@@ -286,15 +286,15 @@ static int max77693_muic_set_path(struct max77693_muic_info *info, | |||
286 | u8 val, bool attached) | 286 | u8 val, bool attached) |
287 | { | 287 | { |
288 | int ret = 0; | 288 | int ret = 0; |
289 | u8 ctrl1, ctrl2 = 0; | 289 | unsigned int ctrl1, ctrl2 = 0; |
290 | 290 | ||
291 | if (attached) | 291 | if (attached) |
292 | ctrl1 = val; | 292 | ctrl1 = val; |
293 | else | 293 | else |
294 | ctrl1 = CONTROL1_SW_OPEN; | 294 | ctrl1 = CONTROL1_SW_OPEN; |
295 | 295 | ||
296 | ret = max77693_update_reg(info->max77693->regmap_muic, | 296 | ret = regmap_update_bits(info->max77693->regmap_muic, |
297 | MAX77693_MUIC_REG_CTRL1, ctrl1, COMP_SW_MASK); | 297 | MAX77693_MUIC_REG_CTRL1, COMP_SW_MASK, ctrl1); |
298 | if (ret < 0) { | 298 | if (ret < 0) { |
299 | dev_err(info->dev, "failed to update MUIC register\n"); | 299 | dev_err(info->dev, "failed to update MUIC register\n"); |
300 | return ret; | 300 | return ret; |
@@ -305,9 +305,9 @@ static int max77693_muic_set_path(struct max77693_muic_info *info, | |||
305 | else | 305 | else |
306 | ctrl2 |= CONTROL2_LOWPWR_MASK; /* LowPwr=1, CPEn=0 */ | 306 | ctrl2 |= CONTROL2_LOWPWR_MASK; /* LowPwr=1, CPEn=0 */ |
307 | 307 | ||
308 | ret = max77693_update_reg(info->max77693->regmap_muic, | 308 | ret = regmap_update_bits(info->max77693->regmap_muic, |
309 | MAX77693_MUIC_REG_CTRL2, ctrl2, | 309 | MAX77693_MUIC_REG_CTRL2, |
310 | CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK); | 310 | CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK, ctrl2); |
311 | if (ret < 0) { | 311 | if (ret < 0) { |
312 | dev_err(info->dev, "failed to update MUIC register\n"); | 312 | dev_err(info->dev, "failed to update MUIC register\n"); |
313 | return ret; | 313 | return ret; |
@@ -969,8 +969,8 @@ static void max77693_muic_irq_work(struct work_struct *work) | |||
969 | if (info->irq == muic_irqs[i].virq) | 969 | if (info->irq == muic_irqs[i].virq) |
970 | irq_type = muic_irqs[i].irq; | 970 | irq_type = muic_irqs[i].irq; |
971 | 971 | ||
972 | ret = max77693_bulk_read(info->max77693->regmap_muic, | 972 | ret = regmap_bulk_read(info->max77693->regmap_muic, |
973 | MAX77693_MUIC_REG_STATUS1, 2, info->status); | 973 | MAX77693_MUIC_REG_STATUS1, info->status, 2); |
974 | if (ret) { | 974 | if (ret) { |
975 | dev_err(info->dev, "failed to read MUIC register\n"); | 975 | dev_err(info->dev, "failed to read MUIC register\n"); |
976 | mutex_unlock(&info->mutex); | 976 | mutex_unlock(&info->mutex); |
@@ -1042,8 +1042,8 @@ static int max77693_muic_detect_accessory(struct max77693_muic_info *info) | |||
1042 | mutex_lock(&info->mutex); | 1042 | mutex_lock(&info->mutex); |
1043 | 1043 | ||
1044 | /* Read STATUSx register to detect accessory */ | 1044 | /* Read STATUSx register to detect accessory */ |
1045 | ret = max77693_bulk_read(info->max77693->regmap_muic, | 1045 | ret = regmap_bulk_read(info->max77693->regmap_muic, |
1046 | MAX77693_MUIC_REG_STATUS1, 2, info->status); | 1046 | MAX77693_MUIC_REG_STATUS1, info->status, 2); |
1047 | if (ret) { | 1047 | if (ret) { |
1048 | dev_err(info->dev, "failed to read MUIC register\n"); | 1048 | dev_err(info->dev, "failed to read MUIC register\n"); |
1049 | mutex_unlock(&info->mutex); | 1049 | mutex_unlock(&info->mutex); |
@@ -1095,7 +1095,7 @@ static int max77693_muic_probe(struct platform_device *pdev) | |||
1095 | int delay_jiffies; | 1095 | int delay_jiffies; |
1096 | int ret; | 1096 | int ret; |
1097 | int i; | 1097 | int i; |
1098 | u8 id; | 1098 | unsigned int id; |
1099 | 1099 | ||
1100 | info = devm_kzalloc(&pdev->dev, sizeof(struct max77693_muic_info), | 1100 | info = devm_kzalloc(&pdev->dev, sizeof(struct max77693_muic_info), |
1101 | GFP_KERNEL); | 1101 | GFP_KERNEL); |
@@ -1204,7 +1204,7 @@ static int max77693_muic_probe(struct platform_device *pdev) | |||
1204 | enum max77693_irq_source irq_src | 1204 | enum max77693_irq_source irq_src |
1205 | = MAX77693_IRQ_GROUP_NR; | 1205 | = MAX77693_IRQ_GROUP_NR; |
1206 | 1206 | ||
1207 | max77693_write_reg(info->max77693->regmap_muic, | 1207 | regmap_write(info->max77693->regmap_muic, |
1208 | init_data[i].addr, | 1208 | init_data[i].addr, |
1209 | init_data[i].data); | 1209 | init_data[i].data); |
1210 | 1210 | ||
@@ -1262,7 +1262,7 @@ static int max77693_muic_probe(struct platform_device *pdev) | |||
1262 | max77693_muic_set_path(info, info->path_uart, true); | 1262 | max77693_muic_set_path(info, info->path_uart, true); |
1263 | 1263 | ||
1264 | /* Check revision number of MUIC device*/ | 1264 | /* Check revision number of MUIC device*/ |
1265 | ret = max77693_read_reg(info->max77693->regmap_muic, | 1265 | ret = regmap_read(info->max77693->regmap_muic, |
1266 | MAX77693_MUIC_REG_ID, &id); | 1266 | MAX77693_MUIC_REG_ID, &id); |
1267 | if (ret < 0) { | 1267 | if (ret < 0) { |
1268 | dev_err(&pdev->dev, "failed to read revision number\n"); | 1268 | dev_err(&pdev->dev, "failed to read revision number\n"); |