Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

misc: tps6594-pfsm: Add TI TPS652G1 PMIC PFSM

The TPS652G1 is a stripped down TPS65224, but the PFSM is the same.
Thus, handle it the same way as the TPS65224 in the driver.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de> # drivers/misc/
Link: https://lore.kernel.org/r/20250613114518.1772109-3-mwalle@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Michael Walle and committed by
Lee Jones
9cba6a7e 626bb0a4

+21 -10
+21 -10
drivers/misc/tps6594-pfsm.c
··· 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 */ ··· 147 141 switch (cmd) { 148 142 case PMIC_GOTO_STANDBY: 149 143 /* Disable LP mode on TPS6594 Family PMIC */ 150 - if (pfsm->chip_id != TPS65224) { 144 + if (pfsm->chip_id != TPS65224 && pfsm->chip_id != TPS652G1) { 151 145 ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_RTC_CTRL_2, 152 146 TPS6594_BIT_LP_STANDBY_SEL); 153 147 ··· 160 154 TPS6594_BIT_TRIGGER_I2C(0), TPS6594_BIT_TRIGGER_I2C(0)); 161 155 break; 162 156 case PMIC_GOTO_LP_STANDBY: 163 - /* TPS65224 does not support LP STANDBY */ 164 - if (pfsm->chip_id == TPS65224) 157 + /* TPS65224/TPS652G1 does not support LP STANDBY */ 158 + if (pfsm->chip_id == TPS65224 || pfsm->chip_id == TPS652G1) 165 159 return ret; 166 160 167 161 /* Enable LP mode */ ··· 185 179 TPS6594_BIT_NSLEEP1B | TPS6594_BIT_NSLEEP2B); 186 180 break; 187 181 case PMIC_SET_MCU_ONLY_STATE: 188 - /* TPS65224 does not support MCU_ONLY_STATE */ 189 - if (pfsm->chip_id == TPS65224) 182 + /* TPS65224/TPS652G1 does not support MCU_ONLY_STATE */ 183 + if (pfsm->chip_id == TPS65224 || pfsm->chip_id == TPS652G1) 190 184 return ret; 191 185 192 186 if (copy_from_user(&state_opt, argp, sizeof(state_opt))) ··· 212 206 return -EFAULT; 213 207 214 208 /* Configure wake-up destination */ 215 - if (pfsm->chip_id == TPS65224) { 209 + if (pfsm->chip_id == TPS65224 || pfsm->chip_id == TPS652G1) { 216 210 regmap_reg = TPS65224_REG_STARTUP_CTRL; 217 211 mask = TPS65224_MASK_STARTUP_DEST; 218 212 } else { ··· 236 230 return ret; 237 231 238 232 /* Modify NSLEEP1-2 bits */ 239 - ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS, 240 - pfsm->chip_id == TPS65224 ? 241 - TPS6594_BIT_NSLEEP1B : TPS6594_BIT_NSLEEP2B); 233 + if (pfsm->chip_id == TPS65224 || pfsm->chip_id == TPS652G1) 234 + ret = regmap_clear_bits(pfsm->regmap, 235 + TPS6594_REG_FSM_NSLEEP_TRIGGERS, 236 + TPS6594_BIT_NSLEEP1B); 237 + else 238 + ret = regmap_clear_bits(pfsm->regmap, 239 + TPS6594_REG_FSM_NSLEEP_TRIGGERS, 240 + TPS6594_BIT_NSLEEP2B); 242 241 break; 243 242 } 244 243