1
2
3
4
5
6
7#ifndef __LINUX_MFD_SEC_CORE_H
8#define __LINUX_MFD_SEC_CORE_H
9
10
11#define MIN_3000_MV 3000000
12#define MIN_2500_MV 2500000
13#define MIN_2000_MV 2000000
14#define MIN_1800_MV 1800000
15#define MIN_1500_MV 1500000
16#define MIN_1400_MV 1400000
17#define MIN_1000_MV 1000000
18
19#define MIN_900_MV 900000
20#define MIN_850_MV 850000
21#define MIN_800_MV 800000
22#define MIN_750_MV 750000
23#define MIN_650_MV 650000
24#define MIN_600_MV 600000
25#define MIN_500_MV 500000
26
27
28#define RAMP_DELAY_12_MVUS 12000
29
30
31#define STEP_50_MV 50000
32#define STEP_25_MV 25000
33#define STEP_12_5_MV 12500
34#define STEP_6_25_MV 6250
35
36struct gpio_desc;
37
38enum sec_device_type {
39 S5M8751X,
40 S5M8763X,
41 S5M8767X,
42 S2MPA01,
43 S2MPS11X,
44 S2MPS13X,
45 S2MPS14X,
46 S2MPS15X,
47 S2MPU02,
48};
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63struct sec_pmic_dev {
64 struct device *dev;
65 struct sec_platform_data *pdata;
66 struct regmap *regmap_pmic;
67 struct i2c_client *i2c;
68
69 unsigned long device_type;
70 int irq_base;
71 int irq;
72 struct regmap_irq_chip_data *irq_data;
73
74 bool wakeup;
75};
76
77int sec_irq_init(struct sec_pmic_dev *sec_pmic);
78void sec_irq_exit(struct sec_pmic_dev *sec_pmic);
79int sec_irq_resume(struct sec_pmic_dev *sec_pmic);
80
81struct sec_platform_data {
82 struct sec_regulator_data *regulators;
83 struct sec_opmode_data *opmode;
84 int device_type;
85 int num_regulators;
86
87 int irq_base;
88 int (*cfg_pmic_irq)(void);
89
90 bool wakeup;
91 bool buck_voltage_lock;
92
93 int buck_gpios[3];
94 int buck_ds[3];
95 unsigned int buck2_voltage[8];
96 bool buck2_gpiodvs;
97 unsigned int buck3_voltage[8];
98 bool buck3_gpiodvs;
99 unsigned int buck4_voltage[8];
100 bool buck4_gpiodvs;
101
102 int buck_set1;
103 int buck_set2;
104 int buck_set3;
105 int buck2_enable;
106 int buck3_enable;
107 int buck4_enable;
108 int buck_default_idx;
109 int buck2_default_idx;
110 int buck3_default_idx;
111 int buck4_default_idx;
112
113 int buck_ramp_delay;
114
115 int buck2_ramp_delay;
116 int buck34_ramp_delay;
117 int buck5_ramp_delay;
118 int buck16_ramp_delay;
119 int buck7810_ramp_delay;
120 int buck9_ramp_delay;
121 int buck24_ramp_delay;
122 int buck3_ramp_delay;
123 int buck7_ramp_delay;
124 int buck8910_ramp_delay;
125
126 bool buck1_ramp_enable;
127 bool buck2_ramp_enable;
128 bool buck3_ramp_enable;
129 bool buck4_ramp_enable;
130 bool buck6_ramp_enable;
131
132 int buck2_init;
133 int buck3_init;
134 int buck4_init;
135
136 bool manual_poweroff;
137
138 bool disable_wrstbi;
139};
140
141
142
143
144
145
146struct sec_regulator_data {
147 int id;
148 struct regulator_init_data *initdata;
149 struct device_node *reg_node;
150 struct gpio_desc *ext_control_gpiod;
151};
152
153
154
155
156
157
158struct sec_opmode_data {
159 int id;
160 unsigned int mode;
161};
162
163
164
165
166
167
168
169
170
171
172
173enum sec_opmode {
174 SEC_OPMODE_OFF,
175 SEC_OPMODE_ON,
176 SEC_OPMODE_LOWPOWER,
177 SEC_OPMODE_SUSPEND,
178};
179
180#endif
181