From: t.figa@samsung.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/16] clocksource: samsung_pwm_timer: Get clock from device tree
Date: Tue, 20 Aug 2013 19:31:30 +0200 [thread overview]
Message-ID: <1377019903-14614-4-git-send-email-t.figa@samsung.com> (raw)
In-Reply-To: <1377019903-14614-1-git-send-email-t.figa@samsung.com>
When booting with device tree static clkdev aliases should not be used.
This patch modifies the samsung_pwm_timer driver to use DT-based clock
lookup when booting with device tree.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/clocksource/samsung_pwm_timer.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
index ac60f8b..ab29476 100644
--- a/drivers/clocksource/samsung_pwm_timer.c
+++ b/drivers/clocksource/samsung_pwm_timer.c
@@ -368,10 +368,6 @@ static void __init samsung_clocksource_init(void)
static void __init samsung_timer_resources(void)
{
- pwm.timerclk = clk_get(NULL, "timers");
- if (IS_ERR(pwm.timerclk))
- panic("failed to get timers clock for timer");
-
clk_prepare_enable(pwm.timerclk);
pwm.tcnt_max = (1UL << pwm.variant.bits) - 1;
@@ -416,6 +412,10 @@ void __init samsung_pwm_clocksource_init(void __iomem *base,
memcpy(&pwm.variant, variant, sizeof(pwm.variant));
memcpy(pwm.irq, irqs, SAMSUNG_PWM_NUM * sizeof(*irqs));
+ pwm.timerclk = clk_get(NULL, "timers");
+ if (IS_ERR(pwm.timerclk))
+ panic("failed to get timers clock for timer");
+
_samsung_pwm_clocksource_init();
}
@@ -447,6 +447,10 @@ static void __init samsung_pwm_alloc(struct device_node *np,
return;
}
+ pwm.timerclk = of_clk_get_by_name(np, "timers");
+ if (IS_ERR(pwm.timerclk))
+ panic("failed to get timers clock for timer");
+
_samsung_pwm_clocksource_init();
}
--
1.8.3.2
next prev parent reply other threads:[~2013-08-20 17:31 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-20 17:31 [PATCH 00/16] Exynos clock clean-up for 3.12 Tomasz Figa
2013-08-20 17:31 ` [PATCH 01/16] pwm: samsung: Update DT bindings documentation to cover clocks Tomasz Figa
2013-08-20 20:34 ` Stephen Warren
2013-08-20 22:32 ` Tomasz Figa
2013-08-20 17:31 ` [PATCH 02/16] ARM: dts: exynos4: Specify PWM clocks in PWM node Tomasz Figa
2013-08-20 17:31 ` Tomasz Figa [this message]
2013-08-20 17:31 ` [PATCH 04/16] clk: samsung: exynos4: Use separate aliases for cpufreq related clocks Tomasz Figa
2013-08-20 17:31 ` [PATCH 05/16] clk: samsung: Modify _get_rate() helper to use __clk_lookup() Tomasz Figa
2013-08-20 17:31 ` [PATCH 06/16] clk: samsung: exynos4: Remove unused static clkdev aliases Tomasz Figa
2013-08-20 17:31 ` [PATCH 07/16] clk: samsung: exynos4: Remove checks for DT node Tomasz Figa
2013-08-20 17:31 ` [PATCH 08/16] clk: samsung: exynos4: Rename exynos4_plls to exynos4x12_plls Tomasz Figa
2013-08-20 17:31 ` [PATCH 09/16] clk: samsung: pll: Use new registration method for PLL45xx Tomasz Figa
2013-08-21 13:17 ` Yadwinder Singh Brar
2013-08-22 19:59 ` Stephen Warren
2013-08-20 17:31 ` [PATCH 10/16] clk: samsung: pll: Add support for rate configuration of PLL45xx Tomasz Figa
2013-08-21 12:18 ` Yadwinder Singh Brar
2013-08-21 12:49 ` Tomasz Figa
2013-08-20 17:31 ` [PATCH 11/16] clk: samsung: pll: Use new registration method for PLL46xx Tomasz Figa
2013-08-20 17:31 ` [PATCH 12/16] clk: samsung: pll: Add support for rate configuration of PLL46xx Tomasz Figa
2013-08-21 12:32 ` Yadwinder Singh Brar
2013-08-21 12:44 ` Tomasz Figa
2013-08-21 13:12 ` Yadwinder Singh Brar
2013-08-20 17:31 ` [PATCH 13/16] clk: samsung: exynos4: Reorder registration of mout_vpllsrc Tomasz Figa
2013-08-20 17:31 ` [PATCH 14/16] clk: samsung: exynos4: Register PLL rate tables for Exynos4210 Tomasz Figa
2013-08-21 12:34 ` Yadwinder Singh Brar
2013-08-21 12:45 ` Tomasz Figa
2013-08-20 17:31 ` [PATCH 15/16] clk: samsung: exynos4: Register PLL rate tables for Exynos4x12 Tomasz Figa
2013-08-20 17:31 ` [PATCH 16/16] clk: samsung: exynos5250: Simplify registration of PLL rate tables 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=1377019903-14614-4-git-send-email-t.figa@samsung.com \
--to=t.figa@samsung.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).