Skip to content

Commit

Permalink
Merge remote-tracking branches 'regulator/fix/ad5398', 'regulator/fix…
Browse files Browse the repository at this point in the history
…/da9210', 'regulator/fix/max77802' and 'regulator/fix/pv88090' into regulator-linus
  • Loading branch information
Mark Brown committed Mar 13, 2016
5 parents 5865865 + 4434cee + 0f48eed + e0d9b7c + 623f7b9 commit 905373b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/regulator/max77802.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions drivers/regulator/ad5398.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions drivers/regulator/da9210-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions drivers/regulator/pv88090-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit 905373b

Please sign in to comment.