drivers/watchdog/simatic-ipc-wdt.c
Source file repositories/reference/linux-study-clean/drivers/watchdog/simatic-ipc-wdt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/watchdog/simatic-ipc-wdt.c- Extension
.c- Size
- 6182 bytes
- Lines
- 234
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/errno.hlinux/init.hlinux/io.hlinux/ioport.hlinux/kernel.hlinux/module.hlinux/pci.hlinux/platform_data/x86/p2sb.hlinux/platform_data/x86/simatic-ipc-base.hlinux/platform_device.hlinux/sizes.hlinux/util_macros.hlinux/watchdog.h
Detected Declarations
function wd_startfunction wd_stopfunction wd_pingfunction wd_set_timeoutfunction wd_secondary_enablefunction wd_setupfunction simatic_ipc_wdt_probe
Annotated Snippet
if (!request_muxed_region(res->start, resource_size(res), res->name)) {
dev_err(dev,
"Unable to register IO resource at %pR\n",
&gp_status_reg_227e_res);
return -EBUSY;
}
fallthrough;
case SIMATIC_IPC_DEVICE_427E:
wdd_data.parent = dev;
break;
default:
return -EINVAL;
}
if (!devm_request_region(dev, io_resource_enable.start,
resource_size(&io_resource_enable),
io_resource_enable.name)) {
dev_err(dev,
"Unable to register IO resource at %#x\n",
WD_ENABLE_IOADR);
return -EBUSY;
}
if (!devm_request_region(dev, io_resource_trigger.start,
resource_size(&io_resource_trigger),
io_resource_trigger.name)) {
dev_err(dev,
"Unable to register IO resource at %#x\n",
WD_TRIGGER_IOADR);
return -EBUSY;
}
if (plat->devmode == SIMATIC_IPC_DEVICE_427E) {
res = &mem_resource;
ret = p2sb_bar(NULL, 0, res);
if (ret)
return ret;
/* do the final address calculation */
res->start = res->start + (GPIO_COMMUNITY0_PORT_ID << 16) +
PAD_CFG_DW0_GPP_A_23;
res->end = res->start + SZ_4 - 1;
wd_reset_base_addr = devm_ioremap_resource(dev, res);
if (IS_ERR(wd_reset_base_addr))
return PTR_ERR(wd_reset_base_addr);
}
wdd_data.bootstatus = wd_setup(plat->devmode);
if (wdd_data.bootstatus)
dev_warn(dev, "last reboot caused by watchdog reset\n");
if (plat->devmode == SIMATIC_IPC_DEVICE_227E)
release_region(gp_status_reg_227e_res.start,
resource_size(&gp_status_reg_227e_res));
watchdog_set_nowayout(&wdd_data, nowayout);
watchdog_stop_on_reboot(&wdd_data);
return devm_watchdog_register_device(dev, &wdd_data);
}
static struct platform_driver simatic_ipc_wdt_driver = {
.probe = simatic_ipc_wdt_probe,
.driver = {
.name = KBUILD_MODNAME,
},
};
module_platform_driver(simatic_ipc_wdt_driver);
MODULE_DESCRIPTION("Siemens SIMATIC IPC driver for Watchdogs");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:" KBUILD_MODNAME);
MODULE_AUTHOR("Gerd Haeussler <gerd.haeussler.ext@siemens.com>");
Annotation
- Immediate include surface: `linux/device.h`, `linux/errno.h`, `linux/init.h`, `linux/io.h`, `linux/ioport.h`, `linux/kernel.h`, `linux/module.h`, `linux/pci.h`.
- Detected declarations: `function wd_start`, `function wd_stop`, `function wd_ping`, `function wd_set_timeout`, `function wd_secondary_enable`, `function wd_setup`, `function simatic_ipc_wdt_probe`.
- Atlas domain: Driver Families / drivers/watchdog.
- Implementation status: source implementation candidate.
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.