Lines Matching full:timer

33 #include <clocksource/timer-ti-dm.h>
36 * timer errata flags
40 * timer counter register is never read. For more details please refer to
157 * dmtimer_read - read timer registers in posted and non-posted mode
158 * @timer: timer pointer over which read operation to perform
165 static inline u32 dmtimer_read(struct dmtimer *timer, u32 reg) in dmtimer_read() argument
173 if (wp && timer->posted) in dmtimer_read()
174 while (readl_relaxed(timer->pend) & wp) in dmtimer_read()
177 return readl_relaxed(timer->func_base + offset); in dmtimer_read()
181 * dmtimer_write - write timer registers in posted and non-posted mode
182 * @timer: timer pointer over which write operation is to perform
190 static inline void dmtimer_write(struct dmtimer *timer, u32 reg, u32 val) in dmtimer_write() argument
198 if (wp && timer->posted) in dmtimer_write()
199 while (readl_relaxed(timer->pend) & wp) in dmtimer_write()
202 writel_relaxed(val, timer->func_base + offset); in dmtimer_write()
205 static inline void __omap_dm_timer_init_regs(struct dmtimer *timer) in __omap_dm_timer_init_regs() argument
210 tidr = readl_relaxed(timer->io_base); in __omap_dm_timer_init_regs()
212 timer->revision = 1; in __omap_dm_timer_init_regs()
213 timer->irq_stat = OMAP_TIMER_V1_STAT_OFFSET; in __omap_dm_timer_init_regs()
214 timer->irq_ena = OMAP_TIMER_V1_INT_EN_OFFSET; in __omap_dm_timer_init_regs()
215 timer->irq_dis = OMAP_TIMER_V1_INT_EN_OFFSET; in __omap_dm_timer_init_regs()
216 timer->pend = timer->io_base + _OMAP_TIMER_WRITE_PEND_OFFSET; in __omap_dm_timer_init_regs()
217 timer->func_base = timer->io_base; in __omap_dm_timer_init_regs()
219 timer->revision = 2; in __omap_dm_timer_init_regs()
220 timer->irq_stat = OMAP_TIMER_V2_IRQSTATUS - OMAP_TIMER_V2_FUNC_OFFSET; in __omap_dm_timer_init_regs()
221 timer->irq_ena = OMAP_TIMER_V2_IRQENABLE_SET - OMAP_TIMER_V2_FUNC_OFFSET; in __omap_dm_timer_init_regs()
222 timer->irq_dis = OMAP_TIMER_V2_IRQENABLE_CLR - OMAP_TIMER_V2_FUNC_OFFSET; in __omap_dm_timer_init_regs()
223 timer->pend = timer->io_base + in __omap_dm_timer_init_regs()
226 timer->func_base = timer->io_base + OMAP_TIMER_V2_FUNC_OFFSET; in __omap_dm_timer_init_regs()
232 * @timer: pointer to timer instance handle
234 * Enables the write posted mode for the timer. When posted mode is enabled
235 * writes to certain timer registers are immediately acknowledged by the
238 * timer registers.
240 static inline void __omap_dm_timer_enable_posted(struct dmtimer *timer) in __omap_dm_timer_enable_posted() argument
242 if (timer->posted) in __omap_dm_timer_enable_posted()
245 if (timer->errata & OMAP_TIMER_ERRATA_I103_I767) { in __omap_dm_timer_enable_posted()
246 timer->posted = OMAP_TIMER_NONPOSTED; in __omap_dm_timer_enable_posted()
247 dmtimer_write(timer, OMAP_TIMER_IF_CTRL_REG, 0); in __omap_dm_timer_enable_posted()
251 dmtimer_write(timer, OMAP_TIMER_IF_CTRL_REG, OMAP_TIMER_CTRL_POSTED); in __omap_dm_timer_enable_posted()
252 timer->context.tsicr = OMAP_TIMER_CTRL_POSTED; in __omap_dm_timer_enable_posted()
253 timer->posted = OMAP_TIMER_POSTED; in __omap_dm_timer_enable_posted()
256 static inline void __omap_dm_timer_stop(struct dmtimer *timer, in __omap_dm_timer_stop() argument
261 l = dmtimer_read(timer, OMAP_TIMER_CTRL_REG); in __omap_dm_timer_stop()
264 dmtimer_write(timer, OMAP_TIMER_CTRL_REG, l); in __omap_dm_timer_stop()
267 dmtimer_read(timer, OMAP_TIMER_CTRL_REG); in __omap_dm_timer_stop()
270 * timer is stopped in __omap_dm_timer_stop()
277 dmtimer_write(timer, timer->irq_stat, OMAP_TIMER_INT_OVERFLOW); in __omap_dm_timer_stop()
280 static inline void __omap_dm_timer_int_enable(struct dmtimer *timer, in __omap_dm_timer_int_enable() argument
283 dmtimer_write(timer, timer->irq_ena, value); in __omap_dm_timer_int_enable()
284 dmtimer_write(timer, OMAP_TIMER_WAKEUP_EN_REG, value); in __omap_dm_timer_int_enable()
288 __omap_dm_timer_read_counter(struct dmtimer *timer) in __omap_dm_timer_read_counter() argument
290 return dmtimer_read(timer, OMAP_TIMER_COUNTER_REG); in __omap_dm_timer_read_counter()
293 static inline void __omap_dm_timer_write_status(struct dmtimer *timer, in __omap_dm_timer_write_status() argument
296 dmtimer_write(timer, timer->irq_stat, value); in __omap_dm_timer_write_status()
299 static void omap_timer_restore_context(struct dmtimer *timer) in omap_timer_restore_context() argument
301 dmtimer_write(timer, OMAP_TIMER_OCP_CFG_OFFSET, timer->context.ocp_cfg); in omap_timer_restore_context()
303 dmtimer_write(timer, OMAP_TIMER_WAKEUP_EN_REG, timer->context.twer); in omap_timer_restore_context()
304 dmtimer_write(timer, OMAP_TIMER_COUNTER_REG, timer->context.tcrr); in omap_timer_restore_context()
305 dmtimer_write(timer, OMAP_TIMER_LOAD_REG, timer->context.tldr); in omap_timer_restore_context()
306 dmtimer_write(timer, OMAP_TIMER_MATCH_REG, timer->context.tmar); in omap_timer_restore_context()
307 dmtimer_write(timer, OMAP_TIMER_IF_CTRL_REG, timer->context.tsicr); in omap_timer_restore_context()
308 dmtimer_write(timer, timer->irq_ena, timer->context.tier); in omap_timer_restore_context()
309 dmtimer_write(timer, OMAP_TIMER_CTRL_REG, timer->context.tclr); in omap_timer_restore_context()
312 static void omap_timer_save_context(struct dmtimer *timer) in omap_timer_save_context() argument
314 timer->context.ocp_cfg = dmtimer_read(timer, OMAP_TIMER_OCP_CFG_OFFSET); in omap_timer_save_context()
316 timer->context.tclr = dmtimer_read(timer, OMAP_TIMER_CTRL_REG); in omap_timer_save_context()
317 timer->context.twer = dmtimer_read(timer, OMAP_TIMER_WAKEUP_EN_REG); in omap_timer_save_context()
318 timer->context.tldr = dmtimer_read(timer, OMAP_TIMER_LOAD_REG); in omap_timer_save_context()
319 timer->context.tmar = dmtimer_read(timer, OMAP_TIMER_MATCH_REG); in omap_timer_save_context()
320 timer->context.tier = dmtimer_read(timer, timer->irq_ena); in omap_timer_save_context()
321 timer->context.tsicr = dmtimer_read(timer, OMAP_TIMER_IF_CTRL_REG); in omap_timer_save_context()
327 struct dmtimer *timer; in omap_timer_context_notifier() local
329 timer = container_of(nb, struct dmtimer, nb); in omap_timer_context_notifier()
333 if ((timer->capability & OMAP_TIMER_ALWON) || in omap_timer_context_notifier()
334 !atomic_read(&timer->enabled)) in omap_timer_context_notifier()
336 omap_timer_save_context(timer); in omap_timer_context_notifier()
341 if ((timer->capability & OMAP_TIMER_ALWON) || in omap_timer_context_notifier()
342 !atomic_read(&timer->enabled)) in omap_timer_context_notifier()
344 omap_timer_restore_context(timer); in omap_timer_context_notifier()
351 static int omap_dm_timer_reset(struct dmtimer *timer) in omap_dm_timer_reset() argument
355 if (timer->revision != 1) in omap_dm_timer_reset()
358 dmtimer_write(timer, OMAP_TIMER_IF_CTRL_REG, 0x06); in omap_dm_timer_reset()
361 l = dmtimer_read(timer, OMAP_TIMER_V1_SYS_STAT_OFFSET); in omap_dm_timer_reset()
365 dev_err(&timer->pdev->dev, "Timer failed to reset\n"); in omap_dm_timer_reset()
369 /* Configure timer for smart-idle mode */ in omap_dm_timer_reset()
370 l = dmtimer_read(timer, OMAP_TIMER_OCP_CFG_OFFSET); in omap_dm_timer_reset()
372 dmtimer_write(timer, OMAP_TIMER_OCP_CFG_OFFSET, l); in omap_dm_timer_reset()
374 timer->posted = 0; in omap_dm_timer_reset()
399 struct dmtimer *timer; in omap_dm_timer_set_source() local
401 timer = to_dmtimer(cookie); in omap_dm_timer_set_source()
402 if (unlikely(!timer) || IS_ERR(timer->fclk)) in omap_dm_timer_set_source()
419 pdata = timer->pdev->dev.platform_data; in omap_dm_timer_set_source()
426 if (timer->omap1 && pdata && pdata->set_timer_src) in omap_dm_timer_set_source()
427 return pdata->set_timer_src(timer->pdev, source); in omap_dm_timer_set_source()
431 if (clk_hw_get_num_parents(__clk_get_hw(timer->fclk)) < 2) in omap_dm_timer_set_source()
435 parent = clk_get(&timer->pdev->dev, parent_name); in omap_dm_timer_set_source()
441 ret = clk_set_parent(timer->fclk, parent); in omap_dm_timer_set_source()
453 struct dmtimer *timer = to_dmtimer(cookie); in omap_dm_timer_enable() local
454 struct device *dev = &timer->pdev->dev; in omap_dm_timer_enable()
459 dev_err(dev, "could not enable timer\n"); in omap_dm_timer_enable()
464 struct dmtimer *timer = to_dmtimer(cookie); in omap_dm_timer_disable() local
465 struct device *dev = &timer->pdev->dev; in omap_dm_timer_disable()
470 static int omap_dm_timer_prepare(struct dmtimer *timer) in omap_dm_timer_prepare() argument
472 struct device *dev = &timer->pdev->dev; in omap_dm_timer_prepare()
479 if (timer->capability & OMAP_TIMER_NEEDS_RESET) { in omap_dm_timer_prepare()
480 rc = omap_dm_timer_reset(timer); in omap_dm_timer_prepare()
487 __omap_dm_timer_enable_posted(timer); in omap_dm_timer_prepare()
500 struct dmtimer *timer = NULL, *t; in _omap_dm_timer_request() local
529 timer = t; in _omap_dm_timer_request()
530 timer->reserved = 1; in _omap_dm_timer_request()
537 * If timer is not NULL, we have already found in _omap_dm_timer_request()
538 * one timer. But it was not an exact match in _omap_dm_timer_request()
541 * timer found and see if this one is a better in _omap_dm_timer_request()
544 if (timer) in _omap_dm_timer_request()
545 timer->reserved = 0; in _omap_dm_timer_request()
546 timer = t; in _omap_dm_timer_request()
547 timer->reserved = 1; in _omap_dm_timer_request()
556 timer = t; in _omap_dm_timer_request()
557 timer->reserved = 1; in _omap_dm_timer_request()
563 timer = t; in _omap_dm_timer_request()
564 timer->reserved = 1; in _omap_dm_timer_request()
571 if (timer && omap_dm_timer_prepare(timer)) { in _omap_dm_timer_request()
572 timer->reserved = 0; in _omap_dm_timer_request()
573 timer = NULL; in _omap_dm_timer_request()
576 if (!timer) in _omap_dm_timer_request()
577 pr_debug("%s: timer request failed!\n", __func__); in _omap_dm_timer_request()
579 return timer; in _omap_dm_timer_request()
584 struct dmtimer *timer; in omap_dm_timer_request() local
586 timer = _omap_dm_timer_request(REQUEST_ANY, NULL); in omap_dm_timer_request()
587 if (!timer) in omap_dm_timer_request()
590 return &timer->cookie; in omap_dm_timer_request()
595 struct dmtimer *timer; in omap_dm_timer_request_specific() local
597 /* Requesting timer by ID is not supported when device tree is used */ in omap_dm_timer_request_specific()
604 timer = _omap_dm_timer_request(REQUEST_BY_ID, &id); in omap_dm_timer_request_specific()
605 if (!timer) in omap_dm_timer_request_specific()
608 return &timer->cookie; in omap_dm_timer_request_specific()
612 * omap_dm_timer_request_by_node - Request a timer by device-tree node
613 * @np: Pointer to device-tree timer node
615 * Request a timer based upon a device node pointer. Returns pointer to
616 * timer handle on success and a NULL pointer on failure.
620 struct dmtimer *timer; in omap_dm_timer_request_by_node() local
625 timer = _omap_dm_timer_request(REQUEST_BY_NODE, np); in omap_dm_timer_request_by_node()
626 if (!timer) in omap_dm_timer_request_by_node()
629 return &timer->cookie; in omap_dm_timer_request_by_node()
634 struct dmtimer *timer; in omap_dm_timer_free() local
638 timer = to_dmtimer(cookie); in omap_dm_timer_free()
639 if (unlikely(!timer)) in omap_dm_timer_free()
642 WARN_ON(!timer->reserved); in omap_dm_timer_free()
643 timer->reserved = 0; in omap_dm_timer_free()
645 dev = &timer->pdev->dev; in omap_dm_timer_free()
650 /* Clear timer configuration */ in omap_dm_timer_free()
651 dmtimer_write(timer, OMAP_TIMER_CTRL_REG, 0); in omap_dm_timer_free()
660 struct dmtimer *timer = to_dmtimer(cookie); in omap_dm_timer_get_irq() local
661 if (timer) in omap_dm_timer_get_irq()
662 return timer->irq; in omap_dm_timer_get_irq()
681 struct dmtimer *timer = NULL; in omap_dm_timer_modify_idlect_mask() local
688 /* If any active timer is using ARMXOR return modified mask */ in omap_dm_timer_modify_idlect_mask()
690 list_for_each_entry(timer, &omap_timer_list, node) { in omap_dm_timer_modify_idlect_mask()
693 l = dmtimer_read(timer, OMAP_TIMER_CTRL_REG); in omap_dm_timer_modify_idlect_mask()
711 struct dmtimer *timer = to_dmtimer(cookie); in omap_dm_timer_get_fclk() local
713 if (timer && !IS_ERR(timer->fclk)) in omap_dm_timer_get_fclk()
714 return timer->fclk; in omap_dm_timer_get_fclk()
729 struct dmtimer *timer; in omap_dm_timer_start() local
734 timer = to_dmtimer(cookie); in omap_dm_timer_start()
735 if (unlikely(!timer)) in omap_dm_timer_start()
738 dev = &timer->pdev->dev; in omap_dm_timer_start()
744 l = dmtimer_read(timer, OMAP_TIMER_CTRL_REG); in omap_dm_timer_start()
747 dmtimer_write(timer, OMAP_TIMER_CTRL_REG, l); in omap_dm_timer_start()
755 struct dmtimer *timer; in omap_dm_timer_stop() local
759 timer = to_dmtimer(cookie); in omap_dm_timer_stop()
760 if (unlikely(!timer)) in omap_dm_timer_stop()
763 dev = &timer->pdev->dev; in omap_dm_timer_stop()
765 if (!timer->omap1) in omap_dm_timer_stop()
766 rate = clk_get_rate(timer->fclk); in omap_dm_timer_stop()
768 __omap_dm_timer_stop(timer, rate); in omap_dm_timer_stop()
778 struct dmtimer *timer; in omap_dm_timer_set_load() local
782 timer = to_dmtimer(cookie); in omap_dm_timer_set_load()
783 if (unlikely(!timer)) in omap_dm_timer_set_load()
786 dev = &timer->pdev->dev; in omap_dm_timer_set_load()
791 dmtimer_write(timer, OMAP_TIMER_LOAD_REG, load); in omap_dm_timer_set_load()
801 struct dmtimer *timer; in omap_dm_timer_set_match() local
806 timer = to_dmtimer(cookie); in omap_dm_timer_set_match()
807 if (unlikely(!timer)) in omap_dm_timer_set_match()
810 dev = &timer->pdev->dev; in omap_dm_timer_set_match()
815 l = dmtimer_read(timer, OMAP_TIMER_CTRL_REG); in omap_dm_timer_set_match()
820 dmtimer_write(timer, OMAP_TIMER_MATCH_REG, match); in omap_dm_timer_set_match()
821 dmtimer_write(timer, OMAP_TIMER_CTRL_REG, l); in omap_dm_timer_set_match()
831 struct dmtimer *timer; in omap_dm_timer_set_pwm() local
836 timer = to_dmtimer(cookie); in omap_dm_timer_set_pwm()
837 if (unlikely(!timer)) in omap_dm_timer_set_pwm()
840 dev = &timer->pdev->dev; in omap_dm_timer_set_pwm()
845 l = dmtimer_read(timer, OMAP_TIMER_CTRL_REG); in omap_dm_timer_set_pwm()
855 dmtimer_write(timer, OMAP_TIMER_CTRL_REG, l); in omap_dm_timer_set_pwm()
864 struct dmtimer *timer; in omap_dm_timer_get_pwm_status() local
869 timer = to_dmtimer(cookie); in omap_dm_timer_get_pwm_status()
870 if (unlikely(!timer)) in omap_dm_timer_get_pwm_status()
873 dev = &timer->pdev->dev; in omap_dm_timer_get_pwm_status()
878 l = dmtimer_read(timer, OMAP_TIMER_CTRL_REG); in omap_dm_timer_get_pwm_status()
888 struct dmtimer *timer; in omap_dm_timer_set_prescaler() local
893 timer = to_dmtimer(cookie); in omap_dm_timer_set_prescaler()
894 if (unlikely(!timer) || prescaler < -1 || prescaler > 7) in omap_dm_timer_set_prescaler()
897 dev = &timer->pdev->dev; in omap_dm_timer_set_prescaler()
902 l = dmtimer_read(timer, OMAP_TIMER_CTRL_REG); in omap_dm_timer_set_prescaler()
908 dmtimer_write(timer, OMAP_TIMER_CTRL_REG, l); in omap_dm_timer_set_prescaler()
918 struct dmtimer *timer; in omap_dm_timer_set_int_enable() local
922 timer = to_dmtimer(cookie); in omap_dm_timer_set_int_enable()
923 if (unlikely(!timer)) in omap_dm_timer_set_int_enable()
926 dev = &timer->pdev->dev; in omap_dm_timer_set_int_enable()
931 __omap_dm_timer_int_enable(timer, value); in omap_dm_timer_set_int_enable()
939 * omap_dm_timer_set_int_disable - disable timer interrupts
940 * @timer: pointer to timer handle
943 * Disables the specified timer interrupts for a timer.
947 struct dmtimer *timer; in omap_dm_timer_set_int_disable() local
952 timer = to_dmtimer(cookie); in omap_dm_timer_set_int_disable()
953 if (unlikely(!timer)) in omap_dm_timer_set_int_disable()
956 dev = &timer->pdev->dev; in omap_dm_timer_set_int_disable()
961 if (timer->revision == 1) in omap_dm_timer_set_int_disable()
962 l = dmtimer_read(timer, timer->irq_ena) & ~mask; in omap_dm_timer_set_int_disable()
964 dmtimer_write(timer, timer->irq_dis, l); in omap_dm_timer_set_int_disable()
965 l = dmtimer_read(timer, OMAP_TIMER_WAKEUP_EN_REG) & ~mask; in omap_dm_timer_set_int_disable()
966 dmtimer_write(timer, OMAP_TIMER_WAKEUP_EN_REG, l); in omap_dm_timer_set_int_disable()
975 struct dmtimer *timer; in omap_dm_timer_read_status() local
978 timer = to_dmtimer(cookie); in omap_dm_timer_read_status()
979 if (unlikely(!timer || !atomic_read(&timer->enabled))) { in omap_dm_timer_read_status()
980 pr_err("%s: timer not available or enabled.\n", __func__); in omap_dm_timer_read_status()
984 l = dmtimer_read(timer, timer->irq_stat); in omap_dm_timer_read_status()
991 struct dmtimer *timer; in omap_dm_timer_write_status() local
993 timer = to_dmtimer(cookie); in omap_dm_timer_write_status()
994 if (unlikely(!timer || !atomic_read(&timer->enabled))) in omap_dm_timer_write_status()
997 __omap_dm_timer_write_status(timer, value); in omap_dm_timer_write_status()
1004 struct dmtimer *timer; in omap_dm_timer_read_counter() local
1006 timer = to_dmtimer(cookie); in omap_dm_timer_read_counter()
1007 if (unlikely(!timer || !atomic_read(&timer->enabled))) { in omap_dm_timer_read_counter()
1008 pr_err("%s: timer not iavailable or enabled.\n", __func__); in omap_dm_timer_read_counter()
1012 return __omap_dm_timer_read_counter(timer); in omap_dm_timer_read_counter()
1017 struct dmtimer *timer; in omap_dm_timer_write_counter() local
1019 timer = to_dmtimer(cookie); in omap_dm_timer_write_counter()
1020 if (unlikely(!timer || !atomic_read(&timer->enabled))) { in omap_dm_timer_write_counter()
1021 pr_err("%s: timer not available or enabled.\n", __func__); in omap_dm_timer_write_counter()
1025 dmtimer_write(timer, OMAP_TIMER_COUNTER_REG, value); in omap_dm_timer_write_counter()
1028 timer->context.tcrr = value; in omap_dm_timer_write_counter()
1034 struct dmtimer *timer = dev_get_drvdata(dev); in omap_dm_timer_runtime_suspend() local
1036 atomic_set(&timer->enabled, 0); in omap_dm_timer_runtime_suspend()
1038 if (timer->capability & OMAP_TIMER_ALWON || !timer->func_base) in omap_dm_timer_runtime_suspend()
1041 omap_timer_save_context(timer); in omap_dm_timer_runtime_suspend()
1048 struct dmtimer *timer = dev_get_drvdata(dev); in omap_dm_timer_runtime_resume() local
1050 if (!(timer->capability & OMAP_TIMER_ALWON) && timer->func_base) in omap_dm_timer_runtime_resume()
1051 omap_timer_restore_context(timer); in omap_dm_timer_runtime_resume()
1053 atomic_set(&timer->enabled, 1); in omap_dm_timer_runtime_resume()
1067 * @pdev: pointer to current timer platform device
1070 * timer devices.
1075 struct dmtimer *timer; in omap_dm_timer_probe() local
1091 timer = devm_kzalloc(dev, sizeof(*timer), GFP_KERNEL); in omap_dm_timer_probe()
1092 if (!timer) in omap_dm_timer_probe()
1095 timer->irq = platform_get_irq(pdev, 0); in omap_dm_timer_probe()
1096 if (timer->irq < 0) in omap_dm_timer_probe()
1097 return timer->irq; in omap_dm_timer_probe()
1099 timer->io_base = devm_platform_ioremap_resource(pdev, 0); in omap_dm_timer_probe()
1100 if (IS_ERR(timer->io_base)) in omap_dm_timer_probe()
1101 return PTR_ERR(timer->io_base); in omap_dm_timer_probe()
1103 platform_set_drvdata(pdev, timer); in omap_dm_timer_probe()
1106 if (of_property_read_bool(dev->of_node, "ti,timer-alwon")) in omap_dm_timer_probe()
1107 timer->capability |= OMAP_TIMER_ALWON; in omap_dm_timer_probe()
1108 if (of_property_read_bool(dev->of_node, "ti,timer-dsp")) in omap_dm_timer_probe()
1109 timer->capability |= OMAP_TIMER_HAS_DSP_IRQ; in omap_dm_timer_probe()
1110 if (of_property_read_bool(dev->of_node, "ti,timer-pwm")) in omap_dm_timer_probe()
1111 timer->capability |= OMAP_TIMER_HAS_PWM; in omap_dm_timer_probe()
1112 if (of_property_read_bool(dev->of_node, "ti,timer-secure")) in omap_dm_timer_probe()
1113 timer->capability |= OMAP_TIMER_SECURE; in omap_dm_timer_probe()
1115 timer->id = pdev->id; in omap_dm_timer_probe()
1116 timer->capability = pdata->timer_capability; in omap_dm_timer_probe()
1117 timer->reserved = omap_dm_timer_reserved_systimer(timer->id); in omap_dm_timer_probe()
1120 timer->omap1 = timer->capability & OMAP_TIMER_NEEDS_RESET; in omap_dm_timer_probe()
1123 if (!timer->omap1) { in omap_dm_timer_probe()
1124 timer->fclk = devm_clk_get(dev, "fck"); in omap_dm_timer_probe()
1125 if (IS_ERR(timer->fclk)) in omap_dm_timer_probe()
1126 return PTR_ERR(timer->fclk); in omap_dm_timer_probe()
1128 timer->fclk = ERR_PTR(-ENODEV); in omap_dm_timer_probe()
1131 if (!(timer->capability & OMAP_TIMER_ALWON)) { in omap_dm_timer_probe()
1132 timer->nb.notifier_call = omap_timer_context_notifier; in omap_dm_timer_probe()
1133 cpu_pm_register_notifier(&timer->nb); in omap_dm_timer_probe()
1136 timer->errata = pdata->timer_errata; in omap_dm_timer_probe()
1138 timer->pdev = pdev; in omap_dm_timer_probe()
1142 if (!timer->reserved) { in omap_dm_timer_probe()
1149 __omap_dm_timer_init_regs(timer); in omap_dm_timer_probe()
1151 /* Clear timer configuration */ in omap_dm_timer_probe()
1152 dmtimer_write(timer, OMAP_TIMER_CTRL_REG, 0); in omap_dm_timer_probe()
1157 /* add the timer element to the list */ in omap_dm_timer_probe()
1159 list_add_tail(&timer->node, &omap_timer_list); in omap_dm_timer_probe()
1172 * omap_dm_timer_remove - cleanup a registered timer device
1173 * @pdev: pointer to current timer platform device
1175 * Called by driver framework whenever a timer device is unregistered.
1176 * In addition to freeing platform resources it also deletes the timer
1181 struct dmtimer *timer; in omap_dm_timer_remove() local
1186 list_for_each_entry(timer, &omap_timer_list, node) in omap_dm_timer_remove()
1187 if (!strcmp(dev_name(&timer->pdev->dev), in omap_dm_timer_remove()
1189 if (!(timer->capability & OMAP_TIMER_ALWON)) in omap_dm_timer_remove()
1190 cpu_pm_unregister_notifier(&timer->nb); in omap_dm_timer_remove()
1191 list_del(&timer->node); in omap_dm_timer_remove()
1200 dev_err(&pdev->dev, "Unable to determine timer entry in list of drivers on remove\n"); in omap_dm_timer_remove()
1239 .compatible = "ti,omap2420-timer",
1242 .compatible = "ti,omap3430-timer",
1246 .compatible = "ti,omap4430-timer",
1250 .compatible = "ti,omap5430-timer",
1254 .compatible = "ti,am335x-timer",
1258 .compatible = "ti,am335x-timer-1ms",
1262 .compatible = "ti,dm816-timer",
1266 .compatible = "ti,am654-timer",
1285 MODULE_DESCRIPTION("OMAP Dual-Mode Timer Driver");