22 #include <linux/kernel.h>
25 #include <linux/module.h>
26 #include <linux/slab.h>
102 .set_voltage_sel = aat2870_ldo_set_voltage_sel,
103 .get_voltage_sel = aat2870_ldo_get_voltage_sel,
104 .enable = aat2870_ldo_enable,
105 .disable = aat2870_ldo_disable,
106 .is_enabled = aat2870_ldo_is_enabled,
109 static const unsigned int aat2870_ldo_voltages[] = {
110 1200000, 1300000, 1500000, 1600000,
111 1800000, 2000000, 2200000, 2500000,
112 2600000, 2700000, 2800000, 2900000,
113 3000000, 3100000, 3200000, 3300000,
116 #define AAT2870_LDO(ids) \
120 .id = AAT2870_ID_##ids, \
121 .n_voltages = ARRAY_SIZE(aat2870_ldo_voltages), \
122 .volt_table = aat2870_ldo_voltages, \
123 .ops = &aat2870_ldo_ops, \
124 .type = REGULATOR_VOLTAGE, \
125 .owner = THIS_MODULE, \
141 for (i = 0; i <
ARRAY_SIZE(aat2870_regulators); i++) {
142 ri = &aat2870_regulators[
i];
143 if (ri->
desc.id ==
id)
168 ri = aat2870_get_regulator(pdev->
id);
170 dev_err(&pdev->
dev,
"Invalid device ID, %d\n", pdev->
id);
181 dev_err(&pdev->
dev,
"Failed to register regulator %s\n",
183 return PTR_ERR(rdev);
185 platform_set_drvdata(pdev, rdev);
200 .name =
"aat2870-regulator",
203 .probe = aat2870_regulator_probe,
207 static int __init aat2870_regulator_init(
void)
213 static void __exit aat2870_regulator_exit(
void)