public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Adrian Hunter <adrian.hunter@nokia.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>,
	"Quadros Roger (Nokia-D/Helsinki)" <roger.quadros@nokia.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
Date: Wed, 13 Jan 2010 13:18:40 +0000	[thread overview]
Message-ID: <20100113131840.GF27473@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <4B4DC66C.5050106@nokia.com>

On Wed, Jan 13, 2010 at 03:11:08PM +0200, Adrian Hunter wrote:
> From bd97e65b280be528239e3932da8be512ce7785ed Mon Sep 17 00:00:00 2001
> From: Adrian Hunter <adrian.hunter@nokia.com>
> Date: Tue, 12 Jan 2010 12:25:13 +0200
> Subject: [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
> 
> Add a field to specify a delay for the start-up time of
> a fixed voltage regulator.
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>

Looks good, thanks.

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

> ---
> drivers/regulator/fixed.c       |    5 +++++
> include/linux/regulator/fixed.h |    2 ++
> 2 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
> index f9f516a..40d4080 100644
> --- a/drivers/regulator/fixed.c
> +++ b/drivers/regulator/fixed.c
> @@ -24,12 +24,14 @@
> #include <linux/regulator/driver.h>
> #include <linux/regulator/fixed.h>
> #include <linux/gpio.h>
> +#include <linux/delay.h>
> 
> struct fixed_voltage_data {
> 	struct regulator_desc desc;
> 	struct regulator_dev *dev;
> 	int microvolts;
> 	int gpio;
> +	unsigned startup_delay;
> 	unsigned enable_high:1;
> 	unsigned is_enabled:1;
> };
> @@ -48,6 +50,8 @@ static int fixed_voltage_enable(struct regulator_dev *dev)
> 	if (gpio_is_valid(data->gpio)) {
> 		gpio_set_value_cansleep(data->gpio, data->enable_high);
> 		data->is_enabled = 1;
> +		if (data->startup_delay)
> +			udelay(data->startup_delay);
> 	}
> 
> 	return 0;
> @@ -117,6 +121,7 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev)
> 
> 	drvdata->microvolts = config->microvolts;
> 	drvdata->gpio = config->gpio;
> +	drvdata->startup_delay = config->startup_delay;
> 
> 	if (gpio_is_valid(config->gpio)) {
> 		drvdata->enable_high = config->enable_high;
> diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
> index e94a4a1..02edef1 100644
> --- a/include/linux/regulator/fixed.h
> +++ b/include/linux/regulator/fixed.h
> @@ -25,6 +25,7 @@ struct regulator_init_data;
>  * @microvolts:		Output voltage of regulator
>  * @gpio:		GPIO to use for enable control
>  * 			set to -EINVAL if not used
> + * @startup_delay:	Start-up time in microseconds
>  * @enable_high:	Polarity of enable GPIO
>  *			1 = Active high, 0 = Active low
>  * @enabled_at_boot:	Whether regulator has been enabled at
> @@ -41,6 +42,7 @@ struct fixed_voltage_config {
> 	const char *supply_name;
> 	int microvolts;
> 	int gpio;
> +	unsigned startup_delay;
> 	unsigned enable_high:1;
> 	unsigned enabled_at_boot:1;
> 	struct regulator_init_data *init_data;
> -- 
> 1.6.0.4

  reply	other threads:[~2010-01-13 13:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13 11:58 [PATCH] regulator: Add 'start-up time' to fixed voltage regulators Adrian Hunter
2010-01-13 12:03 ` Mark Brown
2010-01-13 12:15   ` Adrian Hunter
2010-01-13 12:26     ` Mark Brown
2010-01-13 12:55       ` Adrian Hunter
2010-01-13 13:18         ` Mark Brown
2010-01-13 13:11       ` Adrian Hunter
2010-01-13 13:18         ` Mark Brown [this message]
2010-01-14 19:54         ` Liam Girdwood

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=20100113131840.GF27473@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=adrian.hunter@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=roger.quadros@nokia.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