From: Yadwinder Singh Brar <yadi.brar01@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@ti.com>,
Yadwinder Singh Brar <yadi.brar@samsung.com>
Subject: [PATCH v2 2/2] regulator: Parse ramp_delay in while parsing DT for regulators.
Date: Sat, 9 Jun 2012 16:40:39 +0530 [thread overview]
Message-ID: <1339240239-5626-2-git-send-email-yadi.brar@samsung.com> (raw)
In-Reply-To: <1339240239-5626-1-git-send-email-yadi.brar@samsung.com>
For some hardwares ramp_delay for BUCKs is a configurable parameter which can
be configured through DT.This patch adds support for parsing ramp_delay also
while parsing DT for regulators.
Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com>
---
.../devicetree/bindings/regulator/regulator.txt | 1 +
drivers/regulator/of_regulator.c | 6 ++++++
include/linux/regulator/machine.h | 2 ++
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/Documentation/devicetree/bindings/regulator/regulator.txt b/Documentation/devicetree/bindings/regulator/regulator.txt
index 5b7a408..d0a7b12 100644
--- a/Documentation/devicetree/bindings/regulator/regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/regulator.txt
@@ -10,6 +10,7 @@ Optional properties:
- regulator-always-on: boolean, regulator should never be disabled
- regulator-boot-on: bootloader/firmware enabled regulator
- <name>-supply: phandle to the parent supply/regulator node
+- regulator-ramp-delay: ramp delay for regulator(in mV/uS)
Example:
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 56593b7..8b9cb53 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -74,6 +74,7 @@ struct regulator_init_data *of_get_regulator_init_data(struct device *dev,
struct device_node *node)
{
struct regulator_init_data *init_data;
+ const __be32 *ramp_delay;
if (!node)
return NULL;
@@ -83,6 +84,11 @@ struct regulator_init_data *of_get_regulator_init_data(struct device *dev,
return NULL; /* Out of memory? */
of_get_regulation_constraints(node, &init_data);
+
+ ramp_delay = of_get_property(node, "regulator-ramp-delay", NULL);
+ if (ramp_delay)
+ init_data->ramp_delay = be32_to_cpu(*ramp_delay);
+
return init_data;
}
EXPORT_SYMBOL_GPL(of_get_regulator_init_data);
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index b021084..bb29a6b 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -177,6 +177,8 @@ struct regulator_init_data {
int num_consumer_supplies;
struct regulator_consumer_supply *consumer_supplies;
+ int ramp_delay; /* unit:mV/us */
+
/* optional regulator machine specific init */
int (*regulator_init)(void *driver_data);
void *driver_data; /* core does not touch this */
--
1.7.0.4
next prev parent reply other threads:[~2012-06-09 11:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-09 11:10 [PATCH v2 1/2] regulator: core: Add regulator_set_voltage_time_sel to calculate ramp delay Yadwinder Singh Brar
2012-06-09 11:10 ` Yadwinder Singh Brar [this message]
2012-06-11 4:07 ` [PATCH v2 2/2] regulator: Parse ramp_delay in while parsing DT for regulators Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339240239-5626-2-git-send-email-yadi.brar@samsung.com \
--to=yadi.brar01@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=yadi.brar@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox