diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /drivers/regulator/arizona-micsupp.c | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'drivers/regulator/arizona-micsupp.c')
-rw-r--r-- | drivers/regulator/arizona-micsupp.c | 66 |
1 files changed, 12 insertions, 54 deletions
diff --git a/drivers/regulator/arizona-micsupp.c b/drivers/regulator/arizona-micsupp.c index fd3154d..e87536b 100644 --- a/drivers/regulator/arizona-micsupp.c +++ b/drivers/regulator/arizona-micsupp.c @@ -174,33 +174,6 @@ static const struct regulator_desc arizona_micsupp = { .owner = THIS_MODULE, }; -static const struct regulator_linear_range arizona_micsupp_ext_ranges[] = { - REGULATOR_LINEAR_RANGE(900000, 0, 0x14, 25000), - REGULATOR_LINEAR_RANGE(1500000, 0x15, 0x27, 100000), -}; - -static const struct regulator_desc arizona_micsupp_ext = { - .name = "MICVDD", - .supply_name = "CPVDD", - .type = REGULATOR_VOLTAGE, - .n_voltages = 40, - .ops = &arizona_micsupp_ops, - - .vsel_reg = ARIZONA_LDO2_CONTROL_1, - .vsel_mask = ARIZONA_LDO2_VSEL_MASK, - .enable_reg = ARIZONA_MIC_CHARGE_PUMP_1, - .enable_mask = ARIZONA_CPMIC_ENA, - .bypass_reg = ARIZONA_MIC_CHARGE_PUMP_1, - .bypass_mask = ARIZONA_CPMIC_BYPASS, - - .linear_ranges = arizona_micsupp_ext_ranges, - .n_linear_ranges = ARRAY_SIZE(arizona_micsupp_ext_ranges), - - .enable_time = 3000, - - .owner = THIS_MODULE, -}; - static const struct regulator_init_data arizona_micsupp_default = { .constraints = { .valid_ops_mask = REGULATOR_CHANGE_STATUS | @@ -213,22 +186,9 @@ static const struct regulator_init_data arizona_micsupp_default = { .num_consumer_supplies = 1, }; -static const struct regulator_init_data arizona_micsupp_ext_default = { - .constraints = { - .valid_ops_mask = REGULATOR_CHANGE_STATUS | - REGULATOR_CHANGE_VOLTAGE | - REGULATOR_CHANGE_BYPASS, - .min_uV = 900000, - .max_uV = 3300000, - }, - - .num_consumer_supplies = 1, -}; - static int arizona_micsupp_probe(struct platform_device *pdev) { struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); - const struct regulator_desc *desc; struct regulator_config config = { }; struct arizona_micsupp *micsupp; int ret; @@ -247,17 +207,7 @@ static int arizona_micsupp_probe(struct platform_device *pdev) * default init_data for it. This will be overridden with * platform data if provided. */ - switch (arizona->type) { - case WM5110: - desc = &arizona_micsupp_ext; - micsupp->init_data = arizona_micsupp_ext_default; - break; - default: - desc = &arizona_micsupp; - micsupp->init_data = arizona_micsupp_default; - break; - } - + micsupp->init_data = arizona_micsupp_default; micsupp->init_data.consumer_supplies = &micsupp->supply; micsupp->supply.supply = "MICVDD"; micsupp->supply.dev_name = dev_name(arizona->dev); @@ -275,9 +225,7 @@ static int arizona_micsupp_probe(struct platform_device *pdev) regmap_update_bits(arizona->regmap, ARIZONA_MIC_CHARGE_PUMP_1, ARIZONA_CPMIC_BYPASS, 0); - micsupp->regulator = devm_regulator_register(&pdev->dev, - desc, - &config); + micsupp->regulator = regulator_register(&arizona_micsupp, &config); if (IS_ERR(micsupp->regulator)) { ret = PTR_ERR(micsupp->regulator); dev_err(arizona->dev, "Failed to register mic supply: %d\n", @@ -290,8 +238,18 @@ static int arizona_micsupp_probe(struct platform_device *pdev) return 0; } +static int arizona_micsupp_remove(struct platform_device *pdev) +{ + struct arizona_micsupp *micsupp = platform_get_drvdata(pdev); + + regulator_unregister(micsupp->regulator); + + return 0; +} + static struct platform_driver arizona_micsupp_driver = { .probe = arizona_micsupp_probe, + .remove = arizona_micsupp_remove, .driver = { .name = "arizona-micsupp", .owner = THIS_MODULE, |