linux/drivers/watchdog/it87_wdt.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *	Watchdog Timer Driver
 *	   for ITE IT87xx Environment Control - Low Pin Count Input / Output
 *
 *	(c) Copyright 2007  Oliver Schuster <[email protected]>
 *
 *	Based on softdog.c	by Alan Cox,
 *		 83977f_wdt.c	by Jose Goncalves,
 *		 it87.c		by Chris Gauthron, Jean Delvare
 *
 *	Data-sheets: Publicly available at the ITE website
 *		    http://www.ite.com.tw/
 *
 *	Support of the watchdog timers, which are available on
 *	IT8607, IT8613, IT8620, IT8622, IT8625, IT8628, IT8655, IT8659,
 *	IT8665, IT8686, IT8702, IT8712, IT8716, IT8718, IT8720, IT8721,
 *	IT8726,	IT8728, IT8772, IT8783, IT8784 and IT8786.
 */

#define pr_fmt(fmt)

#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/watchdog.h>

#define WATCHDOG_NAME

/* Defaults for Module Parameter */
#define DEFAULT_TIMEOUT
#define DEFAULT_TESTMODE
#define DEFAULT_NOWAYOUT

/* IO Ports */
#define REG
#define VAL

/* Logical device Numbers LDN */
#define GPIO

/* Configuration Registers and Functions */
#define LDNREG
#define CHIPID
#define CHIPREV

/* Chip Id numbers */
#define NO_DEV_ID
#define IT8607_ID
#define IT8613_ID
#define IT8620_ID
#define IT8622_ID
#define IT8625_ID
#define IT8628_ID
#define IT8655_ID
#define IT8659_ID
#define IT8665_ID
#define IT8686_ID
#define IT8702_ID
#define IT8705_ID
#define IT8712_ID
#define IT8716_ID
#define IT8718_ID
#define IT8720_ID
#define IT8721_ID
#define IT8726_ID
#define IT8728_ID
#define IT8772_ID
#define IT8783_ID
#define IT8784_ID
#define IT8786_ID

/* GPIO Configuration Registers LDN=0x07 */
#define WDTCTRL
#define WDTCFG
#define WDTVALLSB
#define WDTVALMSB

/* GPIO Bits WDTCFG */
#define WDT_TOV1
#define WDT_KRST
#define WDT_TOVE
#define WDT_PWROK
#define WDT_INT_MASK

static unsigned int max_units, chip_type;

static unsigned int timeout =;
static int testmode =;
static bool nowayout = DEFAULT_NOWAYOUT;

module_param(timeout, int, 0);
MODULE_PARM_DESC();
module_param(testmode, int, 0);
MODULE_PARM_DESC();
module_param(nowayout, bool, 0);
MODULE_PARM_DESC();

/* Superio Chip */

static inline int superio_enter(void)
{}

static inline void superio_exit(void)
{}

static inline void superio_select(int ldn)
{}

static inline int superio_inb(int reg)
{}

static inline void superio_outb(int val, int reg)
{}

static inline int superio_inw(int reg)
{}

/* Internal function, should be called after superio_select(GPIO) */
static void _wdt_update_timeout(unsigned int t)
{}

static int wdt_update_timeout(unsigned int t)
{}

static int wdt_round_time(int t)
{}

/* watchdog timer handling */

static int wdt_start(struct watchdog_device *wdd)
{}

static int wdt_stop(struct watchdog_device *wdd)
{}

/**
 *	wdt_set_timeout - set a new timeout value with watchdog ioctl
 *	@wdd: pointer to the watchdog_device structure
 *	@t: timeout value in seconds
 *
 *	The hardware device has a 8 or 16 bit watchdog timer (depends on
 *	chip version) that can be configured to count seconds or minutes.
 *
 *	Used within WDIOC_SETTIMEOUT watchdog device ioctl.
 *
 *	Return: 0 if the timeout was set successfully, or a negative error code on
 *	failure.
 */

static int wdt_set_timeout(struct watchdog_device *wdd, unsigned int t)
{}

static const struct watchdog_info ident =;

static const struct watchdog_ops wdt_ops =;

static struct watchdog_device wdt_dev =;

static int __init it87_wdt_init(void)
{}

static void __exit it87_wdt_exit(void)
{}

module_init();
module_exit(it87_wdt_exit);

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