From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/9] regulator: helper routine to extract fixed_voltage_config
Date: Thu, 29 Sep 2011 19:26:58 -0600 [thread overview]
Message-ID: <20110930012658.GF12606@ponder.secretlab.ca> (raw)
In-Reply-To: <1317118372-17052-6-git-send-email-rnayak@ti.com>
On Tue, Sep 27, 2011 at 03:42:48PM +0530, Rajendra Nayak wrote:
> The helper routine of_get_fixed_voltage_config() extracts
> fixed_voltage_config structure contents from device tree.
>
> Also add documenation for additional bindings for fixed
> regulators that can be passed through dt.
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> ---
> .../bindings/regulator/fixed-regulator.txt | 24 +++++++++++++
> drivers/regulator/fixed.c | 36 ++++++++++++++++++++
> include/linux/regulator/fixed.h | 6 ++--
> 3 files changed, 63 insertions(+), 3 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/regulator/fixed-regulator.txt
>
> diff --git a/Documentation/devicetree/bindings/regulator/fixed-regulator.txt b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt
> new file mode 100644
> index 0000000..a204cbd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt
> @@ -0,0 +1,24 @@
> +Fixed Voltage regulators
> +
> +Required properties:
> +- compatible: Must be "regulator-fixed";
> +
> +Optional properties:
> +- regulator-fixed-supply: Name of the regulator supply
> +- regulator-fixed-microvolts: Output voltage of regulator
> +- regulator-fixed-gpio: gpio to use for enable control
> +- regulator-fixed-startup-delay: startup time in microseconds
> +- regulator-fixed-enable-high: Polarity of enable GPIO, 1 = Active High, 0 = Active low
> +- regulator-fixed-enabled-at-boot: 1 = yes, 0 = no
> +
> +Example:
> +
> + abc: fixedregulator at 0 {
> + compatible = "regulator-fixed";
> + regulator-fixed-supply = "fixed-supply";
> + regulator-fixed-microvolts = <1800000>;
> + regulator-fixed-gpio = <43>;
> + regulator-fixed-startup-delay = <70000>;
> + regulator-fixed-enable-high;
> + regulator-fixed-enabled-at-boot;
> + };
> diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
> index 2fe9d99..c09f791 100644
> --- a/drivers/regulator/fixed.c
> +++ b/drivers/regulator/fixed.c
> @@ -26,6 +26,8 @@
> #include <linux/gpio.h>
> #include <linux/delay.h>
> #include <linux/slab.h>
> +#include <linux/of.h>
> +#include <linux/regulator/of_regulator.h>
>
> struct fixed_voltage_data {
> struct regulator_desc desc;
> @@ -37,6 +39,40 @@ struct fixed_voltage_data {
> bool is_enabled;
> };
>
> +
> +/**
> + * of_get_fixed_voltage_config - extract fixed_voltage_config structure info
> + * @dev: device requesting for fixed_voltage_config
> + *
> + * Populates fixed_voltage_config structure by extracting data from device
> + * tree node, returns a pointer to the populated structure of NULL if memory
> + * alloc fails.
> + */
> +struct fixed_voltage_config *of_get_fixed_voltage_config(struct device *dev)
> +{
> + struct fixed_voltage_config *config;
> + struct device_node *np = dev->of_node;
> +
> + config = devm_kzalloc(dev, sizeof(struct fixed_voltage_config), GFP_KERNEL);
Nit: config = devm_kzalloc(dev, *config, GFP_KERNEL);
g.
next prev parent reply other threads:[~2011-09-30 1:26 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 10:12 [PATCH 0/9] Device tree support for regulators Rajendra Nayak
2011-09-27 10:12 ` [PATCH 1/9] regulator: twl: Remove hardcoded board constraints from driver Rajendra Nayak
2011-09-27 11:37 ` Mark Brown
2011-09-27 14:47 ` Rajendra Nayak
2011-09-27 10:12 ` [PATCH 2/9] regulator: helper routine to extract regulator_init_data Rajendra Nayak
2011-09-27 12:10 ` Mark Brown
2011-09-27 14:48 ` Rajendra Nayak
2011-09-27 15:05 ` Mark Brown
2011-09-28 8:06 ` Cousson, Benoit
2011-09-30 4:27 ` Rajendra Nayak
2011-09-30 7:58 ` Cousson, Benoit
2011-09-30 10:49 ` Mark Brown
2011-09-30 10:28 ` Mark Brown
2011-09-30 10:48 ` Mark Brown
2011-09-30 11:09 ` Rajendra Nayak
2011-09-30 11:35 ` Cousson, Benoit
2011-09-30 12:18 ` Mark Brown
2011-10-04 5:28 ` Rajendra Nayak
2011-10-04 10:18 ` Mark Brown
2011-10-04 11:40 ` Rajendra Nayak
2011-10-04 11:51 ` Mark Brown
2011-10-04 12:02 ` Rajendra Nayak
2011-10-04 12:11 ` Mark Brown
2011-10-04 12:40 ` Nayak, Rajendra
2011-09-30 1:24 ` Grant Likely
2011-10-04 23:01 ` Russell King - ARM Linux
2011-10-04 23:48 ` Grant Likely
2011-09-27 10:12 ` [PATCH 3/9] omap4: sdp: Pass regulator data from dt Rajendra Nayak
2011-09-27 10:12 ` [PATCH 4/9] regulator: twl: Make twl-regulator driver extract data from DT Rajendra Nayak
2011-09-27 12:14 ` Mark Brown
2011-09-27 14:48 ` Rajendra Nayak
2011-09-27 10:12 ` [PATCH 5/9] regulator: helper routine to extract fixed_voltage_config Rajendra Nayak
2011-09-27 12:16 ` Mark Brown
2011-09-27 14:49 ` Rajendra Nayak
2011-09-27 16:13 ` Mark Brown
2011-09-30 1:26 ` Grant Likely [this message]
2011-09-27 10:12 ` [PATCH 6/9] regulator: make fixed regulator driver extract data from dt Rajendra Nayak
2011-09-30 1:34 ` Grant Likely
2011-09-27 10:12 ` [PATCH 7/9] omap4: panda: Pass regulator data from DT Rajendra Nayak
2011-09-27 10:12 ` [PATCH 8/9] regulator: helper to extract regulator node based on supply name Rajendra Nayak
2011-09-27 12:21 ` Mark Brown
2011-09-27 14:49 ` Rajendra Nayak
2011-09-27 18:59 ` Mark Brown
2011-09-28 8:09 ` Cousson, Benoit
2011-09-28 8:18 ` Rajendra Nayak
2011-09-28 12:26 ` Mark Brown
2011-09-30 9:34 ` Rajendra Nayak
2011-09-30 10:35 ` Mark Brown
2011-10-04 17:00 ` Grant Likely
2011-09-28 10:56 ` Rajendra Nayak
2011-09-30 1:36 ` Grant Likely
2011-09-27 10:12 ` [PATCH 9/9] regulator: map consumer regulator based on device tree Rajendra Nayak
2011-09-27 12:23 ` Mark Brown
2011-09-27 14:49 ` Rajendra Nayak
2011-09-30 1:38 ` Grant Likely
2011-09-30 9:29 ` Rajendra Nayak
2011-09-30 1:39 ` [PATCH 0/9] Device tree support for regulators Grant Likely
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=20110930012658.GF12606@ponder.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).