Re: pwm-samsung: incorrect register values for 100% duty cycle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Daniel,

On 18.09.2014 01:42, Daniel Drake wrote:
> Hi,
> 
> I'm using pwm-samsung on Exynos4412 for a variable-brightness LED.
> 
> When the LED is set to maximum brightness via the pwm-leds driver, we
> arrive at pwm_samsung_config with duty_ns = period_ns, i.e. 100% duty
> cycle.
> 
> This function does:
> 
>     /* -1UL will give 100% duty. */
>     --tcmp;
>     writel(tcmp, our_chip->base + REG_TCMPB(pwm->hwpwm));
> 
> I think that comment is incorrect. If tcmp is written as -1UL then the
> LED totally turns off. And there is nothing in the Exynos4412 manual
> to suggest that -1UL should be set in the TCMP register for 100% duty.

Looking at Figure 11-3 in 11.3.2 Basic Timer Operation chapter of Exynos
4412 public datasheet [1] (page 659), the calculation above seems
correct. The default state of timer output is high and if TCMP is set to
a value higher than TCNT, then it will never toggle to low.

[1]
http://www.samsung.com/global/business/semiconductor/file/product/Exynos_4_Quad_User_Manaul_Public_REV1.00-0.pdf

> 
> If I remove that --tcmp line, so that 100% duty cycle is handled as
> tcmp=0, the problem is solved: the LED turns on at max brightness when
> the leds subsystem requests so.

According to my computations, with tcmp=0 you should get exactly the
minimum supported duty cycle (1 / N, where N is the number of ticks of
period), not full brightness. Are you sure that you have the right
output polarity configured?

> 
> Any ideas? Is this -1UL thing a quirk from older chip versions not
> applicable to Exynos4?

Comparing few datasheets, the timers seem identical in this aspect.

Best regards,
Tomasz
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux