diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-13 08:31:04 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-13 08:31:04 -0800 |
commit | 58f253d26254b7ec0faa0a67d70912facd6687e4 (patch) | |
tree | 1378ad33a5d4320a7be2b8bdfa9794b0a2646b21 /include | |
parent | 96955c9682051e70f06103f0d96e26d2f35f4910 (diff) | |
parent | d00b74613fb18dfd0a5aa99270ee2e72d5c808d7 (diff) |
Merge tag 'regulator-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown:
"A quiet release for the regulator API, conference season must've been
slowing everyone down:
- a new interface allowing drivers to provide an interface for
reading a more detailed description of error conditions which
allows devices using these regulators to build
- ACPI support for the fixed voltage regulator.
- cleanups for the TI TWL drivers to reduce code duplication"
* tag 'regulator-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (24 commits)
regulator: tps65086: Fix 25mV ranges for BUCK regulators 1, 2, and 6
regulator: Fix regulator_get_error_flags() signature mismatch
regulator: core: add newline in debug message
regulator: tps65086: Fix 25mV ranges for BUCK regulators
regulator: core: Correct type of mode in regulator_mode_constrain
regulator: max77620: add documentation for MPOK property
regulator: max77620: add support to configure MPOK
regulator: twl6030: Remove unused fields from struct twlreg_info
regulator: twl: Remove unused fields from struct twlreg_info
regulator: twl: split twl6030 logic into its own file
regulator: twl: kill unused functions
regulator: twl: make driver DT only
regulator: twl-regulator: rework fixed regulator definition
regulator: max77620: remove unused variable
regulator: pwm: Add missing quotes to DT example
regulator: stw481x-vmmc: fix ages old enable error
regulator: gpio: properly check return value of of_get_named_gpio
regulator: lp873x: Add support for populating input supply
regulator: axp20x: Fix axp809 ldo_io registration error on cold boot
regulators: helpers: Fix handling of bypass_val_on in get_bypass_regmap
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mfd/max77620.h | 2 | ||||
-rw-r--r-- | include/linux/regulator/consumer.h | 27 | ||||
-rw-r--r-- | include/linux/regulator/driver.h | 4 |
3 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/mfd/max77620.h b/include/linux/mfd/max77620.h index 3ca0af07fc78..ad2a9a852aea 100644 --- a/include/linux/mfd/max77620.h +++ b/include/linux/mfd/max77620.h @@ -180,6 +180,7 @@ #define MAX77620_SD_CFG1_FPWM_SD_MASK BIT(2) #define MAX77620_SD_CFG1_FPWM_SD_SKIP 0 #define MAX77620_SD_CFG1_FPWM_SD_FPWM BIT(2) +#define MAX20024_SD_CFG1_MPOK_MASK BIT(1) #define MAX77620_SD_CFG1_FSRADE_SD_MASK BIT(0) #define MAX77620_SD_CFG1_FSRADE_SD_DISABLE 0 #define MAX77620_SD_CFG1_FSRADE_SD_ENABLE BIT(0) @@ -187,6 +188,7 @@ /* LDO_CNFG2 */ #define MAX77620_LDO_POWER_MODE_MASK 0xC0 #define MAX77620_LDO_POWER_MODE_SHIFT 6 +#define MAX20024_LDO_CFG2_MPOK_MASK BIT(2) #define MAX77620_LDO_CFG2_ADE_MASK BIT(1) #define MAX77620_LDO_CFG2_ADE_DISABLE 0 #define MAX77620_LDO_CFG2_ADE_ENABLE BIT(1) diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 692108222271..ea0fffa5faeb 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -120,6 +120,25 @@ struct regmap; #define REGULATOR_EVENT_PRE_DISABLE 0x400 #define REGULATOR_EVENT_ABORT_DISABLE 0x800 +/* + * Regulator errors that can be queried using regulator_get_error_flags + * + * UNDER_VOLTAGE Regulator output is under voltage. + * OVER_CURRENT Regulator output current is too high. + * REGULATION_OUT Regulator output is out of regulation. + * FAIL Regulator output has failed. + * OVER_TEMP Regulator over temp. + * + * NOTE: These errors can be OR'ed together. + */ + +#define REGULATOR_ERROR_UNDER_VOLTAGE BIT(1) +#define REGULATOR_ERROR_OVER_CURRENT BIT(2) +#define REGULATOR_ERROR_REGULATION_OUT BIT(3) +#define REGULATOR_ERROR_FAIL BIT(4) +#define REGULATOR_ERROR_OVER_TEMP BIT(5) + + /** * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event * @@ -237,6 +256,8 @@ int regulator_get_current_limit(struct regulator *regulator); int regulator_set_mode(struct regulator *regulator, unsigned int mode); unsigned int regulator_get_mode(struct regulator *regulator); +int regulator_get_error_flags(struct regulator *regulator, + unsigned int *flags); int regulator_set_load(struct regulator *regulator, int load_uA); int regulator_allow_bypass(struct regulator *regulator, bool allow); @@ -477,6 +498,12 @@ static inline unsigned int regulator_get_mode(struct regulator *regulator) return REGULATOR_MODE_NORMAL; } +static inline int regulator_get_error_flags(struct regulator *regulator, + unsigned int *flags) +{ + return -EINVAL; +} + static inline int regulator_set_load(struct regulator *regulator, int load_uA) { return REGULATOR_MODE_NORMAL; diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 37b532410528..dac8e7b16bc6 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -100,6 +100,7 @@ struct regulator_linear_range { * * @set_mode: Set the configured operating mode for the regulator. * @get_mode: Get the configured operating mode for the regulator. + * @get_error_flags: Get the current error(s) for the regulator. * @get_status: Return actual (not as-configured) status of regulator, as a * REGULATOR_STATUS value (or negative errno) * @get_optimum_mode: Get the most efficient operating mode for the regulator @@ -169,6 +170,9 @@ struct regulator_ops { int (*set_mode) (struct regulator_dev *, unsigned int mode); unsigned int (*get_mode) (struct regulator_dev *); + /* retrieve current error flags on the regulator */ + int (*get_error_flags)(struct regulator_dev *, unsigned int *flags); + /* Time taken to enable or set voltage on the regulator */ int (*enable_time) (struct regulator_dev *); int (*set_ramp_delay) (struct regulator_dev *, int ramp_delay); |