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]
Message-ID: <1422413199-17273-5-git-send-email-bjorn.andersson@sonymobile.com>
Date:	Tue, 27 Jan 2015 18:46:34 -0800
From:	Bjorn Andersson <bjorn.andersson@...ymobile.com>
To:	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>,
	<patches@...nsource.wolfsonmicro.com>
CC:	<agross@...eaurora.org>, <linux-arm-msm@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>
Subject: [PATCH 4/9] regulator: wm831x-ldo: move to set_optimum_mode

Signed-off-by: Bjorn Andersson <bjorn.andersson@...ymobile.com>
---
 drivers/regulator/wm831x-ldo.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c
index 7ae2dc8..40d391e 100644
--- a/drivers/regulator/wm831x-ldo.c
+++ b/drivers/regulator/wm831x-ldo.c
@@ -186,15 +186,20 @@ static int wm831x_gp_ldo_get_status(struct regulator_dev *rdev)
 		return regulator_mode_to_status(ret);
 }
 
-static unsigned int wm831x_gp_ldo_get_optimum_mode(struct regulator_dev *rdev,
-						   int input_uV,
-						   int output_uV, int load_uA)
+static int wm831x_gp_ldo_set_optimum_mode(struct regulator_dev *rdev,
+					  int input_uV,
+					  int output_uV, int load_uA)
 {
+	unsigned int mode;
+
 	if (load_uA < 20000)
-		return REGULATOR_MODE_STANDBY;
-	if (load_uA < 50000)
-		return REGULATOR_MODE_IDLE;
-	return REGULATOR_MODE_NORMAL;
+		mode = REGULATOR_MODE_STANDBY;
+	else if (load_uA < 50000)
+		mode = REGULATOR_MODE_IDLE;
+	else
+		mode = REGULATOR_MODE_NORMAL;
+
+	return wm831x_gp_ldo_set_mode(rdev, mode);
 }
 
 
@@ -207,7 +212,7 @@ static struct regulator_ops wm831x_gp_ldo_ops = {
 	.get_mode = wm831x_gp_ldo_get_mode,
 	.set_mode = wm831x_gp_ldo_set_mode,
 	.get_status = wm831x_gp_ldo_get_status,
-	.get_optimum_mode = wm831x_gp_ldo_get_optimum_mode,
+	.set_optimum_mode = wm831x_gp_ldo_set_optimum_mode,
 	.get_bypass = regulator_get_bypass_regmap,
 	.set_bypass = regulator_set_bypass_regmap,
 
-- 
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