diff options
author | Mark Brown <broonie@linaro.org> | 2013-10-24 14:11:36 +0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-10-24 14:11:36 +0400 |
commit | 706664c290d69f890a9e3acfc6a8196098459826 (patch) | |
tree | a8b8e7bc7f9172a412363b1ceb9ea1a78587e077 /drivers/regulator/core.c | |
parent | b735e47f6e94f07911dcdf92837ebfd0ec1cf7c0 (diff) | |
parent | 609d5f6ddc18d05801646c869fcf4d0537b9110b (diff) | |
download | linux-706664c290d69f890a9e3acfc6a8196098459826.tar.xz |
Merge remote-tracking branch 'regulator/topic/fixed' into regulator-next
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 916cadf45279..960103a61000 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2582,6 +2582,8 @@ static int _regulator_get_voltage(struct regulator_dev *rdev) ret = rdev->desc->ops->get_voltage(rdev); } else if (rdev->desc->ops->list_voltage) { ret = rdev->desc->ops->list_voltage(rdev, 0); + } else if (rdev->desc->fixed_uV && (rdev->desc->n_voltages == 1)) { + ret = rdev->desc->fixed_uV; } else { return -EINVAL; } @@ -3217,7 +3219,8 @@ static int add_regulator_attributes(struct regulator_dev *rdev) /* some attributes need specific methods to be displayed */ if ((ops->get_voltage && ops->get_voltage(rdev) >= 0) || (ops->get_voltage_sel && ops->get_voltage_sel(rdev) >= 0) || - (ops->list_voltage && ops->list_voltage(rdev, 0) >= 0)) { + (ops->list_voltage && ops->list_voltage(rdev, 0) >= 0) || + (rdev->desc->fixed_uV && (rdev->desc->n_voltages == 1))) { status = device_create_file(dev, &dev_attr_microvolts); if (status < 0) return status; |