Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 1 | /* |
| 2 | * AXP20x regulators driver. |
| 3 | * |
| 4 | * Copyright (C) 2013 Carlo Caione <carlo@caione.org> |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General |
| 7 | * Public License. See the file "COPYING" in the main directory of this |
| 8 | * archive for more details. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #include <linux/err.h> |
| 17 | #include <linux/init.h> |
| 18 | #include <linux/module.h> |
| 19 | #include <linux/of.h> |
| 20 | #include <linux/of_device.h> |
| 21 | #include <linux/platform_device.h> |
| 22 | #include <linux/regmap.h> |
| 23 | #include <linux/mfd/axp20x.h> |
| 24 | #include <linux/regulator/driver.h> |
| 25 | #include <linux/regulator/of_regulator.h> |
| 26 | |
| 27 | #define AXP20X_IO_ENABLED 0x03 |
| 28 | #define AXP20X_IO_DISABLED 0x07 |
| 29 | |
Chen-Yu Tsai | 3cb99e2 | 2015-12-22 17:08:06 +0800 | [diff] [blame] | 30 | #define AXP22X_IO_ENABLED 0x03 |
| 31 | #define AXP22X_IO_DISABLED 0x04 |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 32 | |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 33 | #define AXP20X_WORKMODE_DCDC2_MASK BIT(2) |
| 34 | #define AXP20X_WORKMODE_DCDC3_MASK BIT(1) |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 35 | #define AXP22X_WORKMODE_DCDCX_MASK(x) BIT(x) |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 36 | |
| 37 | #define AXP20X_FREQ_DCDC_MASK 0x0f |
| 38 | |
Hans de Goede | 636e2a3 | 2016-06-03 18:59:44 +0200 | [diff] [blame] | 39 | #define AXP22X_MISC_N_VBUSEN_FUNC BIT(4) |
| 40 | |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 41 | #define AXP_DESC_IO(_family, _id, _match, _supply, _min, _max, _step, _vreg, \ |
| 42 | _vmask, _ereg, _emask, _enable_val, _disable_val) \ |
| 43 | [_family##_##_id] = { \ |
Chen-Yu Tsai | e0bbb38 | 2016-02-15 18:31:22 +0800 | [diff] [blame] | 44 | .name = (_match), \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 45 | .supply_name = (_supply), \ |
Chen-Yu Tsai | 880fe82 | 2015-01-10 00:23:43 +0800 | [diff] [blame] | 46 | .of_match = of_match_ptr(_match), \ |
| 47 | .regulators_node = of_match_ptr("regulators"), \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 48 | .type = REGULATOR_VOLTAGE, \ |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 49 | .id = _family##_##_id, \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 50 | .n_voltages = (((_max) - (_min)) / (_step) + 1), \ |
| 51 | .owner = THIS_MODULE, \ |
| 52 | .min_uV = (_min) * 1000, \ |
| 53 | .uV_step = (_step) * 1000, \ |
| 54 | .vsel_reg = (_vreg), \ |
| 55 | .vsel_mask = (_vmask), \ |
| 56 | .enable_reg = (_ereg), \ |
| 57 | .enable_mask = (_emask), \ |
| 58 | .enable_val = (_enable_val), \ |
| 59 | .disable_val = (_disable_val), \ |
| 60 | .ops = &axp20x_ops, \ |
| 61 | } |
| 62 | |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 63 | #define AXP_DESC(_family, _id, _match, _supply, _min, _max, _step, _vreg, \ |
| 64 | _vmask, _ereg, _emask) \ |
| 65 | [_family##_##_id] = { \ |
Chen-Yu Tsai | e0bbb38 | 2016-02-15 18:31:22 +0800 | [diff] [blame] | 66 | .name = (_match), \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 67 | .supply_name = (_supply), \ |
Chen-Yu Tsai | 880fe82 | 2015-01-10 00:23:43 +0800 | [diff] [blame] | 68 | .of_match = of_match_ptr(_match), \ |
| 69 | .regulators_node = of_match_ptr("regulators"), \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 70 | .type = REGULATOR_VOLTAGE, \ |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 71 | .id = _family##_##_id, \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 72 | .n_voltages = (((_max) - (_min)) / (_step) + 1), \ |
| 73 | .owner = THIS_MODULE, \ |
| 74 | .min_uV = (_min) * 1000, \ |
| 75 | .uV_step = (_step) * 1000, \ |
| 76 | .vsel_reg = (_vreg), \ |
| 77 | .vsel_mask = (_vmask), \ |
| 78 | .enable_reg = (_ereg), \ |
| 79 | .enable_mask = (_emask), \ |
| 80 | .ops = &axp20x_ops, \ |
| 81 | } |
| 82 | |
Chen-Yu Tsai | 94c3904 | 2016-02-02 18:27:37 +0800 | [diff] [blame] | 83 | #define AXP_DESC_SW(_family, _id, _match, _supply, _ereg, _emask) \ |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 84 | [_family##_##_id] = { \ |
Chen-Yu Tsai | e0bbb38 | 2016-02-15 18:31:22 +0800 | [diff] [blame] | 85 | .name = (_match), \ |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 86 | .supply_name = (_supply), \ |
| 87 | .of_match = of_match_ptr(_match), \ |
| 88 | .regulators_node = of_match_ptr("regulators"), \ |
| 89 | .type = REGULATOR_VOLTAGE, \ |
| 90 | .id = _family##_##_id, \ |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 91 | .owner = THIS_MODULE, \ |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 92 | .enable_reg = (_ereg), \ |
| 93 | .enable_mask = (_emask), \ |
| 94 | .ops = &axp20x_ops_sw, \ |
| 95 | } |
| 96 | |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 97 | #define AXP_DESC_FIXED(_family, _id, _match, _supply, _volt) \ |
| 98 | [_family##_##_id] = { \ |
Chen-Yu Tsai | e0bbb38 | 2016-02-15 18:31:22 +0800 | [diff] [blame] | 99 | .name = (_match), \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 100 | .supply_name = (_supply), \ |
Chen-Yu Tsai | 880fe82 | 2015-01-10 00:23:43 +0800 | [diff] [blame] | 101 | .of_match = of_match_ptr(_match), \ |
| 102 | .regulators_node = of_match_ptr("regulators"), \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 103 | .type = REGULATOR_VOLTAGE, \ |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 104 | .id = _family##_##_id, \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 105 | .n_voltages = 1, \ |
| 106 | .owner = THIS_MODULE, \ |
| 107 | .min_uV = (_volt) * 1000, \ |
| 108 | .ops = &axp20x_ops_fixed \ |
| 109 | } |
| 110 | |
Chen-Yu Tsai | 13d57e6 | 2016-02-02 18:27:38 +0800 | [diff] [blame] | 111 | #define AXP_DESC_RANGES(_family, _id, _match, _supply, _ranges, _n_voltages, \ |
| 112 | _vreg, _vmask, _ereg, _emask) \ |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 113 | [_family##_##_id] = { \ |
Chen-Yu Tsai | e0bbb38 | 2016-02-15 18:31:22 +0800 | [diff] [blame] | 114 | .name = (_match), \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 115 | .supply_name = (_supply), \ |
Chen-Yu Tsai | 880fe82 | 2015-01-10 00:23:43 +0800 | [diff] [blame] | 116 | .of_match = of_match_ptr(_match), \ |
| 117 | .regulators_node = of_match_ptr("regulators"), \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 118 | .type = REGULATOR_VOLTAGE, \ |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 119 | .id = _family##_##_id, \ |
Chen-Yu Tsai | 13d57e6 | 2016-02-02 18:27:38 +0800 | [diff] [blame] | 120 | .n_voltages = (_n_voltages), \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 121 | .owner = THIS_MODULE, \ |
| 122 | .vsel_reg = (_vreg), \ |
| 123 | .vsel_mask = (_vmask), \ |
| 124 | .enable_reg = (_ereg), \ |
| 125 | .enable_mask = (_emask), \ |
Chen-Yu Tsai | 13d57e6 | 2016-02-02 18:27:38 +0800 | [diff] [blame] | 126 | .linear_ranges = (_ranges), \ |
| 127 | .n_linear_ranges = ARRAY_SIZE(_ranges), \ |
| 128 | .ops = &axp20x_ops_range, \ |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 129 | } |
| 130 | |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 131 | static struct regulator_ops axp20x_ops_fixed = { |
| 132 | .list_voltage = regulator_list_voltage_linear, |
| 133 | }; |
| 134 | |
Chen-Yu Tsai | 13d57e6 | 2016-02-02 18:27:38 +0800 | [diff] [blame] | 135 | static struct regulator_ops axp20x_ops_range = { |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 136 | .set_voltage_sel = regulator_set_voltage_sel_regmap, |
| 137 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
Chen-Yu Tsai | 13d57e6 | 2016-02-02 18:27:38 +0800 | [diff] [blame] | 138 | .list_voltage = regulator_list_voltage_linear_range, |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 139 | .enable = regulator_enable_regmap, |
| 140 | .disable = regulator_disable_regmap, |
| 141 | .is_enabled = regulator_is_enabled_regmap, |
| 142 | }; |
| 143 | |
| 144 | static struct regulator_ops axp20x_ops = { |
| 145 | .set_voltage_sel = regulator_set_voltage_sel_regmap, |
| 146 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
| 147 | .list_voltage = regulator_list_voltage_linear, |
| 148 | .enable = regulator_enable_regmap, |
| 149 | .disable = regulator_disable_regmap, |
| 150 | .is_enabled = regulator_is_enabled_regmap, |
| 151 | }; |
| 152 | |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 153 | static struct regulator_ops axp20x_ops_sw = { |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 154 | .enable = regulator_enable_regmap, |
| 155 | .disable = regulator_disable_regmap, |
| 156 | .is_enabled = regulator_is_enabled_regmap, |
| 157 | }; |
| 158 | |
Chen-Yu Tsai | 13d57e6 | 2016-02-02 18:27:38 +0800 | [diff] [blame] | 159 | static const struct regulator_linear_range axp20x_ldo4_ranges[] = { |
| 160 | REGULATOR_LINEAR_RANGE(1250000, 0x0, 0x0, 0), |
| 161 | REGULATOR_LINEAR_RANGE(1300000, 0x1, 0x8, 100000), |
Maxime Ripard | 8d4d5c3a | 2016-04-26 16:00:51 +0200 | [diff] [blame] | 162 | REGULATOR_LINEAR_RANGE(2500000, 0x9, 0x9, 0), |
| 163 | REGULATOR_LINEAR_RANGE(2700000, 0xa, 0xb, 100000), |
| 164 | REGULATOR_LINEAR_RANGE(3000000, 0xc, 0xf, 100000), |
Chen-Yu Tsai | 13d57e6 | 2016-02-02 18:27:38 +0800 | [diff] [blame] | 165 | }; |
| 166 | |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 167 | static const struct regulator_desc axp20x_regulators[] = { |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 168 | AXP_DESC(AXP20X, DCDC2, "dcdc2", "vin2", 700, 2275, 25, |
| 169 | AXP20X_DCDC2_V_OUT, 0x3f, AXP20X_PWR_OUT_CTRL, 0x10), |
| 170 | AXP_DESC(AXP20X, DCDC3, "dcdc3", "vin3", 700, 3500, 25, |
| 171 | AXP20X_DCDC3_V_OUT, 0x7f, AXP20X_PWR_OUT_CTRL, 0x02), |
| 172 | AXP_DESC_FIXED(AXP20X, LDO1, "ldo1", "acin", 1300), |
| 173 | AXP_DESC(AXP20X, LDO2, "ldo2", "ldo24in", 1800, 3300, 100, |
| 174 | AXP20X_LDO24_V_OUT, 0xf0, AXP20X_PWR_OUT_CTRL, 0x04), |
| 175 | AXP_DESC(AXP20X, LDO3, "ldo3", "ldo3in", 700, 3500, 25, |
| 176 | AXP20X_LDO3_V_OUT, 0x7f, AXP20X_PWR_OUT_CTRL, 0x40), |
Chen-Yu Tsai | 13d57e6 | 2016-02-02 18:27:38 +0800 | [diff] [blame] | 177 | AXP_DESC_RANGES(AXP20X, LDO4, "ldo4", "ldo24in", axp20x_ldo4_ranges, |
| 178 | 16, AXP20X_LDO24_V_OUT, 0x0f, AXP20X_PWR_OUT_CTRL, |
| 179 | 0x08), |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 180 | AXP_DESC_IO(AXP20X, LDO5, "ldo5", "ldo5in", 1800, 3300, 100, |
| 181 | AXP20X_LDO5_V_OUT, 0xf0, AXP20X_GPIO0_CTRL, 0x07, |
| 182 | AXP20X_IO_ENABLED, AXP20X_IO_DISABLED), |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 183 | }; |
| 184 | |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 185 | static const struct regulator_desc axp22x_regulators[] = { |
| 186 | AXP_DESC(AXP22X, DCDC1, "dcdc1", "vin1", 1600, 3400, 100, |
| 187 | AXP22X_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(1)), |
| 188 | AXP_DESC(AXP22X, DCDC2, "dcdc2", "vin2", 600, 1540, 20, |
| 189 | AXP22X_DCDC2_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(2)), |
| 190 | AXP_DESC(AXP22X, DCDC3, "dcdc3", "vin3", 600, 1860, 20, |
| 191 | AXP22X_DCDC3_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(3)), |
| 192 | AXP_DESC(AXP22X, DCDC4, "dcdc4", "vin4", 600, 1540, 20, |
Chen-Yu Tsai | 6b3600b | 2015-09-26 21:21:12 +0800 | [diff] [blame] | 193 | AXP22X_DCDC4_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(4)), |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 194 | AXP_DESC(AXP22X, DCDC5, "dcdc5", "vin5", 1000, 2550, 50, |
Chen-Yu Tsai | 6b3600b | 2015-09-26 21:21:12 +0800 | [diff] [blame] | 195 | AXP22X_DCDC5_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(5)), |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 196 | /* secondary switchable output of DCDC1 */ |
Chen-Yu Tsai | 94c3904 | 2016-02-02 18:27:37 +0800 | [diff] [blame] | 197 | AXP_DESC_SW(AXP22X, DC1SW, "dc1sw", NULL, AXP22X_PWR_OUT_CTRL2, |
| 198 | BIT(7)), |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 199 | /* LDO regulator internally chained to DCDC5 */ |
Chen-Yu Tsai | 7118f19 | 2015-09-30 14:39:46 +0800 | [diff] [blame] | 200 | AXP_DESC(AXP22X, DC5LDO, "dc5ldo", NULL, 700, 1400, 100, |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 201 | AXP22X_DC5LDO_V_OUT, 0x7, AXP22X_PWR_OUT_CTRL1, BIT(0)), |
| 202 | AXP_DESC(AXP22X, ALDO1, "aldo1", "aldoin", 700, 3300, 100, |
| 203 | AXP22X_ALDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(6)), |
| 204 | AXP_DESC(AXP22X, ALDO2, "aldo2", "aldoin", 700, 3300, 100, |
| 205 | AXP22X_ALDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(7)), |
| 206 | AXP_DESC(AXP22X, ALDO3, "aldo3", "aldoin", 700, 3300, 100, |
| 207 | AXP22X_ALDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(7)), |
| 208 | AXP_DESC(AXP22X, DLDO1, "dldo1", "dldoin", 700, 3300, 100, |
| 209 | AXP22X_DLDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(3)), |
| 210 | AXP_DESC(AXP22X, DLDO2, "dldo2", "dldoin", 700, 3300, 100, |
| 211 | AXP22X_DLDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(4)), |
| 212 | AXP_DESC(AXP22X, DLDO3, "dldo3", "dldoin", 700, 3300, 100, |
| 213 | AXP22X_DLDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(5)), |
| 214 | AXP_DESC(AXP22X, DLDO4, "dldo4", "dldoin", 700, 3300, 100, |
| 215 | AXP22X_DLDO4_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(6)), |
| 216 | AXP_DESC(AXP22X, ELDO1, "eldo1", "eldoin", 700, 3300, 100, |
| 217 | AXP22X_ELDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(0)), |
| 218 | AXP_DESC(AXP22X, ELDO2, "eldo2", "eldoin", 700, 3300, 100, |
| 219 | AXP22X_ELDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(1)), |
| 220 | AXP_DESC(AXP22X, ELDO3, "eldo3", "eldoin", 700, 3300, 100, |
| 221 | AXP22X_ELDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(2)), |
Hans de Goede | f40d489 | 2016-04-27 20:38:44 +0200 | [diff] [blame] | 222 | /* Note the datasheet only guarantees reliable operation up to |
| 223 | * 3.3V, this needs to be enforced via dts provided constraints */ |
| 224 | AXP_DESC_IO(AXP22X, LDO_IO0, "ldo_io0", "ips", 700, 3800, 100, |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 225 | AXP22X_LDO_IO0_V_OUT, 0x1f, AXP20X_GPIO0_CTRL, 0x07, |
| 226 | AXP22X_IO_ENABLED, AXP22X_IO_DISABLED), |
Hans de Goede | f40d489 | 2016-04-27 20:38:44 +0200 | [diff] [blame] | 227 | /* Note the datasheet only guarantees reliable operation up to |
| 228 | * 3.3V, this needs to be enforced via dts provided constraints */ |
| 229 | AXP_DESC_IO(AXP22X, LDO_IO1, "ldo_io1", "ips", 700, 3800, 100, |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 230 | AXP22X_LDO_IO1_V_OUT, 0x1f, AXP20X_GPIO1_CTRL, 0x07, |
| 231 | AXP22X_IO_ENABLED, AXP22X_IO_DISABLED), |
| 232 | AXP_DESC_FIXED(AXP22X, RTC_LDO, "rtc_ldo", "ips", 3000), |
| 233 | }; |
| 234 | |
Hans de Goede | 636e2a3 | 2016-06-03 18:59:44 +0200 | [diff] [blame] | 235 | static const struct regulator_desc axp22x_drivevbus_regulator = { |
| 236 | .name = "drivevbus", |
| 237 | .supply_name = "drivevbus", |
| 238 | .of_match = of_match_ptr("drivevbus"), |
| 239 | .regulators_node = of_match_ptr("regulators"), |
| 240 | .type = REGULATOR_VOLTAGE, |
| 241 | .owner = THIS_MODULE, |
| 242 | .enable_reg = AXP20X_VBUS_IPSOUT_MGMT, |
| 243 | .enable_mask = BIT(2), |
| 244 | .ops = &axp20x_ops_sw, |
| 245 | }; |
| 246 | |
Chen-Yu Tsai | a51f9f4 | 2016-06-01 00:23:19 +0800 | [diff] [blame] | 247 | static const struct regulator_linear_range axp809_dcdc4_ranges[] = { |
| 248 | REGULATOR_LINEAR_RANGE(600000, 0x0, 0x2f, 20000), |
| 249 | REGULATOR_LINEAR_RANGE(1800000, 0x30, 0x38, 100000), |
| 250 | }; |
| 251 | |
| 252 | static const struct regulator_linear_range axp809_dldo1_ranges[] = { |
| 253 | REGULATOR_LINEAR_RANGE(700000, 0x0, 0x1a, 100000), |
| 254 | REGULATOR_LINEAR_RANGE(3400000, 0x1b, 0x1f, 200000), |
| 255 | }; |
| 256 | |
| 257 | static const struct regulator_desc axp809_regulators[] = { |
| 258 | AXP_DESC(AXP809, DCDC1, "dcdc1", "vin1", 1600, 3400, 100, |
| 259 | AXP22X_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(1)), |
| 260 | AXP_DESC(AXP809, DCDC2, "dcdc2", "vin2", 600, 1540, 20, |
| 261 | AXP22X_DCDC2_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(2)), |
| 262 | AXP_DESC(AXP809, DCDC3, "dcdc3", "vin3", 600, 1860, 20, |
| 263 | AXP22X_DCDC3_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, BIT(3)), |
| 264 | AXP_DESC_RANGES(AXP809, DCDC4, "dcdc4", "vin4", axp809_dcdc4_ranges, |
| 265 | 57, AXP22X_DCDC4_V_OUT, 0x3f, AXP22X_PWR_OUT_CTRL1, |
| 266 | BIT(4)), |
| 267 | AXP_DESC(AXP809, DCDC5, "dcdc5", "vin5", 1000, 2550, 50, |
| 268 | AXP22X_DCDC5_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(5)), |
| 269 | /* secondary switchable output of DCDC1 */ |
| 270 | AXP_DESC_SW(AXP809, DC1SW, "dc1sw", NULL, AXP22X_PWR_OUT_CTRL2, |
| 271 | BIT(7)), |
| 272 | /* LDO regulator internally chained to DCDC5 */ |
| 273 | AXP_DESC(AXP809, DC5LDO, "dc5ldo", NULL, 700, 1400, 100, |
| 274 | AXP22X_DC5LDO_V_OUT, 0x7, AXP22X_PWR_OUT_CTRL1, BIT(0)), |
| 275 | AXP_DESC(AXP809, ALDO1, "aldo1", "aldoin", 700, 3300, 100, |
| 276 | AXP22X_ALDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(6)), |
| 277 | AXP_DESC(AXP809, ALDO2, "aldo2", "aldoin", 700, 3300, 100, |
| 278 | AXP22X_ALDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(7)), |
| 279 | AXP_DESC(AXP809, ALDO3, "aldo3", "aldoin", 700, 3300, 100, |
| 280 | AXP22X_ALDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(5)), |
| 281 | AXP_DESC_RANGES(AXP809, DLDO1, "dldo1", "dldoin", axp809_dldo1_ranges, |
| 282 | 32, AXP22X_DLDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, |
| 283 | BIT(3)), |
| 284 | AXP_DESC(AXP809, DLDO2, "dldo2", "dldoin", 700, 3300, 100, |
| 285 | AXP22X_DLDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(4)), |
| 286 | AXP_DESC(AXP809, ELDO1, "eldo1", "eldoin", 700, 3300, 100, |
| 287 | AXP22X_ELDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(0)), |
| 288 | AXP_DESC(AXP809, ELDO2, "eldo2", "eldoin", 700, 3300, 100, |
| 289 | AXP22X_ELDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(1)), |
| 290 | AXP_DESC(AXP809, ELDO3, "eldo3", "eldoin", 700, 3300, 100, |
| 291 | AXP22X_ELDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(2)), |
| 292 | AXP_DESC_IO(AXP809, LDO_IO0, "ldo_io0", "ips", 700, 3300, 100, |
| 293 | AXP22X_LDO_IO0_V_OUT, 0x1f, AXP20X_GPIO0_CTRL, 0x07, |
| 294 | AXP22X_IO_ENABLED, AXP22X_IO_DISABLED), |
| 295 | AXP_DESC_IO(AXP809, LDO_IO1, "ldo_io1", "ips", 700, 3300, 100, |
| 296 | AXP22X_LDO_IO1_V_OUT, 0x1f, AXP20X_GPIO1_CTRL, 0x07, |
| 297 | AXP22X_IO_ENABLED, AXP22X_IO_DISABLED), |
| 298 | AXP_DESC_FIXED(AXP809, RTC_LDO, "rtc_ldo", "ips", 1800), |
| 299 | AXP_DESC_SW(AXP809, SW, "sw", "swin", AXP22X_PWR_OUT_CTRL2, BIT(6)), |
| 300 | }; |
| 301 | |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 302 | static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq) |
| 303 | { |
| 304 | struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 305 | u32 min, max, def, step; |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 306 | |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 307 | switch (axp20x->variant) { |
| 308 | case AXP202_ID: |
| 309 | case AXP209_ID: |
| 310 | min = 750; |
| 311 | max = 1875; |
| 312 | def = 1500; |
| 313 | step = 75; |
| 314 | break; |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 315 | case AXP221_ID: |
Chen-Yu Tsai | 04e0981 | 2016-02-12 10:02:45 +0800 | [diff] [blame] | 316 | case AXP223_ID: |
Chen-Yu Tsai | a51f9f4 | 2016-06-01 00:23:19 +0800 | [diff] [blame] | 317 | case AXP809_ID: |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 318 | min = 1800; |
| 319 | max = 4050; |
| 320 | def = 3000; |
| 321 | step = 150; |
| 322 | break; |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 323 | default: |
| 324 | dev_err(&pdev->dev, |
| 325 | "Setting DCDC frequency for unsupported AXP variant\n"); |
| 326 | return -EINVAL; |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 327 | } |
| 328 | |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 329 | if (dcdcfreq == 0) |
| 330 | dcdcfreq = def; |
| 331 | |
| 332 | if (dcdcfreq < min) { |
| 333 | dcdcfreq = min; |
| 334 | dev_warn(&pdev->dev, "DCDC frequency too low. Set to %ukHz\n", |
| 335 | min); |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 336 | } |
| 337 | |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 338 | if (dcdcfreq > max) { |
| 339 | dcdcfreq = max; |
| 340 | dev_warn(&pdev->dev, "DCDC frequency too high. Set to %ukHz\n", |
| 341 | max); |
| 342 | } |
| 343 | |
| 344 | dcdcfreq = (dcdcfreq - min) / step; |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 345 | |
| 346 | return regmap_update_bits(axp20x->regmap, AXP20X_DCDC_FREQ, |
| 347 | AXP20X_FREQ_DCDC_MASK, dcdcfreq); |
| 348 | } |
| 349 | |
| 350 | static int axp20x_regulator_parse_dt(struct platform_device *pdev) |
| 351 | { |
| 352 | struct device_node *np, *regulators; |
| 353 | int ret; |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 354 | u32 dcdcfreq = 0; |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 355 | |
| 356 | np = of_node_get(pdev->dev.parent->of_node); |
| 357 | if (!np) |
| 358 | return 0; |
| 359 | |
Boris BREZILLON | a6016c5 | 2014-05-19 10:25:30 +0200 | [diff] [blame] | 360 | regulators = of_get_child_by_name(np, "regulators"); |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 361 | if (!regulators) { |
| 362 | dev_warn(&pdev->dev, "regulators node not found\n"); |
| 363 | } else { |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 364 | of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq); |
| 365 | ret = axp20x_set_dcdc_freq(pdev, dcdcfreq); |
| 366 | if (ret < 0) { |
| 367 | dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret); |
| 368 | return ret; |
| 369 | } |
| 370 | |
| 371 | of_node_put(regulators); |
| 372 | } |
| 373 | |
| 374 | return 0; |
| 375 | } |
| 376 | |
| 377 | static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 workmode) |
| 378 | { |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 379 | struct axp20x_dev *axp20x = rdev_get_drvdata(rdev); |
| 380 | unsigned int mask; |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 381 | |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 382 | switch (axp20x->variant) { |
| 383 | case AXP202_ID: |
| 384 | case AXP209_ID: |
| 385 | if ((id != AXP20X_DCDC2) && (id != AXP20X_DCDC3)) |
| 386 | return -EINVAL; |
| 387 | |
| 388 | mask = AXP20X_WORKMODE_DCDC2_MASK; |
| 389 | if (id == AXP20X_DCDC3) |
| 390 | mask = AXP20X_WORKMODE_DCDC3_MASK; |
| 391 | |
| 392 | workmode <<= ffs(mask) - 1; |
| 393 | break; |
| 394 | |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 395 | case AXP221_ID: |
Chen-Yu Tsai | 04e0981 | 2016-02-12 10:02:45 +0800 | [diff] [blame] | 396 | case AXP223_ID: |
Chen-Yu Tsai | a51f9f4 | 2016-06-01 00:23:19 +0800 | [diff] [blame] | 397 | case AXP809_ID: |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 398 | if (id < AXP22X_DCDC1 || id > AXP22X_DCDC5) |
| 399 | return -EINVAL; |
| 400 | |
| 401 | mask = AXP22X_WORKMODE_DCDCX_MASK(id - AXP22X_DCDC1); |
| 402 | workmode <<= id - AXP22X_DCDC1; |
| 403 | break; |
| 404 | |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 405 | default: |
| 406 | /* should not happen */ |
| 407 | WARN_ON(1); |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 408 | return -EINVAL; |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 409 | } |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 410 | |
| 411 | return regmap_update_bits(rdev->regmap, AXP20X_DCDC_MODE, mask, workmode); |
| 412 | } |
| 413 | |
| 414 | static int axp20x_regulator_probe(struct platform_device *pdev) |
| 415 | { |
| 416 | struct regulator_dev *rdev; |
| 417 | struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 418 | const struct regulator_desc *regulators; |
Chen-Yu Tsai | 765e802 | 2015-01-10 00:23:44 +0800 | [diff] [blame] | 419 | struct regulator_config config = { |
| 420 | .dev = pdev->dev.parent, |
| 421 | .regmap = axp20x->regmap, |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 422 | .driver_data = axp20x, |
Chen-Yu Tsai | 765e802 | 2015-01-10 00:23:44 +0800 | [diff] [blame] | 423 | }; |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 424 | int ret, i, nregulators; |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 425 | u32 workmode; |
Chen-Yu Tsai | a51f9f4 | 2016-06-01 00:23:19 +0800 | [diff] [blame] | 426 | const char *dcdc1_name = axp22x_regulators[AXP22X_DCDC1].name; |
| 427 | const char *dcdc5_name = axp22x_regulators[AXP22X_DCDC5].name; |
Hans de Goede | 636e2a3 | 2016-06-03 18:59:44 +0200 | [diff] [blame] | 428 | bool drivevbus = false; |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 429 | |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 430 | switch (axp20x->variant) { |
| 431 | case AXP202_ID: |
| 432 | case AXP209_ID: |
| 433 | regulators = axp20x_regulators; |
| 434 | nregulators = AXP20X_REG_ID_MAX; |
| 435 | break; |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 436 | case AXP221_ID: |
Chen-Yu Tsai | 04e0981 | 2016-02-12 10:02:45 +0800 | [diff] [blame] | 437 | case AXP223_ID: |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 438 | regulators = axp22x_regulators; |
| 439 | nregulators = AXP22X_REG_ID_MAX; |
Hans de Goede | 636e2a3 | 2016-06-03 18:59:44 +0200 | [diff] [blame] | 440 | drivevbus = of_property_read_bool(pdev->dev.parent->of_node, |
| 441 | "x-powers,drive-vbus-en"); |
Boris BREZILLON | 1b82b4e | 2015-04-10 12:09:04 +0800 | [diff] [blame] | 442 | break; |
Chen-Yu Tsai | a51f9f4 | 2016-06-01 00:23:19 +0800 | [diff] [blame] | 443 | case AXP809_ID: |
| 444 | regulators = axp809_regulators; |
| 445 | nregulators = AXP809_REG_ID_MAX; |
| 446 | break; |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 447 | default: |
| 448 | dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n", |
| 449 | axp20x->variant); |
| 450 | return -EINVAL; |
| 451 | } |
| 452 | |
Chen-Yu Tsai | 765e802 | 2015-01-10 00:23:44 +0800 | [diff] [blame] | 453 | /* This only sets the dcdc freq. Ignore any errors */ |
| 454 | axp20x_regulator_parse_dt(pdev); |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 455 | |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 456 | for (i = 0; i < nregulators; i++) { |
Chen-Yu Tsai | 7118f19 | 2015-09-30 14:39:46 +0800 | [diff] [blame] | 457 | const struct regulator_desc *desc = ®ulators[i]; |
| 458 | struct regulator_desc *new_desc; |
| 459 | |
| 460 | /* |
| 461 | * Regulators DC1SW and DC5LDO are connected internally, |
| 462 | * so we have to handle their supply names separately. |
| 463 | * |
| 464 | * We always register the regulators in proper sequence, |
| 465 | * so the supply names are correctly read. See the last |
| 466 | * part of this loop to see where we save the DT defined |
| 467 | * name. |
| 468 | */ |
Chen-Yu Tsai | a51f9f4 | 2016-06-01 00:23:19 +0800 | [diff] [blame] | 469 | if ((regulators == axp22x_regulators && i == AXP22X_DC1SW) || |
| 470 | (regulators == axp809_regulators && i == AXP809_DC1SW)) { |
| 471 | new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), |
| 472 | GFP_KERNEL); |
| 473 | *new_desc = regulators[i]; |
| 474 | new_desc->supply_name = dcdc1_name; |
| 475 | desc = new_desc; |
| 476 | } |
| 477 | |
| 478 | if ((regulators == axp22x_regulators && i == AXP22X_DC5LDO) || |
| 479 | (regulators == axp809_regulators && i == AXP809_DC5LDO)) { |
| 480 | new_desc = devm_kzalloc(&pdev->dev, sizeof(*desc), |
| 481 | GFP_KERNEL); |
| 482 | *new_desc = regulators[i]; |
| 483 | new_desc->supply_name = dcdc5_name; |
| 484 | desc = new_desc; |
Chen-Yu Tsai | 7118f19 | 2015-09-30 14:39:46 +0800 | [diff] [blame] | 485 | } |
| 486 | |
| 487 | rdev = devm_regulator_register(&pdev->dev, desc, &config); |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 488 | if (IS_ERR(rdev)) { |
| 489 | dev_err(&pdev->dev, "Failed to register %s\n", |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 490 | regulators[i].name); |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 491 | |
| 492 | return PTR_ERR(rdev); |
| 493 | } |
| 494 | |
Chen-Yu Tsai | 765e802 | 2015-01-10 00:23:44 +0800 | [diff] [blame] | 495 | ret = of_property_read_u32(rdev->dev.of_node, |
| 496 | "x-powers,dcdc-workmode", |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 497 | &workmode); |
| 498 | if (!ret) { |
| 499 | if (axp20x_set_dcdc_workmode(rdev, i, workmode)) |
| 500 | dev_err(&pdev->dev, "Failed to set workmode on %s\n", |
Boris BREZILLON | 866bd95 | 2015-04-10 12:09:03 +0800 | [diff] [blame] | 501 | rdev->desc->name); |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 502 | } |
Chen-Yu Tsai | 7118f19 | 2015-09-30 14:39:46 +0800 | [diff] [blame] | 503 | |
| 504 | /* |
| 505 | * Save AXP22X DCDC1 / DCDC5 regulator names for later. |
| 506 | */ |
Chen-Yu Tsai | a51f9f4 | 2016-06-01 00:23:19 +0800 | [diff] [blame] | 507 | if ((regulators == axp22x_regulators && i == AXP22X_DCDC1) || |
| 508 | (regulators == axp809_regulators && i == AXP809_DCDC1)) |
| 509 | of_property_read_string(rdev->dev.of_node, |
| 510 | "regulator-name", |
| 511 | &dcdc1_name); |
| 512 | |
| 513 | if ((regulators == axp22x_regulators && i == AXP22X_DCDC5) || |
| 514 | (regulators == axp809_regulators && i == AXP809_DCDC5)) |
| 515 | of_property_read_string(rdev->dev.of_node, |
| 516 | "regulator-name", |
| 517 | &dcdc5_name); |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 518 | } |
| 519 | |
Hans de Goede | 636e2a3 | 2016-06-03 18:59:44 +0200 | [diff] [blame] | 520 | if (drivevbus) { |
| 521 | /* Change N_VBUSEN sense pin to DRIVEVBUS output pin */ |
| 522 | regmap_update_bits(axp20x->regmap, AXP20X_OVER_TMP, |
| 523 | AXP22X_MISC_N_VBUSEN_FUNC, 0); |
| 524 | rdev = devm_regulator_register(&pdev->dev, |
| 525 | &axp22x_drivevbus_regulator, |
| 526 | &config); |
| 527 | if (IS_ERR(rdev)) { |
| 528 | dev_err(&pdev->dev, "Failed to register drivevbus\n"); |
| 529 | return PTR_ERR(rdev); |
| 530 | } |
| 531 | } |
| 532 | |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 533 | return 0; |
| 534 | } |
| 535 | |
| 536 | static struct platform_driver axp20x_regulator_driver = { |
| 537 | .probe = axp20x_regulator_probe, |
| 538 | .driver = { |
| 539 | .name = "axp20x-regulator", |
Carlo Caione | dfe7a1b | 2014-04-11 11:38:10 +0200 | [diff] [blame] | 540 | }, |
| 541 | }; |
| 542 | |
| 543 | module_platform_driver(axp20x_regulator_driver); |
| 544 | |
| 545 | MODULE_LICENSE("GPL v2"); |
| 546 | MODULE_AUTHOR("Carlo Caione <carlo@caione.org>"); |
| 547 | MODULE_DESCRIPTION("Regulator Driver for AXP20X PMIC"); |
Ian Campbell | d4ea7d8 | 2015-08-01 18:13:25 +0100 | [diff] [blame] | 548 | MODULE_ALIAS("platform:axp20x-regulator"); |