drivers/platform/x86/x86-android-tablets/core.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/x86-android-tablets/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/x86-android-tablets/core.c- Extension
.c- Size
- 15131 bytes
- Lines
- 566
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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.
- 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/acpi.hlinux/device.hlinux/dmi.hlinux/gpio/consumer.hlinux/gpio/machine.hlinux/irq.hlinux/module.hlinux/pci.hlinux/platform_device.hlinux/serdev.hlinux/string.hx86-android-tablets.h../serdev_helpers.h
Detected Declarations
function x86_android_tablet_get_gpiodfunction x86_acpi_irq_helper_getfunction get_i2c_adap_by_handlefunction match_parentfunction get_i2c_adap_by_pci_parentfunction x86_instantiate_i2c_clientfunction x86_instantiate_spi_devfunction get_serdev_controller_by_pci_parentfunction x86_instantiate_serdevfunction x86_android_tablet_removefunction x86_android_tablet_probefunction x86_android_tablet_initfunction x86_android_tablet_exitmodule init x86_android_tablet_init
Annotated Snippet
* Since this runs from module_init() it cannot use -EPROBE_DEFER,
* instead pre-load any modules which are listed as requirements.
*/
for (i = 0; dev_info->modules && dev_info->modules[i]; i++)
request_module(dev_info->modules[i]);
switch (dev_info->gpiochip_type) {
case X86_GPIOCHIP_BAYTRAIL:
gpiochip_node_group = baytrail_gpiochip_node_group;
break;
case X86_GPIOCHIP_CHERRYVIEW:
gpiochip_node_group = cherryview_gpiochip_node_group;
break;
case X86_GPIOCHIP_UNSPECIFIED:
gpiochip_node_group = NULL;
break;
}
ret = software_node_register_node_group(gpiochip_node_group);
if (ret)
return ret;
ret = software_node_register_node_group(dev_info->swnode_group);
if (ret) {
x86_android_tablet_remove(pdev);
return ret;
}
swnode_group = dev_info->swnode_group;
if (dev_info->init) {
ret = dev_info->init(&pdev->dev);
if (ret < 0) {
x86_android_tablet_remove(pdev);
return ret;
}
exit_handler = dev_info->exit;
}
i2c_clients = kzalloc_objs(*i2c_clients, dev_info->i2c_client_count);
if (!i2c_clients) {
x86_android_tablet_remove(pdev);
return -ENOMEM;
}
i2c_client_count = dev_info->i2c_client_count;
for (i = 0; i < i2c_client_count; i++) {
ret = x86_instantiate_i2c_client(dev_info, i);
if (ret < 0) {
x86_android_tablet_remove(pdev);
return ret;
}
}
spi_devs = kzalloc_objs(*spi_devs, dev_info->spi_dev_count);
if (!spi_devs) {
x86_android_tablet_remove(pdev);
return -ENOMEM;
}
spi_dev_count = dev_info->spi_dev_count;
for (i = 0; i < spi_dev_count; i++) {
ret = x86_instantiate_spi_dev(dev_info, i);
if (ret < 0) {
x86_android_tablet_remove(pdev);
return ret;
}
}
/* + 1 to make space for the (optional) gpio_keys_button platform device */
pdevs = kzalloc_objs(*pdevs, dev_info->pdev_count + 1);
if (!pdevs) {
x86_android_tablet_remove(pdev);
return -ENOMEM;
}
pdev_count = dev_info->pdev_count;
for (i = 0; i < pdev_count; i++) {
pdevs[i] = platform_device_register_full(&dev_info->pdev_info[i]);
if (IS_ERR(pdevs[i])) {
ret = PTR_ERR(pdevs[i]);
x86_android_tablet_remove(pdev);
return ret;
}
}
serdevs = kzalloc_objs(*serdevs, dev_info->serdev_count);
if (!serdevs) {
x86_android_tablet_remove(pdev);
return -ENOMEM;
}
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/device.h`, `linux/dmi.h`, `linux/gpio/consumer.h`, `linux/gpio/machine.h`, `linux/irq.h`, `linux/module.h`, `linux/pci.h`.
- Detected declarations: `function x86_android_tablet_get_gpiod`, `function x86_acpi_irq_helper_get`, `function get_i2c_adap_by_handle`, `function match_parent`, `function get_i2c_adap_by_pci_parent`, `function x86_instantiate_i2c_client`, `function x86_instantiate_spi_dev`, `function get_serdev_controller_by_pci_parent`, `function x86_instantiate_serdev`, `function x86_android_tablet_remove`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: integration 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.