drivers/acpi/mipi-disco-img.c
Source file repositories/reference/linux-study-clean/drivers/acpi/mipi-disco-img.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/mipi-disco-img.c- Extension
.c- Size
- 23465 bytes
- Lines
- 805
- Domain
- Driver Families
- Bucket
- drivers/acpi
- 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.
- 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/dmi.hlinux/limits.hlinux/list.hlinux/module.hlinux/overflow.hlinux/types.hlinux/slab.hlinux/string.hmedia/v4l2-fwnode.hinternal.hasm/cpu_device_id.hasm/intel-family.h
Detected Declarations
struct crs_csi2_connectionstruct crs_csi2struct csi2_resources_walk_datafunction acpi_mipi_data_tagfunction parse_csi2_resourcefunction csi_csr2_release_connectionsfunction list_for_each_entry_safefunction acpi_mipi_del_crs_csi2function acpi_mipi_check_crs_csi2function alloc_crs_csi2_swnodesfunction next_csi2_port_indexfunction prepare_crs_csi2_swnodesfunction acpi_mipi_scan_crs_csi2function list_for_each_entryfunction init_csi2_port_localfunction init_csi2_portfunction init_crs_csi2_swnodesfunction acpi_mipi_init_crs_csi2_swnodesfunction acpi_mipi_crs_csi2_cleanupfunction instead
Annotated Snippet
struct crs_csi2_connection {
struct list_head entry;
struct acpi_resource_csi2_serialbus csi2_data;
acpi_handle remote_handle;
char remote_name[];
};
/* Data extracted from _CRS CSI-2 resource descriptors for one device. */
struct crs_csi2 {
struct list_head entry;
acpi_handle handle;
struct acpi_device_software_nodes *swnodes;
struct list_head connections;
u32 port_count;
};
struct csi2_resources_walk_data {
acpi_handle handle;
struct list_head connections;
};
static acpi_status parse_csi2_resource(struct acpi_resource *res, void *context)
{
struct csi2_resources_walk_data *crwd = context;
struct acpi_resource_csi2_serialbus *csi2_res;
struct acpi_resource_source *csi2_res_src;
u16 csi2_res_src_length;
struct crs_csi2_connection *conn;
acpi_handle remote_handle;
if (res->type != ACPI_RESOURCE_TYPE_SERIAL_BUS)
return AE_OK;
csi2_res = &res->data.csi2_serial_bus;
if (csi2_res->type != ACPI_RESOURCE_SERIAL_TYPE_CSI2)
return AE_OK;
csi2_res_src = &csi2_res->resource_source;
if (ACPI_FAILURE(acpi_get_handle(NULL, csi2_res_src->string_ptr,
&remote_handle))) {
acpi_handle_debug(crwd->handle,
"unable to find resource source\n");
return AE_OK;
}
csi2_res_src_length = csi2_res_src->string_length;
if (!csi2_res_src_length) {
acpi_handle_debug(crwd->handle,
"invalid resource source string length\n");
return AE_OK;
}
conn = kmalloc_flex(*conn, remote_name, csi2_res_src_length + 1);
if (!conn)
return AE_OK;
conn->csi2_data = *csi2_res;
strscpy(conn->remote_name, csi2_res_src->string_ptr, csi2_res_src_length);
conn->csi2_data.resource_source.string_ptr = conn->remote_name;
conn->remote_handle = remote_handle;
list_add(&conn->entry, &crwd->connections);
return AE_OK;
}
static struct crs_csi2 *acpi_mipi_add_crs_csi2(acpi_handle handle,
struct list_head *list)
{
struct crs_csi2 *csi2;
csi2 = kzalloc_obj(*csi2);
if (!csi2)
return NULL;
csi2->handle = handle;
INIT_LIST_HEAD(&csi2->connections);
csi2->port_count = 1;
if (ACPI_FAILURE(acpi_attach_data(handle, acpi_mipi_data_tag, csi2))) {
kfree(csi2);
return NULL;
}
list_add(&csi2->entry, list);
return csi2;
}
static struct crs_csi2 *acpi_mipi_get_crs_csi2(acpi_handle handle)
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/dmi.h`, `linux/limits.h`, `linux/list.h`, `linux/module.h`, `linux/overflow.h`, `linux/types.h`, `linux/slab.h`.
- Detected declarations: `struct crs_csi2_connection`, `struct crs_csi2`, `struct csi2_resources_walk_data`, `function acpi_mipi_data_tag`, `function parse_csi2_resource`, `function csi_csr2_release_connections`, `function list_for_each_entry_safe`, `function acpi_mipi_del_crs_csi2`, `function acpi_mipi_check_crs_csi2`, `function alloc_crs_csi2_swnodes`.
- Atlas domain: Driver Families / drivers/acpi.
- 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.