hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/media/i2c/techpoint/techpoint_v4l2.c
....@@ -2,7 +2,7 @@
22 /*
33 * techpoint v4l2 driver
44 *
5
- * Copyright (C) 2022 Rockchip Electronics Co., Ltd.
5
+ * Copyright (C) 2023 Rockchip Electronics Co., Ltd.
66 *
77 */
88
....@@ -217,8 +217,6 @@
217217 {
218218 int ret;
219219 struct device *dev = &techpoint->client->dev;
220
-
221
- dev_dbg(dev, "%s\n", __func__);
222220
223221 if (!IS_ERR_OR_NULL(techpoint->pins_default)) {
224222 ret = pinctrl_select_state(techpoint->pinctrl,
....@@ -471,9 +469,6 @@
471469 struct v4l2_subdev_frame_size_enum *fse)
472470 {
473471 struct techpoint *techpoint = to_techpoint(sd);
474
- struct i2c_client *client = techpoint->client;
475
-
476
- dev_dbg(&client->dev, "%s:\n", __func__);
477472
478473 if (fse->index >= techpoint->video_modes_num)
479474 return -EINVAL;
....@@ -502,6 +497,7 @@
502497 }
503498
504499 static int techpoint_g_mbus_config(struct v4l2_subdev *sd,
500
+ unsigned int pad_id,
505501 struct v4l2_mbus_config *cfg)
506502 {
507503 struct techpoint *techpoint = to_techpoint(sd);
....@@ -512,7 +508,7 @@
512508 V4L2_MBUS_PCLK_SAMPLE_RISING |
513509 V4L2_MBUS_PCLK_SAMPLE_FALLING;
514510 } else if (techpoint->input_type == TECHPOINT_MIPI) {
515
- cfg->type = V4L2_MBUS_CSI2;
511
+ cfg->type = V4L2_MBUS_CSI2_DPHY;
516512 if (techpoint->data_lanes == 4) {
517513 cfg->flags = V4L2_MBUS_CSI2_4_LANE | V4L2_MBUS_CSI2_CHANNELS;
518514 } else if (techpoint->data_lanes == 2) {
....@@ -827,7 +823,6 @@
827823
828824 static const struct v4l2_subdev_video_ops techpoint_video_ops = {
829825 .s_stream = techpoint_stream,
830
- .g_mbus_config = techpoint_g_mbus_config,
831826 .g_frame_interval = techpoint_g_frame_interval,
832827 .querystd = techpoint_querystd,
833828 };
....@@ -837,6 +832,7 @@
837832 .enum_frame_size = techpoint_enum_frame_sizes,
838833 .get_fmt = techpoint_get_fmt,
839834 .set_fmt = techpoint_set_fmt,
835
+ .get_mbus_config = techpoint_g_mbus_config,
840836 };
841837
842838 static const struct v4l2_subdev_core_ops techpoint_core_ops = {
....@@ -864,6 +860,7 @@
864860 { .compatible = "techpoint,tp2815" },
865861 { .compatible = "techpoint,tp9930" },
866862 { .compatible = "techpoint,tp9950" },
863
+ { .compatible = "techpoint,tp9951" },
867864 { },
868865 };
869866
....@@ -1210,7 +1207,9 @@
12101207 struct device_node *np;
12111208 int i, count;
12121209
1213
- count = of_count_phandle_with_args(node, "techpoint,audio-in-cascade-slaves", NULL);
1210
+ count = of_count_phandle_with_args(node,
1211
+ "techpoint,audio-in-cascade-slaves",
1212
+ NULL);
12141213 if (count < 0 || count > MAX_SLAVES)
12151214 return -EINVAL;
12161215
....@@ -1299,7 +1298,6 @@
12991298 }
13001299
13011300 if (techpoint->chip_id == CHIP_TP9930) {
1302
-
13031301 techpoint_write_reg(techpoint->client, 0x40, 0x00);
13041302 for (i = 0; i < 0xff; i++)
13051303 techpoint_write_reg(techpoint->client, i, 0xbb);
....@@ -1516,4 +1514,4 @@
15161514
15171515 MODULE_AUTHOR("Vicent Chi <vicent.chi@rock-chips.com>");
15181516 MODULE_DESCRIPTION("Techpoint decoder driver");
1519
-MODULE_LICENSE("GPL v2");
1517
+MODULE_LICENSE("GPL");