ARM: imx: define an enum for gpt timer device type
Define an enum for gpt timer device type in include/soc/imx/timer.h to
tell the gpt block differences among SoCs. Update non-DT users (clock
drivers) to pass the device type.
As we now have include/soc/imx/timer.h, the declaration of
mxc_timer_init() is moved into there as the best fit.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index 7c131e1..307cbc7 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -32,6 +32,7 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
+#include <soc/imx/timer.h>
#include <asm/mach/time.h>
@@ -86,6 +87,7 @@
static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
struct imx_timer {
+ enum imx_gpt_type type;
void __iomem *base;
int irq;
struct clk *clk_per;
@@ -356,7 +358,7 @@
setup_irq(imxtm->irq, &mxc_timer_irq);
}
-void __init mxc_timer_init(unsigned long pbase, int irq)
+void __init mxc_timer_init(unsigned long pbase, int irq, enum imx_gpt_type type)
{
struct imx_timer *imxtm;
@@ -369,6 +371,8 @@
imxtm->base = ioremap(pbase, SZ_4K);
BUG_ON(!imxtm->base);
+ imxtm->type = type;
+
_mxc_timer_init(imxtm);
}