Lines Matching +full:msc313e +full:- +full:timer

1 // SPDX-License-Identifier: GPL-2.0
3 * MStar timer driver
24 #include "timer-of.h"
93 struct timer_of *timer = to_timer_of(evt); in msc313e_timer_clkevt_shutdown() local
95 msc313e_timer_stop(timer_of_base(timer)); in msc313e_timer_clkevt_shutdown()
102 struct timer_of *timer = to_timer_of(evt); in msc313e_timer_clkevt_set_oneshot() local
104 msc313e_timer_stop(timer_of_base(timer)); in msc313e_timer_clkevt_set_oneshot()
105 msc313e_timer_start(timer_of_base(timer), false); in msc313e_timer_clkevt_set_oneshot()
112 struct timer_of *timer = to_timer_of(evt); in msc313e_timer_clkevt_set_periodic() local
114 msc313e_timer_stop(timer_of_base(timer)); in msc313e_timer_clkevt_set_periodic()
115 msc313e_timer_setup(timer_of_base(timer), timer_of_period(timer)); in msc313e_timer_clkevt_set_periodic()
116 msc313e_timer_start(timer_of_base(timer), true); in msc313e_timer_clkevt_set_periodic()
123 struct timer_of *timer = to_timer_of(clkevt); in msc313e_timer_clkevt_next_event() local
125 msc313e_timer_stop(timer_of_base(timer)); in msc313e_timer_clkevt_next_event()
126 msc313e_timer_setup(timer_of_base(timer), evt); in msc313e_timer_clkevt_next_event()
127 msc313e_timer_start(timer_of_base(timer), false); in msc313e_timer_clkevt_next_event()
136 evt->event_handler(evt); in msc313e_timer_clkevt_irq()
143 return msc313e_timer_current_value(msc313e_clksrc) & cs->mask; in msc313e_timer_clksrc_read()
176 return -ENOMEM; in msc313e_clkevt_init()
178 to->flags = TIMER_OF_IRQ | TIMER_OF_CLOCK | TIMER_OF_BASE; in msc313e_clkevt_init()
179 to->of_irq.handler = msc313e_timer_clkevt_irq; in msc313e_clkevt_init()
184 if (of_device_is_compatible(np, "sstar,ssd20xd-timer")) { in msc313e_clkevt_init()
185 to->of_clk.rate = clk_get_rate(to->of_clk.clk) / MSC313E_CLK_DIVIDER; in msc313e_clkevt_init()
186 to->of_clk.period = DIV_ROUND_UP(to->of_clk.rate, HZ); in msc313e_clkevt_init()
187 writew(MSC313E_CLK_DIVIDER - 1, timer_of_base(to) + MSC313E_REG_TIMER_DIVIDE); in msc313e_clkevt_init()
191 msc313e_clkevt.irq = to->of_irq.irq; in msc313e_clkevt_init()
192 to->clkevt = msc313e_clkevt; in msc313e_clkevt_init()
194 clockevents_config_and_register(&to->clkevt, timer_of_rate(to), in msc313e_clkevt_init()
252 TIMER_OF_DECLARE(msc313, "mstar,msc313e-timer", msc313e_timer_init);
253 TIMER_OF_DECLARE(ssd20xd, "sstar,ssd20xd-timer", msc313e_timer_init);