#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/platform_device.h>
#include <linux/ioport.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#define DRV_NAME …
#define GP60 …
#define WDT_TIME_OUT …
#define WDT_VAL …
#define WDT_CFG …
#define WDT_CTRL …
static unsigned long sch311x_wdt_is_open;
static char sch311x_wdt_expect_close;
static struct platform_device *sch311x_wdt_pdev;
static int sch311x_ioports[] = …;
static struct { … } sch311x_wdt_data;
static unsigned short force_id;
module_param(force_id, ushort, 0);
MODULE_PARM_DESC(…) …;
#define WATCHDOG_TIMEOUT …
static int timeout = …;
module_param(timeout, int, 0);
MODULE_PARM_DESC(…) …;
static bool nowayout = … WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(…) …;
static inline void sch311x_sio_enter(int sio_config_port)
{ … }
static inline void sch311x_sio_exit(int sio_config_port)
{ … }
static inline int sch311x_sio_inb(int sio_config_port, int reg)
{ … }
static inline void sch311x_sio_outb(int sio_config_port, int reg, int val)
{ … }
static void sch311x_wdt_set_timeout(int t)
{ … }
static void sch311x_wdt_start(void)
{ … }
static void sch311x_wdt_stop(void)
{ … }
static void sch311x_wdt_keepalive(void)
{ … }
static int sch311x_wdt_set_heartbeat(int t)
{ … }
static void sch311x_wdt_get_status(int *status)
{ … }
static ssize_t sch311x_wdt_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static long sch311x_wdt_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{ … }
static int sch311x_wdt_open(struct inode *inode, struct file *file)
{ … }
static int sch311x_wdt_close(struct inode *inode, struct file *file)
{ … }
static const struct file_operations sch311x_wdt_fops = …;
static struct miscdevice sch311x_wdt_miscdev = …;
static int sch311x_wdt_probe(struct platform_device *pdev)
{ … }
static void sch311x_wdt_remove(struct platform_device *pdev)
{ … }
static void sch311x_wdt_shutdown(struct platform_device *dev)
{ … }
static struct platform_driver sch311x_wdt_driver = …;
static int __init sch311x_detect(int sio_config_port, unsigned short *addr)
{ … }
static int __init sch311x_wdt_init(void)
{ … }
static void __exit sch311x_wdt_exit(void)
{ … }
module_init(…) …;
module_exit(sch311x_wdt_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;