1
1
// SPDX-License-Identifier: GPL-2.0
2
2
/*
3
- * PFSM (Pre-configurable Finite State Machine) driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs
3
+ * PFSM (Pre-configurable Finite State Machine) driver for the following
4
+ * PMICs:
5
+ * - LP8764
6
+ * - TPS65224
7
+ * - TPS652G1
8
+ * - TPS6594
9
+ * - TPS6593
4
10
*
5
11
* Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
6
12
*/
@@ -141,7 +147,7 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a
141
147
switch (cmd ) {
142
148
case PMIC_GOTO_STANDBY :
143
149
/* Disable LP mode on TPS6594 Family PMIC */
144
- if (pfsm -> chip_id != TPS65224 ) {
150
+ if (pfsm -> chip_id != TPS65224 && pfsm -> chip_id != TPS652G1 ) {
145
151
ret = regmap_clear_bits (pfsm -> regmap , TPS6594_REG_RTC_CTRL_2 ,
146
152
TPS6594_BIT_LP_STANDBY_SEL );
147
153
@@ -154,8 +160,8 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a
154
160
TPS6594_BIT_TRIGGER_I2C (0 ), TPS6594_BIT_TRIGGER_I2C (0 ));
155
161
break ;
156
162
case PMIC_GOTO_LP_STANDBY :
157
- /* TPS65224 does not support LP STANDBY */
158
- if (pfsm -> chip_id == TPS65224 )
163
+ /* TPS65224/TPS652G1 does not support LP STANDBY */
164
+ if (pfsm -> chip_id == TPS65224 || pfsm -> chip_id == TPS652G1 )
159
165
return ret ;
160
166
161
167
/* Enable LP mode */
@@ -179,8 +185,8 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a
179
185
TPS6594_BIT_NSLEEP1B | TPS6594_BIT_NSLEEP2B );
180
186
break ;
181
187
case PMIC_SET_MCU_ONLY_STATE :
182
- /* TPS65224 does not support MCU_ONLY_STATE */
183
- if (pfsm -> chip_id == TPS65224 )
188
+ /* TPS65224/TPS652G1 does not support MCU_ONLY_STATE */
189
+ if (pfsm -> chip_id == TPS65224 || pfsm -> chip_id == TPS652G1 )
184
190
return ret ;
185
191
186
192
if (copy_from_user (& state_opt , argp , sizeof (state_opt )))
@@ -206,7 +212,7 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a
206
212
return - EFAULT ;
207
213
208
214
/* Configure wake-up destination */
209
- if (pfsm -> chip_id == TPS65224 ) {
215
+ if (pfsm -> chip_id == TPS65224 || pfsm -> chip_id == TPS652G1 ) {
210
216
regmap_reg = TPS65224_REG_STARTUP_CTRL ;
211
217
mask = TPS65224_MASK_STARTUP_DEST ;
212
218
} else {
@@ -230,9 +236,14 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a
230
236
return ret ;
231
237
232
238
/* Modify NSLEEP1-2 bits */
233
- ret = regmap_clear_bits (pfsm -> regmap , TPS6594_REG_FSM_NSLEEP_TRIGGERS ,
234
- pfsm -> chip_id == TPS65224 ?
235
- TPS6594_BIT_NSLEEP1B : TPS6594_BIT_NSLEEP2B );
239
+ if (pfsm -> chip_id == TPS65224 || pfsm -> chip_id == TPS652G1 )
240
+ ret = regmap_clear_bits (pfsm -> regmap ,
241
+ TPS6594_REG_FSM_NSLEEP_TRIGGERS ,
242
+ TPS6594_BIT_NSLEEP1B );
243
+ else
244
+ ret = regmap_clear_bits (pfsm -> regmap ,
245
+ TPS6594_REG_FSM_NSLEEP_TRIGGERS ,
246
+ TPS6594_BIT_NSLEEP2B );
236
247
break ;
237
248
}
238
249
0 commit comments