From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/drivers/media/i2c/techpoint/techpoint_tp2855.c | 97 ++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 85 insertions(+), 12 deletions(-)
diff --git a/kernel/drivers/media/i2c/techpoint/techpoint_tp2855.c b/kernel/drivers/media/i2c/techpoint/techpoint_tp2855.c
index 54a63e2..2d4b7f5 100644
--- a/kernel/drivers/media/i2c/techpoint/techpoint_tp2855.c
+++ b/kernel/drivers/media/i2c/techpoint/techpoint_tp2855.c
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
/*
- * techpoint techpoint lib
+ * techpoint lib
*
- * Copyright (C) 2021 Rockchip Electronics Co., Ltd.
+ * Copyright (C) 2023 Rockchip Electronics Co., Ltd.
*/
#include "techpoint_tp2855.h"
@@ -46,12 +46,90 @@
{ 0x14, 0x33 },
{ 0x14, 0xb3 },
{ 0x14, 0x33 },
+
// {0x23, 0x02}, //vi test ok
// {0x23, 0x00},
};
+static __maybe_unused const struct regval common_setting_594M_720p_1chn_2lane_regs[] = {
+ {0x40, 0x08},
+ {0x01, 0xf0},
+ {0x02, 0x01},
+ {0x08, 0x0f},
+ {0x20, 0x12},
+ {0x34, 0x10}, //output vin1&vin2
+ {0x15, 0x0c},
+ {0x25, 0x08},
+ {0x26, 0x06},
+ {0x27, 0x11},
+ {0x29, 0x0a},
+ {0x33, 0x07},
+ {0x33, 0x00},
+ {0x14, 0x43},
+ {0x14, 0xc3},
+ {0x14, 0x43},
+
+ {0x23, 0x02}, //vi test ok
+ {0x23, 0x00},
+};
+
+static __maybe_unused const struct regval common_setting_594M_4ch_2lane_720p_25fps_regs[] = {
+ { 0x40, 0x08 },
+ { 0x01, 0xf0 },
+ { 0x02, 0x01 },
+ { 0x08, 0x0f },
+ {0x20, 0x42},
+ {0x34, 0xe4}, //output vin1&vin2
+ {0x15, 0x0c},
+ {0x25, 0x08},
+ {0x26, 0x06},
+ {0x27, 0x11},
+ {0x29, 0x0a},
+ {0x33, 0x07},
+ {0x33, 0x00},
+ {0x14, 0x43},
+ {0x14, 0xc3},
+ {0x14, 0x43},
+
+ {0x23, 0x02},
+ {0x23, 0x00},
+};
+
static struct techpoint_video_modes supported_modes[] = {
- {
+ {// 4CH 2lane 720p
+ .bus_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
+ .width = 1280,
+ .height = 720,
+ .max_fps = {
+ .numerator = 10000,
+ .denominator = 250000,
+ },
+ .link_freq_value = TP2855_LINK_FREQ_594M,
+ .common_reg_list = common_setting_594M_4ch_2lane_720p_25fps_regs,
+ .common_reg_size = ARRAY_SIZE(common_setting_594M_4ch_2lane_720p_25fps_regs),
+ .bpp = 8,
+ .lane = 2,
+ .vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_0,
+ .vc[PAD1] = V4L2_MBUS_CSI2_CHANNEL_1,
+ .vc[PAD2] = V4L2_MBUS_CSI2_CHANNEL_2,
+ .vc[PAD3] = V4L2_MBUS_CSI2_CHANNEL_3,
+ },
+ {//1 chn 2 lane 720p
+ .bus_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
+ .width = 1280,
+ .height = 720,
+ .max_fps = {
+ .numerator = 10000,
+ .denominator = 300000,
+ },
+ .link_freq_value = TP2855_LINK_FREQ_594M,
+ .common_reg_list = common_setting_594M_720p_1chn_2lane_regs,
+ .common_reg_size = ARRAY_SIZE(common_setting_594M_720p_1chn_2lane_regs),
+ .bpp = 8,
+ .lane = 2,
+ .vc[PAD0] = V4L2_MBUS_CSI2_CHANNEL_0,
+ },
+ {//4 chn 4 lane 1080p
.bus_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
.width = 1920,
.height = 1080,
@@ -69,7 +147,7 @@
.vc[PAD2] = V4L2_MBUS_CSI2_CHANNEL_2,
.vc[PAD3] = V4L2_MBUS_CSI2_CHANNEL_3,
},
- {
+ {//4 chn 4 lane 720p
.bus_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
.width = 1280,
.height = 720,
@@ -87,7 +165,7 @@
.vc[PAD2] = V4L2_MBUS_CSI2_CHANNEL_2,
.vc[PAD3] = V4L2_MBUS_CSI2_CHANNEL_3,
},
- {
+ {//4 chn 4 lane 576p
.bus_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
.width = 720,
.height = 576,
@@ -395,7 +473,7 @@
break;
default:
dev_info(&client->dev,
- "set channel %d UNSUPPORT, default 1080P_25\n", ch);
+ "set channel %d is not supported, default 1080P_25\n", ch);
techpoint_read_reg(client, 0xf5, &tmp);
tmp &= ~SYS_MODE[ch];
techpoint_write_reg(client, 0xf5, tmp);
@@ -466,27 +544,22 @@
case TP2855_CVSTD_1080P_30:
dev_err(&client->dev, "detect channel %d 1080P_30\n", ch);
return TECHPOINT_S_RESO_1080P_30;
- break;
case TP2855_CVSTD_1080P_25:
dev_err(&client->dev, "detect channel %d 1080P_25\n", ch);
return TECHPOINT_S_RESO_1080P_25;
- break;
case TP2855_CVSTD_720P_30:
dev_err(&client->dev, "detect channel %d 720P_30\n", ch);
return TECHPOINT_S_RESO_720P_30;
- break;
case TP2855_CVSTD_720P_25:
dev_err(&client->dev, "detect channel %d 720P_25\n", ch);
return TECHPOINT_S_RESO_720P_25;
- break;
case TP2855_CVSTD_SD:
dev_err(&client->dev, "detect channel %d SD\n", ch);
return TECHPOINT_S_RESO_SD;
default:
dev_err(&client->dev,
- "detect channel %d UNSUPPORT, default 1080P_25\n", ch);
+ "detect channel %d is not supported, default 1080P_25\n", ch);
return TECHPOINT_S_RESO_1080P_25;
- break;
}
return reso;
--
Gitblit v1.6.2