drivers/media/platform/qcom/camss/camss-csid-gen3.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/camss/camss-csid-gen3.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/camss/camss-csid-gen3.c- Extension
.c- Size
- 10270 bytes
- Lines
- 364
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/completion.hlinux/delay.hlinux/interrupt.hlinux/io.hlinux/kernel.hlinux/of.hcamss.hcamss-csid.hcamss-csid-gen3.h
Detected Declarations
function Copyrightfunction __csid_ctrl_rdifunction __csid_configure_wrapperfunction __csid_configure_rdi_streamfunction csid_configure_streamfunction csid_configure_testgen_patternfunction csid_subdev_reg_updatefunction csid_isrfunction csid_resetfunction csid_subdev_init
Annotated Snippet
if (csid->phy.en_vc & BIT(i)) {
__csid_configure_rdi_stream(csid, enable, i, 0);
__csid_configure_rx(csid, &csid->phy, 0);
__csid_ctrl_rdi(csid, enable, i);
}
}
static int csid_configure_testgen_pattern(struct csid_device *csid, s32 val)
{
return 0;
}
static void csid_subdev_reg_update(struct csid_device *csid, int port_id, bool clear)
{
if (clear) {
csid->reg_update &= ~CSID_RUP_AUP_RDI(port_id);
} else {
csid->reg_update |= CSID_RUP_AUP_RDI(port_id);
writel(csid->reg_update, csid->base + CSID_RUP_AUP_CMD);
}
}
/*
* csid_isr - CSID module interrupt service routine
* @irq: Interrupt line
* @dev: CSID device
*
* Return IRQ_HANDLED on success
*/
static irqreturn_t csid_isr(int irq, void *dev)
{
struct csid_device *csid = dev;
u32 val, buf_done_val;
u8 reset_done;
int i;
val = readl(csid->base + CSID_TOP_IRQ_STATUS);
writel(val, csid->base + CSID_TOP_IRQ_CLEAR);
reset_done = val & TOP_IRQ_STATUS_RESET_DONE;
val = readl(csid->base + CSID_CSI2_RX_IRQ_STATUS);
writel(val, csid->base + CSID_CSI2_RX_IRQ_CLEAR);
buf_done_val = readl(csid->base + CSID_BUF_DONE_IRQ_STATUS);
writel(buf_done_val, csid->base + CSID_BUF_DONE_IRQ_CLEAR);
/* Read and clear IRQ status for each enabled RDI channel */
for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS; i++)
if (csid->phy.en_vc & BIT(i)) {
val = readl(csid->base + CSID_CSI2_RDIN_IRQ_STATUS(i));
writel(val, csid->base + CSID_CSI2_RDIN_IRQ_CLEAR(i));
if (val & RUP_DONE_IRQ_STATUS)
/* clear the reg update bit */
csid_subdev_reg_update(csid, i, true);
if (buf_done_val & BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i)) {
/*
* For Titan Gen3, bus done and RUP IRQ have been moved to
* CSID from VFE. Once CSID received bus done, need notify
* VFE of this event. Trigger VFE to handle bus done process.
*/
camss_buf_done(csid->camss, csid->id, i);
}
}
val = IRQ_CMD_CLEAR;
writel(val, csid->base + CSID_IRQ_CMD);
if (reset_done)
complete(&csid->reset_complete);
return IRQ_HANDLED;
}
/*
* csid_reset - Trigger reset on CSID module and wait to complete
* @csid: CSID device
*
* Return 0 on success or a negative error code otherwise
*/
static int csid_reset(struct csid_device *csid)
{
unsigned long time;
u32 val;
int i;
reinit_completion(&csid->reset_complete);
writel(1, csid->base + CSID_TOP_IRQ_CLEAR);
Annotation
- Immediate include surface: `linux/completion.h`, `linux/delay.h`, `linux/interrupt.h`, `linux/io.h`, `linux/kernel.h`, `linux/of.h`, `camss.h`, `camss-csid.h`.
- Detected declarations: `function Copyright`, `function __csid_ctrl_rdi`, `function __csid_configure_wrapper`, `function __csid_configure_rdi_stream`, `function csid_configure_stream`, `function csid_configure_testgen_pattern`, `function csid_subdev_reg_update`, `function csid_isr`, `function csid_reset`, `function csid_subdev_init`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- 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.