public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
@ 2010-01-13 11:58 Adrian Hunter
  2010-01-13 12:03 ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Adrian Hunter @ 2010-01-13 11:58 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Mark Brown, Roger Quadros, LKML

>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>
---
 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 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->delay)
+			udelay(data->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->delay = config->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
+ * @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 delay;
 	unsigned enable_high:1;
 	unsigned enabled_at_boot:1;
 	struct regulator_init_data *init_data;
-- 
1.6.0.4


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

* Re: [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2010-01-13 12:03 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Liam Girdwood, Roger Quadros, LKML

On Wed, Jan 13, 2010 at 01:58:26PM +0200, Adrian Hunter wrote:

> 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>

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

but...

> #include <linux/regulator/driver.h>
> #include <linux/regulator/fixed.h>
> #include <linux/gpio.h>
> +#include <linux/delay.h>

I think your MUA may have eaten the patch - it looks like the leading
spaces got stripped which is liable to confuse things.

> --- 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
> + * @delay:		Start-up time in microseconds

startup_delay?  Just in case we think of another delay, though I'm
struggling to think of one right now so I'm not too worried.

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

* Re: [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
  2010-01-13 12:03 ` Mark Brown
@ 2010-01-13 12:15   ` Adrian Hunter
  2010-01-13 12:26     ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Adrian Hunter @ 2010-01-13 12:15 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, Quadros Roger (Nokia-D/Helsinki), LKML

Mark Brown wrote:
> On Wed, Jan 13, 2010 at 01:58:26PM +0200, Adrian Hunter wrote:
> 
>> 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>
> 
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> 
> but...
> 
>> #include <linux/regulator/driver.h>
>> #include <linux/regulator/fixed.h>
>> #include <linux/gpio.h>
>> +#include <linux/delay.h>
> 
> I think your MUA may have eaten the patch - it looks like the leading
> spaces got stripped which is liable to confuse things.
> 

Are you sure?  Looks fines to me.

>> --- 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
>> + * @delay:		Start-up time in microseconds
> 
> startup_delay?  Just in case we think of another delay, though I'm
> struggling to think of one right now so I'm not too worried.
> 

I am too lazy to change it unless there is something else too ;-)

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

* Re: [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
  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:11       ` Adrian Hunter
  0 siblings, 2 replies; 9+ messages in thread
From: Mark Brown @ 2010-01-13 12:26 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Liam Girdwood, Quadros Roger (Nokia-D/Helsinki), LKML

On Wed, Jan 13, 2010 at 02:15:10PM +0200, Adrian Hunter wrote:
> Mark Brown wrote:

> >>#include <linux/gpio.h>
> >>+#include <linux/delay.h>

> >I think your MUA may have eaten the patch - it looks like the leading
> >spaces got stripped which is liable to confuse things.

> Are you sure?  Looks fines to me.

The above should be

  >  #include <linux/gpio.h>
  > +#include <linux/delay.h>

IIRC ie, a one character indent on the context as well as the changed
lines.

> >startup_delay?  Just in case we think of another delay, though I'm
> >struggling to think of one right now so I'm not too worried.

> I am too lazy to change it unless there is something else too ;-)

On the other hand the cross tree issues will be annoying if it's changed
later...

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

* Re: [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
  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
  1 sibling, 1 reply; 9+ messages in thread
From: Adrian Hunter @ 2010-01-13 12:55 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, Quadros Roger (Nokia-D/Helsinki), LKML

Mark Brown wrote:
> On Wed, Jan 13, 2010 at 02:15:10PM +0200, Adrian Hunter wrote:
>> Mark Brown wrote:
> 
>>>> #include <linux/gpio.h>
>>>> +#include <linux/delay.h>
> 
>>> I think your MUA may have eaten the patch - it looks like the leading
>>> spaces got stripped which is liable to confuse things.
> 
>> Are you sure?  Looks fines to me.
> 
> The above should be
> 
>   >  #include <linux/gpio.h>
>   > +#include <linux/delay.h>
> 
> IIRC ie, a one character indent on the context as well as the changed
> lines.
> 

I meant that the space is, in fact, there.
e.g. see http://lkml.org/lkml/2010/1/13/186

>>> startup_delay?  Just in case we think of another delay, though I'm
>>> struggling to think of one right now so I'm not too worried.
> 
>> I am too lazy to change it unless there is something else too ;-)
> 
> On the other hand the cross tree issues will be annoying if it's changed
> later...
> 

OK

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

* Re: [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
  2010-01-13 12:26     ` Mark Brown
  2010-01-13 12:55       ` Adrian Hunter
@ 2010-01-13 13:11       ` Adrian Hunter
  2010-01-13 13:18         ` Mark Brown
  2010-01-14 19:54         ` Liam Girdwood
  1 sibling, 2 replies; 9+ messages in thread
From: Adrian Hunter @ 2010-01-13 13:11 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, Quadros Roger (Nokia-D/Helsinki), LKML

>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>
---
 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

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

* Re: [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
  2010-01-13 12:55       ` Adrian Hunter
@ 2010-01-13 13:18         ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2010-01-13 13:18 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Liam Girdwood, Quadros Roger (Nokia-D/Helsinki), LKML

On Wed, Jan 13, 2010 at 02:55:03PM +0200, Adrian Hunter wrote:
> Mark Brown wrote:

> >IIRC ie, a one character indent on the context as well as the changed
> >lines.

> I meant that the space is, in fact, there.
> e.g. see http://lkml.org/lkml/2010/1/13/186

I see what the problem is here, you're sending in format=flowed which
means that MUAs that understand format=flowed will reindent the text on
reciept.  The indentation of the original mail will be ignored.

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

* Re: [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
  2010-01-13 13:11       ` Adrian Hunter
@ 2010-01-13 13:18         ` Mark Brown
  2010-01-14 19:54         ` Liam Girdwood
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2010-01-13 13:18 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Liam Girdwood, Quadros Roger (Nokia-D/Helsinki), LKML

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

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

* Re: [PATCH] regulator: Add 'start-up time' to fixed voltage regulators
  2010-01-13 13:11       ` Adrian Hunter
  2010-01-13 13:18         ` Mark Brown
@ 2010-01-14 19:54         ` Liam Girdwood
  1 sibling, 0 replies; 9+ messages in thread
From: Liam Girdwood @ 2010-01-14 19:54 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Mark Brown, Quadros Roger (Nokia-D/Helsinki), LKML

On Wed, 2010-01-13 at 15:11 +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.
> 

Applied.

Thanks

Liam


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

end of thread, other threads:[~2010-01-14 19:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-01-14 19:54         ` Liam Girdwood

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