History

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.

Linus Walleij committed 7 years ago

Commit 01dc79c1 parent d6cd33a17 files · +13 −66Browse files

Showing the changes to include/linux (2 of 17 files). Show all

Unified · Split

2 files
  1. include/linux/regulator/fixed.h +0 −10
  2. include/linux/regulator/gpio-regulator.h +0 −6
include/linux/regulator/fixed.h+0−10
@@ -25,14 +25,6 @@ struct regulator_init_data; · 24 unmodified lines
2525 * @input_supply: Name of the input regulator supply
2626 * @microvolts: Output voltage of regulator
2727 * @startup_delay: Start-up time in microseconds
28− * @gpio_is_open_drain: Gpio pin is open drain or normal type.
29− * If it is open drain type then HIGH will be set
30− * through PULL-UP with setting gpio as input
31− * and low will be set as gpio-output with driven
32− * to low. For non-open-drain case, the gpio will
33− * will be in output and drive to low/high accordingly.
34− * @enable_high: Polarity of enable GPIO
35− * 1 = Active high, 0 = Active low
3628 * @enabled_at_boot: Whether regulator has been enabled at
3729 * boot or not. 1 = Yes, 0 = No
3830 * This is used to keep the regulator at
@@ -48,8 +40,6 @@ struct fixed_voltage_config { · 9 unmodified lines
4840 const char *input_supply;
4941 int microvolts;
5042 unsigned startup_delay;
51− unsigned gpio_is_open_drain:1;
52− unsigned enable_high:1;
5343 unsigned enabled_at_boot:1;
5444 struct regulator_init_data *init_data;
5545 };
include/linux/regulator/gpio-regulator.h+0−6
@@ -46,10 +46,6 @@ struct gpio_regulator_state { · 45 unmodified lines
4646 /**
4747 * struct gpio_regulator_config - config structure
4848 * @supply_name: Name of the regulator supply
49− * @enable_gpio: GPIO to use for enable control
50− * set to -EINVAL if not used
51− * @enable_high: Polarity of enable GPIO
52− * 1 = Active high, 0 = Active low
5349 * @enabled_at_boot: Whether regulator has been enabled at
5450 * boot or not. 1 = Yes, 0 = No
5551 * This is used to keep the regulator at
@@ -71,8 +67,6 @@ struct gpio_regulator_state { · 15 unmodified lines
7167 struct gpio_regulator_config {
7268 const char *supply_name;
7369
74− int enable_gpio;
75− unsigned enable_high:1;
7670 unsigned enabled_at_boot:1;
7771 unsigned startup_delay;
7872

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t