Lines Matching +full:cpu +full:- +full:cfg
1 // SPDX-License-Identifier: GPL-2.0
35 unsigned int cfg = smbus_read(offset); in smbus_enable() local
37 cfg |= bit; in smbus_enable()
38 smbus_write(offset, cfg); in smbus_enable()
53 unsigned int cfg = hpet_read(HPET_CFG); in hpet_start_counter() local
55 cfg |= HPET_CFG_ENABLE; in hpet_start_counter()
56 hpet_write(HPET_CFG, cfg); in hpet_start_counter()
61 unsigned int cfg = hpet_read(HPET_CFG); in hpet_stop_counter() local
63 cfg &= ~HPET_CFG_ENABLE; in hpet_stop_counter()
64 hpet_write(HPET_CFG, cfg); in hpet_stop_counter()
82 /* Do nothing on Loongson-3 */ in hpet_enable_legacy_int()
87 int cfg; in hpet_set_state_periodic() local
96 cfg = hpet_read(HPET_T0_CFG); in hpet_set_state_periodic()
97 cfg &= ~HPET_TN_LEVEL; in hpet_set_state_periodic()
98 cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL | in hpet_set_state_periodic()
100 hpet_write(HPET_T0_CFG, cfg); in hpet_set_state_periodic()
116 int cfg; in hpet_set_state_shutdown() local
120 cfg = hpet_read(HPET_T0_CFG); in hpet_set_state_shutdown()
121 cfg &= ~HPET_TN_ENABLE; in hpet_set_state_shutdown()
122 hpet_write(HPET_T0_CFG, cfg); in hpet_set_state_shutdown()
130 int cfg; in hpet_set_state_oneshot() local
135 cfg = hpet_read(HPET_T0_CFG); in hpet_set_state_oneshot()
139 * 0 : non-periodic(oneshot) interrupt in hpet_set_state_oneshot()
141 cfg &= ~HPET_TN_PERIODIC; in hpet_set_state_oneshot()
142 cfg |= HPET_TN_ENABLE | HPET_TN_32BIT; in hpet_set_state_oneshot()
143 hpet_write(HPET_T0_CFG, cfg); in hpet_set_state_oneshot()
168 res = (s32)(cnt - hpet_read(HPET_COUNTER)); in hpet_next_event()
170 return res < HPET_MIN_CYCLES ? -ETIME : 0; in hpet_next_event()
177 unsigned int cpu = smp_processor_id(); in hpet_irq_handler() local
183 cd = &per_cpu(hpet_clockevent_device, cpu); in hpet_irq_handler()
184 cd->event_handler(cd); in hpet_irq_handler()
222 unsigned int cpu = smp_processor_id(); in setup_hpet_timer() local
227 cd = &per_cpu(hpet_clockevent_device, cpu); in setup_hpet_timer()
228 cd->name = "hpet"; in setup_hpet_timer()
229 cd->rating = 100; in setup_hpet_timer()
230 cd->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; in setup_hpet_timer()
231 cd->set_state_shutdown = hpet_set_state_shutdown; in setup_hpet_timer()
232 cd->set_state_periodic = hpet_set_state_periodic; in setup_hpet_timer()
233 cd->set_state_oneshot = hpet_set_state_oneshot; in setup_hpet_timer()
234 cd->tick_resume = hpet_tick_resume; in setup_hpet_timer()
235 cd->set_next_event = hpet_next_event; in setup_hpet_timer()
236 cd->irq = HPET_T0_IRQ; in setup_hpet_timer()
237 cd->cpumask = cpumask_of(cpu); in setup_hpet_timer()
239 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); in setup_hpet_timer()
240 cd->max_delta_ticks = 0x7fffffff; in setup_hpet_timer()
241 cd->min_delta_ns = clockevent_delta2ns(HPET_MIN_PROG_DELTA, cd); in setup_hpet_timer()
242 cd->min_delta_ticks = HPET_MIN_PROG_DELTA; in setup_hpet_timer()