ARM: mxs: use CLKSRC_OF helper to initialize timer
Select CLKSRC_OF and use clocksource_of_init() to initialize timer, so that the call to mxs_timer_init() in clock driver can be removed. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
This commit is contained in:
parent
3ed628a812
commit
633ef4c7d1
|
@ -473,6 +473,7 @@ config ARCH_MXS
|
||||||
select ARCH_REQUIRE_GPIOLIB
|
select ARCH_REQUIRE_GPIOLIB
|
||||||
select CLKDEV_LOOKUP
|
select CLKDEV_LOOKUP
|
||||||
select CLKSRC_MMIO
|
select CLKSRC_MMIO
|
||||||
|
select CLKSRC_OF
|
||||||
select COMMON_CLK
|
select COMMON_CLK
|
||||||
select GENERIC_CLOCKEVENTS
|
select GENERIC_CLOCKEVENTS
|
||||||
select HAVE_CLK_PREPARE
|
select HAVE_CLK_PREPARE
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
extern const u32 *mxs_get_ocotp(void);
|
extern const u32 *mxs_get_ocotp(void);
|
||||||
extern int mxs_reset_block(void __iomem *);
|
extern int mxs_reset_block(void __iomem *);
|
||||||
extern void mxs_timer_init(void);
|
|
||||||
extern void mxs_restart(char, const char *);
|
extern void mxs_restart(char, const char *);
|
||||||
extern int mxs_saif_clkmux_select(unsigned int clkmux);
|
extern int mxs_saif_clkmux_select(unsigned int clkmux);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/clkdev.h>
|
#include <linux/clkdev.h>
|
||||||
|
#include <linux/clocksource.h>
|
||||||
#include <linux/can/platform/flexcan.h>
|
#include <linux/can/platform/flexcan.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
|
@ -168,11 +169,13 @@ static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
|
||||||
static void __init imx23_timer_init(void)
|
static void __init imx23_timer_init(void)
|
||||||
{
|
{
|
||||||
mx23_clocks_init();
|
mx23_clocks_init();
|
||||||
|
clocksource_of_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init imx28_timer_init(void)
|
static void __init imx28_timer_init(void)
|
||||||
{
|
{
|
||||||
mx28_clocks_init();
|
mx28_clocks_init();
|
||||||
|
clocksource_of_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
enum mac_oui {
|
enum mac_oui {
|
||||||
|
|
|
@ -242,18 +242,11 @@ static int __init mxs_clocksource_init(struct clk *timer_clk)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init mxs_timer_init(void)
|
static void __init mxs_timer_init(struct device_node *np)
|
||||||
{
|
{
|
||||||
struct device_node *np;
|
|
||||||
struct clk *timer_clk;
|
struct clk *timer_clk;
|
||||||
int irq;
|
int irq;
|
||||||
|
|
||||||
np = of_find_compatible_node(NULL, NULL, "fsl,timrot");
|
|
||||||
if (!np) {
|
|
||||||
pr_err("%s: failed find timrot node\n", __func__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
timer_clk = clk_get_sys("timrot", NULL);
|
timer_clk = clk_get_sys("timrot", NULL);
|
||||||
if (IS_ERR(timer_clk)) {
|
if (IS_ERR(timer_clk)) {
|
||||||
pr_err("%s: failed to get clk\n", __func__);
|
pr_err("%s: failed to get clk\n", __func__);
|
||||||
|
@ -304,3 +297,4 @@ void __init mxs_timer_init(void)
|
||||||
irq = irq_of_parse_and_map(np, 0);
|
irq = irq_of_parse_and_map(np, 0);
|
||||||
setup_irq(irq, &mxs_timer_irq);
|
setup_irq(irq, &mxs_timer_irq);
|
||||||
}
|
}
|
||||||
|
CLOCKSOURCE_OF_DECLARE(mxs, "fsl,timrot", mxs_timer_init)
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <mach/common.h>
|
|
||||||
#include <mach/mx23.h>
|
#include <mach/mx23.h>
|
||||||
#include "clk.h"
|
#include "clk.h"
|
||||||
|
|
||||||
|
@ -165,7 +164,5 @@ int __init mx23_clocks_init(void)
|
||||||
for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
|
for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
|
||||||
clk_prepare_enable(clks[clks_init_on[i]]);
|
clk_prepare_enable(clks[clks_init_on[i]]);
|
||||||
|
|
||||||
mxs_timer_init();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <mach/common.h>
|
|
||||||
#include <mach/mx28.h>
|
#include <mach/mx28.h>
|
||||||
#include "clk.h"
|
#include "clk.h"
|
||||||
|
|
||||||
|
@ -244,7 +243,5 @@ int __init mx28_clocks_init(void)
|
||||||
for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
|
for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
|
||||||
clk_prepare_enable(clks[clks_init_on[i]]);
|
clk_prepare_enable(clks[clks_init_on[i]]);
|
||||||
|
|
||||||
mxs_timer_init();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue