aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-05 19:19:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-05 19:19:15 -0400
commit91c2ff7708d4edf73ef1f0abb3ea4a44b4b0cf1d (patch)
tree43ddc350e2ee5e0f20b5273accdcc597b89da1f6 /include
parent1325b6550a7b9cda52ee4c0da04fa9f93d2618fc (diff)
parentf955c8ba265540617da67d528ea74e50d48ad2be (diff)
Merge tag 'regulator-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "A couple of nice new features this month, the ability to map regulators in order to allow voltage control by external coprocessors is something people have been asking for for a long time. - improved support for switch only "regulators", allowing current state to be read from the parent regulator but no setting. - support for obtaining the register access method used to set voltages, for use in systems which can offload control of this to a coprocessor (typically for DVFS). - support for Active-Semi AC8846, Dialog DA9211 and Texas Instruments TPS65917" * tag 'regulator-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (58 commits) regulator: act8865: fix build when OF is not enabled regulator: act8865: add act8846 to DT binding documentation regulator: act8865: add support for act8846 regulator: act8865: prepare support for other act88xx devices regulator: act8865: set correct number of regulators in pdata regulator: act8865: Remove error variable in act8865_pmic_probe regulator: act8865: fix parsing of platform data regulator: tps65090: Set voltage for fixed regulators regulator: core: Allow to get voltage count and list from parent regulator: core: Get voltage from parent if not available regulator: Add missing statics and inlines for stub functions regulator: lp872x: Don't set constraints within the regulator driver regmap: Fix return code for stub regmap_get_device() regulator: s2mps11: Update module description and Kconfig to add S2MPU02 support regulator: Add helpers for low-level register access regmap: Allow regmap_get_device() to be used by modules regmap: Add regmap_get_device regulator: da9211: Remove unnecessary devm_regulator_unregister() calls regulator: Add DT bindings for tps65218 PMIC regulators. regulator: da9211: new regulator driver ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/palmas.h837
-rw-r--r--include/linux/regmap.h7
-rw-r--r--include/linux/regulator/ab8500.h14
-rw-r--r--include/linux/regulator/act8865.h23
-rw-r--r--include/linux/regulator/consumer.h26
-rw-r--r--include/linux/regulator/da9211.h32
6 files changed, 924 insertions, 15 deletions
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 3420e09e2e20..fb0390a1a498 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -30,6 +30,8 @@
30#define PALMAS_CHIP_ID 0xC035 30#define PALMAS_CHIP_ID 0xC035
31#define PALMAS_CHIP_CHARGER_ID 0xC036 31#define PALMAS_CHIP_CHARGER_ID 0xC036
32 32
33#define TPS65917_RESERVED -1
34
33#define is_palmas(a) (((a) == PALMAS_CHIP_OLD_ID) || \ 35#define is_palmas(a) (((a) == PALMAS_CHIP_OLD_ID) || \
34 ((a) == PALMAS_CHIP_ID)) 36 ((a) == PALMAS_CHIP_ID))
35#define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID) 37#define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID)
@@ -51,6 +53,8 @@ struct palmas_pmic;
51struct palmas_gpadc; 53struct palmas_gpadc;
52struct palmas_resource; 54struct palmas_resource;
53struct palmas_usb; 55struct palmas_usb;
56struct palmas_pmic_driver_data;
57struct palmas_pmic_platform_data;
54 58
55enum palmas_usb_state { 59enum palmas_usb_state {
56 PALMAS_USB_STATE_DISCONNECT, 60 PALMAS_USB_STATE_DISCONNECT,
@@ -74,6 +78,8 @@ struct palmas {
74 struct mutex irq_lock; 78 struct mutex irq_lock;
75 struct regmap_irq_chip_data *irq_data; 79 struct regmap_irq_chip_data *irq_data;
76 80
81 struct palmas_pmic_driver_data *pmic_ddata;
82
77 /* Child Devices */ 83 /* Child Devices */
78 struct palmas_pmic *pmic; 84 struct palmas_pmic *pmic;
79 struct palmas_gpadc *gpadc; 85 struct palmas_gpadc *gpadc;
@@ -86,6 +92,46 @@ struct palmas {
86 u8 pwm_muxed; 92 u8 pwm_muxed;
87}; 93};
88 94
95#define PALMAS_EXT_REQ (PALMAS_EXT_CONTROL_ENABLE1 | \
96 PALMAS_EXT_CONTROL_ENABLE2 | \
97 PALMAS_EXT_CONTROL_NSLEEP)
98
99struct palmas_sleep_requestor_info {
100 int id;
101 int reg_offset;
102 int bit_pos;
103};
104
105struct palmas_regs_info {
106 char *name;
107 char *sname;
108 u8 vsel_addr;
109 u8 ctrl_addr;
110 u8 tstep_addr;
111 int sleep_id;
112};
113
114struct palmas_pmic_driver_data {
115 int smps_start;
116 int smps_end;
117 int ldo_begin;
118 int ldo_end;
119 int max_reg;
120 struct palmas_regs_info *palmas_regs_info;
121 struct of_regulator_match *palmas_matches;
122 struct palmas_sleep_requestor_info *sleep_req_info;
123 int (*smps_register)(struct palmas_pmic *pmic,
124 struct palmas_pmic_driver_data *ddata,
125 struct palmas_pmic_platform_data *pdata,
126 const char *pdev_name,
127 struct regulator_config config);
128 int (*ldo_register)(struct palmas_pmic *pmic,
129 struct palmas_pmic_driver_data *ddata,
130 struct palmas_pmic_platform_data *pdata,
131 const char *pdev_name,
132 struct regulator_config config);
133};
134
89struct palmas_gpadc_platform_data { 135struct palmas_gpadc_platform_data {
90 /* Channel 3 current source is only enabled during conversion */ 136 /* Channel 3 current source is only enabled during conversion */
91 int ch3_current; 137 int ch3_current;
@@ -184,6 +230,27 @@ enum palmas_regulators {
184 PALMAS_NUM_REGS, 230 PALMAS_NUM_REGS,
185}; 231};
186 232
233enum tps65917_regulators {
234 /* SMPS regulators */
235 TPS65917_REG_SMPS1,
236 TPS65917_REG_SMPS2,
237 TPS65917_REG_SMPS3,
238 TPS65917_REG_SMPS4,
239 TPS65917_REG_SMPS5,
240 /* LDO regulators */
241 TPS65917_REG_LDO1,
242 TPS65917_REG_LDO2,
243 TPS65917_REG_LDO3,
244 TPS65917_REG_LDO4,
245 TPS65917_REG_LDO5,
246 TPS65917_REG_REGEN1,
247 TPS65917_REG_REGEN2,
248 TPS65917_REG_REGEN3,
249
250 /* Total number of regulators */
251 TPS65917_NUM_REGS,
252};
253
187/* External controll signal name */ 254/* External controll signal name */
188enum { 255enum {
189 PALMAS_EXT_CONTROL_ENABLE1 = 0x1, 256 PALMAS_EXT_CONTROL_ENABLE1 = 0x1,
@@ -228,6 +295,24 @@ enum palmas_external_requestor_id {
228 PALMAS_EXTERNAL_REQSTR_ID_MAX, 295 PALMAS_EXTERNAL_REQSTR_ID_MAX,
229}; 296};
230 297
298enum tps65917_external_requestor_id {
299 TPS65917_EXTERNAL_REQSTR_ID_REGEN1,
300 TPS65917_EXTERNAL_REQSTR_ID_REGEN2,
301 TPS65917_EXTERNAL_REQSTR_ID_REGEN3,
302 TPS65917_EXTERNAL_REQSTR_ID_SMPS1,
303 TPS65917_EXTERNAL_REQSTR_ID_SMPS2,
304 TPS65917_EXTERNAL_REQSTR_ID_SMPS3,
305 TPS65917_EXTERNAL_REQSTR_ID_SMPS4,
306 TPS65917_EXTERNAL_REQSTR_ID_SMPS5,
307 TPS65917_EXTERNAL_REQSTR_ID_LDO1,
308 TPS65917_EXTERNAL_REQSTR_ID_LDO2,
309 TPS65917_EXTERNAL_REQSTR_ID_LDO3,
310 TPS65917_EXTERNAL_REQSTR_ID_LDO4,
311 TPS65917_EXTERNAL_REQSTR_ID_LDO5,
312 /* Last entry */
313 TPS65917_EXTERNAL_REQSTR_ID_MAX,
314};
315
231struct palmas_pmic_platform_data { 316struct palmas_pmic_platform_data {
232 /* An array of pointers to regulator init data indexed by regulator 317 /* An array of pointers to regulator init data indexed by regulator
233 * ID 318 * ID
@@ -349,6 +434,48 @@ struct palmas_gpadc_result {
349 434
350#define PALMAS_MAX_CHANNELS 16 435#define PALMAS_MAX_CHANNELS 16
351 436
437/* Define the tps65917 IRQ numbers */
438enum tps65917_irqs {
439 /* INT1 registers */
440 TPS65917_RESERVED1,
441 TPS65917_PWRON_IRQ,
442 TPS65917_LONG_PRESS_KEY_IRQ,
443 TPS65917_RESERVED2,
444 TPS65917_PWRDOWN_IRQ,
445 TPS65917_HOTDIE_IRQ,
446 TPS65917_VSYS_MON_IRQ,
447 TPS65917_RESERVED3,
448 /* INT2 registers */
449 TPS65917_RESERVED4,
450 TPS65917_OTP_ERROR_IRQ,
451 TPS65917_WDT_IRQ,
452 TPS65917_RESERVED5,
453 TPS65917_RESET_IN_IRQ,
454 TPS65917_FSD_IRQ,
455 TPS65917_SHORT_IRQ,
456 TPS65917_RESERVED6,
457 /* INT3 registers */
458 TPS65917_GPADC_AUTO_0_IRQ,
459 TPS65917_GPADC_AUTO_1_IRQ,
460 TPS65917_GPADC_EOC_SW_IRQ,
461 TPS65917_RESREVED6,
462 TPS65917_RESERVED7,
463 TPS65917_RESERVED8,
464 TPS65917_RESERVED9,
465 TPS65917_VBUS_IRQ,
466 /* INT4 registers */
467 TPS65917_GPIO_0_IRQ,
468 TPS65917_GPIO_1_IRQ,
469 TPS65917_GPIO_2_IRQ,
470 TPS65917_GPIO_3_IRQ,