Skip to contentSkip to conversation

pwm: samsung: do not set manual update bit in pwm_samsung_config

PATCH Applied Ajay Kumar 4 participants 4 messages May 12, 2014 – May 21, 2014

Subsystems (2)
lore
Share & tools
lore

Ajay Kumar

author
#0 lore raw

PATCH 1/1 pwm: samsung: do not set manual update bit in pwm_samsung_config

pwm_samsung_config sets manual update bit via call to pwm_samsung_enable even when the channel is already running. This causes noticable flickers on display if we try to change the backlight value from 0 to MAX, continiously.

So, we remove the call to pwm_samsung_enable from pwm_samsung_config to avoid the flicker and this change doesn't harm normal working since the pwm_bl core already takes care of calling pwm_samsung_enable whenever needed.

---
 drivers/pwm/pwm-samsung.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/pwm/pwm-samsung.c +0 -3
index d66529a..ba6b650 100644
@@ -335,9 +335,6 @@ static int pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm,
 	writel(tcnt, our_chip->base + REG_TCNTB(pwm->hwpwm));
 	writel(tcmp, our_chip->base + REG_TCMPB(pwm->hwpwm));
 
-	if (test_bit(PWMF_ENABLED, &pwm->flags))
-		pwm_samsung_enable(chip, pwm);
-
 	chan->period_ns = period_ns;
 	chan->tin_ns = tin_ns;
 	chan->duty_ns = duty_ns;
Signature · 1 line
1.8.3.2
#1 lore raw

This is a simpler version of https://patchwork.kernel.org/patch/3113001/

Quoted 32 lines · Ajay Kumar

pwm_samsung_config sets manual update bit via call to pwm_samsung_enable even when the channel is already running. This causes noticable flickers on display if we try to change the backlight value from 0 to MAX, continiously.

So, we remove the call to pwm_samsung_enable from pwm_samsung_config to avoid the flicker and this change doesn't harm normal working since the pwm_bl core already takes care of calling pwm_samsung_enable whenever needed.

---
 drivers/pwm/pwm-samsung.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/pwm/pwm-samsung.c +0 -4
index d66529a..ba6b650 100644
@@ -335,9 +335,6 @@ static int pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm,
        writel(tcnt, our_chip->base + REG_TCNTB(pwm->hwpwm));
        writel(tcmp, our_chip->base + REG_TCMPB(pwm->hwpwm));
 
-       if (test_bit(PWMF_ENABLED, &pwm->flags))
-               pwm_samsung_enable(chip, pwm);
-
        chan->period_ns = period_ns;
        chan->tin_ns = tin_ns;
        chan->duty_ns = duty_ns;
--

1.8.3.2

Reviewed-by on v1 1/1
#2 lore raw
In reply to Ajay Kumar

Hi Ajay,

Quoted 21 lines · Ajay Kumar

pwm_samsung_config sets manual update bit via call to pwm_samsung_enable even when the channel is already running. This causes noticable flickers on display if we try to change the backlight value from 0 to MAX, continiously.

So, we remove the call to pwm_samsung_enable from pwm_samsung_config to avoid the flicker and this change doesn't harm normal working since the pwm_bl core already takes care of calling pwm_samsung_enable whenever needed.

---
 drivers/pwm/pwm-samsung.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/pwm/pwm-samsung.c +0 -0
index d66529a..ba6b650 100644

drivers/pwm/pwm-samsung.c static int pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm, · line 340

Quoted 9 lines
drivers/pwm/pwm-samsung.c +0 -3
@@ -335,9 +335,6 @@ static int pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm,
 	writel(tcnt, our_chip->base + REG_TCNTB(pwm->hwpwm));
 	writel(tcmp, our_chip->base + REG_TCMPB(pwm->hwpwm));
 
-	if (test_bit(PWMF_ENABLED, &pwm->flags))
-		pwm_samsung_enable(chip, pwm);
-
 	chan->period_ns = period_ns;
 	chan->tin_ns = tin_ns;
 	chan->duty_ns = duty_ns;

Best regards,
Tomasz

#3 lore raw
In reply to Ajay Kumar
Quoted 10 lines · Ajay Kumar

pwm_samsung_config sets manual update bit via call to pwm_samsung_enable even when the channel is already running. This causes noticable flickers on display if we try to change the backlight value from 0 to MAX, continiously.

So, we remove the call to pwm_samsung_enable from pwm_samsung_config to avoid the flicker and this change doesn't harm normal working since the pwm_bl core already takes care of calling pwm_samsung_enable whenever needed.

Quoted 4 lines
---
 drivers/pwm/pwm-samsung.c | 3 ---
 1 file changed, 3 deletions(-)

Applied, thanks.

Thierry