summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Zhu <jack.zhu@starfivetech.com>2023-10-25 06:14:20 +0300
committerHal Feng <hal.feng@starfivetech.com>2024-01-18 13:08:49 +0300
commitb757f4aa9df781d66e36b2828412af2ac6efb1e3 (patch)
treed6fd3f99b038fdd3c209cac35730b2def6899bdb
parent2bd6321de9774e2c8aedaeb422328433879e5f0d (diff)
downloadlinux-b757f4aa9df781d66e36b2828412af2ac6efb1e3.tar.xz
media: staging: media: starfive: camss: Add interrupt handling
Parse interrupt resources and register interrupt handlers. Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
-rw-r--r--drivers/staging/media/starfive/camss/stf-camss.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/staging/media/starfive/camss/stf-camss.c b/drivers/staging/media/starfive/camss/stf-camss.c
index c9743ff23b81..7174a07732f2 100644
--- a/drivers/staging/media/starfive/camss/stf-camss.c
+++ b/drivers/staging/media/starfive/camss/stf-camss.c
@@ -35,6 +35,12 @@ static const char * const stfcamss_resets[] = {
"isp_top_axi",
};
+static const struct stf_isr_data stf_isrs[] = {
+ {"wr_irq", stf_wr_irq_handler},
+ {"isp_irq", stf_isp_irq_handler},
+ {"line_irq", stf_line_irq_handler},
+};
+
static int stfcamss_get_mem_res(struct stfcamss *stfcamss)
{
struct platform_device *pdev = to_platform_device(stfcamss->dev);
@@ -160,6 +166,21 @@ static int stfcamss_probe(struct platform_device *pdev)
stfcamss->dev = dev;
+ for (i = 0; i < ARRAY_SIZE(stf_isrs); ++i) {
+ int irq;
+
+ irq = platform_get_irq(pdev, i);
+ if (irq < 0)
+ return irq;
+
+ ret = devm_request_irq(stfcamss->dev, irq, stf_isrs[i].isr, 0,
+ stf_isrs[i].name, stfcamss);
+ if (ret) {
+ dev_err(dev, "request irq failed: %d\n", ret);
+ return ret;
+ }
+ }
+
stfcamss->nclks = ARRAY_SIZE(stfcamss->sys_clk);
for (i = 0; i < stfcamss->nclks; ++i)
stfcamss->sys_clk[i].id = stfcamss_clocks[i];