Re: [PATCH 2/5 v7] regulator: fixed/gpio: Pull inversion/OD into gpiolib

2018-11-29 Thread Janusz Krzysztofik
Hi Linus,

On Monday, November 19, 2018 8:11:23 AM CET Linus Walleij wrote:
> This pushes the handling of inversion semantics and open drain
> settings to the GPIO descriptor and gpiolib. All affected board
> files are also augmented.
> 
> This is especially nice since we don't have to have any
> confusing flags passed around to the left and right littering
> the fixed and GPIO regulator drivers and the regulator core.
> It is all just very straight-forward: the core asks the GPIO
> line to be asserted or deasserted and gpiolib deals with the
> rest depending on how the platform is configured: if the line
> is active low, it deals with that, if the line is open drain,
> it deals with that too.
> 
> Cc: Janusz Krzysztofik  # OMAP1

Tested-by: Janusz Krzysztofik  #OMAP1 Amstrad Delta

Thanks,
Janusz




[PATCH 2/5 v7] regulator: fixed/gpio: Pull inversion/OD into gpiolib

2018-11-18 Thread Linus Walleij
This pushes the handling of inversion semantics and open drain
settings to the GPIO descriptor and gpiolib. All affected board
files are also augmented.

This is especially nice since we don't have to have any
confusing flags passed around to the left and right littering
the fixed and GPIO regulator drivers and the regulator core.
It is all just very straight-forward: the core asks the GPIO
line to be asserted or deasserted and gpiolib deals with the
rest depending on how the platform is configured: if the line
is active low, it deals with that, if the line is open drain,
it deals with that too.

Cc: Janusz Krzysztofik  # OMAP1
Cc: Alexander Shiyan  # i.MX boards user
Cc: Haojian Zhuang  # MMP2 maintainer
Cc: Aaro Koskinen  # OMAP1 maintainer
Cc: Tony Lindgren  # OMAP1,2,3 maintainer
Cc: Mike Rapoport  # EM-X270 maintainer
Cc: Robert Jarzmik  # EZX maintainer
Cc: Philipp Zabel  # Magician maintainer
Cc: Petr Cvek  # Magician
Cc: Robert Jarzmik  # PXA
Cc: Paul Parsons  # hx4700
Cc: Daniel Mack  # Raumfeld maintainer
Cc: Marc Zyngier  # Zeus maintainer
Cc: Geert Uytterhoeven  # SuperH pinctrl/GPIO 
maintainer
Cc: Russell King  # SA1100
Signed-off-by: Linus Walleij 
---
ChangeLog v6->v7:
- Fix a missed .enable_high on OMAP1.
ChangeLog v4->v6:
- Split out parts relation to GPIO regulator descriptor conversion
  to the right patch.
- Renumber to fit the rest of the series.
- Daniel Mack says he will probably delete the Raumfeld board file
  and replace it with a device tree, I suggest we just deal with that
  conflict upstream.
ChangeLog v3->v4:
- Rebase on fixed regulator changes.
ChangeLog v2->v3:
- Resending.
ChangeLog v1->v2:
- Rebase the patch series
- Cover the new user added in sa1100
---
 arch/arm/mach-imx/mach-mx21ads.c  |  1 -
 arch/arm/mach-imx/mach-mx27ads.c  |  2 +-
 arch/arm/mach-mmp/brownstone.c|  1 -
 arch/arm/mach-omap1/board-ams-delta.c |  2 --
 arch/arm/mach-omap2/pdata-quirks.c|  1 -
 arch/arm/mach-pxa/em-x270.c   |  1 -
 arch/arm/mach-pxa/ezx.c   |  3 +-
 arch/arm/mach-pxa/raumfeld.c  |  1 -
 arch/arm/mach-pxa/zeus.c  |  3 +-
 arch/arm/mach-sa1100/assabet.c|  1 -
 arch/sh/boards/mach-ecovec24/setup.c  |  2 --
 .../intel-mid/device_libs/platform_bcm43xx.c  |  1 -
 drivers/regulator/core.c  |  8 ++---
 drivers/regulator/da9055-regulator.c  |  1 -
 drivers/regulator/fixed.c | 35 +--
 include/linux/regulator/fixed.h   | 10 --
 include/linux/regulator/gpio-regulator.h  |  6 
 17 files changed, 13 insertions(+), 66 deletions(-)

diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index 2e1e540f2e5a..d278fb672d40 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -205,7 +205,6 @@ static struct regulator_init_data 
mx21ads_lcd_regulator_init_data = {
 static struct fixed_voltage_config mx21ads_lcd_regulator_pdata = {
.supply_name= "LCD",
.microvolts = 330,
-   .enable_high= 1,
.init_data  = &mx21ads_lcd_regulator_init_data,
 };
 
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index f5e04047ed13..6dd7f57c332f 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -237,7 +237,7 @@ static struct fixed_voltage_config 
mx27ads_lcd_regulator_pdata = {
 static struct gpiod_lookup_table mx27ads_lcd_regulator_gpiod_table = {
.dev_id = "reg-fixed-voltage.0", /* Let's hope ID 0 is what we get */
.table = {
-   GPIO_LOOKUP("LCD", 0, NULL, GPIO_ACTIVE_HIGH),
+   GPIO_LOOKUP("LCD", 0, NULL, GPIO_ACTIVE_LOW),
{ },
},
 };
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c
index a04e249c654b..d2560fb1e835 100644
--- a/arch/arm/mach-mmp/brownstone.c
+++ b/arch/arm/mach-mmp/brownstone.c
@@ -149,7 +149,6 @@ static struct regulator_init_data brownstone_v_5vp_data = {
 static struct fixed_voltage_config brownstone_v_5vp = {
.supply_name= "v_5vp",
.microvolts = 500,
-   .enable_high= 1,
.enabled_at_boot= 1,
.init_data  = &brownstone_v_5vp_data,
 };
diff --git a/arch/arm/mach-omap1/board-ams-delta.c 
b/arch/arm/mach-omap1/board-ams-delta.c
index 3d191fd52910..26e9b5969b0a 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -268,7 +268,6 @@ static struct fixed_voltage_config modem_nreset_config = {
.supply_name= "modem_nreset",
.microvolts = 330,
.startup_delay  = 25000,
-   .enable_high= 1,
.enabled_at_boot= 1,
.init_data  = &modem_nreset_data,
 };
@@ -529,7 +528,6 @@