linux/drivers/watchdog/advantechwdt.c

// SPDX-License-Identifier: GPL-2.0+
/*
 *	Advantech Single Board Computer WDT driver
 *
 *	(c) Copyright 2000-2001 Marek Michalkiewicz <[email protected]>
 *
 *	Based on acquirewdt.c which is based on wdt.c.
 *	Original copyright messages:
 *
 *	(c) Copyright 1996 Alan Cox <[email protected]>,
 *						All Rights Reserved.
 *
 *	Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
 *	warranty for any of this software. This material is provided
 *	"AS-IS" and at no charge.
 *
 *	(c) Copyright 1995    Alan Cox <[email protected]>
 *
 *	14-Dec-2001 Matt Domsch <[email protected]>
 *	    Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
 *
 *	16-Oct-2002 Rob Radez <[email protected]>
 *	    Clean up ioctls, clean up init + exit, add expect close support,
 *	    add wdt_start and wdt_stop as parameters.
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/fs.h>
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/uaccess.h>


#define DRV_NAME
#define WATCHDOG_NAME
#define WATCHDOG_TIMEOUT

/* the watchdog platform device */
static struct platform_device *advwdt_platform_device;
static unsigned long advwdt_is_open;
static char adv_expect_close;

/*
 *	You must set these - there is no sane way to probe for this board.
 *
 *	To enable or restart, write the timeout value in seconds (1 to 63)
 *	to I/O port wdt_start.  To disable, read I/O port wdt_stop.
 *	Both are 0x443 for most boards (tested on a PCA-6276VE-00B1), but
 *	check your manual (at least the PCA-6159 seems to be different -
 *	the manual says wdt_stop is 0x43, not 0x443).
 *	(0x43 is also a write-only control register for the 8254 timer!)
 */

static int wdt_stop =;
module_param(wdt_stop, int, 0);
MODULE_PARM_DESC();

static int wdt_start =;
module_param(wdt_start, int, 0);
MODULE_PARM_DESC();

static int timeout =;	/* in seconds */
module_param(timeout, int, 0);
MODULE_PARM_DESC();

static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC();

/*
 *	Watchdog Operations
 */

static void advwdt_ping(void)
{}

static void advwdt_disable(void)
{}

static int advwdt_set_heartbeat(int t)
{}

/*
 *	/dev/watchdog handling
 */

static ssize_t advwdt_write(struct file *file, const char __user *buf,
						size_t count, loff_t *ppos)
{}

static long advwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{}

static int advwdt_open(struct inode *inode, struct file *file)
{}

static int advwdt_close(struct inode *inode, struct file *file)
{}

/*
 *	Kernel Interfaces
 */

static const struct file_operations advwdt_fops =;

static struct miscdevice advwdt_miscdev =;

/*
 *	Init & exit routines
 */

static int __init advwdt_probe(struct platform_device *dev)
{}

static void advwdt_remove(struct platform_device *dev)
{}

static void advwdt_shutdown(struct platform_device *dev)
{}

static struct platform_driver advwdt_driver =;

static int __init advwdt_init(void)
{}

static void __exit advwdt_exit(void)
{}

module_init();
module_exit(advwdt_exit);

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();