linux/drivers/watchdog/pnx4008_wdt.c

// SPDX-License-Identifier: GPL-2.0
/*
 * drivers/char/watchdog/pnx4008_wdt.c
 *
 * Watchdog driver for PNX4008 board
 *
 * Authors: Dmitry Chigirev <[email protected]>,
 *	    Vitaly Wool <[email protected]>
 * Based on sa1100 driver,
 * Copyright (C) 2000 Oleg Drokin <[email protected]>
 *
 * 2005-2006 (c) MontaVista Software, Inc.
 *
 * (C) 2012 Wolfram Sang, Pengutronix
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/watchdog.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/of.h>
#include <linux/delay.h>
#include <linux/reboot.h>

/* WatchDog Timer - Chapter 23 Page 207 */

#define DEFAULT_HEARTBEAT
#define MAX_HEARTBEAT

/* Watchdog timer register set definition */
#define WDTIM_INT(p)
#define WDTIM_CTRL(p)
#define WDTIM_COUNTER(p)
#define WDTIM_MCTRL(p)
#define WDTIM_MATCH0(p)
#define WDTIM_EMR(p)
#define WDTIM_PULSE(p)
#define WDTIM_RES(p)

/* WDTIM_INT bit definitions */
#define MATCH_INT

/* WDTIM_CTRL bit definitions */
#define COUNT_ENAB
#define RESET_COUNT
#define DEBUG_EN

/* WDTIM_MCTRL bit definitions */
#define MR0_INT
#undef  RESET_COUNT0
#define RESET_COUNT0
#define STOP_COUNT0
#define M_RES1
#define M_RES2
#define RESFRC1
#define RESFRC2

/* WDTIM_EMR bit definitions */
#define EXT_MATCH0
#define MATCH_OUTPUT_HIGH

/* WDTIM_RES bit definitions */
#define WDOG_RESET

#define WDOG_COUNTER_RATE

static bool nowayout = WATCHDOG_NOWAYOUT;
static unsigned int heartbeat;

static DEFINE_SPINLOCK(io_lock);
static void __iomem	*wdt_base;
static struct clk	*wdt_clk;

static int pnx4008_wdt_start(struct watchdog_device *wdd)
{}

static int pnx4008_wdt_stop(struct watchdog_device *wdd)
{}

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

static int pnx4008_restart_handler(struct watchdog_device *wdd,
				   unsigned long mode, void *cmd)
{}

static const struct watchdog_info pnx4008_wdt_ident =;

static const struct watchdog_ops pnx4008_wdt_ops =;

static struct watchdog_device pnx4008_wdd =;

static int pnx4008_wdt_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_OF
static const struct of_device_id pnx4008_wdt_match[] =;
MODULE_DEVICE_TABLE(of, pnx4008_wdt_match);
#endif

static struct platform_driver platform_wdt_driver =;

module_platform_driver();

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

module_param(heartbeat, uint, 0);
MODULE_PARM_DESC();

module_param(nowayout, bool, 0);
MODULE_PARM_DESC();

MODULE_LICENSE();
MODULE_ALIAS();