lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 27 Jan 2015 18:46:36 -0800
From:	Bjorn Andersson <bjorn.andersson@...ymobile.com>
To:	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>
CC:	<linux-arm-msm@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>, <agross@...eaurora.org>,
	<linux-kernel@...r.kernel.org>,
	<patches@...nsource.wolfsonmicro.com>
Subject: [PATCH 6/9] regulator: hi6421: move to set_optimum_mode

Signed-off-by: Bjorn Andersson <bjorn.andersson@...ymobile.com>
---
 drivers/regulator/hi6421-regulator.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/hi6421-regulator.c b/drivers/regulator/hi6421-regulator.c
index 42dc5fb..42b362d 100644
--- a/drivers/regulator/hi6421-regulator.c
+++ b/drivers/regulator/hi6421-regulator.c
@@ -477,15 +477,18 @@ static int hi6421_regulator_buck_set_mode(struct regulator_dev *rdev,
 	return 0;
 }
 
-unsigned int hi6421_regulator_ldo_get_optimum_mode(struct regulator_dev *rdev,
+static int hi6421_regulator_ldo_set_optimum_mode(struct regulator_dev *rdev,
 			int input_uV, int output_uV, int load_uA)
 {
 	struct hi6421_regulator_info *info = rdev_get_drvdata(rdev);
+	unsigned int mode;
 
 	if (load_uA > info->eco_microamp)
-		return REGULATOR_MODE_NORMAL;
+		mode = REGULATOR_MODE_NORMAL;
+	else
+		mode = REGULATOR_MODE_IDLE;
 
-	return REGULATOR_MODE_IDLE;
+	return hi6421_regulator_ldo_set_mode(rdev, mode);
 }
 
 static const struct regulator_ops hi6421_ldo_ops = {
@@ -498,7 +501,7 @@ static const struct regulator_ops hi6421_ldo_ops = {
 	.set_voltage_sel = regulator_set_voltage_sel_regmap,
 	.get_mode = hi6421_regulator_ldo_get_mode,
 	.set_mode = hi6421_regulator_ldo_set_mode,
-	.get_optimum_mode = hi6421_regulator_ldo_get_optimum_mode,
+	.set_optimum_mode = hi6421_regulator_ldo_set_optimum_mode,
 };
 
 static const struct regulator_ops hi6421_ldo_linear_ops = {
@@ -511,7 +514,7 @@ static const struct regulator_ops hi6421_ldo_linear_ops = {
 	.set_voltage_sel = regulator_set_voltage_sel_regmap,
 	.get_mode = hi6421_regulator_ldo_get_mode,
 	.set_mode = hi6421_regulator_ldo_set_mode,
-	.get_optimum_mode = hi6421_regulator_ldo_get_optimum_mode,
+	.set_optimum_mode = hi6421_regulator_ldo_set_optimum_mode,
 };
 
 static const struct regulator_ops hi6421_ldo_linear_range_ops = {
@@ -524,7 +527,7 @@ static const struct regulator_ops hi6421_ldo_linear_range_ops = {
 	.set_voltage_sel = regulator_set_voltage_sel_regmap,
 	.get_mode = hi6421_regulator_ldo_get_mode,
 	.set_mode = hi6421_regulator_ldo_set_mode,
-	.get_optimum_mode = hi6421_regulator_ldo_get_optimum_mode,
+	.set_optimum_mode = hi6421_regulator_ldo_set_optimum_mode,
 };
 
 static const struct regulator_ops hi6421_buck012_ops = {
-- 
1.9.1

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