Lines Matching refs:tmr
95 struct ixp4xx_timer *tmr = dev_id; in ixp4xx_timer_interrupt() local
96 struct clock_event_device *evt = &tmr->clkevt; in ixp4xx_timer_interrupt()
100 tmr->base + IXP4XX_OSST_OFFSET); in ixp4xx_timer_interrupt()
110 struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt); in ixp4xx_set_next_event() local
113 val = __raw_readl(tmr->base + IXP4XX_OSRT1_OFFSET); in ixp4xx_set_next_event()
117 tmr->base + IXP4XX_OSRT1_OFFSET); in ixp4xx_set_next_event()
124 struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt); in ixp4xx_shutdown() local
127 val = __raw_readl(tmr->base + IXP4XX_OSRT1_OFFSET); in ixp4xx_shutdown()
129 __raw_writel(val, tmr->base + IXP4XX_OSRT1_OFFSET); in ixp4xx_shutdown()
136 struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt); in ixp4xx_set_oneshot() local
139 tmr->base + IXP4XX_OSRT1_OFFSET); in ixp4xx_set_oneshot()
146 struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt); in ixp4xx_set_periodic() local
149 val = tmr->latch & ~IXP4XX_OST_RELOAD_MASK; in ixp4xx_set_periodic()
151 __raw_writel(val, tmr->base + IXP4XX_OSRT1_OFFSET); in ixp4xx_set_periodic()
158 struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt); in ixp4xx_resume() local
161 val = __raw_readl(tmr->base + IXP4XX_OSRT1_OFFSET); in ixp4xx_resume()
163 __raw_writel(val, tmr->base + IXP4XX_OSRT1_OFFSET); in ixp4xx_resume()
177 struct ixp4xx_timer *tmr; in ixp4xx_timer_register() local
180 tmr = kzalloc(sizeof(*tmr), GFP_KERNEL); in ixp4xx_timer_register()
181 if (!tmr) in ixp4xx_timer_register()
183 tmr->base = base; in ixp4xx_timer_register()
184 tmr->tick_rate = timer_freq; in ixp4xx_timer_register()
192 tmr->latch = DIV_ROUND_CLOSEST(timer_freq, in ixp4xx_timer_register()
196 local_ixp4xx_timer = tmr; in ixp4xx_timer_register()
199 __raw_writel(0, tmr->base + IXP4XX_OSRT1_OFFSET); in ixp4xx_timer_register()
203 tmr->base + IXP4XX_OSST_OFFSET); in ixp4xx_timer_register()
206 __raw_writel(0, tmr->base + IXP4XX_OSTS_OFFSET); in ixp4xx_timer_register()
211 tmr->clkevt.name = "ixp4xx timer1"; in ixp4xx_timer_register()
212 tmr->clkevt.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; in ixp4xx_timer_register()
213 tmr->clkevt.rating = 200; in ixp4xx_timer_register()
214 tmr->clkevt.set_state_shutdown = ixp4xx_shutdown; in ixp4xx_timer_register()
215 tmr->clkevt.set_state_periodic = ixp4xx_set_periodic; in ixp4xx_timer_register()
216 tmr->clkevt.set_state_oneshot = ixp4xx_set_oneshot; in ixp4xx_timer_register()
217 tmr->clkevt.tick_resume = ixp4xx_resume; in ixp4xx_timer_register()
218 tmr->clkevt.set_next_event = ixp4xx_set_next_event; in ixp4xx_timer_register()
219 tmr->clkevt.cpumask = cpumask_of(0); in ixp4xx_timer_register()
220 tmr->clkevt.irq = timer_irq; in ixp4xx_timer_register()
222 IRQF_TIMER, "IXP4XX-TIMER1", tmr); in ixp4xx_timer_register()
227 clockevents_config_and_register(&tmr->clkevt, timer_freq, in ixp4xx_timer_register()
234 tmr->delay_timer.read_current_timer = ixp4xx_read_timer; in ixp4xx_timer_register()
235 tmr->delay_timer.freq = timer_freq; in ixp4xx_timer_register()
236 register_current_timer_delay(&tmr->delay_timer); in ixp4xx_timer_register()