14 #include <linux/module.h>
17 #include <linux/bitops.h>
23 #include <linux/slab.h>
29 #define ARIZONA_MICSUPP_MAX_SELECTOR 0x1f
48 return (selector * 50000) + 1700000;
51 static int arizona_micsupp_map_voltage(
struct regulator_dev *rdev,
52 int min_uV,
int max_uV)
68 voltage = arizona_micsupp_list_voltage(rdev, selector);
69 if (voltage < min_uV || voltage > max_uV)
80 .list_voltage = arizona_micsupp_list_voltage,
81 .map_voltage = arizona_micsupp_map_voltage,
92 .supply_name =
"CPVDD",
95 .ops = &arizona_micsupp_ops,
115 .num_consumer_supplies = 1,
122 struct arizona_micsupp *micsupp;
126 if (micsupp ==
NULL) {
127 dev_err(&pdev->
dev,
"Unable to allocate private data\n");
138 micsupp->
init_data = arizona_micsupp_default;
140 micsupp->
supply.supply =
"MICVDD";
141 micsupp->
supply.dev_name = dev_name(arizona->
dev);
143 config.
dev = arizona->
dev;
147 if (arizona->
pdata.micvdd)
159 dev_err(arizona->
dev,
"Failed to register mic supply: %d\n",
164 platform_set_drvdata(pdev, micsupp);
171 struct arizona_micsupp *micsupp = platform_get_drvdata(pdev);
179 .probe = arizona_micsupp_probe,
182 .name =
"arizona-micsupp",