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_tp9930.c | 39 +++++++++++++--------------------------
1 files changed, 13 insertions(+), 26 deletions(-)
diff --git a/kernel/drivers/media/i2c/techpoint/techpoint_tp9930.c b/kernel/drivers/media/i2c/techpoint/techpoint_tp9930.c
index db62e81..b8f141f 100644
--- a/kernel/drivers/media/i2c/techpoint/techpoint_tp9930.c
+++ b/kernel/drivers/media/i2c/techpoint/techpoint_tp9930.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_tp9930.h"
@@ -355,7 +355,7 @@
.link_freq_value = TP9930_LINK_FREQ_297M,
.common_reg_list = common_setting_148M_1080p_25fps_regs,
.common_reg_size = ARRAY_SIZE(common_setting_148M_1080p_25fps_regs),
- },
+ },
{
.bus_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
.width = 1920,
@@ -367,7 +367,7 @@
.link_freq_value = TP9930_LINK_FREQ_297M,
.common_reg_list = common_setting_148M_1080p_30fps_regs,
.common_reg_size = ARRAY_SIZE(common_setting_148M_1080p_30fps_regs),
- },
+ },
#endif
{
.bus_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
@@ -380,7 +380,7 @@
.link_freq_value = TP9930_LINK_FREQ_148M5,
.common_reg_list = common_setting_148M_720p_25fps_regs,
.common_reg_size = ARRAY_SIZE(common_setting_148M_720p_25fps_regs),
- },
+ },
{
.bus_fmt = MEDIA_BUS_FMT_UYVY8_2X8,
.width = 1280,
@@ -392,7 +392,7 @@
.link_freq_value = TP9930_LINK_FREQ_148M5,
.common_reg_list = common_setting_148M_720p_30fps_regs,
.common_reg_size = ARRAY_SIZE(common_setting_148M_720p_30fps_regs),
- }
+ }
};
int tp9930_initialize(struct techpoint *techpoint)
@@ -423,7 +423,7 @@
techpoint_read_reg(client, 0xf4, &val_0xf4);
techpoint_write_reg(client, 0xf4, val_0xf4 | 0x80);
- msleep(10);
+ usleep_range(10000, 12000);
techpoint_write_reg(client, 0x43, val_0x43);
techpoint_write_reg(client, 0x44, val_0x44);
@@ -453,16 +453,11 @@
techpoint_write_reg(client, 0x40, 0x00);
#if DEF_1080P
-#if 1 // 25FPS
+// 25FPS
techpoint_write_reg(client, 0x44, 0x07);
techpoint_write_reg(client, 0x43, 0x17);
techpoint_write_reg(client, 0x45, 0x09);
techpoint_write_reg(client, 0xf4, 0xa0);
-#else
- techpoint_write_reg(client, 0x44, 0x17);
- techpoint_write_reg(client, 0x43, 0x12);
- techpoint_write_reg(client, 0x45, 0x09);
-#endif
#else
techpoint_write_reg(client, 0x44, 0x17);
techpoint_write_reg(client, 0x43, 0x17);
@@ -498,11 +493,8 @@
mutex_unlock(&techpoint->mutex);
dev_dbg(&client->dev, "input_status ch %d : %x\n", ch, val);
-#if 0 // inaccuracy
- return (val & INPUT_STATUS_MASK) ? 0 : 1;
-#else
+// inaccuracy
return (val == INPUT_STATUS_MATCH) ? 1 : 0;
-#endif
}
int tp9930_get_all_input_status(struct techpoint *techpoint, u8 *detect_status)
@@ -540,10 +532,10 @@
default:
#if DEF_1080P
dev_err(&client->dev,
- "set channel %d UNSUPPORT, default 1080P_25, TBD", ch);
+ "set channel %d is not supported, default 1080P_25, TBD", ch);
#else
dev_err(&client->dev,
- "set channel %d UNSUPPORT, default 720P_25, TBD", ch);
+ "set channel %d is not supported, default 720P_25, TBD", ch);
#endif
break;
}
@@ -564,32 +556,27 @@
case TP9930_CVSTD_1080P_30:
dev_err(&client->dev, "detect channel %d 1080P_30", ch);
return TECHPOINT_S_RESO_1080P_30;
- break;
case TP9930_CVSTD_1080P_25:
dev_err(&client->dev, "detect channel %d 1080P_25", ch);
return TECHPOINT_S_RESO_1080P_25;
- break;
case TP9930_CVSTD_720P_30:
dev_err(&client->dev, "detect channel %d 720P_30", ch);
return TECHPOINT_S_RESO_720P_30;
- break;
case TP9930_CVSTD_720P_25:
dev_err(&client->dev, "detect channel %d 720P_25", ch);
return TECHPOINT_S_RESO_720P_25;
- break;
case TP9930_CVSTD_720P_60:
case TP9930_CVSTD_720P_50:
default:
#if DEF_1080P
dev_err(&client->dev,
- "detect channel %d UNSUPPORT, default 1080P_25", ch);
+ "detect channel %d is not supported, default 1080P_25", ch);
return TECHPOINT_S_RESO_1080P_25;
#else
dev_err(&client->dev,
- "detect channel %d UNSUPPORT, default 720P_25", ch);
+ "detect channel %d is not supported, default 720P_25", ch);
return TECHPOINT_S_RESO_720P_25;
#endif
- break;
}
return reso;
--
Gitblit v1.6.2