drivers/acpi/battery.c
Source file repositories/reference/linux-study-clean/drivers/acpi/battery.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/battery.c- Extension
.c- Size
- 38660 bytes
- Lines
- 1338
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/delay.hlinux/dmi.hlinux/jiffies.hlinux/kernel.hlinux/list.hlinux/module.hlinux/mutex.hlinux/platform_device.hlinux/slab.hlinux/suspend.hlinux/types.hlinux/unaligned.hlinux/acpi.hlinux/power_supply.hacpi/battery.h
Detected Declarations
struct acpi_batterystruct acpi_offsetsfunction acpi_battery_presentfunction acpi_battery_technologyfunction acpi_battery_is_chargedfunction acpi_battery_is_degradedfunction acpi_battery_handle_dischargingfunction acpi_battery_get_propertyfunction extract_packagefunction acpi_battery_get_statusfunction extract_battery_infofunction acpi_battery_get_infofunction acpi_battery_get_statefunction acpi_battery_set_alarmfunction acpi_battery_init_alarmfunction acpi_battery_alarm_showfunction acpi_battery_alarm_storefunction battery_hook_unregister_unlockedfunction battery_hook_unregisterfunction battery_hook_registerfunction devm_battery_hook_unregisterfunction devm_battery_hook_registerfunction battery_hook_add_batteryfunction battery_hook_remove_batteryfunction battery_hook_exitfunction sysfs_add_batteryfunction sysfs_remove_batteryfunction find_batteryfunction acpi_battery_quirksfunction acpi_battery_updatefunction acpi_battery_refreshfunction acpi_battery_notifyfunction battery_notifyfunction battery_bix_broken_package_quirkfunction battery_notification_delay_quirkfunction battery_ac_is_broken_quirkfunction acpi_battery_wakeup_cleanupfunction devm_acpi_battery_init_wakeupfunction sysfs_battery_cleanupfunction devm_acpi_battery_update_retryfunction acpi_battery_probefunction acpi_battery_removefunction acpi_battery_resumefunction acpi_battery_initfunction acpi_battery_exitmodule init acpi_battery_initexport battery_hook_unregisterexport battery_hook_register
Annotated Snippet
module_init(acpi_battery_init);
module_exit(acpi_battery_exit);
Annotation
- Immediate include surface: `linux/delay.h`, `linux/dmi.h`, `linux/jiffies.h`, `linux/kernel.h`, `linux/list.h`, `linux/module.h`, `linux/mutex.h`, `linux/platform_device.h`.
- Detected declarations: `struct acpi_battery`, `struct acpi_offsets`, `function acpi_battery_present`, `function acpi_battery_technology`, `function acpi_battery_is_charged`, `function acpi_battery_is_degraded`, `function acpi_battery_handle_discharging`, `function acpi_battery_get_property`, `function extract_package`, `function acpi_battery_get_status`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.