diff options
Diffstat (limited to 'drivers/mfd/palmas.c')
-rw-r--r-- | drivers/mfd/palmas.c | 44 |
1 files changed, 4 insertions, 40 deletions
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index c12759d1bd7c..28cb048f4760 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c | |||
@@ -25,42 +25,6 @@ | |||
25 | #include <linux/mfd/palmas.h> | 25 | #include <linux/mfd/palmas.h> |
26 | #include <linux/of_device.h> | 26 | #include <linux/of_device.h> |
27 | 27 | ||
28 | #define EXTERNAL_REQUESTOR(_id, _offset, _pos) \ | ||
29 | [PALMAS_EXTERNAL_REQSTR_ID_##_id] = { \ | ||
30 | .id = PALMAS_EXTERNAL_REQSTR_ID_##_id, \ | ||
31 | .reg_offset = _offset, \ | ||
32 | .bit_pos = _pos, \ | ||
33 | } | ||
34 | |||
35 | static struct palmas_sleep_requestor_info sleep_req_info[] = { | ||
36 | EXTERNAL_REQUESTOR(REGEN1, 0, 0), | ||
37 | EXTERNAL_REQUESTOR(REGEN2, 0, 1), | ||
38 | EXTERNAL_REQUESTOR(SYSEN1, 0, 2), | ||
39 | EXTERNAL_REQUESTOR(SYSEN2, 0, 3), | ||
40 | EXTERNAL_REQUESTOR(CLK32KG, 0, 4), | ||
41 | EXTERNAL_REQUESTOR(CLK32KGAUDIO, 0, 5), | ||
42 | EXTERNAL_REQUESTOR(REGEN3, 0, 6), | ||
43 | EXTERNAL_REQUESTOR(SMPS12, 1, 0), | ||
44 | EXTERNAL_REQUESTOR(SMPS3, 1, 1), | ||
45 | EXTERNAL_REQUESTOR(SMPS45, 1, 2), | ||
46 | EXTERNAL_REQUESTOR(SMPS6, 1, 3), | ||
47 | EXTERNAL_REQUESTOR(SMPS7, 1, 4), | ||
48 | EXTERNAL_REQUESTOR(SMPS8, 1, 5), | ||
49 | EXTERNAL_REQUESTOR(SMPS9, 1, 6), | ||
50 | EXTERNAL_REQUESTOR(SMPS10, 1, 7), | ||
51 | EXTERNAL_REQUESTOR(LDO1, 2, 0), | ||
52 | EXTERNAL_REQUESTOR(LDO2, 2, 1), | ||
53 | EXTERNAL_REQUESTOR(LDO3, 2, 2), | ||
54 | EXTERNAL_REQUESTOR(LDO4, 2, 3), | ||
55 | EXTERNAL_REQUESTOR(LDO5, 2, 4), | ||
56 | EXTERNAL_REQUESTOR(LDO6, 2, 5), | ||
57 | EXTERNAL_REQUESTOR(LDO7, 2, 6), | ||
58 | EXTERNAL_REQUESTOR(LDO8, 2, 7), | ||
59 | EXTERNAL_REQUESTOR(LDO9, 3, 0), | ||
60 | EXTERNAL_REQUESTOR(LDOLN, 3, 1), | ||
61 | EXTERNAL_REQUESTOR(LDOUSB, 3, 2), | ||
62 | }; | ||
63 | |||
64 | static const struct regmap_config palmas_regmap_config[PALMAS_NUM_CLIENTS] = { | 28 | static const struct regmap_config palmas_regmap_config[PALMAS_NUM_CLIENTS] = { |
65 | { | 29 | { |
66 | .reg_bits = 8, | 30 | .reg_bits = 8, |
@@ -365,10 +329,10 @@ static struct regmap_irq_chip tps65917_irq_chip = { | |||
365 | int palmas_ext_control_req_config(struct palmas *palmas, | 329 | int palmas_ext_control_req_config(struct palmas *palmas, |
366 | enum palmas_external_requestor_id id, int ext_ctrl, bool enable) | 330 | enum palmas_external_requestor_id id, int ext_ctrl, bool enable) |
367 | { | 331 | { |
332 | struct palmas_pmic_driver_data *pmic_ddata = palmas->pmic_ddata; | ||
368 | int preq_mask_bit = 0; | 333 | int preq_mask_bit = 0; |
369 | int reg_add = 0; | 334 | int reg_add = 0; |
370 | int bit_pos; | 335 | int bit_pos, ret; |
371 | int ret; | ||
372 | 336 | ||
373 | if (!(ext_ctrl & PALMAS_EXT_REQ)) | 337 | if (!(ext_ctrl & PALMAS_EXT_REQ)) |
374 | return 0; | 338 | return 0; |
@@ -387,8 +351,8 @@ int palmas_ext_control_req_config(struct palmas *palmas, | |||
387 | preq_mask_bit = 2; | 351 | preq_mask_bit = 2; |
388 | } | 352 | } |
389 | 353 | ||
390 | bit_pos = sleep_req_info[id].bit_pos; | 354 | bit_pos = pmic_ddata->sleep_req_info[id].bit_pos; |
391 | reg_add += sleep_req_info[id].reg_offset; | 355 | reg_add += pmic_ddata->sleep_req_info[id].reg_offset; |
392 | if (enable) | 356 | if (enable) |
393 | ret = palmas_update_bits(palmas, PALMAS_RESOURCE_BASE, | 357 | ret = palmas_update_bits(palmas, PALMAS_RESOURCE_BASE, |
394 | reg_add, BIT(bit_pos), BIT(bit_pos)); | 358 | reg_add, BIT(bit_pos), BIT(bit_pos)); |