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

regulator: ab8500: Update vdmic, vamic[1|2] parameters for AB8540

Add voltage setting for vdmic; add LP mode setting for vamic1,2.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by

Lee Jones and committed by
Mark Brown
4c84b4dd 3fe52289

+40 -5
+40 -5
drivers/regulator/ab8500.c
··· 212 212 2600000, /* Duplicated in Vaudio and IsoUicc Control register. */ 213 213 }; 214 214 215 + static const unsigned int ldo_vdmic_voltages[] = { 216 + 1800000, 217 + 1900000, 218 + 2000000, 219 + 2850000, 220 + }; 221 + 215 222 static DEFINE_MUTEX(shared_mode_mutex); 216 223 static struct ab8500_shared_mode ldo_anamic1_shared; 217 224 static struct ab8500_shared_mode ldo_anamic2_shared; 225 + static struct ab8500_shared_mode ab8540_ldo_anamic1_shared; 226 + static struct ab8500_shared_mode ab8540_ldo_anamic2_shared; 218 227 219 228 static int ab8500_regulator_enable(struct regulator_dev *rdev) 220 229 { ··· 1149 1140 .n_voltages = 1, 1150 1141 .volt_table = fixed_2050000_voltage, 1151 1142 }, 1152 - .shared_mode = &ldo_anamic1_shared, 1143 + .shared_mode = &ldo_anamic1_shared, 1153 1144 .update_bank = 0x03, 1154 1145 .update_reg = 0x83, 1155 1146 .update_mask = 0x08, ··· 1633 1624 [AB8540_LDO_ANAMIC1] = { 1634 1625 .desc = { 1635 1626 .name = "LDO-ANAMIC1", 1636 - .ops = &ab8500_regulator_ops, 1627 + .ops = &ab8500_regulator_anamic_mode_ops, 1637 1628 .type = REGULATOR_VOLTAGE, 1638 1629 .id = AB8540_LDO_ANAMIC1, 1639 1630 .owner = THIS_MODULE, 1640 1631 .n_voltages = 1, 1641 1632 .volt_table = fixed_2050000_voltage, 1642 1633 }, 1634 + .shared_mode = &ab8540_ldo_anamic1_shared, 1643 1635 .update_bank = 0x03, 1644 1636 .update_reg = 0x83, 1645 1637 .update_mask = 0x08, 1646 1638 .update_val = 0x08, 1639 + .mode_bank = 0x03, 1640 + .mode_reg = 0x83, 1641 + .mode_mask = 0x20, 1642 + .mode_val_idle = 0x20, 1643 + .mode_val_normal = 0x00, 1647 1644 }, 1648 1645 [AB8540_LDO_ANAMIC2] = { 1649 1646 .desc = { 1650 1647 .name = "LDO-ANAMIC2", 1651 - .ops = &ab8500_regulator_ops, 1648 + .ops = &ab8500_regulator_anamic_mode_ops, 1652 1649 .type = REGULATOR_VOLTAGE, 1653 1650 .id = AB8540_LDO_ANAMIC2, 1654 1651 .owner = THIS_MODULE, 1655 1652 .n_voltages = 1, 1656 1653 .volt_table = fixed_2050000_voltage, 1657 1654 }, 1655 + .shared_mode = &ab8540_ldo_anamic2_shared, 1658 1656 .update_bank = 0x03, 1659 1657 .update_reg = 0x83, 1660 1658 .update_mask = 0x10, 1661 1659 .update_val = 0x10, 1660 + .mode_bank = 0x03, 1661 + .mode_reg = 0x83, 1662 + .mode_mask = 0x20, 1663 + .mode_val_idle = 0x20, 1664 + .mode_val_normal = 0x00, 1662 1665 }, 1663 1666 [AB8540_LDO_DMIC] = { 1664 1667 .desc = { 1665 1668 .name = "LDO-DMIC", 1666 - .ops = &ab8500_regulator_ops, 1669 + .ops = &ab8500_regulator_volt_mode_ops, 1667 1670 .type = REGULATOR_VOLTAGE, 1668 1671 .id = AB8540_LDO_DMIC, 1669 1672 .owner = THIS_MODULE, 1670 - .n_voltages = 1, 1673 + .n_voltages = ARRAY_SIZE(ldo_vdmic_voltages), 1671 1674 }, 1675 + .load_lp_uA = 1000, 1672 1676 .update_bank = 0x03, 1673 1677 .update_reg = 0x83, 1674 1678 .update_mask = 0x04, 1675 1679 .update_val = 0x04, 1680 + .voltage_bank = 0x03, 1681 + .voltage_reg = 0x83, 1682 + .voltage_mask = 0xc0, 1683 + .voltages = ldo_vdmic_voltages, 1684 + .voltages_len = ARRAY_SIZE(ldo_vdmic_voltages), 1676 1685 }, 1677 1686 1678 1687 /* ··· 1743 1716 1744 1717 static struct ab8500_shared_mode ldo_anamic2_shared = { 1745 1718 .shared_regulator = &ab8505_regulator_info[AB8505_LDO_ANAMIC1], 1719 + }; 1720 + 1721 + static struct ab8500_shared_mode ab8540_ldo_anamic1_shared = { 1722 + .shared_regulator = &ab8540_regulator_info[AB8540_LDO_ANAMIC2], 1723 + }; 1724 + 1725 + static struct ab8500_shared_mode ab8540_ldo_anamic2_shared = { 1726 + .shared_regulator = &ab8540_regulator_info[AB8540_LDO_ANAMIC1], 1746 1727 }; 1747 1728 1748 1729 struct ab8500_reg_init {