Commit ffb8c1e4 authored by Mark Brown's avatar Mark Brown

Merge branch 'topic/coupled' of...

Merge branch 'topic/coupled' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-4.21 for trivial conflict
parents a8d8ee43 ff9b34b6
...@@ -82,6 +82,8 @@ Optional properties: ...@@ -82,6 +82,8 @@ Optional properties:
- regulator-coupled-max-spread: Array of maximum spread between voltages of - regulator-coupled-max-spread: Array of maximum spread between voltages of
coupled regulators in microvolts, each value in the array relates to the coupled regulators in microvolts, each value in the array relates to the
corresponding couple specified by the regulator-coupled-with property. corresponding couple specified by the regulator-coupled-with property.
- regulator-max-step-microvolt: Maximum difference between current and target
voltages that can be changed safely in a single step.
Deprecated properties: Deprecated properties:
- regulator-compatible: If a regulator chip contains multiple - regulator-compatible: If a regulator chip contains multiple
......
This diff is collapsed.
...@@ -131,7 +131,7 @@ static irqreturn_t da9210_irq_handler(int irq, void *data) ...@@ -131,7 +131,7 @@ static irqreturn_t da9210_irq_handler(int irq, void *data)
if (error < 0) if (error < 0)
goto error_i2c; goto error_i2c;
mutex_lock(&chip->rdev->mutex); regulator_lock(chip->rdev);
if (val & DA9210_E_OVCURR) { if (val & DA9210_E_OVCURR) {
regulator_notifier_call_chain(chip->rdev, regulator_notifier_call_chain(chip->rdev,
...@@ -157,7 +157,7 @@ static irqreturn_t da9210_irq_handler(int irq, void *data) ...@@ -157,7 +157,7 @@ static irqreturn_t da9210_irq_handler(int irq, void *data)
handled |= DA9210_E_VMAX; handled |= DA9210_E_VMAX;
} }
mutex_unlock(&chip->rdev->mutex); regulator_unlock(chip->rdev);
if (handled) { if (handled) {
/* Clear handled events */ /* Clear handled events */
......
...@@ -171,6 +171,10 @@ static void of_get_regulation_constraints(struct device_node *np, ...@@ -171,6 +171,10 @@ static void of_get_regulation_constraints(struct device_node *np,
&pval)) &pval))
constraints->max_spread = pval; constraints->max_spread = pval;
if (!of_property_read_u32(np, "regulator-max-step-microvolt",
&pval))
constraints->max_uV_step = pval;
constraints->over_current_protection = of_property_read_bool(np, constraints->over_current_protection = of_property_read_bool(np,
"regulator-over-current-protection"); "regulator-over-current-protection");
......
...@@ -489,14 +489,14 @@ static irqreturn_t stpmic1_curlim_irq_handler(int irq, void *data) ...@@ -489,14 +489,14 @@ static irqreturn_t stpmic1_curlim_irq_handler(int irq, void *data)
{ {
struct regulator_dev *rdev = (struct regulator_dev *)data; struct regulator_dev *rdev = (struct regulator_dev *)data;
mutex_lock(&rdev->mutex); regulator_lock(rdev, NULL);
/* Send an overcurrent notification */ /* Send an overcurrent notification */
regulator_notifier_call_chain(rdev, regulator_notifier_call_chain(rdev,
REGULATOR_EVENT_OVER_CURRENT, REGULATOR_EVENT_OVER_CURRENT,
NULL); NULL);
mutex_unlock(&rdev->mutex); regulator_unlock(rdev);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -1153,7 +1153,7 @@ static irqreturn_t pmic_uv_handler(int irq, void *data) ...@@ -1153,7 +1153,7 @@ static irqreturn_t pmic_uv_handler(int irq, void *data)
{ {
struct regulator_dev *rdev = (struct regulator_dev *)data; struct regulator_dev *rdev = (struct regulator_dev *)data;
mutex_lock(&rdev->mutex); regulator_lock(rdev);
if (irq == WM8350_IRQ_CS1 || irq == WM8350_IRQ_CS2) if (irq == WM8350_IRQ_CS1 || irq == WM8350_IRQ_CS2)
regulator_notifier_call_chain(rdev, regulator_notifier_call_chain(rdev,
REGULATOR_EVENT_REGULATION_OUT, REGULATOR_EVENT_REGULATION_OUT,
...@@ -1162,7 +1162,7 @@ static irqreturn_t pmic_uv_handler(int irq, void *data) ...@@ -1162,7 +1162,7 @@ static irqreturn_t pmic_uv_handler(int irq, void *data)
regulator_notifier_call_chain(rdev, regulator_notifier_call_chain(rdev,
REGULATOR_EVENT_UNDER_VOLTAGE, REGULATOR_EVENT_UNDER_VOLTAGE,
NULL); NULL);
mutex_unlock(&rdev->mutex); regulator_unlock(rdev);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -15,11 +15,12 @@ ...@@ -15,11 +15,12 @@
#ifndef __LINUX_REGULATOR_DRIVER_H_ #ifndef __LINUX_REGULATOR_DRIVER_H_
#define __LINUX_REGULATOR_DRIVER_H_ #define __LINUX_REGULATOR_DRIVER_H_
#define MAX_COUPLED 4 #define MAX_COUPLED 2
#include <linux/device.h> #include <linux/device.h>
#include <linux/notifier.h> #include <linux/notifier.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/ww_mutex.h>
struct gpio_desc; struct gpio_desc;
struct regmap; struct regmap;
...@@ -462,7 +463,7 @@ struct regulator_dev { ...@@ -462,7 +463,7 @@ struct regulator_dev {
struct coupling_desc coupling_desc; struct coupling_desc coupling_desc;
struct blocking_notifier_head notifier; struct blocking_notifier_head notifier;
struct mutex mutex; /* consumer lock */ struct ww_mutex mutex; /* consumer lock */
struct task_struct *mutex_owner; struct task_struct *mutex_owner;
int ref_cnt; int ref_cnt;
struct module *owner; struct module *owner;
...@@ -545,4 +546,7 @@ int regulator_set_active_discharge_regmap(struct regulator_dev *rdev, ...@@ -545,4 +546,7 @@ int regulator_set_active_discharge_regmap(struct regulator_dev *rdev,
bool enable); bool enable);
void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);
void regulator_lock(struct regulator_dev *rdev);
void regulator_unlock(struct regulator_dev *rdev);
#endif #endif
...@@ -158,6 +158,9 @@ struct regulation_constraints { ...@@ -158,6 +158,9 @@ struct regulation_constraints {
/* used for coupled regulators */ /* used for coupled regulators */
int max_spread; int max_spread;
/* used for changing voltage in steps */
int max_uV_step;
/* valid regulator operating modes for this machine */ /* valid regulator operating modes for this machine */
unsigned int valid_modes_mask; unsigned int valid_modes_mask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment