hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/i2c/os08a20.c
....@@ -43,7 +43,7 @@
4343 #endif
4444
4545 /* pixel rate = link frequency * 2 * lanes / BITS_PER_SAMPLE */
46
-#define MIPI_FREQ 360000000U
46
+#define MIPI_FREQ 480000000U
4747 #define OS08A20_PIXEL_RATE (MIPI_FREQ * 2LL * 4LL / 10)
4848 #define OS08A20_XVCLK_FREQ 24000000
4949
....@@ -684,9 +684,7 @@
684684 struct os08a20 *os08a20 = to_os08a20(sd);
685685 const struct os08a20_mode *mode = os08a20->cur_mode;
686686
687
- mutex_lock(&os08a20->mutex);
688687 fi->interval = mode->max_fps;
689
- mutex_unlock(&os08a20->mutex);
690688
691689 return 0;
692690 }
....@@ -1107,9 +1105,7 @@
11071105 if (fie->index >= os08a20->cfg_num)
11081106 return -EINVAL;
11091107
1110
- if (fie->code != OS08A20_MEDIA_BUS_FMT)
1111
- return -EINVAL;
1112
-
1108
+ fie->code = OS08A20_MEDIA_BUS_FMT;
11131109 fie->width = supported_modes[fie->index].width;
11141110 fie->height = supported_modes[fie->index].height;
11151111 fie->interval = supported_modes[fie->index].max_fps;
....@@ -1118,6 +1114,7 @@
11181114 }
11191115
11201116 static int os08a20_g_mbus_config(struct v4l2_subdev *sd,
1117
+ unsigned int pad_id,
11211118 struct v4l2_mbus_config *config)
11221119 {
11231120 u32 val = 0;
....@@ -1125,7 +1122,7 @@
11251122 val = 1 << (OS08A20_LANES - 1) |
11261123 V4L2_MBUS_CSI2_CHANNEL_0 |
11271124 V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
1128
- config->type = V4L2_MBUS_CSI2;
1125
+ config->type = V4L2_MBUS_CSI2_DPHY;
11291126 config->flags = val;
11301127
11311128 return 0;
....@@ -1153,7 +1150,6 @@
11531150 static const struct v4l2_subdev_video_ops os08a20_video_ops = {
11541151 .s_stream = os08a20_s_stream,
11551152 .g_frame_interval = os08a20_g_frame_interval,
1156
- .g_mbus_config = os08a20_g_mbus_config,
11571153 };
11581154
11591155 static const struct v4l2_subdev_pad_ops os08a20_pad_ops = {
....@@ -1162,6 +1158,7 @@
11621158 .enum_frame_interval = os08a20_enum_frame_interval,
11631159 .get_fmt = os08a20_get_fmt,
11641160 .set_fmt = os08a20_set_fmt,
1161
+ .get_mbus_config = os08a20_g_mbus_config,
11651162 };
11661163
11671164 static const struct v4l2_subdev_ops os08a20_subdev_ops = {
....@@ -1606,4 +1603,4 @@
16061603 module_exit(sensor_mod_exit);
16071604
16081605 MODULE_DESCRIPTION("OmniVision os08a20 sensor driver");
1609
-MODULE_LICENSE("GPL v2");
1606
+MODULE_LICENSE("GPL");