diff options
| -rw-r--r-- | drivers/regulator/core.c | 27 | ||||
| -rw-r--r-- | include/linux/regulator/consumer.h | 6 |
2 files changed, 0 insertions, 33 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index ec8184d53f13..db320e8fa865 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
| @@ -2509,33 +2509,6 @@ int regulator_is_enabled(struct regulator *regulator) | |||
| 2509 | EXPORT_SYMBOL_GPL(regulator_is_enabled); | 2509 | EXPORT_SYMBOL_GPL(regulator_is_enabled); |
| 2510 | 2510 | ||
| 2511 | /** | 2511 | /** |
| 2512 | * regulator_can_change_voltage - check if regulator can change voltage | ||
| 2513 | * @regulator: regulator source | ||
| 2514 | * | ||
| 2515 | * Returns positive if the regulator driver backing the source/client | ||
| 2516 | * can change its voltage, false otherwise. Useful for detecting fixed | ||
| 2517 | * or dummy regulators and disabling voltage change logic in the client | ||
| 2518 | * driver. | ||
| 2519 | */ | ||
| 2520 | int regulator_can_change_voltage(struct regulator *regulator) | ||
| 2521 | { | ||
| 2522 | struct regulator_dev *rdev = regulator->rdev; | ||
| 2523 | |||
| 2524 | if (regulator_ops_is_valid(rdev, REGULATOR_CHANGE_VOLTAGE)) { | ||
| 2525 | if (rdev->desc->n_voltages - rdev->desc->linear_min_sel > 1) | ||
| 2526 | return 1; | ||
| 2527 | |||
| 2528 | if (rdev->desc->continuous_voltage_range && | ||
| 2529 | rdev->constraints->min_uV && rdev->constraints->max_uV && | ||
| 2530 | rdev->constraints->min_uV != rdev->constraints->max_uV) | ||
| 2531 | return 1; | ||
| 2532 | } | ||
| 2533 | |||
| 2534 | return 0; | ||
| 2535 | } | ||
| 2536 | EXPORT_SYMBOL_GPL(regulator_can_change_voltage); | ||
| 2537 | |||
| 2538 | /** | ||
| 2539 | * regulator_count_voltages - count regulator_list_voltage() selectors | 2512 | * regulator_count_voltages - count regulator_list_voltage() selectors |
| 2540 | * @regulator: regulator source | 2513 | * @regulator: regulator source |
| 2541 | * | 2514 | * |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 48603506f8de..cae500b2c1d7 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -224,7 +224,6 @@ int regulator_bulk_force_disable(int num_consumers, | |||
| 224 | void regulator_bulk_free(int num_consumers, | 224 | void regulator_bulk_free(int num_consumers, |
| 225 | struct regulator_bulk_data *consumers); | 225 | struct regulator_bulk_data *consumers); |
| 226 | 226 | ||
| 227 | int regulator_can_change_voltage(struct regulator *regulator); | ||
| 228 | int regulator_count_voltages(struct regulator *regulator); | 227 | int regulator_count_voltages(struct regulator *regulator); |
| 229 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); | 228 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); |
| 230 | int regulator_is_supported_voltage(struct regulator *regulator, | 229 | int regulator_is_supported_voltage(struct regulator *regulator, |
| @@ -436,11 +435,6 @@ static inline void regulator_bulk_free(int num_consumers, | |||
| 436 | { | 435 | { |
| 437 | } | 436 | } |
| 438 | 437 | ||
| 439 | static inline int regulator_can_change_voltage(struct regulator *regulator) | ||
| 440 | { | ||
| 441 | return 0; | ||
| 442 | } | ||
| 443 | |||
| 444 | static inline int regulator_set_voltage(struct regulator *regulator, | 438 | static inline int regulator_set_voltage(struct regulator *regulator, |
| 445 | int min_uV, int max_uV) | 439 | int min_uV, int max_uV) |
| 446 | { | 440 | { |
