linux/drivers/watchdog/tegra_wdt.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/watchdog.h>

/* minimum and maximum watchdog trigger timeout, in seconds */
#define MIN_WDT_TIMEOUT
#define MAX_WDT_TIMEOUT

/*
 * Base of the WDT registers, from the timer base address.  There are
 * actually 5 watchdogs that can be configured (by pairing with an available
 * timer), at bases 0x100 + (WDT ID) * 0x20, where WDT ID is 0 through 4.
 * This driver only configures the first watchdog (WDT ID 0).
 */
#define WDT_BASE
#define WDT_ID

/*
 * Register base of the timer that's selected for pairing with the watchdog.
 * This driver arbitrarily uses timer 5, which is currently unused by
 * other drivers (in particular, the Tegra clocksource driver).  If this
 * needs to change, take care that the new timer is not used by the
 * clocksource driver.
 */
#define WDT_TIMER_BASE
#define WDT_TIMER_ID

/* WDT registers */
#define WDT_CFG
#define WDT_CFG_PERIOD_SHIFT
#define WDT_CFG_PERIOD_MASK
#define WDT_CFG_INT_EN
#define WDT_CFG_PMC2CAR_RST_EN
#define WDT_STS
#define WDT_STS_COUNT_SHIFT
#define WDT_STS_COUNT_MASK
#define WDT_STS_EXP_SHIFT
#define WDT_STS_EXP_MASK
#define WDT_CMD
#define WDT_CMD_START_COUNTER
#define WDT_CMD_DISABLE_COUNTER
#define WDT_UNLOCK
#define WDT_UNLOCK_PATTERN

/* Timer registers */
#define TIMER_PTV
#define TIMER_EN
#define TIMER_PERIODIC

struct tegra_wdt {};

#define WDT_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 int tegra_wdt_start(struct watchdog_device *wdd)
{}

static int tegra_wdt_stop(struct watchdog_device *wdd)
{}

static int tegra_wdt_ping(struct watchdog_device *wdd)
{}

static int tegra_wdt_set_timeout(struct watchdog_device *wdd,
				 unsigned int timeout)
{}

static unsigned int tegra_wdt_get_timeleft(struct watchdog_device *wdd)
{}

static const struct watchdog_info tegra_wdt_info =;

static const struct watchdog_ops tegra_wdt_ops =;

static int tegra_wdt_probe(struct platform_device *pdev)
{}

static int tegra_wdt_suspend(struct device *dev)
{}

static int tegra_wdt_resume(struct device *dev)
{}

static const struct of_device_id tegra_wdt_of_match[] =;
MODULE_DEVICE_TABLE(of, tegra_wdt_of_match);

static DEFINE_SIMPLE_DEV_PM_OPS(tegra_wdt_pm_ops,
				tegra_wdt_suspend, tegra_wdt_resume);

static struct platform_driver tegra_wdt_driver =;
module_platform_driver();

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