Re: [PATCH v2 2/2] media: cadence: csi2rx: Enable csi2rx_err_irq interrupt and add support for VIDIOC_LOG_STATUS

From: Yemike Abhilash Chandra
Date: Fri Feb 21 2025 - 00:14:44 EST


Hi Changhuang,
Thanks for the review.

On 19/02/25 08:32, Changhuang Liang wrote:
Enable the csi2rx_err_irq interrupt to record any errors during streaming
and also add support for VIDIOC_LOG_STATUS ioctl. The VIDIOC_LOG_STATUS
ioctl can be invoked from user space to retrieve the device status,
including details about any errors.

Signed-off-by: Yemike Abhilash Chandra <y-abhilashchandra@xxxxxx>
---

[...]

@@ -665,7 +752,7 @@ static int csi2rx_probe(struct platform_device *pdev)
{
struct csi2rx_priv *csi2rx;
unsigned int i;
- int ret;
+ int irq, ret;

csi2rx = kzalloc(sizeof(*csi2rx), GFP_KERNEL);
if (!csi2rx)
@@ -703,6 +790,19 @@ static int csi2rx_probe(struct platform_device *pdev)
if (ret)
goto err_cleanup;

+ irq = platform_get_irq_byname_optional(to_platform_device(csi2rx->dev), "error");

Can use the "pdev" directly ?

Yes, will correct this in v3.

Thanks and Regards,
Yemike Abhilash Chandra.


+ if (irq < 0) {
+ dev_dbg(csi2rx->dev, "Optional interrupt not defined, proceeding without it\n");
+ } else {
+ ret = devm_request_irq(csi2rx->dev, irq, csi2rx_irq_handler, 0,
+ "csi2rx-irq", csi2rx);
+ if (ret) {
+ dev_err(csi2rx->dev, "Unable to request interrupt: %d\n", ret);
+ return ret;
+ }
+ }
+
ret = v4l2_subdev_init_finalize(&csi2rx->subdev);
if (ret)
goto err_cleanup;
--
2.34.1