Lines Matching refs:techpoint
92 static int check_chip_id(struct techpoint *techpoint) in check_chip_id() argument
94 struct i2c_client *client = techpoint->client; in check_chip_id()
105 techpoint->chip_id = CHIP_TP9930; in check_chip_id()
106 techpoint->input_type = TECHPOINT_DVP_BT1120; in check_chip_id()
112 techpoint->chip_id = CHIP_TP2855; in check_chip_id()
113 techpoint->input_type = TECHPOINT_MIPI; in check_chip_id()
119 techpoint->chip_id = CHIP_TP2855; in check_chip_id()
120 techpoint->input_type = TECHPOINT_MIPI; in check_chip_id()
126 techpoint->chip_id = CHIP_TP9950; in check_chip_id()
127 techpoint->input_type = TECHPOINT_MIPI; in check_chip_id()
135 int techpoint_initialize_devices(struct techpoint *techpoint) in techpoint_initialize_devices() argument
137 if (check_chip_id(techpoint)) in techpoint_initialize_devices()
140 if (techpoint->chip_id == CHIP_TP9930) in techpoint_initialize_devices()
141 tp9930_initialize(techpoint); in techpoint_initialize_devices()
142 else if (techpoint->chip_id == CHIP_TP2855) in techpoint_initialize_devices()
143 tp2855_initialize(techpoint); in techpoint_initialize_devices()
144 else if (techpoint->chip_id == CHIP_TP9950) in techpoint_initialize_devices()
145 tp9950_initialize(techpoint); in techpoint_initialize_devices()
152 struct techpoint *techpoint = (struct techpoint *)data; in detect_thread_function() local
153 struct i2c_client *client = techpoint->client; in detect_thread_function()
157 if (techpoint->power_on) { in detect_thread_function()
159 if (techpoint->chip_id == CHIP_TP9930) { in detect_thread_function()
160 tp9930_get_all_input_status(techpoint, in detect_thread_function()
161 techpoint->detect_status); in detect_thread_function()
164 techpoint->detect_status[i]); in detect_thread_function()
165 } else if (techpoint->chip_id == CHIP_TP2855) { in detect_thread_function()
166 tp2855_get_all_input_status(techpoint, in detect_thread_function()
167 techpoint->detect_status); in detect_thread_function()
170 techpoint->detect_status[i]); in detect_thread_function()
173 techpoint->do_reset = 0; in detect_thread_function()
178 if (techpoint->power_on) { in detect_thread_function()
180 if (techpoint->chip_id == CHIP_TP9930) in detect_thread_function()
183 (techpoint, i); in detect_thread_function()
184 else if (techpoint->chip_id == CHIP_TP2855) in detect_thread_function()
187 (techpoint, i); in detect_thread_function()
189 if (techpoint->detect_status[i] != in detect_thread_function()
200 if (techpoint->chip_id == CHIP_TP9930) in detect_thread_function()
202 else if (techpoint->chip_id == CHIP_TP2855) in detect_thread_function()
205 techpoint->detect_status[i] = in detect_thread_function()
214 techpoint->do_reset = 1; in detect_thread_function()
226 static int __maybe_unused detect_thread_start(struct techpoint *techpoint) in detect_thread_start() argument
229 struct i2c_client *client = techpoint->client; in detect_thread_start()
231 techpoint->detect_thread = kthread_create(detect_thread_function, in detect_thread_start()
232 techpoint, in detect_thread_start()
234 if (IS_ERR(techpoint->detect_thread)) { in detect_thread_start()
237 ret = PTR_ERR(techpoint->detect_thread); in detect_thread_start()
238 techpoint->detect_thread = NULL; in detect_thread_start()
241 wake_up_process(techpoint->detect_thread); in detect_thread_start()
245 static int __maybe_unused detect_thread_stop(struct techpoint *techpoint) in detect_thread_stop() argument
247 if (techpoint->detect_thread) in detect_thread_stop()
248 kthread_stop(techpoint->detect_thread); in detect_thread_stop()
249 techpoint->detect_thread = NULL; in detect_thread_stop()
253 static __maybe_unused int auto_detect_channel_fmt(struct techpoint *techpoint) in auto_detect_channel_fmt() argument
257 struct i2c_client *client = techpoint->client; in auto_detect_channel_fmt()
262 if (techpoint->chip_id == CHIP_TP9930) { in auto_detect_channel_fmt()
265 } else if (techpoint->chip_id == CHIP_TP2855) { in auto_detect_channel_fmt()
271 if (techpoint->chip_id == CHIP_TP9950) { in auto_detect_channel_fmt()
281 void __techpoint_get_vc_fmt_inf(struct techpoint *techpoint, in __techpoint_get_vc_fmt_inf() argument
287 struct i2c_client *client = techpoint->client; in __techpoint_get_vc_fmt_inf()
292 if (techpoint->chip_id == CHIP_TP9930) { in __techpoint_get_vc_fmt_inf()
294 techpoint->cur_video_mode->channel_reso[ch] = reso; in __techpoint_get_vc_fmt_inf()
295 } else if (techpoint->chip_id == CHIP_TP2855) { in __techpoint_get_vc_fmt_inf()
297 techpoint->cur_video_mode->channel_reso[ch] = reso; in __techpoint_get_vc_fmt_inf()
343 void techpoint_get_vc_fmt_inf(struct techpoint *techpoint, in techpoint_get_vc_fmt_inf() argument
348 if (techpoint->chip_id == CHIP_TP9930) in techpoint_get_vc_fmt_inf()
349 tp9930_pll_reset(techpoint->client); in techpoint_get_vc_fmt_inf()
351 techpoint_write_array(techpoint->client, in techpoint_get_vc_fmt_inf()
352 techpoint->cur_video_mode->common_reg_list, in techpoint_get_vc_fmt_inf()
353 techpoint->cur_video_mode->common_reg_size); in techpoint_get_vc_fmt_inf()
355 if (techpoint->chip_id == CHIP_TP9930) in techpoint_get_vc_fmt_inf()
356 tp9930_do_reset_pll(techpoint->client); in techpoint_get_vc_fmt_inf()
360 __techpoint_get_vc_fmt_inf(techpoint, inf); in techpoint_get_vc_fmt_inf()
363 void techpoint_get_vc_hotplug_inf(struct techpoint *techpoint, in techpoint_get_vc_hotplug_inf() argument
374 if (techpoint->chip_id == CHIP_TP9930) in techpoint_get_vc_hotplug_inf()
376 tp9930_get_channel_input_status(techpoint, ch); in techpoint_get_vc_hotplug_inf()
377 else if (techpoint->chip_id == CHIP_TP2855) in techpoint_get_vc_hotplug_inf()
379 tp2855_get_channel_input_status(techpoint, ch); in techpoint_get_vc_hotplug_inf()
387 void techpoint_set_quick_stream(struct techpoint *techpoint, u32 stream) in techpoint_set_quick_stream() argument
389 if (techpoint->chip_id == CHIP_TP2855) in techpoint_set_quick_stream()
390 tp2855_set_quick_stream(techpoint, stream); in techpoint_set_quick_stream()
393 int techpoint_start_video_stream(struct techpoint *techpoint) in techpoint_start_video_stream() argument
396 struct i2c_client *client = techpoint->client; in techpoint_start_video_stream()
399 if (techpoint->chip_id == CHIP_TP9930) in techpoint_start_video_stream()
400 tp9930_pll_reset(techpoint->client); in techpoint_start_video_stream()
403 auto_detect_channel_fmt(techpoint); in techpoint_start_video_stream()
404 ret = techpoint_write_array(techpoint->client, in techpoint_start_video_stream()
405 techpoint->cur_video_mode->common_reg_list, in techpoint_start_video_stream()
406 techpoint->cur_video_mode->common_reg_size); in techpoint_start_video_stream()
414 if (techpoint->chip_id == CHIP_TP9930) in techpoint_start_video_stream()
415 tp9930_do_reset_pll(techpoint->client); in techpoint_start_video_stream()
420 detect_thread_start(techpoint); in techpoint_start_video_stream()
425 int techpoint_stop_video_stream(struct techpoint *techpoint) in techpoint_stop_video_stream() argument
427 detect_thread_stop(techpoint); in techpoint_stop_video_stream()