Lines Matching refs:ttccs
242 struct ttc_timer_clocksource *ttccs = container_of(ttc, in ttc_rate_change_clocksource_cb() local
275 ttccs->scale_clk_ctrl_reg_old = in ttc_rate_change_clocksource_cb()
276 readl_relaxed(ttccs->ttc.base_addr + in ttc_rate_change_clocksource_cb()
279 psv = (ttccs->scale_clk_ctrl_reg_old & in ttc_rate_change_clocksource_cb()
291 ttccs->scale_clk_ctrl_reg_new = ttccs->scale_clk_ctrl_reg_old & in ttc_rate_change_clocksource_cb()
293 ttccs->scale_clk_ctrl_reg_new |= psv << TTC_CLK_CNTRL_PSV_SHIFT; in ttc_rate_change_clocksource_cb()
301 writel_relaxed(ttccs->scale_clk_ctrl_reg_new, in ttc_rate_change_clocksource_cb()
302 ttccs->ttc.base_addr + TTC_CLK_CNTRL_OFFSET); in ttc_rate_change_clocksource_cb()
311 writel_relaxed(ttccs->scale_clk_ctrl_reg_new, in ttc_rate_change_clocksource_cb()
312 ttccs->ttc.base_addr + TTC_CLK_CNTRL_OFFSET); in ttc_rate_change_clocksource_cb()
321 writel_relaxed(ttccs->scale_clk_ctrl_reg_old, in ttc_rate_change_clocksource_cb()
322 ttccs->ttc.base_addr + TTC_CLK_CNTRL_OFFSET); in ttc_rate_change_clocksource_cb()
334 struct ttc_timer_clocksource *ttccs; in ttc_setup_clocksource() local
337 ttccs = kzalloc(sizeof(*ttccs), GFP_KERNEL); in ttc_setup_clocksource()
338 if (!ttccs) in ttc_setup_clocksource()
341 ttccs->ttc.clk = clk; in ttc_setup_clocksource()
343 err = clk_prepare_enable(ttccs->ttc.clk); in ttc_setup_clocksource()
345 kfree(ttccs); in ttc_setup_clocksource()
349 ttccs->ttc.freq = clk_get_rate(ttccs->ttc.clk); in ttc_setup_clocksource()
351 ttccs->ttc.clk_rate_change_nb.notifier_call = in ttc_setup_clocksource()
353 ttccs->ttc.clk_rate_change_nb.next = NULL; in ttc_setup_clocksource()
355 err = clk_notifier_register(ttccs->ttc.clk, in ttc_setup_clocksource()
356 &ttccs->ttc.clk_rate_change_nb); in ttc_setup_clocksource()
360 ttccs->ttc.base_addr = base; in ttc_setup_clocksource()
361 ttccs->cs.name = "ttc_clocksource"; in ttc_setup_clocksource()
362 ttccs->cs.rating = 200; in ttc_setup_clocksource()
363 ttccs->cs.read = __ttc_clocksource_read; in ttc_setup_clocksource()
364 ttccs->cs.mask = CLOCKSOURCE_MASK(timer_width); in ttc_setup_clocksource()
365 ttccs->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS; in ttc_setup_clocksource()
372 writel_relaxed(0x0, ttccs->ttc.base_addr + TTC_IER_OFFSET); in ttc_setup_clocksource()
374 ttccs->ttc.base_addr + TTC_CLK_CNTRL_OFFSET); in ttc_setup_clocksource()
376 ttccs->ttc.base_addr + TTC_CNT_CNTRL_OFFSET); in ttc_setup_clocksource()
378 err = clocksource_register_hz(&ttccs->cs, ttccs->ttc.freq / PRESCALE); in ttc_setup_clocksource()
380 kfree(ttccs); in ttc_setup_clocksource()
386 ttccs->ttc.freq / PRESCALE); in ttc_setup_clocksource()