Commit 5ab0475b authored by Shawn Guo's avatar Shawn Guo

ARM: imx: set up .set_next_event hook via imx_gpt_data

Set up .set_next_event hook via imx_gpt_data, so that we can save the
use of timer_is_v2().
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
parent 9c8694bd
...@@ -97,6 +97,8 @@ struct imx_timer { ...@@ -97,6 +97,8 @@ struct imx_timer {
struct imx_gpt_data { struct imx_gpt_data {
void (*gpt_setup_tctl)(struct imx_timer *imxtm); void (*gpt_setup_tctl)(struct imx_timer *imxtm);
int (*set_next_event)(unsigned long evt,
struct clock_event_device *ced);
}; };
static void __iomem *timer_base; static void __iomem *timer_base;
...@@ -301,9 +303,7 @@ static struct clock_event_device clockevent_mxc = { ...@@ -301,9 +303,7 @@ static struct clock_event_device clockevent_mxc = {
static int __init mxc_clockevent_init(struct imx_timer *imxtm) static int __init mxc_clockevent_init(struct imx_timer *imxtm)
{ {
if (timer_is_v2()) clockevent_mxc.set_next_event = imxtm->gpt->set_next_event;
clockevent_mxc.set_next_event = v2_set_next_event;
clockevent_mxc.cpumask = cpumask_of(0); clockevent_mxc.cpumask = cpumask_of(0);
clockevents_config_and_register(&clockevent_mxc, clockevents_config_and_register(&clockevent_mxc,
clk_get_rate(imxtm->clk_per), clk_get_rate(imxtm->clk_per),
...@@ -353,18 +353,22 @@ static void imx6dl_gpt_setup_tctl(struct imx_timer *imxtm) ...@@ -353,18 +353,22 @@ static void imx6dl_gpt_setup_tctl(struct imx_timer *imxtm)
static const struct imx_gpt_data imx1_gpt_data = { static const struct imx_gpt_data imx1_gpt_data = {
.gpt_setup_tctl = imx1_gpt_setup_tctl, .gpt_setup_tctl = imx1_gpt_setup_tctl,
.set_next_event = mx1_2_set_next_event,
}; };
static const struct imx_gpt_data imx21_gpt_data = { static const struct imx_gpt_data imx21_gpt_data = {
.gpt_setup_tctl = imx21_gpt_setup_tctl, .gpt_setup_tctl = imx21_gpt_setup_tctl,
.set_next_event = mx1_2_set_next_event,
}; };
static const struct imx_gpt_data imx31_gpt_data = { static const struct imx_gpt_data imx31_gpt_data = {
.gpt_setup_tctl = imx31_gpt_setup_tctl, .gpt_setup_tctl = imx31_gpt_setup_tctl,
.set_next_event = v2_set_next_event,
}; };
static const struct imx_gpt_data imx6dl_gpt_data = { static const struct imx_gpt_data imx6dl_gpt_data = {
.gpt_setup_tctl = imx6dl_gpt_setup_tctl, .gpt_setup_tctl = imx6dl_gpt_setup_tctl,
.set_next_event = v2_set_next_event,
}; };
static void __init _mxc_timer_init(struct imx_timer *imxtm) static void __init _mxc_timer_init(struct imx_timer *imxtm)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment