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
31 * Prototypes of local functions.
33 /* 28-Jun-1994 sw - Note: hwt_restart() is also used in module 'drvfbi.c'. */
40 * Start hardware timer (clock ticks are 16us).
46 * smc - A pointer to the SMT Context structure.
48 * time - The time in units of 16us to load the timer with.
62 smc->hw.t_start = time ; in hwt_start()
63 smc->hw.t_stop = 0L ; in hwt_start()
73 outpd(ADDR(B2_TI_INI), (u_long) cnt * 200) ; /* Load timer value. */ in hwt_start()
74 outpw(ADDR(B2_TI_CRTL), TIM_START) ; /* Start timer. */ in hwt_start()
76 smc->hw.timer_activ = TRUE ; in hwt_start()
83 * Stop hardware timer.
88 * smc - A pointer to the SMT Context structure.
98 smc->hw.timer_activ = FALSE ; in hwt_stop()
105 * Initialize hardware timer.
110 * smc - A pointer to the SMT Context structure.
117 smc->hw.t_start = 0 ; in hwt_init()
118 smc->hw.t_stop = 0 ; in hwt_init()
119 smc->hw.timer_activ = FALSE ; in hwt_init()
128 * Clear timer interrupt.
133 * smc - A pointer to the SMT Context structure.
147 * Stop hardware timer and read time elapsed since last start.
151 * smc - A pointer to the SMT Context structure.
161 if (smc->hw.timer_activ) { in hwt_read()
166 /* Check if timer expired (or wraparound). */ in hwt_read()
167 if ((tr > smc->hw.t_start) || (is & IS_TIMINT)) { in hwt_read()
169 smc->hw.t_stop = smc->hw.t_start ; in hwt_read()
172 smc->hw.t_stop = smc->hw.t_start - tr ; in hwt_read()
174 return smc->hw.t_stop; in hwt_read()
182 * Stop hardware timer and read timer value and start the timer again.
186 * smc - A pointer to the SMT Context structure.
188 * current timer value in units of 80ns.
216 * NOTE: The function will return immediately, if the timer is not
226 * check if timer is running in hwt_wait_time()
228 if (smc->hw.timer_activ == FALSE || in hwt_wait_time()
236 diff = (long)(start - hwt_quick_read(smc)) ; in hwt_wait_time()