Skip to contentSkip to conversation

PWM: twl: actually disable twl6030 PWMs

PATCH Applied Axel Lin 3 participants 4 messages Apr 9, 2014 – May 8, 2014 PWM

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 PWM: twl: actually disable twl6030 PWMs

Current twl6030_pwm_disable() implementation writes TWL6030_TOGGLE3_REG twice, the second write sets TWL6030_PWMXEN bits so the PWM clock does not disable.

---
Hi Peter,
I don't have this h/w handy to test.
I'd appreciate if you can review and test this patch.

Regards,
Axel

 drivers/pwm/pwm-twl.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/pwm/pwm-twl.c +0 -8
index b99a50e..04f7672 100644
@@ -265,14 +265,6 @@ static void twl6030_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 
 	ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, val, TWL6030_TOGGLE3_REG);
 	if (ret < 0) {
-		dev_err(chip->dev, "%s: Failed to read TOGGLE3\n", pwm->label);
-		goto out;
-	}
-
-	val |= TWL6030_PWM_TOGGLE(pwm->hwpwm, TWL6030_PWMXS | TWL6030_PWMXEN);
-
-	ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, val, TWL6030_TOGGLE3_REG);
-	if (ret < 0) {
 		dev_err(chip->dev, "%s: Failed to disable PWM\n", pwm->label);
 		goto out;
 	}
Signature · 1 line
1.8.3.2
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Axel Lin

Current twl6030_pwm_disable() implementation writes TWL6030_TOGGLE3_REG twice, the second write sets TWL6030_PWMXEN bits so the PWM clock does not disable.

---
Hi Peter,
I don't have this h/w handy to test.
I'd appreciate if you can review and test this patch.

You are right. The code was disabling the given PWM and then set the EN bit to one :o
I don't have any explanation why it was like that, thanks for finding it!

Quoted 26 lines

Regards,
Axel

 drivers/pwm/pwm-twl.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/pwm/pwm-twl.c +0 -8
index b99a50e..04f7672 100644
@@ -265,14 +265,6 @@ static void twl6030_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 
 	ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, val, TWL6030_TOGGLE3_REG);
 	if (ret < 0) {
-		dev_err(chip->dev, "%s: Failed to read TOGGLE3\n", pwm->label);
-		goto out;
-	}
-
-	val |= TWL6030_PWM_TOGGLE(pwm->hwpwm, TWL6030_PWMXS | TWL6030_PWMXEN);
-
-	ret = twl_i2c_write_u8(TWL6030_MODULE_ID1, val, TWL6030_TOGGLE3_REG);
-	if (ret < 0) {
 		dev_err(chip->dev, "%s: Failed to disable PWM\n", pwm->label);
 		goto out;
 	}
Signature · 1 line
Péter
author
#2 lore raw

2014-04-09 17:32 GMT+08:00 Peter Ujfalusi <[email protected]>:

Quoted 10 lines · Axel Lin
Quoted 8 lines

Current twl6030_pwm_disable() implementation writes TWL6030_TOGGLE3_REG twice, the second write sets TWL6030_PWMXEN bits so the PWM clock does not disable.

---
Hi Peter,
I don't have this h/w handy to test.
I'd appreciate if you can review and test this patch.

Quoted 5 lines

You are right. The code was disabling the given PWM and then set the EN bit to one :o
I don't have any explanation why it was like that, thanks for finding it!

Hi Thierry,
Would you pick up this patch?

Regards,
Axel

#3 lore raw
In reply to Axel Lin
Quoted 9 lines · Axel Lin

Current twl6030_pwm_disable() implementation writes TWL6030_TOGGLE3_REG twice, the second write sets TWL6030_PWMXEN bits so the PWM clock does not disable.

---
Hi Peter,
I don't have this h/w handy to test.
I'd appreciate if you can review and test this patch.

Quoted 4 lines

Regards,
Axel

 drivers/pwm/pwm-twl.c | 8 --------
 1 file changed, 8 deletions(-)

Applied, thanks.

Thierry