hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/i2c/techpoint/techpoint_dev.c
....@@ -12,6 +12,7 @@
1212 #include "techpoint_tp9950.h"
1313 #include "techpoint_tp2855.h"
1414 #include "techpoint_tp2815.h"
15
+#include "techpoint_tp9951.h"
1516
1617 static DEFINE_MUTEX(reg_sem);
1718
....@@ -99,31 +100,38 @@
99100 techpoint_read_reg(client, CHIP_ID_L_REG, &chip_id_l);
100101 dev_err(dev, "chip_id_h:0x%2x chip_id_l:0x%2x\n", chip_id_h, chip_id_l);
101102 if (chip_id_h == TP9930_CHIP_ID_H_VALUE &&
102
- chip_id_l == TP9930_CHIP_ID_L_VALUE) {
103
+ chip_id_l == TP9930_CHIP_ID_L_VALUE) { //tp2832
103104 dev_info(&client->dev,
104105 "techpoint check chip id CHIP_TP9930 !\n");
105106 techpoint->chip_id = CHIP_TP9930;
106107 techpoint->input_type = TECHPOINT_DVP_BT1120;
107108 return 0;
108109 } else if (chip_id_h == TP2855_CHIP_ID_H_VALUE &&
109
- chip_id_l == TP2855_CHIP_ID_L_VALUE) {
110
+ chip_id_l == TP2855_CHIP_ID_L_VALUE) { //tp2855
110111 dev_info(&client->dev,
111112 "techpoint check chip id CHIP_TP2855 !\n");
112113 techpoint->chip_id = CHIP_TP2855;
113114 techpoint->input_type = TECHPOINT_MIPI;
114115 return 0;
115116 } else if (chip_id_h == TP2815_CHIP_ID_H_VALUE &&
116
- chip_id_l == TP2815_CHIP_ID_L_VALUE) {
117
+ chip_id_l == TP2815_CHIP_ID_L_VALUE) { //tp2815
117118 dev_info(&client->dev,
118119 "techpoint check chip id CHIP_TP2815 !\n");
119120 techpoint->chip_id = CHIP_TP2855;
120121 techpoint->input_type = TECHPOINT_MIPI;
121122 return 0;
122123 } else if (chip_id_h == TP9950_CHIP_ID_H_VALUE &&
123
- chip_id_l == TP9950_CHIP_ID_L_VALUE) {
124
+ chip_id_l == TP9950_CHIP_ID_L_VALUE) { //tp2850
124125 dev_info(&client->dev,
125126 "techpoint check chip id CHIP_TP9950 !\n");
126127 techpoint->chip_id = CHIP_TP9950;
128
+ techpoint->input_type = TECHPOINT_MIPI;
129
+ return 0;
130
+ } else if (chip_id_h == TP9951_CHIP_ID_H_VALUE &&
131
+ chip_id_l == TP9951_CHIP_ID_L_VALUE) { //tp2860
132
+ dev_info(&client->dev,
133
+ "techpoint check chip id CHIP_TP9951 !\n");
134
+ techpoint->chip_id = CHIP_TP9951;
127135 techpoint->input_type = TECHPOINT_MIPI;
128136 return 0;
129137 }
....@@ -143,6 +151,8 @@
143151 tp2855_initialize(techpoint);
144152 else if (techpoint->chip_id == CHIP_TP9950)
145153 tp9950_initialize(techpoint);
154
+ else if (techpoint->chip_id == CHIP_TP9951)
155
+ tp9951_initialize(techpoint);
146156
147157 return 0;
148158 }
....@@ -185,6 +195,10 @@
185195 detect_status =
186196 tp2855_get_channel_input_status
187197 (techpoint, i);
198
+ else if (techpoint->chip_id == CHIP_TP9951)
199
+ detect_status =
200
+ tp9951_get_channel_input_status
201
+ (techpoint, i);
188202
189203 if (techpoint->detect_status[i] !=
190204 detect_status) {
....@@ -202,8 +216,7 @@
202216 else if (techpoint->chip_id == CHIP_TP2855)
203217 tp2855_set_decoder_mode(client, i, detect_status);
204218
205
- techpoint->detect_status[i] =
206
- detect_status;
219
+ techpoint->detect_status[i] = detect_status;
207220 need_reset_wait = 5;
208221 }
209222 }
....@@ -273,6 +286,11 @@
273286 tp9950_set_channel_reso(client, 0, reso);
274287 }
275288
289
+ if (techpoint->chip_id == CHIP_TP9951) {
290
+ reso = tp9951_get_channel_reso(client, 0);
291
+ tp9951_set_channel_reso(client, 0, reso);
292
+ }
293
+
276294 mutex_unlock(&reg_sem);
277295
278296 return 0;