summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-27 11:37:04 -0700
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-07 09:48:15 +0800
commitf2889e650a8dbd51644997aef7bae71d6ac4d423 (patch)
tree911e8ff45ef616b8755ec381e4623f4fb8ac05e2 /drivers/regulator/core.c
parent380a0e6f72e8d0211f48c24f293a366a53b374d7 (diff)
downloadblackbird-op-linux-f2889e650a8dbd51644997aef7bae71d6ac4d423.tar.gz
blackbird-op-linux-f2889e650a8dbd51644997aef7bae71d6ac4d423.zip
regulator: core: Report microvolts in sysfs even with only list_voltage()
If a regulator only supports a single voltage list_voltage() can be used to report what that voltage is so add this as one of the criteria for creating the microvolts file in sysfs. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 2a3e4213865b..50977a69f09a 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3020,7 +3020,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->get_voltage_sel && ops->get_voltage_sel(rdev) >= 0) ||
+ (ops->list_voltage && ops->list_voltage(rdev, 0) >= 0)) {
status = device_create_file(dev, &dev_attr_microvolts);
if (status < 0)
return status;
OpenPOWER on IntegriCloud