linux/drivers/watchdog/at91sam9_wdt.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Watchdog driver for Atmel AT91SAM9x processors.
 *
 * Copyright (C) 2008 Renaud CERRATO [email protected]
 *
 */

/*
 * The Watchdog Timer Mode Register can be only written to once. If the
 * timeout need to be set from Linux, be sure that the bootstrap or the
 * bootloader doesn't write to this register.
 */

#define pr_fmt(fmt)

#include <linux/clk.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/types.h>
#include <linux/watchdog.h>
#include <linux/jiffies.h>
#include <linux/timer.h>
#include <linux/bitops.h>
#include <linux/uaccess.h>
#include <linux/of.h>
#include <linux/of_irq.h>

#include "at91sam9_wdt.h"

#define DRV_NAME

#define wdt_read(wdt, field)
#define wdt_write(wtd, field, val)

/* AT91SAM9 watchdog runs a 12bit counter @ 256Hz,
 * use this to convert a watchdog
 * value from/to milliseconds.
 */
#define ticks_to_hz_rounddown(t)
#define ticks_to_hz_roundup(t)
#define ticks_to_secs(t)
#define secs_to_ticks(s)

#define WDT_MR_RESET

/* Watchdog max counter value in ticks */
#define WDT_COUNTER_MAX_TICKS

/* Watchdog max delta/value in secs */
#define WDT_COUNTER_MAX_SECS

/* Hardware timeout in seconds */
#define WDT_HW_TIMEOUT

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

/* User land timeout */
#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();

#define to_wdt(wdd)
struct at91wdt {};

/* ......................................................................... */

static irqreturn_t wdt_interrupt(int irq, void *dev_id)
{}

/*
 * Reload the watchdog timer.  (ie, pat the watchdog)
 */
static inline void at91_wdt_reset(struct at91wdt *wdt)
{}

/*
 * Timer tick
 */
static void at91_ping(struct timer_list *t)
{}

static int at91_wdt_start(struct watchdog_device *wdd)
{}

static int at91_wdt_stop(struct watchdog_device *wdd)
{}

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

static int at91_wdt_init(struct platform_device *pdev, struct at91wdt *wdt)
{}

/* ......................................................................... */

static const struct watchdog_info at91_wdt_info =;

static const struct watchdog_ops at91_wdt_ops =;

#if defined(CONFIG_OF)
static int of_at91wdt_init(struct device_node *np, struct at91wdt *wdt)
{}
#else
static inline int of_at91wdt_init(struct device_node *np, struct at91wdt *wdt)
{
	return 0;
}
#endif

static int at91wdt_probe(struct platform_device *pdev)
{}

static void at91wdt_remove(struct platform_device *pdev)
{}

#if defined(CONFIG_OF)
static const struct of_device_id at91_wdt_dt_ids[] =;

MODULE_DEVICE_TABLE(of, at91_wdt_dt_ids);
#endif

static struct platform_driver at91wdt_driver =;
module_platform_driver();

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