|
@@ -34,7 +34,6 @@
|
|
|
struct fixed_voltage_data {
|
|
|
struct regulator_desc desc;
|
|
|
struct regulator_dev *dev;
|
|
|
- int microvolts;
|
|
|
};
|
|
|
|
|
|
|
|
@@ -108,30 +107,7 @@ of_get_fixed_voltage_config(struct device *dev)
|
|
|
return config;
|
|
|
}
|
|
|
|
|
|
-static int fixed_voltage_get_voltage(struct regulator_dev *dev)
|
|
|
-{
|
|
|
- struct fixed_voltage_data *data = rdev_get_drvdata(dev);
|
|
|
-
|
|
|
- if (data->microvolts)
|
|
|
- return data->microvolts;
|
|
|
- else
|
|
|
- return -EINVAL;
|
|
|
-}
|
|
|
-
|
|
|
-static int fixed_voltage_list_voltage(struct regulator_dev *dev,
|
|
|
- unsigned selector)
|
|
|
-{
|
|
|
- struct fixed_voltage_data *data = rdev_get_drvdata(dev);
|
|
|
-
|
|
|
- if (selector != 0)
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- return data->microvolts;
|
|
|
-}
|
|
|
-
|
|
|
static struct regulator_ops fixed_voltage_ops = {
|
|
|
- .get_voltage = fixed_voltage_get_voltage,
|
|
|
- .list_voltage = fixed_voltage_list_voltage,
|
|
|
};
|
|
|
|
|
|
static int reg_fixed_voltage_probe(struct platform_device *pdev)
|
|
@@ -186,23 +162,21 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
|
|
|
if (config->microvolts)
|
|
|
drvdata->desc.n_voltages = 1;
|
|
|
|
|
|
- drvdata->microvolts = config->microvolts;
|
|
|
+ drvdata->desc.fixed_uV = config->microvolts;
|
|
|
|
|
|
if (config->gpio >= 0)
|
|
|
cfg.ena_gpio = config->gpio;
|
|
|
cfg.ena_gpio_invert = !config->enable_high;
|
|
|
if (config->enabled_at_boot) {
|
|
|
- if (config->enable_high) {
|
|
|
+ if (config->enable_high)
|
|
|
cfg.ena_gpio_flags |= GPIOF_OUT_INIT_HIGH;
|
|
|
- } else {
|
|
|
+ else
|
|
|
cfg.ena_gpio_flags |= GPIOF_OUT_INIT_LOW;
|
|
|
- }
|
|
|
} else {
|
|
|
- if (config->enable_high) {
|
|
|
+ if (config->enable_high)
|
|
|
cfg.ena_gpio_flags |= GPIOF_OUT_INIT_LOW;
|
|
|
- } else {
|
|
|
+ else
|
|
|
cfg.ena_gpio_flags |= GPIOF_OUT_INIT_HIGH;
|
|
|
- }
|
|
|
}
|
|
|
if (config->gpio_is_open_drain)
|
|
|
cfg.ena_gpio_flags |= GPIOF_OPEN_DRAIN;
|
|
@@ -222,7 +196,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
|
|
|
platform_set_drvdata(pdev, drvdata);
|
|
|
|
|
|
dev_dbg(&pdev->dev, "%s supplying %duV\n", drvdata->desc.name,
|
|
|
- drvdata->microvolts);
|
|
|
+ drvdata->desc.fixed_uV);
|
|
|
|
|
|
return 0;
|
|
|
|