linux/drivers/watchdog/lpc18xx_wdt.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * NXP LPC18xx Watchdog Timer (WDT)
 *
 * Copyright (c) 2015 Ariel D'Alessandro <[email protected]>
 *
 * Notes
 * -----
 * The Watchdog consists of a fixed divide-by-4 clock pre-scaler and a 24-bit
 * counter which decrements on every clock cycle.
 */

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

/* Registers */
#define LPC18XX_WDT_MOD
#define LPC18XX_WDT_MOD_WDEN
#define LPC18XX_WDT_MOD_WDRESET

#define LPC18XX_WDT_TC
#define LPC18XX_WDT_TC_MIN
#define LPC18XX_WDT_TC_MAX

#define LPC18XX_WDT_FEED
#define LPC18XX_WDT_FEED_MAGIC1
#define LPC18XX_WDT_FEED_MAGIC2

#define LPC18XX_WDT_TV

/* Clock pre-scaler */
#define LPC18XX_WDT_CLK_DIV

/* Timeout values in seconds */
#define LPC18XX_WDT_DEF_TIMEOUT

static int heartbeat;
module_param(heartbeat, int, 0);
MODULE_PARM_DESC();

static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC();

struct lpc18xx_wdt_dev {};

static int lpc18xx_wdt_feed(struct watchdog_device *wdt_dev)
{}

static void lpc18xx_wdt_timer_feed(struct timer_list *t)
{}

/*
 * Since LPC18xx Watchdog cannot be disabled in hardware, we must keep feeding
 * it with a timer until userspace watchdog software takes over.
 */
static int lpc18xx_wdt_stop(struct watchdog_device *wdt_dev)
{}

static void __lpc18xx_wdt_set_timeout(struct lpc18xx_wdt_dev *lpc18xx_wdt)
{}

static int lpc18xx_wdt_set_timeout(struct watchdog_device *wdt_dev,
				   unsigned int new_timeout)
{}

static unsigned int lpc18xx_wdt_get_timeleft(struct watchdog_device *wdt_dev)
{}

static int lpc18xx_wdt_start(struct watchdog_device *wdt_dev)
{}

static int lpc18xx_wdt_restart(struct watchdog_device *wdt_dev,
			       unsigned long action, void *data)
{}

static const struct watchdog_info lpc18xx_wdt_info =;

static const struct watchdog_ops lpc18xx_wdt_ops =;

static int lpc18xx_wdt_probe(struct platform_device *pdev)
{}

static void lpc18xx_wdt_remove(struct platform_device *pdev)
{}

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

static struct platform_driver lpc18xx_wdt_driver =;
module_platform_driver();

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