All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
@ 2018-07-26 11:47 Peng Fan
  2018-07-26 13:59 ` Peng Fan
  2018-08-20 17:40 ` [U-Boot] [U-Boot, " Tom Rini
  0 siblings, 2 replies; 13+ messages in thread
From: Peng Fan @ 2018-07-26 11:47 UTC (permalink / raw)
  To: u-boot

Add u-boot,off-on-delay-us for fixed regulator.

Depends on board design, the gpio regulator sometimes
connects with a big capacitance. When need to off, then
on the regulator, if there is no enough delay,
the voltage does not drop to 0, so introduce this
property to handle such case.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
---

V2:
 Moved device tree bindings to new directory.
 Simon, I keep you reviewed by tag. Thanks.

 doc/device-tree-bindings/regulator/fixed.txt | 1 +
 drivers/power/regulator/fixed.c              | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/doc/device-tree-bindings/regulator/fixed.txt b/doc/device-tree-bindings/regulator/fixed.txt
index 5fd9033fea..453d2bef44 100644
--- a/doc/device-tree-bindings/regulator/fixed.txt
+++ b/doc/device-tree-bindings/regulator/fixed.txt
@@ -11,6 +11,7 @@ Required properties:
 Optional properties:
 - gpio: GPIO to use for enable control
 - startup-delay-us: startup time in microseconds
+- u-boot,off-on-delay-us: off delay time in microseconds
 - regulator constraints (binding info: regulator.txt)
 - enable-active-high: Polarity of GPIO is Active high. If this property
   is missing, the default assumed is Active low.
diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c
index 0be5b7bd51..a99aa78310 100644
--- a/drivers/power/regulator/fixed.c
+++ b/drivers/power/regulator/fixed.c
@@ -16,6 +16,7 @@
 struct fixed_regulator_platdata {
 	struct gpio_desc gpio; /* GPIO for regulator enable control */
 	unsigned int startup_delay_us;
+	unsigned int off_on_delay_us;
 };
 
 static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
@@ -50,6 +51,8 @@ static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
 	/* Get optional ramp up delay */
 	dev_pdata->startup_delay_us = dev_read_u32_default(dev,
 							"startup-delay-us", 0);
+	dev_pdata->off_on_delay_us =
+			dev_read_u32_default(dev, "u-boot,off-on-delay-us", 0);
 
 	return 0;
 }
@@ -123,6 +126,9 @@ static int fixed_regulator_set_enable(struct udevice *dev, bool enable)
 		udelay(dev_pdata->startup_delay_us);
 	debug("%s: done\n", __func__);
 
+	if (!enable && dev_pdata->off_on_delay_us)
+		udelay(dev_pdata->off_on_delay_us);
+
 	return 0;
 }
 
-- 
2.14.1

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-26 11:47 [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us Peng Fan
@ 2018-07-26 13:59 ` Peng Fan
  2018-07-26 17:05   ` Tom Rini
  2018-08-20 17:40 ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 1 reply; 13+ messages in thread
From: Peng Fan @ 2018-07-26 13:59 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Peng Fan
> Sent: 2018年7月26日 19:47
> To: sjg at chromium.org; trini at konsulko.com
> Cc: yamada.masahiro at socionext.com; u-boot at lists.denx.de; Peng Fan
> <peng.fan@nxp.com>
> Subject: [PATCH V2] drivers: regulator: fixed: add u-boot,off-on-delay-us
> 
> Add u-boot,off-on-delay-us for fixed regulator.
> 
> Depends on board design, the gpio regulator sometimes connects with a big
> capacitance. When need to off, then on the regulator, if there is no enough delay,
> the voltage does not drop to 0, so introduce this property to handle such case.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
> V2:
>  Moved device tree bindings to new directory.
>  Simon, I keep you reviewed by tag. Thanks.

Sorry, this patchset should be V3 version.

Tom, should I resend a v3 out? Or you could apply this one?

Thanks,
Peng.

> 
>  doc/device-tree-bindings/regulator/fixed.txt | 1 +
>  drivers/power/regulator/fixed.c              | 6 ++++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/doc/device-tree-bindings/regulator/fixed.txt
> b/doc/device-tree-bindings/regulator/fixed.txt
> index 5fd9033fea..453d2bef44 100644
> --- a/doc/device-tree-bindings/regulator/fixed.txt
> +++ b/doc/device-tree-bindings/regulator/fixed.txt
> @@ -11,6 +11,7 @@ Required properties:
>  Optional properties:
>  - gpio: GPIO to use for enable control
>  - startup-delay-us: startup time in microseconds
> +- u-boot,off-on-delay-us: off delay time in microseconds
>  - regulator constraints (binding info: regulator.txt)
>  - enable-active-high: Polarity of GPIO is Active high. If this property
>    is missing, the default assumed is Active low.
> diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c
> index 0be5b7bd51..a99aa78310 100644
> --- a/drivers/power/regulator/fixed.c
> +++ b/drivers/power/regulator/fixed.c
> @@ -16,6 +16,7 @@
>  struct fixed_regulator_platdata {
>  	struct gpio_desc gpio; /* GPIO for regulator enable control */
>  	unsigned int startup_delay_us;
> +	unsigned int off_on_delay_us;
>  };
> 
>  static int fixed_regulator_ofdata_to_platdata(struct udevice *dev) @@ -50,6
> +51,8 @@ static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
>  	/* Get optional ramp up delay */
>  	dev_pdata->startup_delay_us = dev_read_u32_default(dev,
>  							"startup-delay-us", 0);
> +	dev_pdata->off_on_delay_us =
> +			dev_read_u32_default(dev, "u-boot,off-on-delay-us", 0);
> 
>  	return 0;
>  }
> @@ -123,6 +126,9 @@ static int fixed_regulator_set_enable(struct udevice
> *dev, bool enable)
>  		udelay(dev_pdata->startup_delay_us);
>  	debug("%s: done\n", __func__);
> 
> +	if (!enable && dev_pdata->off_on_delay_us)
> +		udelay(dev_pdata->off_on_delay_us);
> +
>  	return 0;
>  }
> 
> --
> 2.14.1

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-26 13:59 ` Peng Fan
@ 2018-07-26 17:05   ` Tom Rini
  2018-07-27  2:10     ` Peng Fan
  2018-08-06  3:04     ` Peng Fan
  0 siblings, 2 replies; 13+ messages in thread
From: Tom Rini @ 2018-07-26 17:05 UTC (permalink / raw)
  To: u-boot

On Thu, Jul 26, 2018 at 01:59:20PM +0000, Peng Fan wrote:

> > -----Original Message-----
> > From: Peng Fan
> > Sent: 2018年7月26日 19:47
> > To: sjg at chromium.org; trini at konsulko.com
> > Cc: yamada.masahiro at socionext.com; u-boot at lists.denx.de; Peng Fan
> > <peng.fan@nxp.com>
> > Subject: [PATCH V2] drivers: regulator: fixed: add u-boot,off-on-delay-us
> > 
> > Add u-boot,off-on-delay-us for fixed regulator.
> > 
> > Depends on board design, the gpio regulator sometimes connects with a big
> > capacitance. When need to off, then on the regulator, if there is no enough delay,
> > the voltage does not drop to 0, so introduce this property to handle such case.
> > 
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> > Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> > 
> > V2:
> >  Moved device tree bindings to new directory.
> >  Simon, I keep you reviewed by tag. Thanks.
> 
> Sorry, this patchset should be V3 version.
> 
> Tom, should I resend a v3 out? Or you could apply this one?

Barring further comments from people, you can just keep this version.
FWIW, I think that if people register with patchwork they can manage the
state of their own patches and that always helps keep me from failing to
notice something / grab the wrong version :)  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180726/7d0b7e6e/attachment.sig>

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-26 17:05   ` Tom Rini
@ 2018-07-27  2:10     ` Peng Fan
  2018-08-06  3:04     ` Peng Fan
  1 sibling, 0 replies; 13+ messages in thread
From: Peng Fan @ 2018-07-27  2:10 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Tom Rini [mailto:trini at konsulko.com]
> Sent: 2018年7月27日 1:06
> To: Peng Fan <peng.fan@nxp.com>
> Cc: sjg at chromium.org; yamada.masahiro at socionext.com;
> u-boot at lists.denx.de
> Subject: Re: [PATCH V2] drivers: regulator: fixed: add u-boot,off-on-delay-us
> 
> On Thu, Jul 26, 2018 at 01:59:20PM +0000, Peng Fan wrote:
> 
> > > -----Original Message-----
> > > From: Peng Fan
> > > Sent: 2018年7月26日 19:47
> > > To: sjg at chromium.org; trini at konsulko.com
> > > Cc: yamada.masahiro at socionext.com; u-boot at lists.denx.de; Peng Fan
> > > <peng.fan@nxp.com>
> > > Subject: [PATCH V2] drivers: regulator: fixed: add
> > > u-boot,off-on-delay-us
> > >
> > > Add u-boot,off-on-delay-us for fixed regulator.
> > >
> > > Depends on board design, the gpio regulator sometimes connects with
> > > a big capacitance. When need to off, then on the regulator, if there
> > > is no enough delay, the voltage does not drop to 0, so introduce this property
> to handle such case.
> > >
> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> > > ---
> > >
> > > V2:
> > >  Moved device tree bindings to new directory.
> > >  Simon, I keep you reviewed by tag. Thanks.
> >
> > Sorry, this patchset should be V3 version.
> >
> > Tom, should I resend a v3 out? Or you could apply this one?
> 
> Barring further comments from people, you can just keep this version.
> FWIW, I think that if people register with patchwork they can manage the state
> of their own patches and that always helps keep me from failing to notice
> something / grab the wrong version :)  Thanks!

Thanks. I set the previous one to rejected.

Thanks,
Peng.

> 
> --
> Tom

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-26 17:05   ` Tom Rini
  2018-07-27  2:10     ` Peng Fan
@ 2018-08-06  3:04     ` Peng Fan
  1 sibling, 0 replies; 13+ messages in thread
From: Peng Fan @ 2018-08-06  3:04 UTC (permalink / raw)
  To: u-boot

Hi,

Would anyone pick up this patch?

Thanks,
Peng.

> -----Original Message-----
> From: Tom Rini [mailto:trini at konsulko.com]
> Sent: 2018年7月27日 1:06
> To: Peng Fan <peng.fan@nxp.com>
> Cc: sjg at chromium.org; yamada.masahiro at socionext.com;
> u-boot at lists.denx.de
> Subject: Re: [PATCH V2] drivers: regulator: fixed: add u-boot,off-on-delay-us
> 
> On Thu, Jul 26, 2018 at 01:59:20PM +0000, Peng Fan wrote:
> 
> > > -----Original Message-----
> > > From: Peng Fan
> > > Sent: 2018年7月26日 19:47
> > > To: sjg at chromium.org; trini at konsulko.com
> > > Cc: yamada.masahiro at socionext.com; u-boot at lists.denx.de; Peng Fan
> > > <peng.fan@nxp.com>
> > > Subject: [PATCH V2] drivers: regulator: fixed: add
> > > u-boot,off-on-delay-us
> > >
> > > Add u-boot,off-on-delay-us for fixed regulator.
> > >
> > > Depends on board design, the gpio regulator sometimes connects with
> > > a big capacitance. When need to off, then on the regulator, if there
> > > is no enough delay, the voltage does not drop to 0, so introduce this property
> to handle such case.
> > >
> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> > > ---
> > >
> > > V2:
> > >  Moved device tree bindings to new directory.
> > >  Simon, I keep you reviewed by tag. Thanks.
> >
> > Sorry, this patchset should be V3 version.
> >
> > Tom, should I resend a v3 out? Or you could apply this one?
> 
> Barring further comments from people, you can just keep this version.
> FWIW, I think that if people register with patchwork they can manage the state
> of their own patches and that always helps keep me from failing to notice
> something / grab the wrong version :)  Thanks!
> 
> --
> Tom

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

