#define pr_fmt(fmt) …
#include <linux/init.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/types.h>
#include <linux/watchdog.h>
#include "sp5100_tco.h"
#define TCO_DRIVER_NAME …
enum tco_reg_layout { … };
struct sp5100_tco { … };
static struct platform_device *sp5100_tco_platform_device;
static struct pci_dev *sp5100_tco_pci;
#define WATCHDOG_ACTION …
static bool action = …;
module_param(action, bool, 0);
MODULE_PARM_DESC(…) …;
#define WATCHDOG_HEARTBEAT …
static int heartbeat = …;
module_param(heartbeat, int, 0);
MODULE_PARM_DESC(…) …;
static bool nowayout = … WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(…) …;
static enum tco_reg_layout tco_reg_layout(struct pci_dev *dev)
{ … }
static int tco_timer_start(struct watchdog_device *wdd)
{ … }
static int tco_timer_stop(struct watchdog_device *wdd)
{ … }
static int tco_timer_ping(struct watchdog_device *wdd)
{ … }
static int tco_timer_set_timeout(struct watchdog_device *wdd,
unsigned int t)
{ … }
static unsigned int tco_timer_get_timeleft(struct watchdog_device *wdd)
{ … }
static u8 sp5100_tco_read_pm_reg8(u8 index)
{ … }
static void sp5100_tco_update_pm_reg8(u8 index, u8 reset, u8 set)
{ … }
static void tco_timer_enable(struct sp5100_tco *tco)
{ … }
static u32 sp5100_tco_read_pm_reg32(u8 index)
{ … }
static u32 sp5100_tco_request_region(struct device *dev,
u32 mmio_addr,
const char *dev_name)
{ … }
static u32 sp5100_tco_prepare_base(struct sp5100_tco *tco,
u32 mmio_addr,
u32 alt_mmio_addr,
const char *dev_name)
{ … }
static int sp5100_tco_timer_init(struct sp5100_tco *tco)
{ … }
static u8 efch_read_pm_reg8(void __iomem *addr, u8 index)
{ … }
static void efch_update_pm_reg8(void __iomem *addr, u8 index, u8 reset, u8 set)
{ … }
static void tco_timer_enable_mmio(void __iomem *addr)
{ … }
static int sp5100_tco_setupdevice_mmio(struct device *dev,
struct watchdog_device *wdd)
{ … }
static int sp5100_tco_setupdevice(struct device *dev,
struct watchdog_device *wdd)
{ … }
static struct watchdog_info sp5100_tco_wdt_info = …;
static const struct watchdog_ops sp5100_tco_wdt_ops = …;
static int sp5100_tco_probe(struct platform_device *pdev)
{ … }
static struct platform_driver sp5100_tco_driver = …;
static const struct pci_device_id sp5100_tco_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl);
static int __init sp5100_tco_init(void)
{ … }
static void __exit sp5100_tco_exit(void)
{ … }
module_init(…) …;
module_exit(sp5100_tco_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;