hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/i2c/gc2145.c
....@@ -2105,7 +2105,7 @@
21052105
21062106 dev_dbg(&client->dev, "%s: on: %d\n", __func__, on);
21072107
2108
- if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2) {
2108
+ if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2_DPHY) {
21092109 val = on ? 0x94 : 0x84;
21102110 ret = gc2145_write(client, 0xfe, 0x03);
21112111 ret |= gc2145_write(client, 0x10, val);
....@@ -2458,13 +2458,13 @@
24582458 }
24592459 #endif
24602460
2461
-static int gc2145_g_mbus_config(struct v4l2_subdev *sd,
2461
+static int gc2145_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad_id,
24622462 struct v4l2_mbus_config *config)
24632463 {
24642464 struct gc2145 *gc2145 = to_gc2145(sd);
24652465
2466
- if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2) {
2467
- config->type = V4L2_MBUS_CSI2;
2466
+ if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2_DPHY) {
2467
+ config->type = V4L2_MBUS_CSI2_DPHY;
24682468 config->flags = V4L2_MBUS_CSI2_1_LANE |
24692469 V4L2_MBUS_CSI2_CHANNEL_0 |
24702470 V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
....@@ -2483,9 +2483,7 @@
24832483 {
24842484 struct gc2145 *gc2145 = to_gc2145(sd);
24852485
2486
- mutex_lock(&gc2145->lock);
24872486 fi->interval = gc2145->frame_size->max_fps;
2488
- mutex_unlock(&gc2145->lock);
24892487
24902488 return 0;
24912489 }
....@@ -2628,7 +2626,7 @@
26282626
26292627 dev_info(&client->dev, "%s(%d)\n", __func__, __LINE__);
26302628
2631
- if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2)
2629
+ if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2_DPHY)
26322630 ret = gc2145_write_array(client, gc2145_mipi_init_regs);
26332631 else
26342632 ret = gc2145_write_array(client, gc2145_dvp_init_regs);
....@@ -2672,9 +2670,7 @@
26722670 if (fie->index >= gc2145->cfg_num)
26732671 return -EINVAL;
26742672
2675
- if (fie->code != MEDIA_BUS_FMT_UYVY8_2X8)
2676
- return -EINVAL;
2677
-
2673
+ fie->code = MEDIA_BUS_FMT_UYVY8_2X8;
26782674 fie->width = gc2145->framesize_cfg[fie->index].width;
26792675 fie->height = gc2145->framesize_cfg[fie->index].height;
26802676 fie->interval = gc2145->framesize_cfg[fie->index].max_fps;
....@@ -2694,7 +2690,6 @@
26942690
26952691 static const struct v4l2_subdev_video_ops gc2145_subdev_video_ops = {
26962692 .s_stream = gc2145_s_stream,
2697
- .g_mbus_config = gc2145_g_mbus_config,
26982693 .g_frame_interval = gc2145_g_frame_interval,
26992694 .s_frame_interval = gc2145_s_frame_interval,
27002695 };
....@@ -2705,6 +2700,7 @@
27052700 .enum_frame_interval = gc2145_enum_frame_interval,
27062701 .get_fmt = gc2145_get_fmt,
27072702 .set_fmt = gc2145_set_fmt,
2703
+ .get_mbus_config = gc2145_g_mbus_config,
27082704 };
27092705
27102706 #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
....@@ -2856,7 +2852,7 @@
28562852 of_node_put(endpoint);
28572853 return ret;
28582854 }
2859
- if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2) {
2855
+ if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2_DPHY) {
28602856 gc2145->framesize_cfg = gc2145_mipi_framesizes;
28612857 gc2145->cfg_num = ARRAY_SIZE(gc2145_mipi_framesizes);
28622858 } else {