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

regulator: pfuze100-regulator: add coin support

Add support for PF0200 coin cell/super capacitor charger which works as
a current limited voltage source via the LICELL pin. When VIN goes below
a certain threshold LICELL is used to provide power for VSNVS which is
usually used to hold up secure non-volatile storage and the real-time
clock on the SoC.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

George McCollister and committed by
Mark Brown
c6182ac9 d00b7461

+32 -1
+7 -1
Documentation/devicetree/bindings/regulator/pfuze100.txt
··· 13 13 --PFUZE100 14 14 sw1ab,sw1c,sw2,sw3a,sw3b,sw4,swbst,vsnvs,vrefddr,vgen1~vgen6 15 15 --PFUZE200 16 - sw1ab,sw2,sw3a,sw3b,swbst,vsnvs,vrefddr,vgen1~vgen6 16 + sw1ab,sw2,sw3a,sw3b,swbst,vsnvs,vrefddr,vgen1~vgen6,coin 17 17 --PFUZE3000 18 18 sw1a,sw1b,sw2,sw3,swbst,vsnvs,vrefddr,vldo1,vldo2,vccsd,v33,vldo3,vldo4 19 19 ··· 202 202 203 203 vgen6_reg: vgen6 { 204 204 regulator-min-microvolt = <1800000>; 205 + regulator-max-microvolt = <3300000>; 206 + regulator-always-on; 207 + }; 208 + 209 + coin_reg: coin { 210 + regulator-min-microvolt = <2500000>; 205 211 regulator-max-microvolt = <3300000>; 206 212 regulator-always-on; 207 213 };
+24
drivers/regulator/pfuze100-regulator.c
··· 40 40 #define PFUZE100_REVID 0x3 41 41 #define PFUZE100_FABID 0x4 42 42 43 + #define PFUZE100_COINVOL 0x1a 43 44 #define PFUZE100_SW1ABVOL 0x20 44 45 #define PFUZE100_SW1CVOL 0x2e 45 46 #define PFUZE100_SW2VOL 0x35 ··· 80 79 81 80 static const int pfuze100_vsnvs[] = { 82 81 1000000, 1100000, 1200000, 1300000, 1500000, 1800000, 3000000, 82 + }; 83 + 84 + static const int pfuze100_coin[] = { 85 + 2500000, 2700000, 2800000, 2900000, 3000000, 3100000, 3200000, 3300000, 83 86 }; 84 87 85 88 static const int pfuze3000_sw2lo[] = { ··· 235 230 .stby_mask = 0x20, \ 236 231 } 237 232 233 + #define PFUZE100_COIN_REG(_chip, _name, base, mask, voltages) \ 234 + [_chip ## _ ## _name] = { \ 235 + .desc = { \ 236 + .name = #_name, \ 237 + .n_voltages = ARRAY_SIZE(voltages), \ 238 + .ops = &pfuze100_swb_regulator_ops, \ 239 + .type = REGULATOR_VOLTAGE, \ 240 + .id = _chip ## _ ## _name, \ 241 + .owner = THIS_MODULE, \ 242 + .volt_table = voltages, \ 243 + .vsel_reg = (base), \ 244 + .vsel_mask = (mask), \ 245 + .enable_reg = (base), \ 246 + .enable_mask = 0x8, \ 247 + }, \ 248 + } 249 + 238 250 #define PFUZE3000_VCC_REG(_chip, _name, base, min, max, step) { \ 239 251 .desc = { \ 240 252 .name = #_name, \ ··· 339 317 PFUZE100_VGEN_REG(PFUZE200, VGEN4, PFUZE100_VGEN4VOL, 1800000, 3300000, 100000), 340 318 PFUZE100_VGEN_REG(PFUZE200, VGEN5, PFUZE100_VGEN5VOL, 1800000, 3300000, 100000), 341 319 PFUZE100_VGEN_REG(PFUZE200, VGEN6, PFUZE100_VGEN6VOL, 1800000, 3300000, 100000), 320 + PFUZE100_COIN_REG(PFUZE200, COIN, PFUZE100_COINVOL, 0x7, pfuze100_coin), 342 321 }; 343 322 344 323 static struct pfuze_regulator pfuze3000_regulators[] = { ··· 394 371 { .name = "vgen4", }, 395 372 { .name = "vgen5", }, 396 373 { .name = "vgen6", }, 374 + { .name = "coin", }, 397 375 }; 398 376 399 377 /* PFUZE3000 */
+1
include/linux/regulator/pfuze100.h
··· 48 48 #define PFUZE200_VGEN4 10 49 49 #define PFUZE200_VGEN5 11 50 50 #define PFUZE200_VGEN6 12 51 + #define PFUZE200_COIN 13 51 52 52 53 #define PFUZE3000_SW1A 0 53 54 #define PFUZE3000_SW1B 1