Lines Matching +full:local +full:- +full:timer +full:- +full:stop

1 // SPDX-License-Identifier: GPL-2.0-or-later
14 * Timer Driver for FBI board (timer chip 82C54)
20 * 28-Jun-1994 sw Edit v1.6.
21 * MCA: Added support for the SK-NET FDDI-FM2 adapter. The
35 * Prototypes of local functions.
37 /* 28-Jun-1994 sw - Note: hwt_restart() is also used in module 'drvfbi.c'. */
44 * Start hardware timer (clock ticks are 16us).
50 * smc - A pointer to the SMT Context structure.
52 * time - The time in units of 16us to load the timer with.
66 smc->hw.t_start = time ; in hwt_start()
67 smc->hw.t_stop = 0L ; in hwt_start()
77 outpd(ADDR(B2_TI_INI), (u_long) cnt * 200) ; /* Load timer value. */ in hwt_start()
78 outpw(ADDR(B2_TI_CRTL), TIM_START) ; /* Start timer. */ in hwt_start()
80 smc->hw.timer_activ = TRUE ; in hwt_start()
87 * Stop hardware timer.
92 * smc - A pointer to the SMT Context structure.
102 smc->hw.timer_activ = FALSE ; in hwt_stop()
109 * Initialize hardware timer.
114 * smc - A pointer to the SMT Context structure.
121 smc->hw.t_start = 0 ; in hwt_init()
122 smc->hw.t_stop = 0 ; in hwt_init()
123 smc->hw.timer_activ = FALSE ; in hwt_init()
132 * Clear timer interrupt.
137 * smc - A pointer to the SMT Context structure.
151 * Stop hardware timer and read time elapsed since last start.
155 * smc - A pointer to the SMT Context structure.
165 if (smc->hw.timer_activ) { in hwt_read()
170 /* Check if timer expired (or wraparound). */ in hwt_read()
171 if ((tr > smc->hw.t_start) || (is & IS_TIMINT)) { in hwt_read()
173 smc->hw.t_stop = smc->hw.t_start ; in hwt_read()
176 smc->hw.t_stop = smc->hw.t_start - tr ; in hwt_read()
178 return smc->hw.t_stop; in hwt_read()
186 * Stop hardware timer and read timer value and start the timer again.
190 * smc - A pointer to the SMT Context structure.
192 * current timer value in units of 80ns.
220 * NOTE: The function will return immediately, if the timer is not
230 * check if timer is running in hwt_wait_time()
232 if (smc->hw.timer_activ == FALSE || in hwt_wait_time()
240 diff = (long)(start - hwt_quick_read(smc)) ; in hwt_wait_time()