drivers/input/serio/i8042-sparcio.h
Source file repositories/reference/linux-study-clean/drivers/input/serio/i8042-sparcio.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/serio/i8042-sparcio.h- Extension
.h- Size
- 3578 bytes
- Lines
- 161
- 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/of.hlinux/of_platform.hlinux/platform_device.hlinux/types.hasm/io.hasm/oplib.hasm/prom.h
Detected Declarations
function i8042_read_datafunction i8042_read_statusfunction i8042_write_datafunction i8042_write_commandfunction sparc_i8042_probefunction for_each_child_of_nodefunction of_node_name_eqfunction sparc_i8042_removefunction i8042_is_mr_coffeefunction i8042_platform_initfunction i8042_platform_exitfunction i8042_platform_initfunction i8042_platform_exit
Annotated Snippet
of_node_name_eq(dp, OBP_PS2KBD_NAME2)) {
struct platform_device *kbd = of_find_device_by_node(dp);
unsigned int irq = kbd->archdata.irqs[0];
if (irq == 0xffffffff)
irq = op->archdata.irqs[0];
i8042_kbd_irq = irq;
kbd_iobase = of_ioremap(&kbd->resource[0],
0, 8, "kbd");
kbd_res = &kbd->resource[0];
} else if (of_node_name_eq(dp, OBP_PS2MS_NAME1) ||
of_node_name_eq(dp, OBP_PS2MS_NAME2)) {
struct platform_device *ms = of_find_device_by_node(dp);
unsigned int irq = ms->archdata.irqs[0];
if (irq == 0xffffffff)
irq = op->archdata.irqs[0];
i8042_aux_irq = irq;
}
}
return 0;
}
static void sparc_i8042_remove(struct platform_device *op)
{
of_iounmap(kbd_res, kbd_iobase, 8);
}
static const struct of_device_id sparc_i8042_match[] = {
{
.name = "8042",
},
{},
};
MODULE_DEVICE_TABLE(of, sparc_i8042_match);
static struct platform_driver sparc_i8042_driver = {
.driver = {
.name = "i8042",
.of_match_table = sparc_i8042_match,
},
.probe = sparc_i8042_probe,
.remove = sparc_i8042_remove,
};
static bool i8042_is_mr_coffee(void)
{
struct device_node *root __free(device_node) = of_find_node_by_path("/");
const char *name = of_get_property(root, "name", NULL);
return name && !strcmp(name, "SUNW,JavaStation-1");
}
static int __init i8042_platform_init(void)
{
if (i8042_is_mr_coffee()) {
/* Hardcoded values for MrCoffee. */
i8042_kbd_irq = i8042_aux_irq = 13 | 0x20;
kbd_iobase = ioremap(0x71300060, 8);
if (!kbd_iobase)
return -ENODEV;
} else {
int err = platform_driver_register(&sparc_i8042_driver);
if (err)
return err;
if (i8042_kbd_irq == -1 ||
i8042_aux_irq == -1) {
if (kbd_iobase) {
of_iounmap(kbd_res, kbd_iobase, 8);
kbd_iobase = (void __iomem *) NULL;
}
return -ENODEV;
}
}
i8042_reset = I8042_RESET_ALWAYS;
return 0;
}
static inline void i8042_platform_exit(void)
{
if (!i8042_is_mr_coffee())
platform_driver_unregister(&sparc_i8042_driver);
}
#else /* !CONFIG_PCI */
static int __init i8042_platform_init(void)
{
return -ENODEV;
Annotation
- Immediate include surface: `linux/of.h`, `linux/of_platform.h`, `linux/platform_device.h`, `linux/types.h`, `asm/io.h`, `asm/oplib.h`, `asm/prom.h`.
- Detected declarations: `function i8042_read_data`, `function i8042_read_status`, `function i8042_write_data`, `function i8042_write_command`, `function sparc_i8042_probe`, `function for_each_child_of_node`, `function of_node_name_eq`, `function sparc_i8042_remove`, `function i8042_is_mr_coffee`, `function i8042_platform_init`.
- 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.