Lines Matching refs:watchdog_device
94 static struct intel_scu_watchdog_dev watchdog_device; variable
158 int_status = ioread32(watchdog_device.timer_interrupt_status_addr); in watchdog_timer_interrupt()
166 if (watchdog_device.timer_started == 0) { in watchdog_timer_interrupt()
172 iowrite32(0x00000002, watchdog_device.timer_control_addr); in watchdog_timer_interrupt()
175 iowrite32(watchdog_device.threshold, in watchdog_timer_interrupt()
176 watchdog_device.timer_load_count_addr); in watchdog_timer_interrupt()
179 iowrite32(0x00000003, watchdog_device.timer_control_addr); in watchdog_timer_interrupt()
188 ioread32(watchdog_device.timer_clear_interrupt_addr); in intel_scu_keepalive()
191 iowrite32(0x00000002, watchdog_device.timer_control_addr); in intel_scu_keepalive()
194 iowrite32(watchdog_device.soft_threshold, in intel_scu_keepalive()
195 watchdog_device.timer_load_count_addr); in intel_scu_keepalive()
198 iowrite32(0x00000003, watchdog_device.timer_control_addr); in intel_scu_keepalive()
205 iowrite32(0, watchdog_device.timer_control_addr); in intel_scu_stop()
217 watchdog_device.timer_set = t; in intel_scu_set_heartbeat()
218 watchdog_device.threshold = in intel_scu_set_heartbeat()
219 timer_margin * watchdog_device.timer_tbl_ptr->freq_hz; in intel_scu_set_heartbeat()
220 watchdog_device.soft_threshold = in intel_scu_set_heartbeat()
221 (watchdog_device.timer_set - timer_margin) in intel_scu_set_heartbeat()
222 * watchdog_device.timer_tbl_ptr->freq_hz; in intel_scu_set_heartbeat()
225 watchdog_device.timer_tbl_ptr->freq_hz); in intel_scu_set_heartbeat()
227 watchdog_device.timer_set); in intel_scu_set_heartbeat()
231 watchdog_device.threshold); in intel_scu_set_heartbeat()
233 watchdog_device.soft_threshold); in intel_scu_set_heartbeat()
237 watchdog_device.threshold = in intel_scu_set_heartbeat()
238 watchdog_device.threshold / FREQ_ADJUSTMENT; in intel_scu_set_heartbeat()
239 watchdog_device.soft_threshold = in intel_scu_set_heartbeat()
240 watchdog_device.soft_threshold / FREQ_ADJUSTMENT; in intel_scu_set_heartbeat()
243 iowrite32(0x00000002, watchdog_device.timer_control_addr); in intel_scu_set_heartbeat()
246 ipc_ret = watchdog_set_ipc(watchdog_device.soft_threshold, in intel_scu_set_heartbeat()
247 watchdog_device.threshold); in intel_scu_set_heartbeat()
260 soft_value = watchdog_device.soft_threshold & 0xFFFF0000; in intel_scu_set_heartbeat()
273 iowrite32(watchdog_device.soft_threshold, in intel_scu_set_heartbeat()
274 watchdog_device.timer_load_count_addr); in intel_scu_set_heartbeat()
277 hw_pre_value = ioread32(watchdog_device.timer_load_count_addr); in intel_scu_set_heartbeat()
281 iowrite32(0x00000003, watchdog_device.timer_control_addr); in intel_scu_set_heartbeat()
284 hw_value = ioread32(watchdog_device.timer_load_count_addr); in intel_scu_set_heartbeat()
290 watchdog_device.timer_started = 1; in intel_scu_set_heartbeat()
303 if (test_and_set_bit(0, &watchdog_device.driver_open)) in intel_scu_open()
307 if (watchdog_device.driver_closed) in intel_scu_open()
324 if (!test_and_clear_bit(0, &watchdog_device.driver_open)) { in intel_scu_release()
329 if (!watchdog_device.timer_started) { in intel_scu_release()
339 watchdog_device.driver_closed = 1; in intel_scu_release()
357 if (watchdog_device.timer_started) in intel_scu_write()
362 intel_scu_set_heartbeat(watchdog_device.timer_set); in intel_scu_write()
407 return put_user(watchdog_device.soft_threshold, p); in intel_scu_ioctl()
468 watchdog_device.timer_tbl_ptr = sfi_get_mtmr(sfi_mtimer_num-1); in intel_scu_watchdog_init()
470 if (watchdog_device.timer_tbl_ptr == NULL) { in intel_scu_watchdog_init()
475 if (watchdog_device.timer_tbl_ptr->phys_addr == 0) { in intel_scu_watchdog_init()
481 if (watchdog_device.timer_tbl_ptr->irq == 0) { in intel_scu_watchdog_init()
487 tmp_addr = ioremap_nocache(watchdog_device.timer_tbl_ptr->phys_addr, in intel_scu_watchdog_init()
495 watchdog_device.timer_load_count_addr = tmp_addr++; in intel_scu_watchdog_init()
496 watchdog_device.timer_current_value_addr = tmp_addr++; in intel_scu_watchdog_init()
497 watchdog_device.timer_control_addr = tmp_addr++; in intel_scu_watchdog_init()
498 watchdog_device.timer_clear_interrupt_addr = tmp_addr++; in intel_scu_watchdog_init()
499 watchdog_device.timer_interrupt_status_addr = tmp_addr++; in intel_scu_watchdog_init()
503 watchdog_device.timer_set = timer_set; in intel_scu_watchdog_init()
504 watchdog_device.threshold = in intel_scu_watchdog_init()
505 timer_margin * watchdog_device.timer_tbl_ptr->freq_hz; in intel_scu_watchdog_init()
506 watchdog_device.soft_threshold = in intel_scu_watchdog_init()
507 (watchdog_device.timer_set - timer_margin) in intel_scu_watchdog_init()
508 * watchdog_device.timer_tbl_ptr->freq_hz; in intel_scu_watchdog_init()
511 watchdog_device.intel_scu_notifier.notifier_call = in intel_scu_watchdog_init()
514 ret = register_reboot_notifier(&watchdog_device.intel_scu_notifier); in intel_scu_watchdog_init()
520 watchdog_device.miscdev.minor = WATCHDOG_MINOR; in intel_scu_watchdog_init()
521 watchdog_device.miscdev.name = "watchdog"; in intel_scu_watchdog_init()
522 watchdog_device.miscdev.fops = &intel_scu_fops; in intel_scu_watchdog_init()
524 ret = misc_register(&watchdog_device.miscdev); in intel_scu_watchdog_init()
531 ret = request_irq((unsigned int)watchdog_device.timer_tbl_ptr->irq, in intel_scu_watchdog_init()
534 &watchdog_device.timer_load_count_addr); in intel_scu_watchdog_init()
546 misc_deregister(&watchdog_device.miscdev); in intel_scu_watchdog_init()
548 unregister_reboot_notifier(&watchdog_device.intel_scu_notifier); in intel_scu_watchdog_init()
551 iounmap(watchdog_device.timer_load_count_addr); in intel_scu_watchdog_init()
558 misc_deregister(&watchdog_device.miscdev); in intel_scu_watchdog_exit()
559 unregister_reboot_notifier(&watchdog_device.intel_scu_notifier); in intel_scu_watchdog_exit()
561 iowrite32(0x00000002, watchdog_device.timer_control_addr); in intel_scu_watchdog_exit()
562 iounmap(watchdog_device.timer_load_count_addr); in intel_scu_watchdog_exit()