drivers/media/platform/qcom/iris/iris_core.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/iris/iris_core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/iris/iris_core.c- Extension
.c- Size
- 1944 bytes
- Lines
- 104
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pm_runtime.hiris_core.hiris_firmware.hiris_state.hiris_vpu_common.h
Detected Declarations
function Copyrightfunction iris_wait_for_system_responsefunction iris_core_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/pm_runtime.h>
#include "iris_core.h"
#include "iris_firmware.h"
#include "iris_state.h"
#include "iris_vpu_common.h"
void iris_core_deinit(struct iris_core *core)
{
pm_runtime_resume_and_get(core->dev);
mutex_lock(&core->lock);
if (core->state != IRIS_CORE_DEINIT) {
iris_fw_unload(core);
iris_vpu_power_off(core);
iris_hfi_queues_deinit(core);
core->state = IRIS_CORE_DEINIT;
}
mutex_unlock(&core->lock);
pm_runtime_put_sync(core->dev);
}
static int iris_wait_for_system_response(struct iris_core *core)
{
int ret;
if (core->state == IRIS_CORE_ERROR)
return -EIO;
ret = wait_for_completion_timeout(&core->core_init_done,
msecs_to_jiffies(HW_RESPONSE_TIMEOUT_VALUE));
if (!ret) {
core->state = IRIS_CORE_ERROR;
return -ETIMEDOUT;
}
return 0;
}
int iris_core_init(struct iris_core *core)
{
int ret;
mutex_lock(&core->lock);
if (core->state == IRIS_CORE_INIT) {
ret = 0;
goto exit;
} else if (core->state == IRIS_CORE_ERROR) {
ret = -EINVAL;
goto error;
}
core->state = IRIS_CORE_INIT;
ret = iris_hfi_queues_init(core);
if (ret)
goto error;
ret = iris_vpu_power_on(core);
if (ret)
goto error_queue_deinit;
ret = iris_fw_load(core);
if (ret)
goto error_power_off;
ret = iris_vpu_boot_firmware(core);
if (ret)
goto error_unload_fw;
ret = iris_vpu_switch_to_hwmode(core);
if (ret)
goto error_unload_fw;
core->iris_firmware_data->init_hfi_ops(core);
ret = iris_hfi_core_init(core);
if (ret)
goto error_unload_fw;
mutex_unlock(&core->lock);
return iris_wait_for_system_response(core);
Annotation
- Immediate include surface: `linux/pm_runtime.h`, `iris_core.h`, `iris_firmware.h`, `iris_state.h`, `iris_vpu_common.h`.
- Detected declarations: `function Copyright`, `function iris_wait_for_system_response`, `function iris_core_init`.
- 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.
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.