#include <linux/clk.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>
#include <linux/watchdog.h>
#define STARFIVE_WDT_JH7100_INTSTAUS …
#define STARFIVE_WDT_JH7100_CONTROL …
#define STARFIVE_WDT_JH7100_LOAD …
#define STARFIVE_WDT_JH7100_EN …
#define STARFIVE_WDT_JH7100_RELOAD …
#define STARFIVE_WDT_JH7100_VALUE …
#define STARFIVE_WDT_JH7100_INTCLR …
#define STARFIVE_WDT_JH7100_LOCK …
#define STARFIVE_WDT_JH7110_LOAD …
#define STARFIVE_WDT_JH7110_VALUE …
#define STARFIVE_WDT_JH7110_CONTROL …
#define STARFIVE_WDT_JH7110_INTCLR …
#define STARFIVE_WDT_JH7110_IMS …
#define STARFIVE_WDT_JH7110_LOCK …
#define STARFIVE_WDT_ENABLE …
#define STARFIVE_WDT_EN_SHIFT …
#define STARFIVE_WDT_RESET_EN …
#define STARFIVE_WDT_JH7100_RST_EN_SHIFT …
#define STARFIVE_WDT_JH7110_RST_EN_SHIFT …
#define STARFIVE_WDT_JH7100_UNLOCK_KEY …
#define STARFIVE_WDT_JH7110_UNLOCK_KEY …
#define STARFIVE_WDT_INTCLR …
#define STARFIVE_WDT_JH7100_INTCLR_AVA_SHIFT …
#define STARFIVE_WDT_MAXCNT …
#define STARFIVE_WDT_DEFAULT_TIME …
#define STARFIVE_WDT_DELAY_US …
#define STARFIVE_WDT_TIMEOUT_US …
#define STARFIVE_WDT_EARLY_ENA …
static bool nowayout = … WATCHDOG_NOWAYOUT;
static int heartbeat;
static bool early_enable = …;
module_param(heartbeat, int, 0);
module_param(early_enable, bool, 0);
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
struct starfive_wdt_variant { … };
struct starfive_wdt { … };
static const struct starfive_wdt_variant starfive_wdt_jh7100_variant = …;
static const struct starfive_wdt_variant starfive_wdt_jh7110_variant = …;
static int starfive_wdt_enable_clock(struct starfive_wdt *wdt)
{ … }
static void starfive_wdt_disable_clock(struct starfive_wdt *wdt)
{ … }
static inline int starfive_wdt_get_clock(struct starfive_wdt *wdt)
{ … }
static inline int starfive_wdt_reset_init(struct device *dev)
{ … }
static u32 starfive_wdt_ticks_to_sec(struct starfive_wdt *wdt, u32 ticks)
{ … }
static void starfive_wdt_unlock(struct starfive_wdt *wdt)
__acquires(&wdt->lock)
{ … }
static void starfive_wdt_lock(struct starfive_wdt *wdt)
__releases(&wdt->lock)
{ … }
static void starfive_wdt_enable_reset(struct starfive_wdt *wdt)
{ … }
static bool starfive_wdt_raise_irq_status(struct starfive_wdt *wdt)
{ … }
static int starfive_wdt_wait_int_free(struct starfive_wdt *wdt)
{ … }
static int starfive_wdt_int_clr(struct starfive_wdt *wdt)
{ … }
static inline void starfive_wdt_set_count(struct starfive_wdt *wdt, u32 val)
{ … }
static inline u32 starfive_wdt_get_count(struct starfive_wdt *wdt)
{ … }
static inline void starfive_wdt_enable(struct starfive_wdt *wdt)
{ … }
static inline void starfive_wdt_disable(struct starfive_wdt *wdt)
{ … }
static inline void starfive_wdt_set_reload_count(struct starfive_wdt *wdt, u32 count)
{ … }
static unsigned int starfive_wdt_max_timeout(struct starfive_wdt *wdt)
{ … }
static unsigned int starfive_wdt_get_timeleft(struct watchdog_device *wdd)
{ … }
static int starfive_wdt_keepalive(struct watchdog_device *wdd)
{ … }
static int starfive_wdt_start(struct starfive_wdt *wdt)
{ … }
static void starfive_wdt_stop(struct starfive_wdt *wdt)
{ … }
static int starfive_wdt_pm_start(struct watchdog_device *wdd)
{ … }
static int starfive_wdt_pm_stop(struct watchdog_device *wdd)
{ … }
static int starfive_wdt_set_timeout(struct watchdog_device *wdd,
unsigned int timeout)
{ … }
#define STARFIVE_WDT_OPTIONS …
static const struct watchdog_info starfive_wdt_info = …;
static const struct watchdog_ops starfive_wdt_ops = …;
static int starfive_wdt_probe(struct platform_device *pdev)
{ … }
static void starfive_wdt_remove(struct platform_device *pdev)
{ … }
static void starfive_wdt_shutdown(struct platform_device *pdev)
{ … }
static int starfive_wdt_suspend(struct device *dev)
{ … }
static int starfive_wdt_resume(struct device *dev)
{ … }
static int starfive_wdt_runtime_suspend(struct device *dev)
{ … }
static int starfive_wdt_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops starfive_wdt_pm_ops = …;
static const struct of_device_id starfive_wdt_match[] = …;
MODULE_DEVICE_TABLE(of, starfive_wdt_match);
static struct platform_driver starfive_wdt_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;