linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clocksource: samsung_pwm: Correct definition of AUTORELOAD bit
@ 2013-06-18 17:41 Tomasz Figa
  2013-06-23  9:59 ` Tomasz Figa
  0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Figa @ 2013-06-18 17:41 UTC (permalink / raw)
  To: linux-arm-kernel

PWM channel 4 (logically channel 5 in TCON register) has its autoreload
bit located at different position. This patch fixes the driver to account
for this.

This fixes a problem with clocksource hanging after it overflows because
it is not reloaded any more.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 drivers/clocksource/samsung_pwm_timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
index 2977043..6af178f 100644
--- a/drivers/clocksource/samsung_pwm_timer.c
+++ b/drivers/clocksource/samsung_pwm_timer.c
@@ -47,7 +47,8 @@
 #define TCON_START(chan)		(1 << (4 * (chan) + 0))
 #define TCON_MANUALUPDATE(chan)		(1 << (4 * (chan) + 1))
 #define TCON_INVERT(chan)		(1 << (4 * (chan) + 2))
-#define TCON_AUTORELOAD(chan)		(1 << (4 * (chan) + 3))
+#define TCON_AUTORELOAD(chan)		(1 << (4 * (chan) \
+						+ (((chan) < 5) ? 3 : 2)))
 
 DEFINE_SPINLOCK(samsung_pwm_lock);
 EXPORT_SYMBOL(samsung_pwm_lock);
-- 
1.8.2.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] clocksource: samsung_pwm: Correct definition of AUTORELOAD bit
  2013-06-18 17:41 [PATCH] clocksource: samsung_pwm: Correct definition of AUTORELOAD bit Tomasz Figa
@ 2013-06-23  9:59 ` Tomasz Figa
  0 siblings, 0 replies; 2+ messages in thread
From: Tomasz Figa @ 2013-06-23  9:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 18 of June 2013 19:41:07 Tomasz Figa wrote:
> PWM channel 4 (logically channel 5 in TCON register) has its autoreload
> bit located at different position. This patch fixes the driver to
> account for this.
> 
> This fixes a problem with clocksource hanging after it overflows because
> it is not reloaded any more.
> 
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> ---
>  drivers/clocksource/samsung_pwm_timer.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clocksource/samsung_pwm_timer.c
> b/drivers/clocksource/samsung_pwm_timer.c index 2977043..6af178f 100644
> --- a/drivers/clocksource/samsung_pwm_timer.c
> +++ b/drivers/clocksource/samsung_pwm_timer.c
> @@ -47,7 +47,8 @@
>  #define TCON_START(chan)		(1 << (4 * (chan) + 0))
>  #define TCON_MANUALUPDATE(chan)		(1 << (4 * (chan) + 1))
>  #define TCON_INVERT(chan)		(1 << (4 * (chan) + 2))
> -#define TCON_AUTORELOAD(chan)		(1 << (4 * (chan) + 3))
> +#define TCON_AUTORELOAD(chan)		(1 << (4 * (chan) \
> +						+ (((chan) < 5) ? 3 : 2)))
> 
>  DEFINE_SPINLOCK(samsung_pwm_lock);
>  EXPORT_SYMBOL(samsung_pwm_lock);

Ping.

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-23  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18 17:41 [PATCH] clocksource: samsung_pwm: Correct definition of AUTORELOAD bit Tomasz Figa
2013-06-23  9:59 ` Tomasz Figa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).