Merge remote-tracking branches 'regulator/fix/ad5398', 'regulator/fix/da9210', 'regul...
authorMark Brown <broonie@kernel.org>
Sun, 13 Mar 2016 08:19:09 +0000 (15:19 +0700)
committerMark Brown <broonie@kernel.org>
Sun, 13 Mar 2016 08:19:09 +0000 (15:19 +0700)
Documentation/devicetree/bindings/regulator/max77802.txt
drivers/regulator/ad5398.c
drivers/regulator/da9210-regulator.c
drivers/regulator/pv88090-regulator.c

index 09d796e..879e98d 100644 (file)
@@ -60,7 +60,7 @@ The possible values for "regulator-initial-mode" and "regulator-mode" are:
        1: Normal regulator voltage output mode.
        3: Low Power which reduces the quiescent current down to only 1uA
 
-The list of valid modes are defined in the dt-bindings/clock/maxim,max77802.h
+The valid modes list is defined in the dt-bindings/regulator/maxim,max77802.h
 header and can be included by device tree source files.
 
 The standard "regulator-mode" property can only be used for regulators that
index ea50a88..8b0f788 100644 (file)
@@ -58,10 +58,12 @@ static int ad5398_write_reg(struct i2c_client *client, const unsigned short data
 
        val = cpu_to_be16(data);
        ret = i2c_master_send(client, (char *)&val, 2);
-       if (ret < 0)
+       if (ret != 2) {
                dev_err(&client->dev, "I2C write error\n");
+               return ret < 0 ? ret : -EIO;
+       }
 
-       return ret;
+       return 0;
 }
 
 static int ad5398_get_current_limit(struct regulator_dev *rdev)
index 8b3cc9f..01c0e37 100644 (file)
@@ -132,6 +132,8 @@ static irqreturn_t da9210_irq_handler(int irq, void *data)
        if (error < 0)
                goto error_i2c;
 
+       mutex_lock(&chip->rdev->mutex);
+
        if (val & DA9210_E_OVCURR) {
                regulator_notifier_call_chain(chip->rdev,
                                              REGULATOR_EVENT_OVER_CURRENT,
@@ -155,6 +157,9 @@ static irqreturn_t da9210_irq_handler(int irq, void *data)
                                              NULL);
                handled |= DA9210_E_VMAX;
        }
+
+       mutex_unlock(&chip->rdev->mutex);
+
        if (handled) {
                /* Clear handled events */
                error = regmap_write(chip->regmap, DA9210_REG_EVENT_B, handled);
index ac15f31..0057c67 100644 (file)
@@ -283,8 +283,8 @@ static irqreturn_t pv88090_irq_handler(int irq, void *data)
                        }
                }
 
-               err = regmap_update_bits(chip->regmap, PV88090_REG_EVENT_A,
-                       PV88090_E_VDD_FLT, PV88090_E_VDD_FLT);
+               err = regmap_write(chip->regmap, PV88090_REG_EVENT_A,
+                       PV88090_E_VDD_FLT);
                if (err < 0)
                        goto error_i2c;
 
@@ -300,8 +300,8 @@ static irqreturn_t pv88090_irq_handler(int irq, void *data)
                        }
                }
 
-               err = regmap_update_bits(chip->regmap, PV88090_REG_EVENT_A,
-                       PV88090_E_OVER_TEMP, PV88090_E_OVER_TEMP);
+               err = regmap_write(chip->regmap, PV88090_REG_EVENT_A,
+                       PV88090_E_OVER_TEMP);
                if (err < 0)
                        goto error_i2c;