Lines Matching defs:watchdog_device

79 static struct intel_scu_watchdog_dev watchdog_device;
142 int_status = ioread32(watchdog_device.timer_interrupt_status_addr);
150 if (watchdog_device.timer_started == 0) {
156 iowrite32(0x00000002, watchdog_device.timer_control_addr);
159 iowrite32(watchdog_device.threshold,
160 watchdog_device.timer_load_count_addr);
163 iowrite32(0x00000003, watchdog_device.timer_control_addr);
172 ioread32(watchdog_device.timer_clear_interrupt_addr);
175 iowrite32(0x00000002, watchdog_device.timer_control_addr);
178 iowrite32(watchdog_device.soft_threshold,
179 watchdog_device.timer_load_count_addr);
182 iowrite32(0x00000003, watchdog_device.timer_control_addr);
189 iowrite32(0, watchdog_device.timer_control_addr);
200 watchdog_device.timer_set = t;
201 watchdog_device.threshold =
202 timer_margin * watchdog_device.timer_tbl_ptr->freq_hz;
203 watchdog_device.soft_threshold =
204 (watchdog_device.timer_set - timer_margin)
205 * watchdog_device.timer_tbl_ptr->freq_hz;
208 watchdog_device.timer_tbl_ptr->freq_hz);
210 watchdog_device.timer_set);
213 watchdog_device.threshold);
215 watchdog_device.soft_threshold);
219 watchdog_device.threshold =
220 watchdog_device.threshold / FREQ_ADJUSTMENT;
221 watchdog_device.soft_threshold =
222 watchdog_device.soft_threshold / FREQ_ADJUSTMENT;
225 iowrite32(0x00000002, watchdog_device.timer_control_addr);
228 ipc_ret = watchdog_set_ipc(watchdog_device.soft_threshold,
229 watchdog_device.threshold);
242 soft_value = watchdog_device.soft_threshold & 0xFFFF0000;
255 iowrite32(watchdog_device.soft_threshold,
256 watchdog_device.timer_load_count_addr);
259 ioread32(watchdog_device.timer_load_count_addr);
262 iowrite32(0x00000003, watchdog_device.timer_control_addr);
265 hw_value = ioread32(watchdog_device.timer_load_count_addr);
271 watchdog_device.timer_started = 1;
284 if (test_and_set_bit(0, &watchdog_device.driver_open))
288 if (watchdog_device.driver_closed)
305 if (!test_and_clear_bit(0, &watchdog_device.driver_open)) {
310 if (!watchdog_device.timer_started) {
319 watchdog_device.driver_closed = 1;
337 if (watchdog_device.timer_started)
342 intel_scu_set_heartbeat(watchdog_device.timer_set);
387 return put_user(watchdog_device.soft_threshold, p);
448 watchdog_device.timer_tbl_ptr = sfi_get_mtmr(sfi_mtimer_num-1);
450 if (watchdog_device.timer_tbl_ptr == NULL) {
455 if (watchdog_device.timer_tbl_ptr->phys_addr == 0) {
461 if (watchdog_device.timer_tbl_ptr->irq == 0) {
466 tmp_addr = ioremap(watchdog_device.timer_tbl_ptr->phys_addr,
474 watchdog_device.timer_load_count_addr = tmp_addr++;
475 watchdog_device.timer_current_value_addr = tmp_addr++;
476 watchdog_device.timer_control_addr = tmp_addr++;
477 watchdog_device.timer_clear_interrupt_addr = tmp_addr++;
478 watchdog_device.timer_interrupt_status_addr = tmp_addr++;
482 watchdog_device.timer_set = timer_set;
483 watchdog_device.threshold =
484 timer_margin * watchdog_device.timer_tbl_ptr->freq_hz;
485 watchdog_device.soft_threshold =
486 (watchdog_device.timer_set - timer_margin)
487 * watchdog_device.timer_tbl_ptr->freq_hz;
490 watchdog_device.intel_scu_notifier.notifier_call =
493 ret = register_reboot_notifier(&watchdog_device.intel_scu_notifier);
499 watchdog_device.miscdev.minor = WATCHDOG_MINOR;
500 watchdog_device.miscdev.name = "watchdog";
501 watchdog_device.miscdev.fops = &intel_scu_fops;
503 ret = misc_register(&watchdog_device.miscdev);
510 ret = request_irq((unsigned int)watchdog_device.timer_tbl_ptr->irq,
513 &watchdog_device.timer_load_count_addr);
525 misc_deregister(&watchdog_device.miscdev);
527 unregister_reboot_notifier(&watchdog_device.intel_scu_notifier);
530 iounmap(watchdog_device.timer_load_count_addr);