From 9370bb92b2d16684ee45cf24e879c93c509162da Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 19 Dec 2024 01:47:39 +0000
Subject: [PATCH] add wifi6 8852be driver

---
 kernel/drivers/media/i2c/ov13850.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/kernel/drivers/media/i2c/ov13850.c b/kernel/drivers/media/i2c/ov13850.c
index 49df051..d060c6e 100644
--- a/kernel/drivers/media/i2c/ov13850.c
+++ b/kernel/drivers/media/i2c/ov13850.c
@@ -902,9 +902,7 @@
 	struct ov13850 *ov13850 = to_ov13850(sd);
 	const struct ov13850_mode *mode = ov13850->cur_mode;
 
-	mutex_lock(&ov13850->mutex);
 	fi->interval = mode->max_fps;
-	mutex_unlock(&ov13850->mutex);
 
 	return 0;
 }
@@ -1189,7 +1187,7 @@
 	regulator_bulk_disable(OV13850_NUM_SUPPLIES, ov13850->supplies);
 }
 
-static int ov13850_runtime_resume(struct device *dev)
+static int __maybe_unused ov13850_runtime_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1198,7 +1196,7 @@
 	return __ov13850_power_on(ov13850);
 }
 
-static int ov13850_runtime_suspend(struct device *dev)
+static int __maybe_unused ov13850_runtime_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1238,16 +1236,14 @@
 	if (fie->index >= ARRAY_SIZE(supported_modes))
 		return -EINVAL;
 
-	if (fie->code != MEDIA_BUS_FMT_SBGGR10_1X10)
-		return -EINVAL;
-
+	fie->code = MEDIA_BUS_FMT_SBGGR10_1X10;
 	fie->width = supported_modes[fie->index].width;
 	fie->height = supported_modes[fie->index].height;
 	fie->interval = supported_modes[fie->index].max_fps;
 	return 0;
 }
 
-static int ov13850_g_mbus_config(struct v4l2_subdev *sd,
+static int ov13850_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad_id,
 				struct v4l2_mbus_config *config)
 {
 	u32 val = 0;
@@ -1255,7 +1251,7 @@
 	val = 1 << (OV13850_LANES - 1) |
 	      V4L2_MBUS_CSI2_CHANNEL_0 |
 	      V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
-	config->type = V4L2_MBUS_CSI2;
+	config->type = V4L2_MBUS_CSI2_DPHY;
 	config->flags = val;
 
 	return 0;
@@ -1283,7 +1279,6 @@
 static const struct v4l2_subdev_video_ops ov13850_video_ops = {
 	.s_stream = ov13850_s_stream,
 	.g_frame_interval = ov13850_g_frame_interval,
-	.g_mbus_config = ov13850_g_mbus_config,
 };
 
 static const struct v4l2_subdev_pad_ops ov13850_pad_ops = {
@@ -1292,6 +1287,7 @@
 	.enum_frame_interval = ov13850_enum_frame_interval,
 	.get_fmt = ov13850_get_fmt,
 	.set_fmt = ov13850_set_fmt,
+	.get_mbus_config = ov13850_g_mbus_config,
 };
 
 static const struct v4l2_subdev_ops ov13850_subdev_ops = {

--
Gitblit v1.6.2