• Home
  • Raw
  • Download

Lines Matching +full:2500 +full:base +full:- +full:x

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * twl-regulator.c -- support regulators in twl4030/twl6030 family chips
26 * These chips are often used in OMAP-based systems.
28 * This driver implements software-based resource control for various
35 u8 base; member
40 /* voltage in mV = table[VSEL]; table_len must be a power-of-two */
58 /* LDO control registers ... offset is from the base of its register bank.
82 &value, info->base + offset); in twlreg_read()
91 value, info->base + offset); in twlreg_write()
94 /*----------------------------------------------------------------------*/
148 timeout--; in twl4030_wait_pb_ready()
151 return -ETIMEDOUT; in twl4030_wait_pb_ready()
253 message = MSG_SINGULAR(DEV_GRP_P1, info->id, RES_STATE_ACTIVE); in twl4030reg_set_mode()
256 message = MSG_SINGULAR(DEV_GRP_P1, info->id, RES_STATE_SLEEP); in twl4030reg_set_mode()
259 return -EINVAL; in twl4030reg_set_mode()
277 /*----------------------------------------------------------------------*/
280 * Support for adjustable-voltage LDOs uses a four bit (or less) voltage
296 #define UNSUP(x) (UNSUP_MASK | (x)) argument
297 #define IS_UNSUP(info, x) \ argument
298 ((UNSUP_MASK & (x)) && \
299 !((info)->features & TWL4030_ALLOW_UNSUPPORTED))
300 #define LDO_MV(x) (~UNSUP_MASK & (x)) argument
304 UNSUP(1500), UNSUP(1800), 2500, 2800,
309 1500, 1800, UNSUP(1850), 2500,
315 1500, 1800, 2000, 2500,
320 1500, 1800, 2500, 2800,
325 1500, 1800, UNSUP(1850), 2500,
334 UNSUP(1500), UNSUP(1800), 1850, UNSUP(2500),
344 UNSUP(1500), 1800, UNSUP(1850), UNSUP(2500),
359 2500, 2750,
376 int mV = info->table[index]; in twl4030ldo_list_voltage()
398 vsel &= info->table_len - 1; in twl4030ldo_get_voltage_sel()
422 int vsel = DIV_ROUND_UP(min_uV - 600000, 12500); in twl4030smps_set_voltage()
447 /*----------------------------------------------------------------------*/
461 /*----------------------------------------------------------------------*/
465 .base = offset, \
485 .base = offset, \
505 .base = offset, \
560 TWL4030_OF_MATCH("ti,twl4030-vaux1", VAUX1),
561 TWL4030_OF_MATCH("ti,twl4030-vaux2", VAUX2_4030),
562 TWL4030_OF_MATCH("ti,twl5030-vaux2", VAUX2),
563 TWL4030_OF_MATCH("ti,twl4030-vaux3", VAUX3),
564 TWL4030_OF_MATCH("ti,twl4030-vaux4", VAUX4),
565 TWL4030_OF_MATCH("ti,twl4030-vmmc1", VMMC1),
566 TWL4030_OF_MATCH("ti,twl4030-vmmc2", VMMC2),
567 TWL4030_OF_MATCH("ti,twl4030-vpll1", VPLL1),
568 TWL4030_OF_MATCH("ti,twl4030-vpll2", VPLL2),
569 TWL4030_OF_MATCH("ti,twl4030-vsim", VSIM),
570 TWL4030_OF_MATCH("ti,twl4030-vdac", VDAC),
571 TWL4030_OF_MATCH("ti,twl4030-vintana2", VINTANA2),
572 TWL4030_OF_MATCH("ti,twl4030-vio", VIO),
573 TWL4030_OF_MATCH("ti,twl4030-vdd1", VDD1),
574 TWL4030_OF_MATCH("ti,twl4030-vdd2", VDD2),
575 TWLFIXED_OF_MATCH("ti,twl4030-vintana1", VINTANA1),
576 TWLFIXED_OF_MATCH("ti,twl4030-vintdig", VINTDIG),
577 TWLFIXED_OF_MATCH("ti,twl4030-vusb1v5", VUSB1V5),
578 TWLFIXED_OF_MATCH("ti,twl4030-vusb1v8", VUSB1V8),
579 TWLFIXED_OF_MATCH("ti,twl4030-vusb3v1", VUSB3V1),
594 template = of_device_get_match_data(&pdev->dev); in twlreg_probe()
596 return -ENODEV; in twlreg_probe()
598 id = template->desc.id; in twlreg_probe()
599 initdata = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node, in twlreg_probe()
600 &template->desc); in twlreg_probe()
602 return -EINVAL; in twlreg_probe()
604 info = devm_kmemdup(&pdev->dev, template, sizeof(*info), GFP_KERNEL); in twlreg_probe()
606 return -ENOMEM; in twlreg_probe()
608 /* Constrain board-specific capabilities according to what in twlreg_probe()
611 c = &initdata->constraints; in twlreg_probe()
612 c->valid_modes_mask &= REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY; in twlreg_probe()
613 c->valid_ops_mask &= REGULATOR_CHANGE_VOLTAGE in twlreg_probe()
624 c->always_on = true; in twlreg_probe()
630 config.dev = &pdev->dev; in twlreg_probe()
633 config.of_node = pdev->dev.of_node; in twlreg_probe()
635 rdev = devm_regulator_register(&pdev->dev, &info->desc, &config); in twlreg_probe()
637 dev_err(&pdev->dev, "can't register %s, %ld\n", in twlreg_probe()
638 info->desc.name, PTR_ERR(rdev)); in twlreg_probe()
643 twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_REMAP, info->remap); in twlreg_probe()
645 /* NOTE: many regulators support short-circuit IRQs (presentable in twlreg_probe()
647 * - SC_CONFIG in twlreg_probe()
648 * - SC_DETECT1 (vintana2, vmmc1/2, vaux1/2/3/4) in twlreg_probe()
649 * - SC_DETECT2 (vusb, vdac, vio, vdd1/2, vpll2) in twlreg_probe()
650 * - IT_CONFIG in twlreg_probe()