drivers/media/pci/intel/ipu6/ipu6-isys.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/intel/ipu6/ipu6-isys.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/intel/ipu6/ipu6-isys.c- Extension
.c- Size
- 37209 bytes
- Lines
- 1366
- Domain
- Driver Families
- Bucket
- drivers/media
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/auxiliary_bus.hlinux/bitfield.hlinux/bits.hlinux/completion.hlinux/container_of.hlinux/delay.hlinux/device.hlinux/dma-mapping.hlinux/err.hlinux/firmware.hlinux/io.hlinux/irqreturn.hlinux/list.hlinux/module.hlinux/mutex.hlinux/pci.hlinux/pm_runtime.hlinux/pm_qos.hlinux/slab.hlinux/spinlock.hlinux/string.hmedia/ipu-bridge.hmedia/media-device.hmedia/media-entity.hmedia/v4l2-async.hmedia/v4l2-device.hmedia/v4l2-fwnode.hipu6-bus.hipu6-cpd.hipu6-dma.hipu6-isys.hipu6-isys-csi2.h
Detected Declarations
struct fwmsgenum ltr_did_typefunction isys_complete_ext_device_registrationfunction isys_stream_initfunction isys_csi2_unregister_subdevicesfunction isys_csi2_register_subdevicesfunction isys_csi2_create_media_linksfunction isys_unregister_video_devicesfunction isys_register_video_devicesfunction isys_setup_hwfunction ipu6_isys_csi2_isrfunction isys_isrfunction get_lut_ltrdidfunction set_iwake_registerfunction set_iwake_ltrdidfunction enable_iwakefunction update_watermark_settingfunction list_for_eachfunction isys_iwake_watermark_initfunction isys_iwake_watermark_cleanupfunction isys_notifier_boundfunction isys_notifier_completefunction isys_notifier_initfunction isys_notifier_cleanupfunction isys_register_devicesfunction isys_unregister_devicesfunction isys_runtime_pm_resumefunction isys_runtime_pm_suspendfunction isys_suspendfunction isys_resumefunction free_fw_msg_bufsfunction alloc_fw_msg_bufsfunction ipu6_cleanup_fw_msg_bufsfunction ipu6_put_fw_msg_buffunction isys_probefunction isys_removefunction resp_type_to_indexfunction isys_isr_one
Annotated Snippet
struct fwmsg {
int type;
char *msg;
bool valid_ts;
};
static const struct fwmsg fw_msg[] = {
{IPU6_FW_ISYS_RESP_TYPE_STREAM_OPEN_DONE, "STREAM_OPEN_DONE", 0},
{IPU6_FW_ISYS_RESP_TYPE_STREAM_CLOSE_ACK, "STREAM_CLOSE_ACK", 0},
{IPU6_FW_ISYS_RESP_TYPE_STREAM_START_ACK, "STREAM_START_ACK", 0},
{IPU6_FW_ISYS_RESP_TYPE_STREAM_START_AND_CAPTURE_ACK,
"STREAM_START_AND_CAPTURE_ACK", 0},
{IPU6_FW_ISYS_RESP_TYPE_STREAM_STOP_ACK, "STREAM_STOP_ACK", 0},
{IPU6_FW_ISYS_RESP_TYPE_STREAM_FLUSH_ACK, "STREAM_FLUSH_ACK", 0},
{IPU6_FW_ISYS_RESP_TYPE_PIN_DATA_READY, "PIN_DATA_READY", 1},
{IPU6_FW_ISYS_RESP_TYPE_STREAM_CAPTURE_ACK, "STREAM_CAPTURE_ACK", 0},
{IPU6_FW_ISYS_RESP_TYPE_STREAM_START_AND_CAPTURE_DONE,
"STREAM_START_AND_CAPTURE_DONE", 1},
{IPU6_FW_ISYS_RESP_TYPE_STREAM_CAPTURE_DONE, "STREAM_CAPTURE_DONE", 1},
{IPU6_FW_ISYS_RESP_TYPE_FRAME_SOF, "FRAME_SOF", 1},
{IPU6_FW_ISYS_RESP_TYPE_FRAME_EOF, "FRAME_EOF", 1},
{IPU6_FW_ISYS_RESP_TYPE_STATS_DATA_READY, "STATS_READY", 1},
{-1, "UNKNOWN MESSAGE", 0}
};
static u32 resp_type_to_index(int type)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(fw_msg); i++)
if (fw_msg[i].type == type)
return i;
return ARRAY_SIZE(fw_msg) - 1;
}
static int isys_isr_one(struct ipu6_bus_device *adev)
{
struct ipu6_isys *isys = ipu6_bus_get_drvdata(adev);
struct ipu6_fw_isys_resp_info_abi *resp;
struct ipu6_isys_stream *stream;
struct ipu6_isys_csi2 *csi2 = NULL;
u32 index;
u64 ts;
if (!isys->fwcom)
return 1;
resp = ipu6_fw_isys_get_resp(isys->fwcom, IPU6_BASE_MSG_RECV_QUEUES);
if (!resp)
return 1;
ts = (u64)resp->timestamp[1] << 32 | resp->timestamp[0];
index = resp_type_to_index(resp->type);
dev_dbg(&adev->auxdev.dev,
"FW resp %02d %s, stream %u, ts 0x%16.16llx, pin %d\n",
resp->type, fw_msg[index].msg, resp->stream_handle,
fw_msg[index].valid_ts ? ts : 0, resp->pin_id);
if (resp->error_info.error == IPU6_FW_ISYS_ERROR_STREAM_IN_SUSPENSION)
/* Suspension is kind of special case: not enough buffers */
dev_dbg(&adev->auxdev.dev,
"FW error resp SUSPENSION, details %d\n",
resp->error_info.error_details);
else if (resp->error_info.error)
dev_dbg(&adev->auxdev.dev,
"FW error resp error %d, details %d\n",
resp->error_info.error, resp->error_info.error_details);
if (resp->stream_handle >= IPU6_ISYS_MAX_STREAMS) {
dev_err(&adev->auxdev.dev, "bad stream handle %u\n",
resp->stream_handle);
goto leave;
}
stream = ipu6_isys_query_stream_by_handle(isys, resp->stream_handle);
if (!stream) {
dev_err(&adev->auxdev.dev, "stream of stream_handle %u is unused\n",
resp->stream_handle);
goto leave;
}
stream->error = resp->error_info.error;
csi2 = ipu6_isys_subdev_to_csi2(stream->asd);
switch (resp->type) {
case IPU6_FW_ISYS_RESP_TYPE_STREAM_OPEN_DONE:
complete(&stream->stream_open_completion);
break;
Annotation
- Immediate include surface: `linux/auxiliary_bus.h`, `linux/bitfield.h`, `linux/bits.h`, `linux/completion.h`, `linux/container_of.h`, `linux/delay.h`, `linux/device.h`, `linux/dma-mapping.h`.
- Detected declarations: `struct fwmsg`, `enum ltr_did_type`, `function isys_complete_ext_device_registration`, `function isys_stream_init`, `function isys_csi2_unregister_subdevices`, `function isys_csi2_register_subdevices`, `function isys_csi2_create_media_links`, `function isys_unregister_video_devices`, `function isys_register_video_devices`, `function isys_setup_hw`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.