]> git.baikalelectronics.ru Git - kernel.git/commit
clocksource: samsung_pwm_timer: Correct programming of clock events
authorTomasz Figa <t.figa@samsung.com>
Tue, 23 Apr 2013 15:46:29 +0000 (17:46 +0200)
committerOlof Johansson <olof@lixom.net>
Sun, 28 Apr 2013 19:17:01 +0000 (12:17 -0700)
commit7a830aab8d867bcc4d1397d0cbd95d525c2e7c51
tree05c695f8677efcdfbaa6a3e8e84b7c57d940f172
parent5fd76125515cd0e2c3d7acf6ae09c0616b3a1f98
clocksource: samsung_pwm_timer: Correct programming of clock events

In current code, the tick count value programmed to the hardware is
always decremented by one. This is reasonable for periodic mode, since
there is one extra tick between 0 and COUNT (after reloading), but it
makes oneshot events happen 1 tick earlier than requested, because the
interrupt is triggered on transition from 1 to 0.

This patch removes the decrementation from PWM channel setup code and
moves it instead to periodic timer setup, to make both periodic and
oneshot modes work correctly.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
drivers/clocksource/samsung_pwm_timer.c