hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/i2c/ov8858.c
....@@ -2131,9 +2131,7 @@
21312131 struct ov8858 *ov8858 = to_ov8858(sd);
21322132 const struct ov8858_mode *mode = ov8858->cur_mode;
21332133
2134
- mutex_lock(&ov8858->mutex);
21352134 fi->interval = mode->max_fps;
2136
- mutex_unlock(&ov8858->mutex);
21372135
21382136 return 0;
21392137 }
....@@ -2803,7 +2801,7 @@
28032801 regulator_bulk_disable(OV8858_NUM_SUPPLIES, ov8858->supplies);
28042802 }
28052803
2806
-static int ov8858_runtime_resume(struct device *dev)
2804
+static int __maybe_unused ov8858_runtime_resume(struct device *dev)
28072805 {
28082806 struct i2c_client *client = to_i2c_client(dev);
28092807 struct v4l2_subdev *sd = i2c_get_clientdata(client);
....@@ -2812,7 +2810,7 @@
28122810 return __ov8858_power_on(ov8858);
28132811 }
28142812
2815
-static int ov8858_runtime_suspend(struct device *dev)
2813
+static int __maybe_unused ov8858_runtime_suspend(struct device *dev)
28162814 {
28172815 struct i2c_client *client = to_i2c_client(dev);
28182816 struct v4l2_subdev *sd = i2c_get_clientdata(client);
....@@ -2854,16 +2852,14 @@
28542852 if (fie->index >= ov8858->cfg_num)
28552853 return -EINVAL;
28562854
2857
- if (fie->code != OV8858_MEDIA_BUS_FMT)
2858
- return -EINVAL;
2859
-
2855
+ fie->code = OV8858_MEDIA_BUS_FMT;
28602856 fie->width = supported_modes[fie->index].width;
28612857 fie->height = supported_modes[fie->index].height;
28622858 fie->interval = supported_modes[fie->index].max_fps;
28632859 return 0;
28642860 }
28652861
2866
-static int ov8858_g_mbus_config(struct v4l2_subdev *sd,
2862
+static int ov8858_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad_id,
28672863 struct v4l2_mbus_config *config)
28682864 {
28692865 struct ov8858 *sensor = to_ov8858 (sd);
....@@ -2872,12 +2868,12 @@
28722868 dev_info(dev, "%s(%d) enter!\n", __func__, __LINE__);
28732869
28742870 if (2 == sensor->lane_num) {
2875
- config->type = V4L2_MBUS_CSI2;
2871
+ config->type = V4L2_MBUS_CSI2_DPHY;
28762872 config->flags = V4L2_MBUS_CSI2_2_LANE |
28772873 V4L2_MBUS_CSI2_CHANNEL_0 |
28782874 V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
28792875 } else if (4 == sensor->lane_num) {
2880
- config->type = V4L2_MBUS_CSI2;
2876
+ config->type = V4L2_MBUS_CSI2_DPHY;
28812877 config->flags = V4L2_MBUS_CSI2_4_LANE |
28822878 V4L2_MBUS_CSI2_CHANNEL_0 |
28832879 V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
....@@ -2910,7 +2906,6 @@
29102906 static const struct v4l2_subdev_video_ops ov8858_video_ops = {
29112907 .s_stream = ov8858_s_stream,
29122908 .g_frame_interval = ov8858_g_frame_interval,
2913
- .g_mbus_config = ov8858_g_mbus_config,
29142909 };
29152910
29162911 static const struct v4l2_subdev_pad_ops ov8858_pad_ops = {
....@@ -2919,6 +2914,7 @@
29192914 .enum_frame_interval = ov8858_enum_frame_interval,
29202915 .get_fmt = ov8858_get_fmt,
29212916 .set_fmt = ov8858_set_fmt,
2917
+ .get_mbus_config = ov8858_g_mbus_config,
29222918 };
29232919
29242920 static const struct v4l2_subdev_ops ov8858_subdev_ops = {