[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1352796533-12350-3-git-send-email-m.szyprowski@samsung.com>
Date: Tue, 13 Nov 2012 09:48:52 +0100
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: linux-kernel@...r.kernel.org, linux-mmc@...r.kernel.org
Cc: Marek Szyprowski <m.szyprowski@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Liam Girdwood <lrg@...com>, Chris Ball <cjb@...top.org>
Subject: [PATCH 2/3] regulator: threat regulators with constant volatage as
fixed
Some drivers has additional logic for fixed regulators. Let regulator core
to threat regulators which cannot change their voltage due to applied
constraints as fixed.
Signed-off-by: Marek Szyprowski <m.szyprowski@...sung.com>
---
drivers/regulator/core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 042c1ff..271182e 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1872,7 +1872,10 @@ int regulator_count_voltages(struct regulator *regulator)
{
struct regulator_dev *rdev = regulator->rdev;
- return rdev->desc->n_voltages ? : -EINVAL;
+ if (rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)
+ return rdev->desc->n_voltages ? : -EINVAL;
+ else
+ return 1;
}
EXPORT_SYMBOL_GPL(regulator_count_voltages);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists