Re: [U-Boot] [PATCH v2] regulator: fixed: Modify enable-active-high behavior

2019-10-12 Thread Tom Rini
On Mon, Aug 26, 2019 at 01:50:31PM +0200, Patrice Chotard wrote:

> Regulator should not be enabled at probe time if regulator-boot-on
> property is not in the dt node.
> 
> "enable-active-high" property is only used to indicate the GPIO
> polarity.
> 
> See kernel documentation :
>  - Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
>  - Documentation/devicetree/bindings/regulator/gpio-regulator.yaml
> 
> Signed-off-by: Christophe Kerello 
> Signed-off-by: Patrice Chotard 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] regulator: fixed: Modify enable-active-high behavior

2019-09-10 Thread Patrice CHOTARD
Hi,

It's a gentle reminder to not forgot this patch.

Thanks

Patrice

On 8/26/19 1:50 PM, Patrice Chotard wrote:
> Regulator should not be enabled at probe time if regulator-boot-on
> property is not in the dt node.
>
> "enable-active-high" property is only used to indicate the GPIO
> polarity.
>
> See kernel documentation :
>  - Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
>  - Documentation/devicetree/bindings/regulator/gpio-regulator.yaml
>
> Signed-off-by: Christophe Kerello 
> Signed-off-by: Patrice Chotard 
> ---
>
> Changes in v2:
>   - fix build issue
>
>  drivers/power/regulator/regulator_common.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/power/regulator/regulator_common.c 
> b/drivers/power/regulator/regulator_common.c
> index 3dabbe2a85..2041086567 100644
> --- a/drivers/power/regulator/regulator_common.c
> +++ b/drivers/power/regulator/regulator_common.c
> @@ -12,10 +12,15 @@ int regulator_common_ofdata_to_platdata(struct udevice 
> *dev,
>   struct regulator_common_platdata *dev_pdata, const char 
> *enable_gpio_name)
>  {
>   struct gpio_desc *gpio;
> + struct dm_regulator_uclass_platdata *uc_pdata;
>   int flags = GPIOD_IS_OUT;
>   int ret;
>  
> - if (dev_read_bool(dev, "enable-active-high"))
> + uc_pdata = dev_get_uclass_platdata(dev);
> +
> + if (!dev_read_bool(dev, "enable-active-high"))
> + flags |= GPIOD_ACTIVE_LOW;
> + if (uc_pdata->boot_on)
>   flags |= GPIOD_IS_OUT_ACTIVE;
>  
>   /* Get optional enable GPIO desc */
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2] regulator: fixed: Modify enable-active-high behavior

2019-08-26 Thread Patrice Chotard
Regulator should not be enabled at probe time if regulator-boot-on
property is not in the dt node.

"enable-active-high" property is only used to indicate the GPIO
polarity.

See kernel documentation :
 - Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
 - Documentation/devicetree/bindings/regulator/gpio-regulator.yaml

Signed-off-by: Christophe Kerello 
Signed-off-by: Patrice Chotard 
---

Changes in v2:
  - fix build issue

 drivers/power/regulator/regulator_common.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/power/regulator/regulator_common.c 
b/drivers/power/regulator/regulator_common.c
index 3dabbe2a85..2041086567 100644
--- a/drivers/power/regulator/regulator_common.c
+++ b/drivers/power/regulator/regulator_common.c
@@ -12,10 +12,15 @@ int regulator_common_ofdata_to_platdata(struct udevice *dev,
struct regulator_common_platdata *dev_pdata, const char 
*enable_gpio_name)
 {
struct gpio_desc *gpio;
+   struct dm_regulator_uclass_platdata *uc_pdata;
int flags = GPIOD_IS_OUT;
int ret;
 
-   if (dev_read_bool(dev, "enable-active-high"))
+   uc_pdata = dev_get_uclass_platdata(dev);
+
+   if (!dev_read_bool(dev, "enable-active-high"))
+   flags |= GPIOD_ACTIVE_LOW;
+   if (uc_pdata->boot_on)
flags |= GPIOD_IS_OUT_ACTIVE;
 
/* Get optional enable GPIO desc */
-- 
2.17.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot