linux/drivers/watchdog/via_wdt.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * VIA Chipset Watchdog Driver
 *
 * Copyright (C) 2011 Sigfox
 * Author: Marc Vertes <[email protected]>
 * Based on a preliminary version from Harald Welte <[email protected]>
 * Timer code by Wim Van Sebroeck <[email protected]>
 *
 * Caveat: PnP must be enabled in BIOS to allow full access to watchdog
 * control registers. If not, the watchdog must be configured in BIOS manually.
 */

#define pr_fmt(fmt)

#include <linux/device.h>
#include <linux/io.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/timer.h>
#include <linux/watchdog.h>

/* Configuration registers relative to the pci device */
#define VIA_WDT_MMIO_BASE
#define VIA_WDT_CONF

/* Relevant bits for the VIA_WDT_CONF register */
#define VIA_WDT_CONF_ENABLE
#define VIA_WDT_CONF_MMIO

/*
 * The MMIO region contains the watchdog control register and the
 * hardware timer counter.
 */
#define VIA_WDT_MMIO_LEN
#define VIA_WDT_CTL
#define VIA_WDT_COUNT

/* Bits for the VIA_WDT_CTL register */
#define VIA_WDT_RUNNING
#define VIA_WDT_FIRED
#define VIA_WDT_PWROFF
#define VIA_WDT_DISABLED
#define VIA_WDT_TRIGGER

/* Hardware heartbeat in seconds */
#define WDT_HW_HEARTBEAT

/* Timer heartbeat (500ms) */
#define WDT_HEARTBEAT

/* User space timeout in seconds */
#define WDT_TIMEOUT_MAX
#define WDT_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 struct watchdog_device wdt_dev;
static struct resource wdt_res;
static void __iomem *wdt_mem;
static unsigned int mmio;
static void wdt_timer_tick(struct timer_list *unused);
static DEFINE_TIMER(timer, wdt_timer_tick);
					/* The timer that pings the watchdog */
static unsigned long next_heartbeat;	/* the next_heartbeat for the timer */

static inline void wdt_reset(void)
{}

/*
 * Timer tick: the timer will make sure that the watchdog timer hardware
 * is being reset in time. The conditions to do this are:
 *  1) the watchdog timer has been started and /dev/watchdog is open
 *     and there is still time left before userspace should send the
 *     next heartbeat/ping. (note: the internal heartbeat is much smaller
 *     then the external/userspace heartbeat).
 *  2) the watchdog timer has been stopped by userspace.
 */
static void wdt_timer_tick(struct timer_list *unused)
{}

static int wdt_ping(struct watchdog_device *wdd)
{}

static int wdt_start(struct watchdog_device *wdd)
{}

static int wdt_stop(struct watchdog_device *wdd)
{}

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

static const struct watchdog_info wdt_info =;

static const struct watchdog_ops wdt_ops =;

static struct watchdog_device wdt_dev =;

static int wdt_probe(struct pci_dev *pdev,
			       const struct pci_device_id *ent)
{}

static void wdt_remove(struct pci_dev *pdev)
{}

static const struct pci_device_id wdt_pci_table[] =;

static struct pci_driver wdt_driver =;

module_pci_driver();

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