From: David Lechner <david@lechnology.com>
To: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>, Sekhar Nori <nsekhar@ti.com>,
Kevin Hilman <khilman@kernel.org>, Adam Ford <aford173@gmail.com>,
linux-kernel@vger.kernel.org,
David Lechner <david@lechnology.com>
Subject: [PATCH v5 42/44] ARM: davinci: add device tree support to timer
Date: Sun, 7 Jan 2018 20:25:05 -0600 [thread overview]
Message-ID: <1515378307-23718-3-git-send-email-david@lechnology.com> (raw)
In-Reply-To: <1515378307-23718-1-git-send-email-david@lechnology.com>
This adds device tree support to the davinci timer so that when clocks
are moved to device tree, the timer will still work.
Signed-off-by: David Lechner <david@lechnology.com>
---
arch/arm/mach-davinci/Kconfig | 1 +
arch/arm/mach-davinci/time.c | 17 ++++++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index ba9912b..da8a039 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -59,6 +59,7 @@ config MACH_DA8XX_DT
default y
depends on ARCH_DAVINCI_DA850
select PINCTRL
+ select TIMER_OF
help
Say y here to include support for TI DaVinci DA850 based using
Flattened Device Tree. More information at Documentation/devicetree
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index bd0c80e..44470e9 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -333,9 +333,9 @@ static struct clock_event_device clockevent_davinci = {
};
-void __init davinci_timer_init(void)
+static int __init of_davinci_timer_init(struct device_node *node)
{
- struct clk *timer_clk;
+ struct clk *timer_clk = NULL;
struct davinci_soc_info *soc_info = &davinci_soc_info;
unsigned int clockevent_id;
unsigned int clocksource_id;
@@ -371,7 +371,10 @@ void __init davinci_timer_init(void)
}
}
- timer_clk = clk_get(NULL, "timer0");
+ if (node)
+ timer_clk = of_clk_get(node, 0);
+ if (IS_ERR_OR_NULL(timer_clk))
+ timer_clk = clk_get(NULL, "timer0");
BUG_ON(IS_ERR(timer_clk));
clk_prepare_enable(timer_clk);
@@ -399,4 +402,12 @@ void __init davinci_timer_init(void)
for (i=0; i< ARRAY_SIZE(timers); i++)
timer32_config(&timers[i]);
+
+ return 0;
+}
+TIMER_OF_DECLARE(davinci_timer, "ti,davinci-timer", of_davinci_timer_init);
+
+void __init davinci_timer_init(void)
+{
+ of_davinci_timer_init(NULL);
}
--
2.7.4
next prev parent reply other threads:[~2018-01-08 2:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 2:25 [PATCH v5 40/44] ARM: da8xx: Remove legacy clock init David Lechner
2018-01-08 2:25 ` [PATCH v5 41/44] ARM: davinci: remove legacy clocks David Lechner
2018-01-08 2:25 ` David Lechner [this message]
2018-01-08 2:25 ` [PATCH v5 43/44] ARM: da8xx-dt: switch to device tree clocks David Lechner
2018-01-18 15:27 ` Sekhar Nori
2018-01-18 18:40 ` David Lechner
2018-01-19 6:14 ` Sekhar Nori
2018-01-08 2:25 ` [PATCH v5 44/44] ARM: dts: da850: Add clocks David Lechner
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=1515378307-23718-3-git-send-email-david@lechnology.com \
--to=david@lechnology.com \
--cc=aford173@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=khilman@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mturquette@baylibre.com \
--cc=nsekhar@ti.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@codeaurora.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).