History

Merge tag 'regulator-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown: "The bulk of the standout changes in this release are cleanups, with the core work being a combination of factoring out common code into helpers and the completion of the conversion of the core to use GPIO descriptors. Summary: - Addition of helper functions for current limits and conversion of drivers to use them by Axel Lin. - Lots and lots of cleanups from Axel Lin. - Conversion of the core to use GPIO descriptors rather than numbers by Linus Walleij. - New drivers for Maxim MAX77650 and ROHM BD70528" * tag 'regulator-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (131 commits) regulator: mc13xxx: Constify regulator_ops variables regulator: palmas: Constify palmas_smps_ramp_delay array regulator: wm831x-dcdc: Convert to use regulator_set/get_current_limit_regmap regulator: pv88090: Convert to use regulator_set/get_current_limit_regmap regulator: pv88080: Convert to use regulator_set/get_current_limit_regmap regulator: pv88060: Convert to use regulator_set/get_current_limit_regmap regulator: max77650: Convert to use regulator_set/get_current_limit_regmap regulator: lp873x: Convert to use regulator_set/get_current_limit_regmap regulator: lp872x: Convert to use regulator_set/get_current_limit_regmap regulator: da9210: Convert to use regulator_set/get_current_limit_regmap regulator: da9055: Convert to use regulator_set/get_current_limit_regmap regulator: core: Add set/get_current_limit helpers for regmap users regulator: Fix comment for csel_reg and csel_mask regulator: stm32-vrefbuf: add power management support regulator: 88pm8607: Remove unused fields from struct pm8607_regulator_info regulator: 88pm8607: Simplify pm8607_list_voltage implementation regulator: cpcap: Constify omap4_regulators and xoom_regulators regulator: cpcap: Remove unused vsel_shift from struct cpcap_regulator dt-bindings: regulator: tps65218: rectify units of LS3 dt-bindings: regulator: add LS2 load switch documentation ...

Linus Torvalds committed 7 years ago

Commit 32c0ac32 parents e48b044 88f268a94 files · +2489 −1521Browse files

Showing the changes to include/linux (4 of 94 files). Show all

Unified · Split

4 files
  1. include/linux/mfd/tps65218.h +2 −1
  2. include/linux/regulator/driver.h +17 −13
  3. include/linux/regulator/fixed.h +0 −10
  4. include/linux/regulator/gpio-regulator.h +7 −11
