.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Intel_SCU 0.2: An Intel SCU IOH Based Watchdog Device |
---|
3 | 4 | * for Intel part #(s): |
---|
4 | 5 | * - AF82MP20 PCH |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (C) 2009-2010 Intel Corporation. All rights reserved. |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or |
---|
9 | | - * modify it under the terms of version 2 of the GNU General |
---|
10 | | - * Public License as published by the Free Software Foundation. |
---|
11 | | - * |
---|
12 | | - * This program is distributed in the hope that it will be |
---|
13 | | - * useful, but WITHOUT ANY WARRANTY; without even the implied |
---|
14 | | - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
---|
15 | | - * PURPOSE. See the GNU General Public License for more details. |
---|
16 | | - * You should have received a copy of the GNU General Public |
---|
17 | | - * License along with this program; if not, write to the Free |
---|
18 | | - * Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
19 | | - * Boston, MA 02111-1307, USA. |
---|
20 | | - * The full GNU General Public License is included in this |
---|
21 | | - * distribution in the file called COPYING. |
---|
22 | | - * |
---|
23 | 8 | */ |
---|
24 | 9 | |
---|
25 | 10 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
26 | 11 | |
---|
27 | 12 | #include <linux/compiler.h> |
---|
28 | | -#include <linux/module.h> |
---|
29 | 13 | #include <linux/kernel.h> |
---|
30 | 14 | #include <linux/moduleparam.h> |
---|
31 | 15 | #include <linux/types.h> |
---|
.. | .. |
---|
224 | 208 | watchdog_device.timer_tbl_ptr->freq_hz); |
---|
225 | 209 | pr_debug("set_heartbeat: timer_set is %x (hex)\n", |
---|
226 | 210 | watchdog_device.timer_set); |
---|
227 | | - pr_debug("set_hearbeat: timer_margin is %x (hex)\n", timer_margin); |
---|
| 211 | + pr_debug("set_heartbeat: timer_margin is %x (hex)\n", timer_margin); |
---|
228 | 212 | pr_debug("set_heartbeat: threshold is %x (hex)\n", |
---|
229 | 213 | watchdog_device.threshold); |
---|
230 | 214 | pr_debug("set_heartbeat: soft_threshold is %x (hex)\n", |
---|
.. | .. |
---|
304 | 288 | if (watchdog_device.driver_closed) |
---|
305 | 289 | return -EPERM; |
---|
306 | 290 | |
---|
307 | | - return nonseekable_open(inode, file); |
---|
| 291 | + return stream_open(inode, file); |
---|
308 | 292 | } |
---|
309 | 293 | |
---|
310 | 294 | static int intel_scu_release(struct inode *inode, struct file *file) |
---|
.. | .. |
---|
428 | 412 | .llseek = no_llseek, |
---|
429 | 413 | .write = intel_scu_write, |
---|
430 | 414 | .unlocked_ioctl = intel_scu_ioctl, |
---|
| 415 | + .compat_ioctl = compat_ptr_ioctl, |
---|
431 | 416 | .open = intel_scu_open, |
---|
432 | 417 | .release = intel_scu_release, |
---|
433 | 418 | }; |
---|
.. | .. |
---|
478 | 463 | return -ENODEV; |
---|
479 | 464 | } |
---|
480 | 465 | |
---|
481 | | - tmp_addr = ioremap_nocache(watchdog_device.timer_tbl_ptr->phys_addr, |
---|
| 466 | + tmp_addr = ioremap(watchdog_device.timer_tbl_ptr->phys_addr, |
---|
482 | 467 | 20); |
---|
483 | 468 | |
---|
484 | 469 | if (tmp_addr == NULL) { |
---|
.. | .. |
---|
545 | 530 | iounmap(watchdog_device.timer_load_count_addr); |
---|
546 | 531 | return ret; |
---|
547 | 532 | } |
---|
548 | | - |
---|
549 | | -static void __exit intel_scu_watchdog_exit(void) |
---|
550 | | -{ |
---|
551 | | - |
---|
552 | | - misc_deregister(&watchdog_device.miscdev); |
---|
553 | | - unregister_reboot_notifier(&watchdog_device.intel_scu_notifier); |
---|
554 | | - /* disable the timer */ |
---|
555 | | - iowrite32(0x00000002, watchdog_device.timer_control_addr); |
---|
556 | | - iounmap(watchdog_device.timer_load_count_addr); |
---|
557 | | -} |
---|
558 | | - |
---|
559 | 533 | late_initcall(intel_scu_watchdog_init); |
---|
560 | | -module_exit(intel_scu_watchdog_exit); |
---|
561 | | - |
---|
562 | | -MODULE_AUTHOR("Intel Corporation"); |
---|
563 | | -MODULE_DESCRIPTION("Intel SCU Watchdog Device Driver"); |
---|
564 | | -MODULE_LICENSE("GPL"); |
---|
565 | | -MODULE_VERSION(WDT_VER); |
---|