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
208208 /* LDOs */
209209 TPS65218_LDO_1,
210210 /* LS's */
211+ TPS65218_LS_2,
211212 TPS65218_LS_3,
212213 };
213214
@@ -218,7 +219,7 @@ enum tps65218_regulator_id { · 4 unmodified lines
218219 /* Number of LDO voltage regulators available */
219220 #define TPS65218_NUM_LDO 1
220221 /* Number of total LS current regulators available */
221−#define TPS65218_NUM_LS 1
222+#define TPS65218_NUM_LS 2
222223 /* Number of total regulators available */
223224 #define TPS65218_NUM_REGULATOR (TPS65218_NUM_DCDC + TPS65218_NUM_LDO \
224225 + TPS65218_NUM_LS)
include/linux/regulator/driver.h+17−13
@@ -264,6 +264,7 @@ enum regulator_type { · 263 unmodified lines
264264 * @continuous_voltage_range: Indicates if the regulator can set any
265265 * voltage within constrains range.
266266 * @n_voltages: Number of selectors available for ops.list_voltage().
267+ * @n_current_limits: Number of selectors available for current limits
267268 *
268269 * @min_uV: Voltage given by the lowest selector (if linear mapping)
269270 * @uV_step: Voltage increase with each selector (if linear mapping)
@@ -278,14 +279,15 @@ enum regulator_type { · 8 unmodified lines
278279 * @n_linear_ranges: Number of entries in the @linear_ranges (and in
279280 * linear_range_selectors if used) table(s).
280281 * @volt_table: Voltage mapping table (if table based mapping)
282+ * @curr_table: Current limit mapping table (if table based mapping)
281283 *
282284 * @vsel_range_reg: Register for range selector when using pickable ranges
283285 * and regulator_regmap_X_voltage_X_pickable functions.
284286 * @vsel_range_mask: Mask for register bitfield used for range selector
285287 * @vsel_reg: Register for selector when using regulator_regmap_X_voltage_
286288 * @vsel_mask: Mask for register bitfield used for selector
287− * @csel_reg: Register for TPS65218 LS3 current regulator
288− * @csel_mask: Mask for TPS65218 LS3 current regulator
289+ * @csel_reg: Register for current limit selector using regmap set_current_limit
290+ * @csel_mask: Mask for register bitfield used for current limit selector
289291 * @apply_reg: Register for initiate voltage change on the output when
290292 * using regulator_set_voltage_sel_regmap
291293 * @apply_bit: Register bitfield used for initiate voltage change on the
@@ -333,6 +335,7 @@ struct regulator_desc { · 41 unmodified lines
333335 int id;
334336 unsigned int continuous_voltage_range:1;
335337 unsigned n_voltages;
338+ unsigned int n_current_limits;
336339 const struct regulator_ops *ops;
337340 int irq;
338341 enum regulator_type type;
@@ -351,6 +354,7 @@ struct regulator_desc { · 12 unmodified lines
351354 int n_linear_ranges;
352355
353356 const unsigned int *volt_table;
357+ const unsigned int *curr_table;
354358
355359 unsigned int vsel_range_reg;
356360 unsigned int vsel_range_mask;
@@ -401,13 +405,7 @@ struct regulator_desc { · 44 unmodified lines
401405 * NULL).
402406 * @regmap: regmap to use for core regmap helpers if dev_get_regmap() is
403407 * insufficient.
404− * @ena_gpio_initialized: GPIO controlling regulator enable was properly
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()
408+ * @ena_gpiod: GPIO controlling regulator enable.
411409 */
412410 struct regulator_config {
413411 struct device *dev;
@@ -416,11 +414,7 @@ struct regulator_config { · 2 unmodified lines
416414 struct device_node *of_node;
417415 struct regmap *regmap;
418416
419− bool ena_gpio_initialized;
420− int ena_gpio;
421417 struct gpio_desc *ena_gpiod;
422− unsigned int ena_gpio_invert:1;
423− unsigned int ena_gpio_flags;
424418 };
425419
426420 /*
@@ -503,6 +497,7 @@ int regulator_notifier_call_chain(struct regulator_dev *rdev, · 76 unmodified lines
503497
504498 void *rdev_get_drvdata(struct regulator_dev *rdev);
505499 struct device *rdev_get_dev(struct regulator_dev *rdev);
500+struct regmap *rdev_get_regmap(struct regulator_dev *rdev);
506501 int rdev_get_id(struct regulator_dev *rdev);
507502
508503 int regulator_mode_to_status(unsigned int);
@@ -543,9 +538,18 @@ int regulator_set_pull_down_regmap(struct regulator_dev *rdev); · 34 unmodified lines
543538
544539 int regulator_set_active_discharge_regmap(struct regulator_dev *rdev,
545540 bool enable);
541+int regulator_set_current_limit_regmap(struct regulator_dev *rdev,
542+ int min_uA, int max_uA);
543+int regulator_get_current_limit_regmap(struct regulator_dev *rdev);
546544 void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);
547545
548546 void regulator_lock(struct regulator_dev *rdev);
549547 void regulator_unlock(struct regulator_dev *rdev);
550548
549+/*
550+ * Helper functions intended to be used by regulator drivers prior registering
551+ * their regulators.
552+ */
553+int regulator_desc_list_voltage_linear_range(const struct regulator_desc *desc,
554+ unsigned int selector);
551555 #endif
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+7−11
@@ -21,6 +21,8 @@ · 20 unmodified lines
2121 #ifndef __REGULATOR_GPIO_H
2222 #define __REGULATOR_GPIO_H
2323
24+#include <linux/gpio/consumer.h>
25+
2426 struct regulator_init_data;
2527
2628 enum regulator_type;
@@ -44,18 +46,14 @@ struct gpio_regulator_state { · 17 unmodified lines
4446 /**
4547 * struct gpio_regulator_config - config structure
4648 * @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
5149 * @enabled_at_boot: Whether regulator has been enabled at
5250 * boot or not. 1 = Yes, 0 = No
5351 * This is used to keep the regulator at
5452 * the default state
5553 * @startup_delay: Start-up time in microseconds
56− * @gpios: Array containing the gpios needed to control
57− * the setting of the regulator
58− * @nr_gpios: Number of gpios
54+ * @gflags: Array of GPIO configuration flags for initial
55+ * states
56+ * @ngpios: Number of GPIOs and configurations available
5957 * @states: Array of gpio_regulator_state entries describing
6058 * the gpio state for specific voltages
6159 * @nr_states: Number of states available
@@ -69,13 +67,11 @@ struct gpio_regulator_state { · 7 unmodified lines
6967 struct gpio_regulator_config {
7068 const char *supply_name;
7169
72− int enable_gpio;
73− unsigned enable_high:1;
7470 unsigned enabled_at_boot:1;
7571 unsigned startup_delay;
7672
77− struct gpio *gpios;
78− int nr_gpios;
73+ enum gpiod_flags *gflags;
74+ int ngpios;
7975
8076 struct gpio_regulator_state *states;
8177 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