clocksource: samsung_pwm_timer: Work around rounding errors in clockevents core
authorTomasz Figa <t.figa@samsung.com>
Tue, 23 Apr 2013 15:46:30 +0000 (17:46 +0200)
committerOlof Johansson <olof@lixom.net>
Sun, 28 Apr 2013 19:17:05 +0000 (12:17 -0700)
commit81d4f7bfdc9417e7d8fc1133c762daa4458eec5e
treea9942c9fb2ec8d830ead2fb01517b7f95985fb80
parent6fe4dfd041dadbc1cc2460ed8680f2734dc3dc95
clocksource: samsung_pwm_timer: Work around rounding errors in clockevents core

Due to rounding errors in clockevents core (in conversions between ticks
and nsecs), it might happen that the set_next_event callback gets called
with cycles = 0, causing the code to incorrectly program the PWM timer.

This patch modifies the callback to program the timer for 1 tick, if
received tick count value is 0.

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