Skip to content

Commit

Permalink
pwm: pca9685: Fix wrong argument to set MODE1_SLEEP bit
Browse files Browse the repository at this point in the history
Current code actually does not set MODE1_SLEEP bit because the new value for
bitmask (0x1) is wrong. To set MODE1_SLEEP bit, we should pass MODE1_SLEEP
as the new value for bitmask.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
Axel Lin authored and Thierry Reding committed Jun 26, 2013
1 parent 71077bc commit fed1bf8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/pwm/pwm-pca9685.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static void pca9685_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)

if (--pca->active_cnt == 0)
regmap_update_bits(pca->regmap, PCA9685_MODE1, MODE1_SLEEP,
0x1);
MODE1_SLEEP);
}

static const struct pwm_ops pca9685_pwm_ops = {
Expand Down Expand Up @@ -264,7 +264,8 @@ static int pca9685_pwm_remove(struct i2c_client *client)
{
struct pca9685 *pca = i2c_get_clientdata(client);

regmap_update_bits(pca->regmap, PCA9685_MODE1, MODE1_SLEEP, 0x1);
regmap_update_bits(pca->regmap, PCA9685_MODE1, MODE1_SLEEP,
MODE1_SLEEP);

return pwmchip_remove(&pca->chip);
}
Expand Down

0 comments on commit fed1bf8

Please sign in to comment.