drivers/watchdog/s3c2410_wdt.c
Source file repositories/reference/linux-study-clean/drivers/watchdog/s3c2410_wdt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/watchdog/s3c2410_wdt.c- Extension
.c- Size
- 28773 bytes
- Lines
- 945
- Domain
- Driver Families
- Bucket
- drivers/watchdog
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bits.hlinux/module.hlinux/moduleparam.hlinux/types.hlinux/timer.hlinux/watchdog.hlinux/platform_device.hlinux/interrupt.hlinux/clk.hlinux/uaccess.hlinux/io.hlinux/cpufreq.hlinux/slab.hlinux/err.hlinux/of.hlinux/mfd/syscon.hlinux/regmap.hlinux/delay.hlinux/math64.h
Detected Declarations
struct s3c2410_wdt_variantstruct s3c2410_wdtfunction s3c2410wdt_get_freqfunction s3c2410wdt_max_timeoutfunction s3c2410wdt_disable_wdt_resetfunction s3c2410wdt_mask_wdt_resetfunction s3c2410wdt_enable_counterfunction s3c2410wdt_enablefunction s3c2410wdt_mask_dbgackfunction s3c2410wdt_keepalivefunction __s3c2410wdt_stopfunction s3c2410wdt_stopfunction s3c2410wdt_startfunction s3c2410wdt_set_heartbeatfunction s3c2410wdt_restartfunction s3c2410wdt_irqfunction s3c2410wdt_get_bootstatusfunction s3c2410_get_wdt_drv_datafunction s3c2410wdt_wdt_disable_actionfunction s3c2410wdt_probefunction s3c2410wdt_shutdownfunction s3c2410wdt_suspendfunction s3c2410wdt_resume
Annotated Snippet
struct s3c2410_wdt_variant {
int disable_reg;
int mask_reset_reg;
bool mask_reset_inv;
int mask_bit;
int rst_stat_reg;
int rst_stat_bit;
int cnt_en_reg;
int cnt_en_bit;
u32 quirks;
};
struct s3c2410_wdt {
struct device *dev;
struct clk *bus_clk; /* for register interface (PCLK) */
struct clk *src_clk; /* for WDT counter */
void __iomem *reg_base;
unsigned int count;
spinlock_t lock;
unsigned long wtcon_save;
unsigned long wtdat_save;
struct watchdog_device wdt_device;
struct notifier_block freq_transition;
const struct s3c2410_wdt_variant *drv_data;
struct regmap *pmureg;
u32 max_cnt;
};
static const struct s3c2410_wdt_variant drv_data_s3c6410 = {
.quirks = QUIRK_HAS_WTCLRINT_REG,
};
static const struct s3c2410_wdt_variant drv_data_exynos5250 = {
.disable_reg = EXYNOS5_WDT_DISABLE_REG_OFFSET,
.mask_reset_reg = EXYNOS5_WDT_MASK_RESET_REG_OFFSET,
.mask_bit = 20,
.rst_stat_reg = EXYNOS5_RST_STAT_REG_OFFSET,
.rst_stat_bit = 20,
.quirks = QUIRK_HAS_WTCLRINT_REG | QUIRK_HAS_PMU_MASK_RESET | \
QUIRK_HAS_PMU_RST_STAT | QUIRK_HAS_PMU_AUTO_DISABLE,
};
static const struct s3c2410_wdt_variant drv_data_exynos5420 = {
.disable_reg = EXYNOS5_WDT_DISABLE_REG_OFFSET,
.mask_reset_reg = EXYNOS5_WDT_MASK_RESET_REG_OFFSET,
.mask_bit = 0,
.rst_stat_reg = EXYNOS5_RST_STAT_REG_OFFSET,
.rst_stat_bit = 9,
.quirks = QUIRK_HAS_WTCLRINT_REG | QUIRK_HAS_PMU_MASK_RESET | \
QUIRK_HAS_PMU_RST_STAT | QUIRK_HAS_PMU_AUTO_DISABLE,
};
static const struct s3c2410_wdt_variant drv_data_exynos7 = {
.disable_reg = EXYNOS5_WDT_DISABLE_REG_OFFSET,
.mask_reset_reg = EXYNOS5_WDT_MASK_RESET_REG_OFFSET,
.mask_bit = 23,
.rst_stat_reg = EXYNOS5_RST_STAT_REG_OFFSET,
.rst_stat_bit = 23, /* A57 WDTRESET */
.quirks = QUIRK_HAS_WTCLRINT_REG | QUIRK_HAS_PMU_MASK_RESET | \
QUIRK_HAS_PMU_RST_STAT | QUIRK_HAS_PMU_AUTO_DISABLE,
};
static const struct s3c2410_wdt_variant drv_data_exynos850_cl0 = {
.mask_reset_reg = EXYNOS850_CLUSTER0_NONCPU_INT_EN,
.mask_bit = 2,
.mask_reset_inv = true,
.rst_stat_reg = EXYNOS5_RST_STAT_REG_OFFSET,
.rst_stat_bit = EXYNOS850_CLUSTER0_WDTRESET_BIT,
.cnt_en_reg = EXYNOS850_CLUSTER0_NONCPU_OUT,
.cnt_en_bit = 7,
.quirks = QUIRK_HAS_WTCLRINT_REG | QUIRK_HAS_PMU_MASK_RESET | \
QUIRK_HAS_PMU_RST_STAT | QUIRK_HAS_PMU_CNT_EN,
};
static const struct s3c2410_wdt_variant drv_data_exynos850_cl1 = {
.mask_reset_reg = EXYNOS850_CLUSTER1_NONCPU_INT_EN,
.mask_bit = 2,
.mask_reset_inv = true,
.rst_stat_reg = EXYNOS5_RST_STAT_REG_OFFSET,
.rst_stat_bit = EXYNOS850_CLUSTER1_WDTRESET_BIT,
.cnt_en_reg = EXYNOS850_CLUSTER1_NONCPU_OUT,
.cnt_en_bit = 7,
.quirks = QUIRK_HAS_WTCLRINT_REG | QUIRK_HAS_PMU_MASK_RESET | \
QUIRK_HAS_PMU_RST_STAT | QUIRK_HAS_PMU_CNT_EN,
};
static const struct s3c2410_wdt_variant drv_data_exynos990_cl0 = {
.mask_reset_reg = GS_CLUSTER0_NONCPU_INT_EN,
.mask_bit = 2,
.mask_reset_inv = true,
Annotation
- Immediate include surface: `linux/bits.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/types.h`, `linux/timer.h`, `linux/watchdog.h`, `linux/platform_device.h`, `linux/interrupt.h`.
- Detected declarations: `struct s3c2410_wdt_variant`, `struct s3c2410_wdt`, `function s3c2410wdt_get_freq`, `function s3c2410wdt_max_timeout`, `function s3c2410wdt_disable_wdt_reset`, `function s3c2410wdt_mask_wdt_reset`, `function s3c2410wdt_enable_counter`, `function s3c2410wdt_enable`, `function s3c2410wdt_mask_dbgack`, `function s3c2410wdt_keepalive`.
- Atlas domain: Driver Families / drivers/watchdog.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.