xref: /OK3568_Linux_fs/kernel/drivers/media/i2c/techpoint/techpoint_tp9930.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * techpoint tp9930 regs
4  *
5  * Copyright (C) 2023 Rockchip Electronics Co., Ltd.
6  */
7 
8 #ifndef _TECHPOINT_TP9930_H
9 #define _TECHPOINT_TP9930_H
10 
11 #include "techpoint_common.h"
12 
13 #define TP9930_CHIP_ID_H_REG        0xFE
14 #define TP9930_CHIP_ID_H_VALUE      0x28
15 #define TP9930_CHIP_ID_L_REG        0xFF
16 #define TP9930_CHIP_ID_L_VALUE      0x32
17 
18 #define TP9930_LINK_FREQ_74M25      (74250000)
19 #define TP9930_LINK_FREQ_148M5      (148500000)
20 #define TP9930_LINK_FREQ_297M       (297000000)
21 
22 #define INPUT_STATUS_MATCH			0x7a
23 
24 enum tp9930_support_reso {
25 	TP9930_CVSTD_720P_60 = 0,
26 	TP9930_CVSTD_720P_50,
27 	TP9930_CVSTD_1080P_30,
28 	TP9930_CVSTD_1080P_25,
29 	TP9930_CVSTD_720P_30,
30 	TP9930_CVSTD_720P_25,
31 	TP9930_CVSTD_SD,
32 	TP9930_CVSTD_OTHER,
33 };
34 
35 int tp9930_initialize(struct techpoint *techpoint);
36 int tp9930_do_reset_pll(struct i2c_client *client);
37 int tp9930_pll_reset(struct i2c_client *client);
38 
39 int tp9930_set_decoder_mode(struct i2c_client *client, int ch, int status);
40 int tp9930_set_channel_reso(struct i2c_client *client, int ch,
41 			    enum techpoint_support_reso reso);
42 int tp9930_get_channel_reso(struct i2c_client *client, int ch);
43 int tp9930_get_channel_input_status(struct techpoint *techpoint, u8 index);
44 int tp9930_get_all_input_status(struct techpoint *techpoint, u8 *detect_status);
45 
46 #endif // _TECHPOINT_TP9930_H
47