Lines Matching refs:ttcce
386 struct ttc_timer_clockevent *ttcce = container_of(ttc, in ttc_rate_change_clockevent_cb() local
394 clockevents_update_freq(&ttcce->ce, ndata->new_rate / PRESCALE); in ttc_rate_change_clockevent_cb()
407 struct ttc_timer_clockevent *ttcce; in ttc_setup_clockevent() local
410 ttcce = kzalloc(sizeof(*ttcce), GFP_KERNEL); in ttc_setup_clockevent()
411 if (!ttcce) in ttc_setup_clockevent()
414 ttcce->ttc.clk = clk; in ttc_setup_clockevent()
416 err = clk_prepare_enable(ttcce->ttc.clk); in ttc_setup_clockevent()
420 ttcce->ttc.clk_rate_change_nb.notifier_call = in ttc_setup_clockevent()
422 ttcce->ttc.clk_rate_change_nb.next = NULL; in ttc_setup_clockevent()
424 err = clk_notifier_register(ttcce->ttc.clk, in ttc_setup_clockevent()
425 &ttcce->ttc.clk_rate_change_nb); in ttc_setup_clockevent()
431 ttcce->ttc.freq = clk_get_rate(ttcce->ttc.clk); in ttc_setup_clockevent()
433 ttcce->ttc.base_addr = base; in ttc_setup_clockevent()
434 ttcce->ce.name = "ttc_clockevent"; in ttc_setup_clockevent()
435 ttcce->ce.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; in ttc_setup_clockevent()
436 ttcce->ce.set_next_event = ttc_set_next_event; in ttc_setup_clockevent()
437 ttcce->ce.set_state_shutdown = ttc_shutdown; in ttc_setup_clockevent()
438 ttcce->ce.set_state_periodic = ttc_set_periodic; in ttc_setup_clockevent()
439 ttcce->ce.set_state_oneshot = ttc_shutdown; in ttc_setup_clockevent()
440 ttcce->ce.tick_resume = ttc_resume; in ttc_setup_clockevent()
441 ttcce->ce.rating = 200; in ttc_setup_clockevent()
442 ttcce->ce.irq = irq; in ttc_setup_clockevent()
443 ttcce->ce.cpumask = cpu_possible_mask; in ttc_setup_clockevent()
450 writel_relaxed(0x23, ttcce->ttc.base_addr + TTC_CNT_CNTRL_OFFSET); in ttc_setup_clockevent()
452 ttcce->ttc.base_addr + TTC_CLK_CNTRL_OFFSET); in ttc_setup_clockevent()
453 writel_relaxed(0x1, ttcce->ttc.base_addr + TTC_IER_OFFSET); in ttc_setup_clockevent()
456 IRQF_TIMER, ttcce->ce.name, ttcce); in ttc_setup_clockevent()
460 clockevents_config_and_register(&ttcce->ce, in ttc_setup_clockevent()
461 ttcce->ttc.freq / PRESCALE, 1, 0xfffe); in ttc_setup_clockevent()
466 kfree(ttcce); in ttc_setup_clockevent()