1
2
3
4
5
6
7
8 #ifndef __LP872X_REGULATOR_H__
9 #define __LP872X_REGULATOR_H__
10
11 #include <linux/regulator/machine.h>
12 #include <linux/platform_device.h>
13 #include <linux/gpio.h>
14
15 #define LP872X_MAX_REGULATORS 9
16
17 #define LP8720_ENABLE_DELAY 200
18 #define LP8725_ENABLE_DELAY 30000
19
20 enum lp872x_regulator_id {
21 LP8720_ID_BASE,
22 LP8720_ID_LDO1 = LP8720_ID_BASE,
23 LP8720_ID_LDO2,
24 LP8720_ID_LDO3,
25 LP8720_ID_LDO4,
26 LP8720_ID_LDO5,
27 LP8720_ID_BUCK,
28
29 LP8725_ID_BASE,
30 LP8725_ID_LDO1 = LP8725_ID_BASE,
31 LP8725_ID_LDO2,
32 LP8725_ID_LDO3,
33 LP8725_ID_LDO4,
34 LP8725_ID_LDO5,
35 LP8725_ID_LILO1,
36 LP8725_ID_LILO2,
37 LP8725_ID_BUCK1,
38 LP8725_ID_BUCK2,
39
40 LP872X_ID_MAX,
41 };
42
43 enum lp872x_dvs_state {
44 DVS_LOW = GPIOF_OUT_INIT_LOW,
45 DVS_HIGH = GPIOF_OUT_INIT_HIGH,
46 };
47
48 enum lp872x_dvs_sel {
49 SEL_V1,
50 SEL_V2,
51 };
52
53
54
55
56
57
58
59 struct lp872x_dvs {
60 int gpio;
61 enum lp872x_dvs_sel vsel;
62 enum lp872x_dvs_state init_state;
63 };
64
65
66
67
68
69
70 struct lp872x_regulator_data {
71 enum lp872x_regulator_id id;
72 struct regulator_init_data *init_data;
73 };
74
75
76
77
78
79
80
81
82
83 struct lp872x_platform_data {
84 u8 general_config;
85 bool update_config;
86 struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS];
87 struct lp872x_dvs *dvs;
88 int enable_gpio;
89 };
90
91 #endif