drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c- Extension
.c- Size
- 1547 bytes
- Lines
- 53
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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/gpio/machine.hlinux/gpio/consumer.hlinux/kernel.hlinux/module.hlinux/platform_device.hsimatic-ipc-batt.h
Detected Declarations
function simatic_ipc_batt_elkhartlake_removefunction simatic_ipc_batt_elkhartlake_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Siemens SIMATIC IPC driver for CMOS battery monitoring
*
* Copyright (c) Siemens AG, 2023
*
* Authors:
* Henning Schild <henning.schild@siemens.com>
*/
#include <linux/gpio/machine.h>
#include <linux/gpio/consumer.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include "simatic-ipc-batt.h"
static struct gpiod_lookup_table simatic_ipc_batt_gpio_table_bx_21a = {
.table = {
GPIO_LOOKUP_IDX("INTC1020:04", 18, NULL, 0, GPIO_ACTIVE_HIGH),
GPIO_LOOKUP_IDX("INTC1020:04", 19, NULL, 1, GPIO_ACTIVE_HIGH),
GPIO_LOOKUP_IDX("INTC1020:01", 66, NULL, 2, GPIO_ACTIVE_HIGH),
{} /* Terminating entry */
},
};
static void simatic_ipc_batt_elkhartlake_remove(struct platform_device *pdev)
{
simatic_ipc_batt_remove(pdev, &simatic_ipc_batt_gpio_table_bx_21a);
}
static int simatic_ipc_batt_elkhartlake_probe(struct platform_device *pdev)
{
return simatic_ipc_batt_probe(pdev, &simatic_ipc_batt_gpio_table_bx_21a);
}
static struct platform_driver simatic_ipc_batt_driver = {
.probe = simatic_ipc_batt_elkhartlake_probe,
.remove = simatic_ipc_batt_elkhartlake_remove,
.driver = {
.name = KBUILD_MODNAME,
},
};
module_platform_driver(simatic_ipc_batt_driver);
MODULE_DESCRIPTION("CMOS Battery monitoring for Simatic IPCs based on Elkhart Lake GPIO");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:" KBUILD_MODNAME);
MODULE_SOFTDEP("pre: simatic-ipc-batt platform:elkhartlake-pinctrl");
MODULE_AUTHOR("Henning Schild <henning.schild@siemens.com>");
Annotation
- Immediate include surface: `linux/gpio/machine.h`, `linux/gpio/consumer.h`, `linux/kernel.h`, `linux/module.h`, `linux/platform_device.h`, `simatic-ipc-batt.h`.
- Detected declarations: `function simatic_ipc_batt_elkhartlake_remove`, `function simatic_ipc_batt_elkhartlake_probe`.
- Atlas domain: Driver Families / drivers/platform.
- 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.