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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1459347792-13515-1-git-send-email-georgi.djakov@linaro.org>
Date:	Wed, 30 Mar 2016 17:23:12 +0300
From:	Georgi Djakov <georgi.djakov@...aro.org>
To:	broonie@...nel.org
Cc:	linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
	stephen.boyd@...aro.org, georgi.djakov@...aro.org
Subject: [PATCH] regulator: Support ramp-up delay for drivers with get_voltage()

Currently a ramp-up delay is supported only for drivers which have an
implementation of both set_voltage_time_sel() and get_voltage_sel().
But some drivers use get_voltage() instead of get_voltage_sel().

Allow the regulator core to support ramp-up delays for drivers which
use get_voltage().

Signed-off-by: Georgi Djakov <georgi.djakov@...aro.org>
---
 drivers/regulator/core.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 74e8a7a3b3e8..39806b4d580a 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2772,6 +2772,17 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
 		old_selector = rdev->desc->ops->get_voltage_sel(rdev);
 		if (old_selector < 0)
 			return old_selector;
+
+	} else if (_regulator_is_enabled(rdev) &&
+		   rdev->desc->ops->set_voltage_time_sel &&
+		   rdev->desc->ops->get_voltage) {
+		int uV = rdev->desc->ops->get_voltage(rdev);
+
+		if (uV > 0) {
+			old_selector = regulator_map_voltage(rdev, uV, uV);
+			if (old_selector < 0)
+				return old_selector;
+		}
 	}
 
 	if (rdev->desc->ops->set_voltage) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