Lines Matching +full:vdd +full:- +full:vbat +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) ST-Ericsson SA 2010
11 * ab8500-ext supports the following regulators:
12 * - VextSupply3
35 REGULATOR_SUPPLY("vcc", "gpio-keys.0"),
37 REGULATOR_SUPPLY("vcc", "2-0029"),
39 REGULATOR_SUPPLY("vdd", "2-0018"),
41 REGULATOR_SUPPLY("vdd", "2-0019"),
43 REGULATOR_SUPPLY("vdd", "2-001e"),
45 REGULATOR_SUPPLY("avdd", "3-005c"),
46 REGULATOR_SUPPLY("avdd", "3-005d"),
48 REGULATOR_SUPPLY("vdd", "3-004b"),
50 REGULATOR_SUPPLY("vdd", "2-0068"),
52 REGULATOR_SUPPLY("vdd", "3-0029"),
54 REGULATOR_SUPPLY("vdd", "2-005c"),
62 /* On-board eMMC power */
65 REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"),
67 REGULATOR_SUPPLY("vcc-N2158", "ab8500-acc-det.0"),
68 /* AB8500 Tv-out device */
69 REGULATOR_SUPPLY("vcc-N2158", "mcde_tv_ab8500.4"),
71 REGULATOR_SUPPLY("vcc-N2158", "av8100_hdmi.3"),
75 REGULATOR_SUPPLY("v-SD-STM", "stm"),
81 /* TV-out DENC supply */
82 REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"),
83 /* Internal general-purpose ADC */
84 REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"),
86 REGULATOR_SUPPLY("vddadc", "ab8500-charger.0"),
87 /* AB8500 Tv-out device */
92 /* AB8500 audio-codec main supply */
93 REGULATOR_SUPPLY("vaud", "ab8500-codec.0"),
97 /* AB8500 audio-codec Mic1 supply */
98 REGULATOR_SUPPLY("vamic1", "ab8500-codec.0"),
102 /* AB8500 audio-codec Mic2 supply */
103 REGULATOR_SUPPLY("vamic2", "ab8500-codec.0"),
107 /* AB8500 audio-codec DMic supply */
108 REGULATOR_SUPPLY("vdmic", "ab8500-codec.0"),
112 /* SoC core supply, no device */
113 REGULATOR_SUPPLY("v-intcore", NULL),
115 REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"),
117 REGULATOR_SUPPLY("v-intcore", "abx500-clk.0"),
239 * Vamic1_dzout = high-Z when Vamic1 is disabled
240 * Vamic2_dzout = high-Z when Vamic2 is disabled
256 * VextSupply3Regu = force HP (-> STBB2=LP and TPS=LP)
307 .supply_regulator = "ab8500-ext-supply3",
309 .name = "V-DISPLAY",
319 /* supplies to the on-board eMMC */
321 .supply_regulator = "ab8500-ext-supply3",
323 .name = "V-eMMC1",
335 /* supply for VAUX3, supplies to SDcard slots */
337 .supply_regulator = "ab8500-ext-supply3",
339 .name = "V-MMC-SD",
351 /* supply for tvout, gpadc, TVOUT LDO */
354 .name = "V-TVOUT",
360 /* supply for ab8500-vaudio, VAUDIO LDO */
363 .name = "V-AUD",
369 /* supply for v-anamic1 VAMic1-LDO */
372 .name = "V-AMIC1",
378 /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */
381 .name = "V-AMIC2",
387 /* supply for v-dmic, VDMIC LDO */
390 .name = "V-DMIC",
396 /* supply for v-intcore12, VINTCORE12 LDO */
399 .name = "V-INTCORE",
413 /* supply for U8500 CSI-DSI, VANA LDO */
416 .name = "V-CSI-DSI",
424 /* supply for VextSupply3 */
426 /* SIM supply for 3 V SIM cards */
427 REGULATOR_SUPPLY("vinvsim", "sim-detect.0"),
434 /* fixed Vbat supplies VSMPS1_EXT_1V8 */
437 .name = "ab8500-ext-supply1",
445 /* fixed Vbat supplies VSMPS2_EXT_1V36 and VSMPS5_EXT_1V15 */
448 .name = "ab8500-ext-supply2",
453 /* fixed Vbat supplies VSMPS3_EXT_3V4 and VSMPS4_EXT_3V4 */
456 .name = "ab8500-ext-supply3",
478 * struct ab8500_ext_regulator_info - ab8500 regulator information
514 return -EINVAL; in ab8500_ext_regulator_enable()
521 if (info->cfg && info->cfg->hwreq) in ab8500_ext_regulator_enable()
522 regval = info->update_val_hp; in ab8500_ext_regulator_enable()
524 regval = info->update_val; in ab8500_ext_regulator_enable()
526 ret = abx500_mask_and_set_register_interruptible(info->dev, in ab8500_ext_regulator_enable()
527 info->update_bank, info->update_reg, in ab8500_ext_regulator_enable()
528 info->update_mask, regval); in ab8500_ext_regulator_enable()
536 "%s-enable (bank, reg, mask, value): 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", in ab8500_ext_regulator_enable()
537 info->desc.name, info->update_bank, info->update_reg, in ab8500_ext_regulator_enable()
538 info->update_mask, regval); in ab8500_ext_regulator_enable()
551 return -EINVAL; in ab8500_ext_regulator_disable()
557 if (info->cfg && info->cfg->hwreq) in ab8500_ext_regulator_disable()
558 regval = info->update_val_hw; in ab8500_ext_regulator_disable()
562 ret = abx500_mask_and_set_register_interruptible(info->dev, in ab8500_ext_regulator_disable()
563 info->update_bank, info->update_reg, in ab8500_ext_regulator_disable()
564 info->update_mask, regval); in ab8500_ext_regulator_disable()
571 dev_dbg(rdev_get_dev(rdev), "%s-disable (bank, reg, mask, value):" in ab8500_ext_regulator_disable()
573 info->desc.name, info->update_bank, info->update_reg, in ab8500_ext_regulator_disable()
574 info->update_mask, regval); in ab8500_ext_regulator_disable()
587 return -EINVAL; in ab8500_ext_regulator_is_enabled()
590 ret = abx500_get_register_interruptible(info->dev, in ab8500_ext_regulator_is_enabled()
591 info->update_bank, info->update_reg, &regval); in ab8500_ext_regulator_is_enabled()
594 "couldn't read 0x%x register\n", info->update_reg); in ab8500_ext_regulator_is_enabled()
598 dev_dbg(rdev_get_dev(rdev), "%s-is_enabled (bank, reg, mask, value):" in ab8500_ext_regulator_is_enabled()
600 info->desc.name, info->update_bank, info->update_reg, in ab8500_ext_regulator_is_enabled()
601 info->update_mask, regval); in ab8500_ext_regulator_is_enabled()
603 if (((regval & info->update_mask) == info->update_val_lp) || in ab8500_ext_regulator_is_enabled()
604 ((regval & info->update_mask) == info->update_val_hp)) in ab8500_ext_regulator_is_enabled()
619 return -EINVAL; in ab8500_ext_regulator_set_mode()
624 regval = info->update_val_hp; in ab8500_ext_regulator_set_mode()
627 regval = info->update_val_lp; in ab8500_ext_regulator_set_mode()
631 return -EINVAL; in ab8500_ext_regulator_set_mode()
634 /* If regulator is enabled and info->cfg->hwreq is set, the regulator in ab8500_ext_regulator_set_mode()
639 !(info->cfg && info->cfg->hwreq)) { in ab8500_ext_regulator_set_mode()
640 ret = abx500_mask_and_set_register_interruptible(info->dev, in ab8500_ext_regulator_set_mode()
641 info->update_bank, info->update_reg, in ab8500_ext_regulator_set_mode()
642 info->update_mask, regval); in ab8500_ext_regulator_set_mode()
650 "%s-set_mode (bank, reg, mask, value): " in ab8500_ext_regulator_set_mode()
652 info->desc.name, info->update_bank, info->update_reg, in ab8500_ext_regulator_set_mode()
653 info->update_mask, regval); in ab8500_ext_regulator_set_mode()
656 info->update_val = regval; in ab8500_ext_regulator_set_mode()
668 return -EINVAL; in ab8500_ext_regulator_get_mode()
671 if (info->update_val == info->update_val_hp) in ab8500_ext_regulator_get_mode()
673 else if (info->update_val == info->update_val_lp) in ab8500_ext_regulator_get_mode()
676 ret = -EINVAL; in ab8500_ext_regulator_get_mode()
684 struct regulation_constraints *regu_constraints = rdev->constraints; in ab8500_ext_set_voltage()
688 return -EINVAL; in ab8500_ext_set_voltage()
691 if (regu_constraints->min_uV == min_uV && in ab8500_ext_set_voltage()
692 regu_constraints->max_uV == max_uV) in ab8500_ext_set_voltage()
698 regu_constraints->min_uV, regu_constraints->max_uV); in ab8500_ext_set_voltage()
700 return -EINVAL; in ab8500_ext_set_voltage()
706 struct regulation_constraints *regu_constraints = rdev->constraints; in ab8500_ext_list_voltage()
710 return -EINVAL; in ab8500_ext_list_voltage()
713 if (regu_constraints->min_uV && regu_constraints->max_uV) { in ab8500_ext_list_voltage()
714 if (regu_constraints->min_uV == regu_constraints->max_uV) in ab8500_ext_list_voltage()
715 return regu_constraints->min_uV; in ab8500_ext_list_voltage()
717 return -EINVAL; in ab8500_ext_list_voltage()
790 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); in ab8500_ext_regulator_probe()
797 dev_err(&pdev->dev, "null mfd parent\n"); in ab8500_ext_regulator_probe()
798 return -EINVAL; in ab8500_ext_regulator_probe()
802 if (pdata->num_ext_regulator != ARRAY_SIZE(ab8500_ext_regulator_info)) { in ab8500_ext_regulator_probe()
803 dev_err(&pdev->dev, "Configuration error: size mismatch.\n"); in ab8500_ext_regulator_probe()
804 return -EINVAL; in ab8500_ext_regulator_probe()
813 info->update_val = 0x30; in ab8500_ext_regulator_probe()
814 info->update_val_hp = 0x30; in ab8500_ext_regulator_probe()
815 info->update_val_lp = 0x10; in ab8500_ext_regulator_probe()
822 /* assign per-regulator data */ in ab8500_ext_regulator_probe()
824 info->dev = &pdev->dev; in ab8500_ext_regulator_probe()
825 info->cfg = (struct ab8500_ext_regulator_cfg *) in ab8500_ext_regulator_probe()
826 pdata->ext_regulator[i].driver_data; in ab8500_ext_regulator_probe()
828 config.dev = &pdev->dev; in ab8500_ext_regulator_probe()
830 config.init_data = &pdata->ext_regulator[i]; in ab8500_ext_regulator_probe()
833 rdev = devm_regulator_register(&pdev->dev, &info->desc, in ab8500_ext_regulator_probe()
836 dev_err(&pdev->dev, "failed to register regulator %s\n", in ab8500_ext_regulator_probe()
837 info->desc.name); in ab8500_ext_regulator_probe()
841 dev_dbg(&pdev->dev, "%s-probed\n", info->desc.name); in ab8500_ext_regulator_probe()
850 .name = "ab8500-ext-regulator",
875 MODULE_ALIAS("platform:ab8500-ext-regulator");