aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-13 11:31:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-13 11:31:04 -0500
commit58f253d26254b7ec0faa0a67d70912facd6687e4 (patch)
tree1378ad33a5d4320a7be2b8bdfa9794b0a2646b21 /include/linux
parent96955c9682051e70f06103f0d96e26d2f35f4910 (diff)
parentd00b74613fb18dfd0a5aa99270ee2e72d5c808d7 (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/linux')
-rw-r--r--include/linux/mfd/max77620.h2
-rw-r--r--include/linux/regulator/consumer.h27
-rw-r--r--include/linux/regulator/driver.h4
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 @@
180#define MAX77620_SD_CFG1_FPWM_SD_MASK BIT(2) 180#define MAX77620_SD_CFG1_FPWM_SD_MASK BIT(2)
181#define MAX77620_SD_CFG1_FPWM_SD_SKIP 0 181#define MAX77620_SD_CFG1_FPWM_SD_SKIP 0
182#define MAX77620_SD_CFG1_FPWM_SD_FPWM BIT(2) 182#define MAX77620_SD_CFG1_FPWM_SD_FPWM BIT(2)
183#define MAX20024_SD_CFG1_MPOK_MASK BIT(1)
183#define MAX77620_SD_CFG1_FSRADE_SD_MASK BIT(0) 184#define MAX77620_SD_CFG1_FSRADE_SD_MASK BIT(0)
184#define MAX77620_SD_CFG1_FSRADE_SD_DISABLE 0 185#define MAX77620_SD_CFG1_FSRADE_SD_DISABLE 0
185#define MAX77620_SD_CFG1_FSRADE_SD_ENABLE BIT(0) 186#define MAX77620_SD_CFG1_FSRADE_SD_ENABLE BIT(0)
@@ -187,6 +188,7 @@
187/* LDO_CNFG2 */ 188/* LDO_CNFG2 */
188#define MAX77620_LDO_POWER_MODE_MASK 0xC0 189#define MAX77620_LDO_POWER_MODE_MASK 0xC0
189#define MAX77620_LDO_POWER_MODE_SHIFT 6 190#define MAX77620_LDO_POWER_MODE_SHIFT 6
191#define MAX20024_LDO_CFG2_MPOK_MASK BIT(2)
190#define MAX77620_LDO_CFG2_ADE_MASK BIT(1) 192#define MAX77620_LDO_CFG2_ADE_MASK BIT(1)
191#define MAX77620_LDO_CFG2_ADE_DISABLE 0 193#define MAX77620_LDO_CFG2_ADE_DISABLE 0
192#define MAX77620_LDO_CFG2_ADE_ENABLE BIT(1) 194#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;
120#define REGULATOR_EVENT_PRE_DISABLE 0x400 120#define REGULATOR_EVENT_PRE_DISABLE 0x400
121#define REGULATOR_EVENT_ABORT_DISABLE 0x800 121#define REGULATOR_EVENT_ABORT_DISABLE 0x800
122 122
123/*
124 * Regulator errors that can be queried using regulator_get_error_flags
125 *
126 * UNDER_VOLTAGE Regulator output is under voltage.
127 * OVER_CURRENT Regulator output current is too high.
128 * REGULATION_OUT Regulator output is out of regulation.
129 * FAIL Regulator output has failed.
130 * OVER_TEMP Regulator over temp.
131 *
132 * NOTE: These errors can be OR'ed together.
133 */
134
135#define REGULATOR_ERROR_UNDER_VOLTAGE BIT(1)
136#define REGULATOR_ERROR_OVER_CURRENT BIT(2)
137#define REGULATOR_ERROR_REGULATION_OUT BIT(3)
138#define REGULATOR_ERROR_FAIL BIT(4)
139#define REGULATOR_ERROR_OVER_TEMP BIT(5)
140
141
123/** 142/**
124 * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event 143 * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event
125 * 144 *
@@ -237,6 +256,8 @@ int regulator_get_current_limit(struct regulator *regulator);
237 256
238int regulator_set_mode(struct regulator *regulator, unsigned int mode); 257int regulator_set_mode(struct regulator *regulator, unsigned int mode);
239unsigned int regulator_get_mode(struct regulator *regulator); 258unsigned int regulator_get_mode(struct regulator *regulator);
259int regulator_get_error_flags(struct regulator *regulator,
260 unsigned int *flags);
240int regulator_set_load(struct regulator *regulator, int load_uA); 261int regulator_set_load(struct regulator *regulator, int load_uA);
241 262
242int regulator_allow_bypass(struct regulator *regulator, bool allow); 263int regulator_allow_bypass(struct regulator *regulator, bool allow);
@@ -477,6 +498,12 @@ static inline unsigned int regulator_get_mode(struct regulator *regulator)
477 return REGULATOR_MODE_NORMAL; 498 return REGULATOR_MODE_NORMAL;
478} 499}
479 500
501static inline int regulator_get_error_flags(struct regulator *regulator,
502 unsigned int *flags)
503{
504 return -EINVAL;
505}
506
480static inline int regulator_set_load(struct regulator *regulator, int load_uA) 507static inline int regulator_set_load(struct regulator *regulator, int load_uA)
481{ 508{
482 return REGULATOR_MODE_NORMAL; 509 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 {
100 * 100 *
101 * @set_mode: Set the configured operating mode for the regulator. 101 * @set_mode: Set the configured operating mode for the regulator.
102 * @get_mode: Get the configured operating mode for the regulator. 102 * @get_mode: Get the configured operating mode for the regulator.
103 * @get_error_flags: Get the current error(s) for the regulator.
103 * @get_status: Return actual (not as-configured) status of regulator, as a 104 * @get_status: Return actual (not as-configured) status of regulator, as a
104 * REGULATOR_STATUS value (or negative errno) 105 * REGULATOR_STATUS value (or negative errno)
105 * @get_optimum_mode: Get the most efficient operating mode for the regulator 106 * @get_optimum_mode: Get the most efficient operating mode for the regulator
@@ -169,6 +170,9 @@ struct regulator_ops {
169 int (*set_mode) (struct regulator_dev *, unsigned int mode); 170 int (*set_mode) (struct regulator_dev *, unsigned int mode);
170 unsigned int (*get_mode) (struct regulator_dev *); 171 unsigned int (*get_mode) (struct regulator_dev *);
171 172
173 /* retrieve current error flags on the regulator */
174 int (*get_error_flags)(struct regulator_dev *, unsigned int *flags);
175
172 /* Time taken to enable or set voltage on the regulator */ 176 /* Time taken to enable or set voltage on the regulator */
173 int (*enable_time) (struct regulator_dev *); 177 int (*enable_time) (struct regulator_dev *);
174 int (*set_ramp_delay) (struct regulator_dev *, int ramp_delay); 178 int (*set_ramp_delay) (struct regulator_dev *, int ramp_delay);