diff options
| author | Axel Lin <axel.lin@ingics.com> | 2013-06-19 13:27:27 -0400 |
|---|---|---|
| committer | Thierry Reding <thierry.reding@gmail.com> | 2013-06-26 17:23:54 -0400 |
| commit | fed1bf8dc76cd102892379fce59b9ba237afd438 (patch) | |
| tree | b035f2e9f6b6d9f4039088f0578d9717eb252384 /drivers/pwm | |
| parent | 71077bc8db67f560453d62c48e3bec467ec6b37f (diff) | |
pwm: pca9685: Fix wrong argument to set MODE1_SLEEP bit
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>
Diffstat (limited to 'drivers/pwm')
| -rw-r--r-- | drivers/pwm/pwm-pca9685.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pwm/pwm-pca9685.c b/drivers/pwm/pwm-pca9685.c index c9f9e65415f3..3fb775ded0df 100644 --- a/drivers/pwm/pwm-pca9685.c +++ b/drivers/pwm/pwm-pca9685.c | |||
| @@ -190,7 +190,7 @@ static void pca9685_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) | |||
| 190 | 190 | ||
| 191 | if (--pca->active_cnt == 0) | 191 | if (--pca->active_cnt == 0) |
| 192 | regmap_update_bits(pca->regmap, PCA9685_MODE1, MODE1_SLEEP, | 192 | regmap_update_bits(pca->regmap, PCA9685_MODE1, MODE1_SLEEP, |
| 193 | 0x1); | 193 | MODE1_SLEEP); |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | static const struct pwm_ops pca9685_pwm_ops = { | 196 | static const struct pwm_ops pca9685_pwm_ops = { |
| @@ -264,7 +264,8 @@ static int pca9685_pwm_remove(struct i2c_client *client) | |||
| 264 | { | 264 | { |
| 265 | struct pca9685 *pca = i2c_get_clientdata(client); | 265 | struct pca9685 *pca = i2c_get_clientdata(client); |
| 266 | 266 | ||
| 267 | regmap_update_bits(pca->regmap, PCA9685_MODE1, MODE1_SLEEP, 0x1); | 267 | regmap_update_bits(pca->regmap, PCA9685_MODE1, MODE1_SLEEP, |
| 268 | MODE1_SLEEP); | ||
| 268 | 269 | ||
| 269 | return pwmchip_remove(&pca->chip); | 270 | return pwmchip_remove(&pca->chip); |
| 270 | } | 271 | } |
