From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clocksource: samsung_pwm: Correct definition of AUTORELOAD bit
Date: Tue, 18 Jun 2013 19:41:07 +0200 [thread overview]
Message-ID: <1371577267-2860-1-git-send-email-tomasz.figa@gmail.com> (raw)
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
next reply other threads:[~2013-06-18 17:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 17:41 Tomasz Figa [this message]
2013-06-23 9:59 ` [PATCH] clocksource: samsung_pwm: Correct definition of AUTORELOAD bit Tomasz Figa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371577267-2860-1-git-send-email-tomasz.figa@gmail.com \
--to=tomasz.figa@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).