mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Merge branch 'clockevents/4.8' of http://git.linaro.org/people/daniel.lezcano/linux into timers/core
Pull the clockevents/clocksource tree from Daniel Lezcano:
- Convert the clocksource-probe init functions to return a value in order to
prepare the consolidation of the drivers using the DT. It is a big patchset
but went through 01.org (kbuild bot), linux next and kernel-ci (continuous
integration) (Daniel Lezcano)
- Fix a bad error handling by returning the right value for cadence_ttc
(Christophe Jaillet)
- Fix typo in the Kconfig for the Samsung pwm (Alexandre Belloni)
- Change functions to static for armada-370-xp and digicolor (Ben Dooks)
- Add support for the rk3399 SoC timer by adding bindings and a slight
change in the base address. Take the opportunity to add the DYNIRQ flag
(Huang Tao)
- Fix endian accessors for the Samsung pwm timer (Matthew Leach)
- Add Oxford Semiconductor RPS Dual Timer driver (Neil Armstrong)
- Add a kernel parameter to swich on/off the event stream feature of the arch
arm timer (Will Deacon)
This commit is contained in:
commit
3d93f42d44
79 changed files with 1628 additions and 621 deletions
|
|
@ -170,7 +170,7 @@ static struct irqaction timer_irqaction = {
|
|||
.dev_id = &clockevent_xilinx_timer,
|
||||
};
|
||||
|
||||
static __init void xilinx_clockevent_init(void)
|
||||
static __init int xilinx_clockevent_init(void)
|
||||
{
|
||||
clockevent_xilinx_timer.mult =
|
||||
div_sc(timer_clock_freq, NSEC_PER_SEC,
|
||||
|
|
@ -181,6 +181,8 @@ static __init void xilinx_clockevent_init(void)
|
|||
clockevent_delta2ns(1, &clockevent_xilinx_timer);
|
||||
clockevent_xilinx_timer.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&clockevent_xilinx_timer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u64 xilinx_clock_read(void)
|
||||
|
|
@ -229,8 +231,14 @@ static struct clocksource clocksource_microblaze = {
|
|||
|
||||
static int __init xilinx_clocksource_init(void)
|
||||
{
|
||||
if (clocksource_register_hz(&clocksource_microblaze, timer_clock_freq))
|
||||
panic("failed to register clocksource");
|
||||
int ret;
|
||||
|
||||
ret = clocksource_register_hz(&clocksource_microblaze,
|
||||
timer_clock_freq);
|
||||
if (ret) {
|
||||
pr_err("failed to register clocksource");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* stop timer1 */
|
||||
write_fn(read_fn(timer_baseaddr + TCSR1) & ~TCSR_ENT,
|
||||
|
|
@ -239,16 +247,16 @@ static int __init xilinx_clocksource_init(void)
|
|||
write_fn(TCSR_TINT|TCSR_ENT|TCSR_ARHT, timer_baseaddr + TCSR1);
|
||||
|
||||
/* register timecounter - for ftrace support */
|
||||
init_xilinx_timecounter();
|
||||
return 0;
|
||||
return init_xilinx_timecounter();
|
||||
}
|
||||
|
||||
static void __init xilinx_timer_init(struct device_node *timer)
|
||||
static int __init xilinx_timer_init(struct device_node *timer)
|
||||
{
|
||||
struct clk *clk;
|
||||
static int initialized;
|
||||
u32 irq;
|
||||
u32 timer_num = 1;
|
||||
int ret;
|
||||
|
||||
if (initialized)
|
||||
return;
|
||||
|
|
@ -258,7 +266,7 @@ static void __init xilinx_timer_init(struct device_node *timer)
|
|||
timer_baseaddr = of_iomap(timer, 0);
|
||||
if (!timer_baseaddr) {
|
||||
pr_err("ERROR: invalid timer base address\n");
|
||||
BUG();
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
write_fn = timer_write32;
|
||||
|
|
@ -271,11 +279,15 @@ static void __init xilinx_timer_init(struct device_node *timer)
|
|||
}
|
||||
|
||||
irq = irq_of_parse_and_map(timer, 0);
|
||||
if (irq <= 0) {
|
||||
pr_err("Failed to parse and map irq");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
of_property_read_u32(timer, "xlnx,one-timer-only", &timer_num);
|
||||
if (timer_num) {
|
||||
pr_emerg("Please enable two timers in HW\n");
|
||||
BUG();
|
||||
pr_err("Please enable two timers in HW\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pr_info("%s: irq=%d\n", timer->full_name, irq);
|
||||
|
|
@ -297,14 +309,27 @@ static void __init xilinx_timer_init(struct device_node *timer)
|
|||
|
||||
freq_div_hz = timer_clock_freq / HZ;
|
||||
|
||||
setup_irq(irq, &timer_irqaction);
|
||||
ret = setup_irq(irq, &timer_irqaction);
|
||||
if (ret) {
|
||||
pr_err("Failed to setup IRQ");
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HEART_BEAT
|
||||
microblaze_setup_heartbeat();
|
||||
#endif
|
||||
xilinx_clocksource_init();
|
||||
xilinx_clockevent_init();
|
||||
|
||||
ret = xilinx_clocksource_init();
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = xilinx_clockevent_init();
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
sched_clock_register(xilinx_clock_read, 32, timer_clock_freq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
CLOCKSOURCE_OF_DECLARE(xilinx_timer, "xlnx,xps-timer-1.00.a",
|
||||
|
|
|
|||
Loading…
Reference in a new issue