Merge remote-tracking branch 'korg_arm-soc/timer/cleanup' into cleanup
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
config CLKSRC_OF
|
||||
bool
|
||||
|
||||
config CLKSRC_I8253
|
||||
bool
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
obj-$(CONFIG_CLKSRC_OF) += clksrc-of.o
|
||||
obj-$(CONFIG_ATMEL_TCB_CLKSRC) += tcb_clksrc.o
|
||||
obj-$(CONFIG_X86_CYCLONE_TIMER) += cyclone.o
|
||||
obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o
|
||||
|
@@ -101,7 +101,7 @@ static struct of_device_id bcm2835_time_match[] __initconst = {
|
||||
{}
|
||||
};
|
||||
|
||||
static void __init bcm2835_time_init(void)
|
||||
void __init bcm2835_timer_init(void)
|
||||
{
|
||||
struct device_node *node;
|
||||
void __iomem *base;
|
||||
@@ -155,7 +155,3 @@ static void __init bcm2835_time_init(void)
|
||||
|
||||
pr_info("bcm2835: system timer (irq = %d)\n", irq);
|
||||
}
|
||||
|
||||
struct sys_timer bcm2835_timer = {
|
||||
.init = bcm2835_time_init,
|
||||
};
|
||||
|
35
drivers/clocksource/clksrc-of.c
Normal file
35
drivers/clocksource/clksrc-of.c
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
extern struct of_device_id __clksrc_of_table[];
|
||||
|
||||
static const struct of_device_id __clksrc_of_table_sentinel
|
||||
__used __section(__clksrc_of_table_end);
|
||||
|
||||
void __init clocksource_of_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
const struct of_device_id *match;
|
||||
void (*init_func)(void);
|
||||
|
||||
for_each_matching_node_and_match(np, __clksrc_of_table, &match) {
|
||||
init_func = match->data;
|
||||
init_func();
|
||||
}
|
||||
}
|
@@ -107,7 +107,7 @@ static const struct of_device_id osctimer_ids[] __initconst = {
|
||||
{},
|
||||
};
|
||||
|
||||
static void __init timer_init(void)
|
||||
void __init dw_apb_timer_init(void)
|
||||
{
|
||||
struct device_node *event_timer, *source_timer;
|
||||
|
||||
@@ -125,7 +125,3 @@ static void __init timer_init(void)
|
||||
|
||||
init_sched_clock();
|
||||
}
|
||||
|
||||
struct sys_timer dw_apb_timer = {
|
||||
.init = timer_init,
|
||||
};
|
||||
|
@@ -134,12 +134,32 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode,
|
||||
}
|
||||
}
|
||||
|
||||
void nmdk_clksrc_reset(void)
|
||||
{
|
||||
/* Disable */
|
||||
writel(0, mtu_base + MTU_CR(0));
|
||||
|
||||
/* ClockSource: configure load and background-load, and fire it up */
|
||||
writel(nmdk_cycle, mtu_base + MTU_LR(0));
|
||||
writel(nmdk_cycle, mtu_base + MTU_BGLR(0));
|
||||
|
||||
writel(clk_prescale | MTU_CRn_32BITS | MTU_CRn_ENA,
|
||||
mtu_base + MTU_CR(0));
|
||||
}
|
||||
|
||||
static void nmdk_clkevt_resume(struct clock_event_device *cedev)
|
||||
{
|
||||
nmdk_clkevt_reset();
|
||||
nmdk_clksrc_reset();
|
||||
}
|
||||
|
||||
static struct clock_event_device nmdk_clkevt = {
|
||||
.name = "mtu_1",
|
||||
.features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
|
||||
.rating = 200,
|
||||
.set_mode = nmdk_clkevt_mode,
|
||||
.set_next_event = nmdk_clkevt_next,
|
||||
.resume = nmdk_clkevt_resume,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -161,19 +181,6 @@ static struct irqaction nmdk_timer_irq = {
|
||||
.dev_id = &nmdk_clkevt,
|
||||
};
|
||||
|
||||
void nmdk_clksrc_reset(void)
|
||||
{
|
||||
/* Disable */
|
||||
writel(0, mtu_base + MTU_CR(0));
|
||||
|
||||
/* ClockSource: configure load and background-load, and fire it up */
|
||||
writel(nmdk_cycle, mtu_base + MTU_LR(0));
|
||||
writel(nmdk_cycle, mtu_base + MTU_BGLR(0));
|
||||
|
||||
writel(clk_prescale | MTU_CRn_32BITS | MTU_CRn_ENA,
|
||||
mtu_base + MTU_CR(0));
|
||||
}
|
||||
|
||||
void __init nmdk_timer_init(void __iomem *base, int irq)
|
||||
{
|
||||
unsigned long rate;
|
||||
|
@@ -104,7 +104,7 @@ static struct of_device_id sunxi_timer_dt_ids[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static void __init sunxi_timer_init(void)
|
||||
void __init sunxi_timer_init(void)
|
||||
{
|
||||
struct device_node *node;
|
||||
unsigned long rate = 0;
|
||||
@@ -165,7 +165,3 @@ static void __init sunxi_timer_init(void)
|
||||
|
||||
clockevents_register_device(&sunxi_clockevent);
|
||||
}
|
||||
|
||||
struct sys_timer sunxi_timer = {
|
||||
.init = sunxi_timer_init,
|
||||
};
|
||||
|
Reference in New Issue
Block a user