From: Xiubo Li <Li.Xiubo@freescale.com>
To: <daniel.lezcano@linaro.org>, <tglx@linutronix.de>
Cc: <linux-kernel@vger.kernel.org>, Xiubo Li <Li.Xiubo@freescale.com>
Subject: [PATCHv2 1/4] Clocksource: Flextimer: Use internal clocksource read API.
Date: Fri, 5 Sep 2014 13:02:17 +0800 [thread overview]
Message-ID: <1409893340-30027-2-git-send-email-Li.Xiubo@freescale.com> (raw)
In-Reply-To: <1409893340-30027-1-git-send-email-Li.Xiubo@freescale.com>
Since the Flextimer device will be implemented in BE mode on
LS1 SoC, and in LE mode on Vybrid, LS2 SoCs, so here we need
the endianness judgment before doing the mmio.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
drivers/clocksource/fsl_ftm_timer.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/clocksource/fsl_ftm_timer.c b/drivers/clocksource/fsl_ftm_timer.c
index 454227d..9c6e935 100644
--- a/drivers/clocksource/fsl_ftm_timer.c
+++ b/drivers/clocksource/fsl_ftm_timer.c
@@ -226,6 +226,11 @@ static int __init ftm_clockevent_init(unsigned long freq, int irq)
return 0;
}
+static cycle_t ftm_clocksource_read_up(struct clocksource *c)
+{
+ return ftm_readl(priv->clksrc_base + FTM_CNT) & 0xffff;
+}
+
static int __init ftm_clocksource_init(unsigned long freq)
{
int err;
@@ -238,7 +243,7 @@ static int __init ftm_clocksource_init(unsigned long freq)
sched_clock_register(ftm_read_sched_clock, 16, freq / (1 << priv->ps));
err = clocksource_mmio_init(priv->clksrc_base + FTM_CNT, "fsl-ftm",
freq / (1 << priv->ps), 300, 16,
- clocksource_mmio_readl_up);
+ ftm_clocksource_read_up);
if (err) {
pr_err("ftm: init clock source mmio failed: %d\n", err);
return err;
--
2.1.0.27.g96db324
next prev parent reply other threads:[~2014-09-05 5:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 5:02 [PATCHv2 0/4] Clocksource: Flextimer: add LS1 support Xiubo Li
2014-09-05 5:02 ` Xiubo Li [this message]
2014-09-05 15:40 ` [PATCHv2 1/4] Clocksource: Flextimer: Use internal clocksource read API Thomas Gleixner
2014-09-09 1:55 ` Li.Xiubo
2014-09-05 5:02 ` [PATCHv2 2/4] Clocksource: Flextimer: Remove the useless code Xiubo Li
2014-09-05 5:02 ` [PATCHv2 3/4] Clocksource: Flextimer: Set cpumask to cpu_possible_mask Xiubo Li
2014-09-05 5:02 ` [PATCHv2 4/4] Clocksource: Flextimer: Fix counter clock prescaler calculation Xiubo Li
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=1409893340-30027-2-git-send-email-Li.Xiubo@freescale.com \
--to=li.xiubo@freescale.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®