linux/drivers/watchdog/max63xx_wdt.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * drivers/char/watchdog/max63xx_wdt.c
 *
 * Driver for max63{69,70,71,72,73,74} watchdog timers
 *
 * Copyright (C) 2009 Marc Zyngier <[email protected]>
 *
 * This driver assumes the watchdog pins are memory mapped (as it is
 * the case for the Arcom Zeus). Should it be connected over GPIOs or
 * another interface, some abstraction will have to be introduced.
 */

#include <linux/err.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/mod_devicetable.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/watchdog.h>
#include <linux/bitops.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/property.h>

#define DEFAULT_HEARTBEAT
#define MAX_HEARTBEAT

static unsigned int heartbeat =;
static bool nowayout  = WATCHDOG_NOWAYOUT;

/*
 * Memory mapping: a single byte, 3 first lower bits to select bit 3
 * to ping the watchdog.
 */
#define MAX6369_WDSET
#define MAX6369_WDI

#define MAX6369_WDSET_DISABLED

static int nodelay;

struct max63xx_wdt {};

/*
 * The timeout values used are actually the absolute minimum the chip
 * offers. Typical values on my board are slightly over twice as long
 * (10s setting ends up with a 25s timeout), and can be up to 3 times
 * the nominal setting (according to the datasheet). So please take
 * these values with a grain of salt. Same goes for the initial delay
 * "feature". Only max6373/74 have a few settings without this initial
 * delay (selected with the "nodelay" parameter).
 *
 * I also decided to remove from the tables any timeout smaller than a
 * second, as it looked completly overkill...
 */

/* Timeouts in second */
struct max63xx_timeout {};

static const struct max63xx_timeout max6369_table[] =;

static const struct max63xx_timeout max6371_table[] =;

static const struct max63xx_timeout max6373_table[] =;

static const struct max63xx_timeout *
max63xx_select_timeout(const struct max63xx_timeout *table, int value)
{}

static int max63xx_wdt_ping(struct watchdog_device *wdd)
{}

static int max63xx_wdt_start(struct watchdog_device *wdd)
{}

static int max63xx_wdt_stop(struct watchdog_device *wdd)
{}

static const struct watchdog_ops max63xx_wdt_ops =;

static const struct watchdog_info max63xx_wdt_info =;

static void max63xx_mmap_ping(struct max63xx_wdt *wdt)
{}

static void max63xx_mmap_set(struct max63xx_wdt *wdt, u8 set)
{}

static int max63xx_mmap_init(struct platform_device *p, struct max63xx_wdt *wdt)
{}

static int max63xx_wdt_probe(struct platform_device *pdev)
{}

static const struct platform_device_id max63xx_id_table[] =;
MODULE_DEVICE_TABLE(platform, max63xx_id_table);

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

static struct platform_driver max63xx_wdt_driver =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();

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

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

module_param(nodelay, int, 0);
MODULE_PARM_DESC();

MODULE_LICENSE();