include/linux/mfd/tps65218.h+2−1
@@ -208,6 +208,7 @@ enum tps65218_regulator_id { · 207 unmodified lines
208 /* LDOs */208 /* LDOs */
209 TPS65218_LDO_1,209 TPS65218_LDO_1,
210 /* LS's */210 /* LS's */
211 TPS65218_LS_2,
211 TPS65218_LS_3,212 TPS65218_LS_3,
212};213};
213 214
@@ -218,7 +219,7 @@ enum tps65218_regulator_id { · 4 unmodified lines
218/* Number of LDO voltage regulators available */219/* Number of LDO voltage regulators available */
219#define TPS65218_NUM_LDO 1220#define TPS65218_NUM_LDO 1
220/* Number of total LS current regulators available */221/* Number of total LS current regulators available */
221#define TPS65218_NUM_LS 1222#define TPS65218_NUM_LS 2
222/* Number of total regulators available */223/* Number of total regulators available */
223#define TPS65218_NUM_REGULATOR (TPS65218_NUM_DCDC + TPS65218_NUM_LDO \224#define TPS65218_NUM_REGULATOR (TPS65218_NUM_DCDC + TPS65218_NUM_LDO \
224 + TPS65218_NUM_LS)225 + TPS65218_NUM_LS)
include/linux/regulator/driver.h+17−13
@@ -264,6 +264,7 @@ enum regulator_type { · 263 unmodified lines
264 * @continuous_voltage_range: Indicates if the regulator can set any264 * @continuous_voltage_range: Indicates if the regulator can set any
265 * voltage within constrains range.265 * voltage within constrains range.
266 * @n_voltages: Number of selectors available for ops.list_voltage().266 * @n_voltages: Number of selectors available for ops.list_voltage().
267 * @n_current_limits: Number of selectors available for current limits
267 *268 *
268 * @min_uV: Voltage given by the lowest selector (if linear mapping)269 * @min_uV: Voltage given by the lowest selector (if linear mapping)
269 * @uV_step: Voltage increase with each selector (if linear mapping)270 * @uV_step: Voltage increase with each selector (if linear mapping)
@@ -278,14 +279,15 @@ enum regulator_type { · 8 unmodified lines
278 * @n_linear_ranges: Number of entries in the @linear_ranges (and in279 * @n_linear_ranges: Number of entries in the @linear_ranges (and in
279 * linear_range_selectors if used) table(s).280 * linear_range_selectors if used) table(s).
280 * @volt_table: Voltage mapping table (if table based mapping)281 * @volt_table: Voltage mapping table (if table based mapping)
282 * @curr_table: Current limit mapping table (if table based mapping)
281 *283 *
282 * @vsel_range_reg: Register for range selector when using pickable ranges284 * @vsel_range_reg: Register for range selector when using pickable ranges
283 * and regulator_regmap_X_voltage_X_pickable functions.285 * and regulator_regmap_X_voltage_X_pickable functions.
284 * @vsel_range_mask: Mask for register bitfield used for range selector286 * @vsel_range_mask: Mask for register bitfield used for range selector
285 * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_287 * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_
286 * @vsel_mask: Mask for register bitfield used for selector288 * @vsel_mask: Mask for register bitfield used for selector
287 * @csel_reg: Register for TPS65218 LS3 current regulator289 * @csel_reg: Register for current limit selector using regmap set_current_limit
288 * @csel_mask: Mask for TPS65218 LS3 current regulator290 * @csel_mask: Mask for register bitfield used for current limit selector
289 * @apply_reg: Register for initiate voltage change on the output when291 * @apply_reg: Register for initiate voltage change on the output when
290 * using regulator_set_voltage_sel_regmap292 * using regulator_set_voltage_sel_regmap
291 * @apply_bit: Register bitfield used for initiate voltage change on the293 * @apply_bit: Register bitfield used for initiate voltage change on the
@@ -333,6 +335,7 @@ struct regulator_desc { · 41 unmodified lines
333 int id;335 int id;
334 unsigned int continuous_voltage_range:1;336 unsigned int continuous_voltage_range:1;
335 unsigned n_voltages;337 unsigned n_voltages;
338 unsigned int n_current_limits;
336 const struct regulator_ops *ops;339 const struct regulator_ops *ops;
337 int irq;340 int irq;
338 enum regulator_type type;341 enum regulator_type type;
@@ -351,6 +354,7 @@ struct regulator_desc { · 12 unmodified lines
351 int n_linear_ranges;354 int n_linear_ranges;
352 355
353 const unsigned int *volt_table;356 const unsigned int *volt_table;
357 const unsigned int *curr_table;
354 358
355 unsigned int vsel_range_reg;359 unsigned int vsel_range_reg;
356 unsigned int vsel_range_mask;360 unsigned int vsel_range_mask;
@@ -401,13 +405,7 @@ struct regulator_desc { · 44 unmodified lines
401 * NULL).405 * NULL).
402 * @regmap: regmap to use for core regmap helpers if dev_get_regmap() is406 * @regmap: regmap to use for core regmap helpers if dev_get_regmap() is
403 * insufficient.407 * insufficient.
404 * @ena_gpio_initialized: GPIO controlling regulator enable was properly408 * @ena_gpiod: GPIO controlling regulator enable.
405 * initialized, meaning that >= 0 is a valid gpio
406 * identifier and < 0 is a non existent gpio.
407 * @ena_gpio: GPIO controlling regulator enable.
408 * @ena_gpiod: GPIO descriptor controlling regulator enable.
409 * @ena_gpio_invert: Sense for GPIO enable control.
410 * @ena_gpio_flags: Flags to use when calling gpio_request_one()
411 */409 */
412struct regulator_config {410struct regulator_config {
413 struct device *dev;411 struct device *dev;
@@ -416,11 +414,7 @@ struct regulator_config { · 2 unmodified lines
416 struct device_node *of_node;414 struct device_node *of_node;
417 struct regmap *regmap;415 struct regmap *regmap;
418 416
419 bool ena_gpio_initialized;
420 int ena_gpio;
421 struct gpio_desc *ena_gpiod;417 struct gpio_desc *ena_gpiod;
422 unsigned int ena_gpio_invert:1;
423 unsigned int ena_gpio_flags;
424};418};
425 419
426/*420/*
@@ -503,6 +497,7 @@ int regulator_notifier_call_chain(struct regulator_dev *rdev, · 76 unmodified lines
503 497
504void *rdev_get_drvdata(struct regulator_dev *rdev);498void *rdev_get_drvdata(struct regulator_dev *rdev);
505struct device *rdev_get_dev(struct regulator_dev *rdev);499struct device *rdev_get_dev(struct regulator_dev *rdev);
500struct regmap *rdev_get_regmap(struct regulator_dev *rdev);
506int rdev_get_id(struct regulator_dev *rdev);501int rdev_get_id(struct regulator_dev *rdev);
507 502
508int regulator_mode_to_status(unsigned int);503int regulator_mode_to_status(unsigned int);
@@ -543,9 +538,18 @@ int regulator_set_pull_down_regmap(struct regulator_dev *rdev); · 34 unmodified lines
543 538
544int regulator_set_active_discharge_regmap(struct regulator_dev *rdev,539int regulator_set_active_discharge_regmap(struct regulator_dev *rdev,
545 bool enable);540 bool enable);
541int regulator_set_current_limit_regmap(struct regulator_dev *rdev,
542 int min_uA, int max_uA);
543int regulator_get_current_limit_regmap(struct regulator_dev *rdev);
546void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);544void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);
547 545
548void regulator_lock(struct regulator_dev *rdev);546void regulator_lock(struct regulator_dev *rdev);
549void regulator_unlock(struct regulator_dev *rdev);547void regulator_unlock(struct regulator_dev *rdev);
550 548
549/*
550 * Helper functions intended to be used by regulator drivers prior registering
551 * their regulators.
552 */
553int regulator_desc_list_voltage_linear_range(const struct regulator_desc *desc,
554 unsigned int selector);
551#endif555#endif
include/linux/regulator/fixed.h+0−10
@@ -25,14 +25,6 @@ struct regulator_init_data; · 24 unmodified lines
25 * @input_supply: Name of the input regulator supply25 * @input_supply: Name of the input regulator supply
26 * @microvolts: Output voltage of regulator26 * @microvolts: Output voltage of regulator
27 * @startup_delay: Start-up time in microseconds27 * @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
36 * @enabled_at_boot: Whether regulator has been enabled at28 * @enabled_at_boot: Whether regulator has been enabled at
37 * boot or not. 1 = Yes, 0 = No29 * boot or not. 1 = Yes, 0 = No
38 * This is used to keep the regulator at30 * This is used to keep the regulator at
@@ -48,8 +40,6 @@ struct fixed_voltage_config { · 9 unmodified lines
48 const char *input_supply;40 const char *input_supply;
49 int microvolts;41 int microvolts;
50 unsigned startup_delay;42 unsigned startup_delay;
51 unsigned gpio_is_open_drain:1;
52 unsigned enable_high:1;
53 unsigned enabled_at_boot:1;43 unsigned enabled_at_boot:1;
54 struct regulator_init_data *init_data;44 struct regulator_init_data *init_data;
55};45};
include/linux/regulator/gpio-regulator.h+7−11
@@ -21,6 +21,8 @@ · 20 unmodified lines
21#ifndef __REGULATOR_GPIO_H21#ifndef __REGULATOR_GPIO_H
22#define __REGULATOR_GPIO_H22#define __REGULATOR_GPIO_H
23 23
24#include <linux/gpio/consumer.h>
25
24struct regulator_init_data;26struct regulator_init_data;
25 27
26enum regulator_type;28enum regulator_type;
@@ -44,18 +46,14 @@ struct gpio_regulator_state { · 17 unmodified lines
44/**46/**
45 * struct gpio_regulator_config - config structure47 * struct gpio_regulator_config - config structure
46 * @supply_name: Name of the regulator supply48 * @supply_name: Name of the regulator supply
47 * @enable_gpio: GPIO to use for enable control
48 * set to -EINVAL if not used
49 * @enable_high: Polarity of enable GPIO
50 * 1 = Active high, 0 = Active low
51 * @enabled_at_boot: Whether regulator has been enabled at49 * @enabled_at_boot: Whether regulator has been enabled at
52 * boot or not. 1 = Yes, 0 = No50 * boot or not. 1 = Yes, 0 = No
53 * This is used to keep the regulator at51 * This is used to keep the regulator at
54 * the default state52 * the default state
55 * @startup_delay: Start-up time in microseconds53 * @startup_delay: Start-up time in microseconds
56 * @gpios: Array containing the gpios needed to control54 * @gflags: Array of GPIO configuration flags for initial
57 * the setting of the regulator55 * states
58 * @nr_gpios: Number of gpios56 * @ngpios: Number of GPIOs and configurations available
59 * @states: Array of gpio_regulator_state entries describing57 * @states: Array of gpio_regulator_state entries describing
60 * the gpio state for specific voltages58 * the gpio state for specific voltages
61 * @nr_states: Number of states available59 * @nr_states: Number of states available
@@ -69,13 +67,11 @@ struct gpio_regulator_state { · 7 unmodified lines
69struct gpio_regulator_config {67struct gpio_regulator_config {
70 const char *supply_name;68 const char *supply_name;
71 69
72 int enable_gpio;
73 unsigned enable_high:1;
74 unsigned enabled_at_boot:1;70 unsigned enabled_at_boot:1;
75 unsigned startup_delay;71 unsigned startup_delay;
76 72
77 struct gpio *gpios;73 enum gpiod_flags *gflags;
78 int nr_gpios;74 int ngpios;
79 75
80 struct gpio_regulator_state *states;76 struct gpio_regulator_state *states;
81 int nr_states;77 int nr_states;

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