mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: da9052: Add ramp speed information for the DVC regulators
@ 2014-02-06 14:35 Philipp Zabel
  2014-02-19 13:05 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Philipp Zabel @ 2014-02-06 14:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Liam Girdwood, kernel, Philipp Zabel

Some LDOs and DCDCs have a fixed ramp speed of 6.25 mV/µs. This patch adds
the set_voltage_time_sel function to let consumers know about this.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/regulator/da9052-regulator.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c
index 3adeaef..e0dbfec 100644
--- a/drivers/regulator/da9052-regulator.c
+++ b/drivers/regulator/da9052-regulator.c
@@ -240,6 +240,31 @@ static int da9052_regulator_set_voltage_sel(struct regulator_dev *rdev,
 	return ret;
 }
 
+static int da9052_regulator_set_voltage_time_sel(struct regulator_dev *rdev,
+						 unsigned int old_sel,
+						 unsigned int new_sel)
+{
+	struct da9052_regulator *regulator = rdev_get_drvdata(rdev);
+	struct da9052_regulator_info *info = regulator->info;
+	int id = rdev_get_id(rdev);
+	int ret = 0;
+
+	/* The DVC controlled LDOs and DCDCs ramp with 6.25mV/µs after enabling
+	 * the activate bit.
+	 */
+	switch (id) {
+	case DA9052_ID_BUCK1:
+	case DA9052_ID_BUCK2:
+	case DA9052_ID_BUCK3:
+	case DA9052_ID_LDO2:
+	case DA9052_ID_LDO3:
+		ret = (new_sel - old_sel) * info->step_uV / 6250;
+		break;
+	}
+
+	return ret;
+}
+
 static struct regulator_ops da9052_dcdc_ops = {
 	.get_current_limit = da9052_dcdc_get_current_limit,
 	.set_current_limit = da9052_dcdc_set_current_limit,
@@ -248,6 +273,7 @@ static struct regulator_ops da9052_dcdc_ops = {
 	.map_voltage = da9052_map_voltage,
 	.get_voltage_sel = regulator_get_voltage_sel_regmap,
 	.set_voltage_sel = da9052_regulator_set_voltage_sel,
+	.set_voltage_time_sel = da9052_regulator_set_voltage_time_sel,
 	.is_enabled = regulator_is_enabled_regmap,
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
@@ -258,6 +284,7 @@ static struct regulator_ops da9052_ldo_ops = {
 	.map_voltage = da9052_map_voltage,
 	.get_voltage_sel = regulator_get_voltage_sel_regmap,
 	.set_voltage_sel = da9052_regulator_set_voltage_sel,
+	.set_voltage_time_sel = da9052_regulator_set_voltage_time_sel,
 	.is_enabled = regulator_is_enabled_regmap,
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
-- 
1.8.5.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: da9052: Add ramp speed information for the DVC regulators
  2014-02-06 14:35 [PATCH] regulator: da9052: Add ramp speed information for the DVC regulators Philipp Zabel
@ 2014-02-19 13:05 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-02-19 13:05 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: linux-kernel, Liam Girdwood, kernel

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

On Thu, Feb 06, 2014 at 03:35:21PM +0100, Philipp Zabel wrote:
> Some LDOs and DCDCs have a fixed ramp speed of 6.25 mV/µs. This patch adds
> the set_voltage_time_sel function to let consumers know about this.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-19 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-06 14:35 [PATCH] regulator: da9052: Add ramp speed information for the DVC regulators Philipp Zabel
2014-02-19 13:05 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®