linux/drivers/watchdog/sc1200wdt.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *	National Semiconductor PC87307/PC97307 (ala SC1200) WDT driver
 *	(c) Copyright 2002 Zwane Mwaikambo <[email protected]>,
 *			All Rights Reserved.
 *	Based on wdt.c and wdt977.c by Alan Cox and Woody Suwalski respectively.
 *
 *	The author(s) of this software shall not be held liable for damages
 *	of any nature resulting due to the use of this software. This
 *	software is provided AS-IS with no warranties.
 *
 *	Changelog:
 *	20020220 Zwane Mwaikambo	Code based on datasheet, no hardware.
 *	20020221 Zwane Mwaikambo	Cleanups as suggested by Jeff Garzik
 *					and Alan Cox.
 *	20020222 Zwane Mwaikambo	Added probing.
 *	20020225 Zwane Mwaikambo	Added ISAPNP support.
 *	20020412 Rob Radez		Broke out start/stop functions
 *		 <[email protected]>	Return proper status instead of
 *					temperature warning
 *					Add WDIOC_GETBOOTSTATUS and
 *					WDIOC_SETOPTIONS ioctls
 *					Fix CONFIG_WATCHDOG_NOWAYOUT
 *	20020530 Joel Becker		Add Matt Domsch's nowayout module
 *					option
 *	20030116 Adam Belay		Updated to the latest pnp code
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/ioport.h>
#include <linux/spinlock.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/pnp.h>
#include <linux/fs.h>
#include <linux/semaphore.h>
#include <linux/io.h>
#include <linux/uaccess.h>

#define SC1200_MODULE_VER
#define SC1200_MODULE_NAME

#define MAX_TIMEOUT
#define PMIR
#define PMDR

/* Data Register indexes */
#define FER1
#define FER2
#define PMC1
#define PMC2
#define PMC3
#define WDTO
#define WDCF
#define WDST

/* WDCF bitfields - which devices assert WDO */
#define KBC_IRQ
#define MSE_IRQ
#define UART1_IRQ
#define UART2_IRQ
/* 5 -7 are reserved */

static int timeout =;
static int io =;
static int io_len =;		/* for non plug and play */
static unsigned long open_flag;
static char expect_close;
static DEFINE_SPINLOCK(sc1200wdt_lock);	/* io port access serialisation */

#if defined CONFIG_PNP
static int isapnp =;
static struct pnp_dev *wdt_dev;

module_param(isapnp, int, 0);
MODULE_PARM_DESC();
#endif

module_param_hw(io, int, ioport, 0);
MODULE_PARM_DESC();
module_param(timeout, int, 0);
MODULE_PARM_DESC();

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



/* Read from Data Register */
static inline void __sc1200wdt_read_data(unsigned char index,
						unsigned char *data)
{}

static void sc1200wdt_read_data(unsigned char index, unsigned char *data)
{}

/* Write to Data Register */
static inline void __sc1200wdt_write_data(unsigned char index,
						unsigned char data)
{}

static inline void sc1200wdt_write_data(unsigned char index,
						unsigned char data)
{}


static void sc1200wdt_start(void)
{}

static void sc1200wdt_stop(void)
{}

/* This returns the status of the WDO signal, inactive high. */
static inline int sc1200wdt_status(void)
{}

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


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


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


static ssize_t sc1200wdt_write(struct file *file, const char __user *data,
						size_t len, loff_t *ppos)
{}


static int sc1200wdt_notify_sys(struct notifier_block *this,
					unsigned long code, void *unused)
{}


static struct notifier_block sc1200wdt_notifier =;

static const struct file_operations sc1200wdt_fops =;

static struct miscdevice sc1200wdt_miscdev =;


static int __init sc1200wdt_probe(void)
{}


#if defined CONFIG_PNP

static const struct pnp_device_id scl200wdt_pnp_devices[] =;

static int scl200wdt_pnp_probe(struct pnp_dev *dev,
					const struct pnp_device_id *dev_id)
{}

static void scl200wdt_pnp_remove(struct pnp_dev *dev)
{}

static struct pnp_driver scl200wdt_pnp_driver =;

#endif /* CONFIG_PNP */


static int __init sc1200wdt_init(void)
{}


static void __exit sc1200wdt_exit(void)
{}

module_init();
module_exit(sc1200wdt_exit);

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