Skip to content

Commit 01dc79c

Browse files
Linus Walleijbroonie
authored andcommitted
regulator: fixed/gpio: Pull inversion/OD into gpiolib
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: Alexander Shiyan <shc_work@mail.ru> # i.MX boards user Cc: Haojian Zhuang <haojian.zhuang@gmail.com> # MMP2 maintainer Cc: Aaro Koskinen <aaro.koskinen@iki.fi> # OMAP1 maintainer Cc: Tony Lindgren <tony@atomide.com> # OMAP1,2,3 maintainer Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> # EM-X270 maintainer Cc: Robert Jarzmik <robert.jarzmik@free.fr> # EZX maintainer Cc: Philipp Zabel <philipp.zabel@gmail.com> # Magician maintainer Cc: Petr Cvek <petr.cvek@tul.cz> # Magician Cc: Robert Jarzmik <robert.jarzmik@free.fr> # PXA Cc: Paul Parsons <lost.distance@yahoo.com> # hx4700 Cc: Daniel Mack <zonque@gmail.com> # Raumfeld maintainer Cc: Marc Zyngier <marc.zyngier@arm.com> # Zeus maintainer Cc: Geert Uytterhoeven <geert+renesas@glider.be> # SuperH pinctrl/GPIO maintainer Cc: Russell King <rmk+kernel@armlinux.org.uk> # SA1100 Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> #OMAP1 Amstrad Delta Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent d6cd33a commit 01dc79c

17 files changed

Lines changed: 13 additions & 66 deletions

File tree

‎arch/arm/mach-imx/mach-mx21ads.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ static struct regulator_init_data mx21ads_lcd_regulator_init_data = {
205205
static struct fixed_voltage_config mx21ads_lcd_regulator_pdata = {
206206
.supply_name = "LCD",
207207
.microvolts = 3300000,
208-
.enable_high = 1,
209208
.init_data = &mx21ads_lcd_regulator_init_data,
210209
};
211210

‎arch/arm/mach-imx/mach-mx27ads.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static struct fixed_voltage_config mx27ads_lcd_regulator_pdata = {
237237
static struct gpiod_lookup_table mx27ads_lcd_regulator_gpiod_table = {
238238
.dev_id = "reg-fixed-voltage.0", /* Let's hope ID 0 is what we get */
239239
.table = {
240-
GPIO_LOOKUP("LCD", 0, NULL, GPIO_ACTIVE_HIGH),
240+
GPIO_LOOKUP("LCD", 0, NULL, GPIO_ACTIVE_LOW),
241241
{ },
242242
},
243243
};

‎arch/arm/mach-mmp/brownstone.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ static struct regulator_init_data brownstone_v_5vp_data = {
149149
static struct fixed_voltage_config brownstone_v_5vp = {
150150
.supply_name = "v_5vp",
151151
.microvolts = 5000000,
152-
.enable_high = 1,
153152
.enabled_at_boot = 1,
154153
.init_data = &brownstone_v_5vp_data,
155154
};

‎arch/arm/mach-omap1/board-ams-delta.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ static struct fixed_voltage_config modem_nreset_config = {
267267
.supply_name = "modem_nreset",
268268
.microvolts = 3300000,
269269
.startup_delay = 25000,
270-
.enable_high = 1,
271270
.enabled_at_boot = 1,
272271
.init_data = &modem_nreset_data,
273272
};
@@ -533,7 +532,6 @@ static struct regulator_init_data keybrd_pwr_initdata = {
533532
static struct fixed_voltage_config keybrd_pwr_config = {
534533
.supply_name = "keybrd_pwr",
535534
.microvolts = 5000000,
536-
.enable_high = 1,
537535
.init_data = &keybrd_pwr_initdata,
538536
};
539537

‎arch/arm/mach-omap2/pdata-quirks.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ static struct fixed_voltage_config pandora_vwlan = {
330330
.supply_name = "vwlan",
331331
.microvolts = 1800000, /* 1.8V */
332332
.startup_delay = 50000, /* 50ms */
333-
.enable_high = 1,
334333
.init_data = &pandora_vmmc3,
335334
};
336335

‎arch/arm/mach-pxa/em-x270.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,6 @@ static struct fixed_voltage_config camera_dummy_config = {
976976
.supply_name = "camera_vdd",
977977
.input_supply = "vcc cam",
978978
.microvolts = 2800000,
979-
.enable_high = 0,
980979
.init_data = &camera_dummy_initdata,
981980
};
982981

‎arch/arm/mach-pxa/ezx.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,6 @@ static struct regulator_init_data camera_regulator_initdata = {
714714
static struct fixed_voltage_config camera_regulator_config = {
715715
.supply_name = "camera_vdd",
716716
.microvolts = 2800000,
717-
.enable_high = 0,
718717
.init_data = &camera_regulator_initdata,
719718
};
720719

@@ -730,7 +729,7 @@ static struct gpiod_lookup_table camera_supply_gpiod_table = {
730729
.dev_id = "reg-fixed-voltage.1",
731730
.table = {
732731
GPIO_LOOKUP("gpio-pxa", GPIO50_nCAM_EN,
733-
NULL, GPIO_ACTIVE_HIGH),
732+
NULL, GPIO_ACTIVE_LOW),
734733
{ },
735734
},
736735
};

‎arch/arm/mach-pxa/raumfeld.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,6 @@ static struct regulator_init_data audio_va_initdata = {
883883
static struct fixed_voltage_config audio_va_config = {
884884
.supply_name = "audio_va",
885885
.microvolts = 5000000,
886-
.enable_high = 1,
887886
.enabled_at_boot = 0,
888887
.init_data = &audio_va_initdata,
889888
};

‎arch/arm/mach-pxa/zeus.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static struct gpiod_lookup_table can_regulator_gpiod_table = {
426426
.dev_id = "reg-fixed-voltage.0",
427427
.table = {
428428
GPIO_LOOKUP("gpio-pxa", ZEUS_CAN_SHDN_GPIO,
429-
NULL, GPIO_ACTIVE_HIGH),
429+
NULL, GPIO_ACTIVE_LOW),
430430
{ },
431431
},
432432
};
@@ -547,7 +547,6 @@ static struct regulator_init_data zeus_ohci_regulator_data = {
547547
static struct fixed_voltage_config zeus_ohci_regulator_config = {
548548
.supply_name = "vbus2",
549549
.microvolts = 5000000, /* 5.0V */
550-
.enable_high = 1,
551550
.startup_delay = 0,
552551
.init_data = &zeus_ohci_regulator_data,
553552
};

‎arch/arm/mach-sa1100/assabet.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ static struct regulator_consumer_supply assabet_cf_vcc_consumers[] = {
469469
static struct fixed_voltage_config assabet_cf_vcc_pdata __initdata = {
470470
.supply_name = "cf-power",
471471
.microvolts = 3300000,
472-
.enable_high = 1,
473472
};
474473

475474
static struct gpiod_lookup_table assabet_cf_vcc_gpio_table = {

0 commit comments

Comments
 (0)