drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c- Extension
.c- Size
- 14064 bytes
- Lines
- 555
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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/clk.hlinux/device.hlinux/dmi.hlinux/platform_data/x86/int3472.hlinux/property.hmedia/ipu-bridge.hmedia/v4l2-fwnode.hatomisp_cmd.hatomisp_csi2.hatomisp_internal.h
Detected Declarations
struct atomisp_sensor_configstruct gmin_cfg_varstruct sensor_async_subdevfunction gmin_cfg_get_intfunction atomisp_csi2_get_pmc_clk_nr_from_acpi_pr0function atomisp_csi2_set_pmc_clk_freqfunction atomisp_csi2_get_portfunction ipu_bridge_initfunction atomisp_csi2_parse_sensor_fwnodefunction atomisp_csi2_bridge_initfunction atomisp_notifier_boundfunction atomisp_notifier_unbindfunction atomisp_notifier_completefunction atomisp_csi2_bridge_parse_firmware
Annotated Snippet
struct atomisp_sensor_config {
int lanes;
bool vcm;
};
#define ATOMISP_SENSOR_CONFIG(_HID, _LANES, _VCM) \
{ \
.id = _HID, \
.driver_data = (long)&((const struct atomisp_sensor_config) { \
.lanes = _LANES, \
.vcm = _VCM, \
}) \
}
/*
* gmin_cfg parsing code. This is a cleaned up version of the gmin_cfg parsing
* code from atomisp_gmin_platform.c.
* Once all sensors are moved to v4l2-async probing atomisp_gmin_platform.c can
* be removed and the duplication of this code goes away.
*/
struct gmin_cfg_var {
const char *acpi_dev_name;
const char *key;
const char *val;
};
static struct gmin_cfg_var lenovo_ideapad_miix_310_vars[] = {
/* _DSM contains the wrong CsiPort! */
{ "OVTI2680:01", "CsiPort", "0" },
{}
};
static struct gmin_cfg_var xiaomi_mipad2_vars[] = {
/* _DSM contains the wrong CsiPort for the front facing OV5693 sensor */
{ "INT33BE:00", "CsiPort", "0" },
/* _DSM contains the wrong CsiLanes for the back facing T4KA3 sensor */
{ "XMCC0003:00", "CsiLanes", "4" },
{}
};
static const struct dmi_system_id gmin_cfg_dmi_overrides[] = {
{
/* Lenovo Ideapad Miix 310 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10"),
},
.driver_data = lenovo_ideapad_miix_310_vars,
},
{
/* Xiaomi Mipad2 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Xiaomi Inc"),
DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"),
},
.driver_data = xiaomi_mipad2_vars,
},
{}
};
static char *gmin_cfg_get_dsm(struct acpi_device *adev, const char *key)
{
union acpi_object *obj, *key_el, *val_el;
char *val = NULL;
int i;
obj = acpi_evaluate_dsm_typed(adev->handle, &atomisp_dsm_guid, 0, 0,
NULL, ACPI_TYPE_PACKAGE);
if (!obj)
return NULL;
for (i = 0; i + 1 < obj->package.count; i += 2) {
key_el = &obj->package.elements[i + 0];
val_el = &obj->package.elements[i + 1];
if (key_el->type != ACPI_TYPE_STRING || val_el->type != ACPI_TYPE_STRING)
break;
if (!strcmp(key_el->string.pointer, key)) {
val = kstrdup(val_el->string.pointer, GFP_KERNEL);
if (!val)
break;
acpi_handle_info(adev->handle, "%s: Using DSM entry %s=%s\n",
dev_name(&adev->dev), key, val);
break;
}
}
ACPI_FREE(obj);
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/clk.h`, `linux/device.h`, `linux/dmi.h`, `linux/platform_data/x86/int3472.h`, `linux/property.h`, `media/ipu-bridge.h`, `media/v4l2-fwnode.h`.
- Detected declarations: `struct atomisp_sensor_config`, `struct gmin_cfg_var`, `struct sensor_async_subdev`, `function gmin_cfg_get_int`, `function atomisp_csi2_get_pmc_clk_nr_from_acpi_pr0`, `function atomisp_csi2_set_pmc_clk_freq`, `function atomisp_csi2_get_port`, `function ipu_bridge_init`, `function atomisp_csi2_parse_sensor_fwnode`, `function atomisp_csi2_bridge_init`.
- Atlas domain: Driver Families / drivers/staging.
- 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.