Lines Matching refs:to
52 struct timer_of *to = to_timer_of(clk); in mlb_timer_interrupt() local
55 val = readl_relaxed(timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS); in mlb_timer_interrupt()
57 writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS); in mlb_timer_interrupt()
64 static void mlb_evt_timer_start(struct timer_of *to, bool periodic) in mlb_evt_timer_start() argument
71 writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS); in mlb_evt_timer_start()
74 static void mlb_evt_timer_stop(struct timer_of *to) in mlb_evt_timer_stop() argument
76 u32 val = readl_relaxed(timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS); in mlb_evt_timer_stop()
79 writel_relaxed(val, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS); in mlb_evt_timer_stop()
82 static void mlb_evt_timer_register_count(struct timer_of *to, unsigned long cnt) in mlb_evt_timer_register_count() argument
84 writel_relaxed(cnt, timer_of_base(to) + MLB_TMR_EVT_TMRLR1_OFS); in mlb_evt_timer_register_count()
89 struct timer_of *to = to_timer_of(clk); in mlb_set_state_periodic() local
91 mlb_evt_timer_stop(to); in mlb_set_state_periodic()
92 mlb_evt_timer_register_count(to, to->of_clk.period); in mlb_set_state_periodic()
93 mlb_evt_timer_start(to, MLB_TIMER_PERIODIC); in mlb_set_state_periodic()
99 struct timer_of *to = to_timer_of(clk); in mlb_set_state_oneshot() local
101 mlb_evt_timer_stop(to); in mlb_set_state_oneshot()
102 mlb_evt_timer_start(to, MLB_TIMER_ONESHOT); in mlb_set_state_oneshot()
108 struct timer_of *to = to_timer_of(clk); in mlb_set_state_shutdown() local
110 mlb_evt_timer_stop(to); in mlb_set_state_shutdown()
117 struct timer_of *to = to_timer_of(clk); in mlb_clkevt_next_event() local
119 mlb_evt_timer_stop(to); in mlb_clkevt_next_event()
120 mlb_evt_timer_register_count(to, event); in mlb_clkevt_next_event()
121 mlb_evt_timer_start(to, MLB_TIMER_ONESHOT); in mlb_clkevt_next_event()
125 static int mlb_config_clock_source(struct timer_of *to) in mlb_config_clock_source() argument
129 writel_relaxed(val, timer_of_base(to) + MLB_TMR_SRC_TMCSR_OFS); in mlb_config_clock_source()
130 writel_relaxed(~0, timer_of_base(to) + MLB_TMR_SRC_TMRLR1_OFS); in mlb_config_clock_source()
131 writel_relaxed(~0, timer_of_base(to) + MLB_TMR_SRC_TMRLR2_OFS); in mlb_config_clock_source()
133 writel_relaxed(val, timer_of_base(to) + MLB_TMR_SRC_TMCSR_OFS); in mlb_config_clock_source()
137 static int mlb_config_clock_event(struct timer_of *to) in mlb_config_clock_event() argument
139 writel_relaxed(0, timer_of_base(to) + MLB_TMR_EVT_TMCSR_OFS); in mlb_config_clock_event()
143 static struct timer_of to = { variable
165 return ~readl_relaxed(timer_of_base(&to) + MLB_TMR_SRC_TMR_OFS); in mlb_timer_sched_read()
173 ret = timer_of_init(node, &to); in mlb_timer_init()
177 rate = timer_of_rate(&to) / MLB_TMR_DIV_CNT; in mlb_timer_init()
178 mlb_config_clock_source(&to); in mlb_timer_init()
179 clocksource_mmio_init(timer_of_base(&to) + MLB_TMR_SRC_TMR_OFS, in mlb_timer_init()
183 mlb_config_clock_event(&to); in mlb_timer_init()
184 clockevents_config_and_register(&to.clkevt, timer_of_rate(&to), 15, in mlb_timer_init()