drivers/input/misc/atlas_btns.c
Source file repositories/reference/linux-study-clean/drivers/input/misc/atlas_btns.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/misc/atlas_btns.c- Extension
.c- Size
- 3756 bytes
- Lines
- 148
- Domain
- Driver Families
- Bucket
- drivers/input
- 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/kernel.hlinux/module.hlinux/input.hlinux/types.hlinux/acpi.hlinux/platform_device.hlinux/uaccess.h
Detected Declarations
function acpi_atlas_button_setupfunction acpi_atlas_button_handlerfunction atlas_acpi_button_probefunction atlas_acpi_button_remove
Annotated Snippet
if (i < 9) {
atlas_keymap[i] = KEY_F1 + i;
__set_bit(KEY_F1 + i, input_dev->keybit);
} else
atlas_keymap[i] = KEY_RESERVED;
}
err = input_register_device(input_dev);
if (err) {
pr_err("couldn't register input device\n");
input_free_device(input_dev);
return err;
}
/* hookup button handler */
status = acpi_install_address_space_handler(device->handle,
0x81, &acpi_atlas_button_handler,
&acpi_atlas_button_setup, device);
if (ACPI_FAILURE(status)) {
pr_err("error installing addr spc handler\n");
input_unregister_device(input_dev);
err = -EINVAL;
}
return err;
}
static void atlas_acpi_button_remove(struct platform_device *pdev)
{
struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
acpi_status status;
status = acpi_remove_address_space_handler(device->handle,
0x81, &acpi_atlas_button_handler);
if (ACPI_FAILURE(status))
pr_err("error removing addr spc handler\n");
input_unregister_device(input_dev);
}
static const struct acpi_device_id atlas_device_ids[] = {
{"ASIM0000", 0},
{"", 0},
};
MODULE_DEVICE_TABLE(acpi, atlas_device_ids);
static struct platform_driver atlas_acpi_driver = {
.probe = atlas_acpi_button_probe,
.remove = atlas_acpi_button_remove,
.driver = {
.name = ACPI_ATLAS_NAME,
.acpi_match_table = atlas_device_ids,
},
};
module_platform_driver(atlas_acpi_driver);
MODULE_AUTHOR("Jaya Kumar");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Atlas button driver");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/input.h`, `linux/types.h`, `linux/acpi.h`, `linux/platform_device.h`, `linux/uaccess.h`.
- Detected declarations: `function acpi_atlas_button_setup`, `function acpi_atlas_button_handler`, `function atlas_acpi_button_probe`, `function atlas_acpi_button_remove`.
- Atlas domain: Driver Families / drivers/input.
- 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.