Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1408409 > unrolled thread
| Started by | Kefeng Wang <wangkefeng.wang@huawei.com> |
|---|---|
| First post | 2016-05-28 11:40 +0200 |
| Last post | 2016-05-28 11:40 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/4] Support hisilicon 64bit mode timer Kefeng Wang <wangkefeng.wang@huawei.com> - 2016-05-28 11:40 +0200
[PATCH 1/4] clocksource: sp804: cleanup clk_get_sys() Kefeng Wang <wangkefeng.wang@huawei.com> - 2016-05-28 11:40 +0200
| From | Kefeng Wang <wangkefeng.wang@huawei.com> |
|---|---|
| Date | 2016-05-28 11:40 +0200 |
| Subject | [PATCH 0/4] Support hisilicon 64bit mode timer |
| Message-ID | <rDISR-7c7-3@gated-at.bofh.it> |
There is a kind of 64bit mode timer in hisilicon soc(like Hip05, Hip06 and some arm32 soc), it is very similar with ARM sp804 Dual Timers, but TimerX LOAD/Value/BGLoad are 64bit(two 32bit regs), and reg offset is different. This patchset make some cleanup and enable 64bit mode timer for hisilicon. Kefeng Wang (4): clocksource: sp804: cleanup clk_get_sys() clocksource: sp804: introduce helper sp804_load_mode_set() clocksource: sp804: use sp804_timer_disable() where possible clocksource: sp804: support 64bit mode for hisilicon timer64 .../devicetree/bindings/timer/arm,sp804.txt | 1 + drivers/clocksource/timer-sp.h | 1 + drivers/clocksource/timer-sp804.c | 142 +++++++++++++-------- 3 files changed, 92 insertions(+), 52 deletions(-) -- 1.7.12.4
[toc] | [next] | [standalone]
| From | Kefeng Wang <wangkefeng.wang@huawei.com> |
|---|---|
| Date | 2016-05-28 11:40 +0200 |
| Subject | [PATCH 1/4] clocksource: sp804: cleanup clk_get_sys() |
| Message-ID | <rDISS-7c7-17@gated-at.bofh.it> |
| In reply to | #1408409 |
Move the clk_get_sys() part into sp804_get_clock_rate(), cleanup the same code.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/clocksource/timer-sp804.c | 34 +++++++++++-----------------------
1 file changed, 11 insertions(+), 23 deletions(-)
diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c
index 5f45b9a..362e5d0 100644
--- a/drivers/clocksource/timer-sp804.c
+++ b/drivers/clocksource/timer-sp804.c
@@ -34,11 +34,19 @@
#include "timer-sp.h"
-static long __init sp804_get_clock_rate(struct clk *clk)
+static long __init sp804_get_clock_rate(struct clk *clk, const char *name)
{
long rate;
int err;
+ if (!clk) {
+ clk = clk_get_sys("sp804", name);
+ if (IS_ERR(clk)) {
+ pr_err("sp804: clock not found: %ld\n", PTR_ERR(clk));
+ return PTR_ERR(clk);
+ }
+ }
+
err = clk_prepare(clk);
if (err) {
pr_err("sp804: clock failed to prepare: %d\n", err);
@@ -82,18 +90,7 @@ void __init __sp804_clocksource_and_sched_clock_init(void __iomem *base,
struct clk *clk,
int use_sched_clock)
{
- long rate;
-
- if (!clk) {
- clk = clk_get_sys("sp804", name);
- if (IS_ERR(clk)) {
- pr_err("sp804: clock not found: %d\n",
- (int)PTR_ERR(clk));
- return;
- }
- }
-
- rate = sp804_get_clock_rate(clk);
+ long rate = sp804_get_clock_rate(clk, name);
if (rate < 0)
return;
@@ -189,17 +186,8 @@ static struct irqaction sp804_timer_irq = {
void __init __sp804_clockevents_init(void __iomem *base, unsigned int irq, struct clk *clk, const char *name)
{
struct clock_event_device *evt = &sp804_clockevent;
- long rate;
-
- if (!clk)
- clk = clk_get_sys("sp804", name);
- if (IS_ERR(clk)) {
- pr_err("sp804: %s clock not found: %d\n", name,
- (int)PTR_ERR(clk));
- return;
- }
+ long rate = sp804_get_clock_rate(clk, name);
- rate = sp804_get_clock_rate(clk);
if (rate < 0)
return;
--
1.7.12.4
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web