* [U-Boot] [U-Boot, V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-26 11:47 [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us Peng Fan
  2018-07-26 13:59 ` Peng Fan
@ 2018-08-20 17:40 ` Tom Rini
  1 sibling, 0 replies; 13+ messages in thread
From: Tom Rini @ 2018-08-20 17:40 UTC (permalink / raw)
  To: u-boot

On Thu, Jul 26, 2018 at 07:47:24PM +0800, Peng Fan wrote:

> Add u-boot,off-on-delay-us for fixed regulator.
> 
> Depends on board design, the gpio regulator sometimes
> connects with a big capacitance. When need to off, then
> on the regulator, if there is no enough delay,
> the voltage does not drop to 0, so introduce this
> property to handle such case.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180820/3c867d23/attachment.sig>

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-25 15:25     ` Tom Rini
@ 2018-07-26 12:40       ` Fabio Estevam
  0 siblings, 0 replies; 13+ messages in thread
From: Fabio Estevam @ 2018-07-26 12:40 UTC (permalink / raw)
  To: u-boot

Hi Tom,

On Wed, Jul 25, 2018 at 12:25 PM, Tom Rini <trini@konsulko.com> wrote:

> I just yesterday consolidated into just doc/device-tree-bindings/ as
> everything else was already in there.

Excellent, I saw that Breno's patch has been applied.

Thanks

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-25  3:02   ` Peng Fan
  2018-07-25  3:08     ` Fabio Estevam
@ 2018-07-25 15:25     ` Tom Rini
  2018-07-26 12:40       ` Fabio Estevam
  1 sibling, 1 reply; 13+ messages in thread
From: Tom Rini @ 2018-07-25 15:25 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 25, 2018 at 03:02:04AM +0000, Peng Fan wrote:
> Hi Fabio,
> 
> > -----Original Message-----
> > From: Fabio Estevam [mailto:festevam at gmail.com]
> > Sent: 2018年7月25日 10:59
> > To: Peng Fan <peng.fan@nxp.com>
> > Cc: Simon Glass <sjg@chromium.org>; U-Boot-Denx <u-boot@lists.denx.de>;
> > dl-linux-imx <linux-imx@nxp.com>; Breno Matheus Lima <breno.lima@nxp.com>
> > Subject: Re: [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot,
> > off-on-delay-us
> > 
> > Hi Peng,
> > 
> > On Tue, Jul 24, 2018 at 5:11 AM, Peng Fan <peng.fan@nxp.com> wrote:
> > 
> > >  .../devicetree/bindings/regulator/fixed-regulator.txt    | 16
> > ++++++++++++++++
> > >  drivers/power/regulator/fixed.c                          |  6
> > ++++++
> > >  2 files changed, 22 insertions(+)
> > >  create mode 100644
> > > Documentation/devicetree/bindings/regulator/fixed-regulator.txt
> > 
> > I thought that bindings should go into doc/device-tree-bindings/ in U-Boot
> > instead?
> 
> I was not aware of this place. I am not sure, because there is also a
> Documentation/devicetree/bindings/ directory.
> 
> Tom,
> 
> Where should the new uboot bindings be put into?

I just yesterday consolidated into just doc/device-tree-bindings/ as
everything else was already in there.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180725/e6272397/attachment.sig>

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-25  3:02   ` Peng Fan
@ 2018-07-25  3:08     ` Fabio Estevam
  2018-07-25 15:25     ` Tom Rini
  1 sibling, 0 replies; 13+ messages in thread
From: Fabio Estevam @ 2018-07-25  3:08 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On Wed, Jul 25, 2018 at 12:02 AM, Peng Fan <peng.fan@nxp.com> wrote:

> I was not aware of this place. I am not sure, because there is also a Documentation/devicetree/bindings/ directory.

Yes, currently we have only a few bindings inside
Documentation/devicetree/bindings/.

Most of the bindings are inside doc/device-tree-bindings/ in U-Boot.

Breno has recently submitted a patch to move bindings to the more
common used doc/device-tree-bindings/ directory:
https://lists.denx.de/pipermail/u-boot/2018-July/335626.html

> Tom,
>
> Where should the new uboot bindings be put into?

Yes, some guidance here would be helpful to avoid inconsistent
placement of the bindings.

Thanks

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-25  2:59 ` Fabio Estevam
@ 2018-07-25  3:02   ` Peng Fan
  2018-07-25  3:08     ` Fabio Estevam
  2018-07-25 15:25     ` Tom Rini
  0 siblings, 2 replies; 13+ messages in thread
From: Peng Fan @ 2018-07-25  3:02 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

> -----Original Message-----
> From: Fabio Estevam [mailto:festevam at gmail.com]
> Sent: 2018年7月25日 10:59
> To: Peng Fan <peng.fan@nxp.com>
> Cc: Simon Glass <sjg@chromium.org>; U-Boot-Denx <u-boot@lists.denx.de>;
> dl-linux-imx <linux-imx@nxp.com>; Breno Matheus Lima <breno.lima@nxp.com>
> Subject: Re: [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot,
> off-on-delay-us
> 
> Hi Peng,
> 
> On Tue, Jul 24, 2018 at 5:11 AM, Peng Fan <peng.fan@nxp.com> wrote:
> 
> >  .../devicetree/bindings/regulator/fixed-regulator.txt    | 16
> ++++++++++++++++
> >  drivers/power/regulator/fixed.c                          |  6
> ++++++
> >  2 files changed, 22 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/regulator/fixed-regulator.txt
> 
> I thought that bindings should go into doc/device-tree-bindings/ in U-Boot
> instead?

I was not aware of this place. I am not sure, because there is also a Documentation/devicetree/bindings/ directory.

Tom,

Where should the new uboot bindings be put into?

Thanks,
Peng.

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-24  8:11 [U-Boot] [PATCH " Peng Fan
  2018-07-25  2:45 ` Simon Glass
@ 2018-07-25  2:59 ` Fabio Estevam
  2018-07-25  3:02   ` Peng Fan
  1 sibling, 1 reply; 13+ messages in thread
From: Fabio Estevam @ 2018-07-25  2:59 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On Tue, Jul 24, 2018 at 5:11 AM, Peng Fan <peng.fan@nxp.com> wrote:

>  .../devicetree/bindings/regulator/fixed-regulator.txt    | 16 ++++++++++++++++
>  drivers/power/regulator/fixed.c                          |  6 ++++++
>  2 files changed, 22 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/fixed-regulator.txt

I thought that bindings should go into doc/device-tree-bindings/ in
U-Boot instead?

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
  2018-07-24  8:11 [U-Boot] [PATCH " Peng Fan
@ 2018-07-25  2:45 ` Simon Glass
  2018-07-25  2:59 ` Fabio Estevam
  1 sibling, 0 replies; 13+ messages in thread
From: Simon Glass @ 2018-07-25  2:45 UTC (permalink / raw)
  To: u-boot

On 24 July 2018 at 02:11, Peng Fan <peng.fan@nxp.com> wrote:
> Add u-boot,off-on-delay-us for fixed regulator.
>
> Depends on board design, the gpio regulator sometimes
> connects with a big capacitance. When need to off, then
> on the regulator, if there is no enough delay,
> the voltage does not drop to 0, so introduce this
> property to handle such case.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>
> Simon, I droped your reviewed-by tag in V2, because I changed
> "off-on-delay-us" to "u-boot,off-on-delay-us" and
> add devicetree bindings.
>
> Thanks,
> Peng.
>
>  .../devicetree/bindings/regulator/fixed-regulator.txt    | 16 ++++++++++++++++
>  drivers/power/regulator/fixed.c                          |  6 ++++++
>  2 files changed, 22 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/fixed-regulator.txt

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us
@ 2018-07-24  8:11 Peng Fan
  2018-07-25  2:45 ` Simon Glass
  2018-07-25  2:59 ` Fabio Estevam
  0 siblings, 2 replies; 13+ messages in thread
From: Peng Fan @ 2018-07-24  8:11 UTC (permalink / raw)
  To: u-boot

Add u-boot,off-on-delay-us for fixed regulator.

Depends on board design, the gpio regulator sometimes
connects with a big capacitance. When need to off, then
on the regulator, if there is no enough delay,
the voltage does not drop to 0, so introduce this
property to handle such case.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Simon Glass <sjg@chromium.org>
---

Simon, I droped your reviewed-by tag in V2, because I changed
"off-on-delay-us" to "u-boot,off-on-delay-us" and
add devicetree bindings.

Thanks,
Peng.

 .../devicetree/bindings/regulator/fixed-regulator.txt    | 16 ++++++++++++++++
 drivers/power/regulator/fixed.c                          |  6 ++++++
 2 files changed, 22 insertions(+)
 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 0000000000..2b241cf563
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt
@@ -0,0 +1,16 @@
+Fixed Voltage regulators
+
+Check Linux Kernel
+Documentation/devicetree/bindings/regulator/fixed-regulator.txt
+
+U-Boot Specific:
+Optional properties:
+- u-boot,off-on-delay-us: off delay time in microseconds
+
+Example:
+
+	abc: fixedregulator at 0 {
+		...
+		u-boot,off-on-delay-us = <80000>;
+		...
+	};
diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c
index 0be5b7bd51..c5fe0ba43d 100644
--- a/drivers/power/regulator/fixed.c
+++ b/drivers/power/regulator/fixed.c
@@ -16,6 +16,7 @@
 struct fixed_regulator_platdata {
 	struct gpio_desc gpio; /* GPIO for regulator enable control */
 	unsigned int startup_delay_us;
+	unsigned int off_on_delay_us;
 };
 
 static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
@@ -50,6 +51,8 @@ static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
 	/* Get optional ramp up delay */
 	dev_pdata->startup_delay_us = dev_read_u32_default(dev,
 							"startup-delay-us", 0);
+	dev_pdata->off_on_delay_us = dev_read_u32_default(dev,
+							  "u-boot,off-on-delay-us", 0);
 
 	return 0;
 }
@@ -123,6 +126,9 @@ static int fixed_regulator_set_enable(struct udevice *dev, bool enable)
 		udelay(dev_pdata->startup_delay_us);
 	debug("%s: done\n", __func__);
 
+	if (!enable && dev_pdata->off_on_delay_us)
+		udelay(dev_pdata->off_on_delay_us);
+
 	return 0;
 }
 
-- 
2.14.1

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

end of thread, other threads:[~2018-08-20 17:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26 11:47 [U-Boot] [PATCH V2] drivers: regulator: fixed: add u-boot, off-on-delay-us Peng Fan
2018-07-26 13:59 ` Peng Fan
2018-07-26 17:05   ` Tom Rini
2018-07-27  2:10     ` Peng Fan
2018-08-06  3:04     ` Peng Fan
2018-08-20 17:40 ` [U-Boot] [U-Boot, " Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2018-07-24  8:11 [U-Boot] [PATCH " Peng Fan
2018-07-25  2:45 ` Simon Glass
2018-07-25  2:59 ` Fabio Estevam
2018-07-25  3:02   ` Peng Fan
2018-07-25  3:08     ` Fabio Estevam
2018-07-25 15:25     ` Tom Rini
2018-07-26 12:40       ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.