hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/platform/rockchip/isp/csi.c
....@@ -15,7 +15,7 @@
1515 #include "isp_external.h"
1616 #include "regs.h"
1717
18
-static void get_remote_mipi_sensor(struct rkisp_device *dev,
18
+void rkisp_get_remote_mipi_sensor(struct rkisp_device *dev,
1919 struct v4l2_subdev **sensor_sd, u32 function)
2020 {
2121 struct media_graph graph;
....@@ -82,6 +82,8 @@
8282 id = local->index - 1;
8383 if (id && id < RKISP_STREAM_DMATX3)
8484 stream = &csi->ispdev->cap_dev.stream[id + 1];
85
+ if (id >= ARRAY_SIZE(csi->sink))
86
+ return -EINVAL;
8587 if (flags & MEDIA_LNK_FL_ENABLED) {
8688 if (csi->sink[id].linked) {
8789 ret = -EBUSY;
....@@ -210,7 +212,7 @@
210212 emd_vc = 0xFF;
211213 emd_dt = 0;
212214 dev->hdr.sensor = NULL;
213
- get_remote_mipi_sensor(dev, &mipi_sensor, MEDIA_ENT_F_CAM_SENSOR);
215
+ rkisp_get_remote_mipi_sensor(dev, &mipi_sensor, MEDIA_ENT_F_CAM_SENSOR);
214216 if (mipi_sensor) {
215217 ctrl = v4l2_ctrl_find(mipi_sensor->ctrl_handler,
216218 CIFISP_CID_EMB_VC);
....@@ -546,7 +548,7 @@
546548 }
547549 return 0;
548550 }
549
- get_remote_mipi_sensor(dev, &sd, type);
551
+ rkisp_get_remote_mipi_sensor(dev, &sd, type);
550552 if (!sd) {
551553 v4l2_err(&dev->v4l2_dev, "%s don't find subdev\n", __func__);
552554 return -EINVAL;
....@@ -577,7 +579,7 @@
577579 memset(&mode, 0, sizeof(mode));
578580 mode.name = dev->name;
579581
580
- get_remote_mipi_sensor(dev, &mipi_sensor, MEDIA_ENT_F_PROC_VIDEO_COMPOSER);
582
+ rkisp_get_remote_mipi_sensor(dev, &mipi_sensor, MEDIA_ENT_F_PROC_VIDEO_COMPOSER);
581583 if (!mipi_sensor)
582584 return -EINVAL;
583585 dev->hdr.op_mode = HDR_NORMAL;