1 // SPDX-License-Identifier: GPL-2.0
2 #define USE_DVICHIP
3 #ifdef USE_DVICHIP
4 #include "ddk750_chip.h"
5 #include "ddk750_reg.h"
6 #include "ddk750_dvi.h"
7 #include "ddk750_sii164.h"
8 
9 /*
10  * This global variable contains all the supported driver and its corresponding
11  * function API. Please set the function pointer to NULL whenever the function
12  * is not supported.
13  */
14 static struct dvi_ctrl_device dcft_supported_dvi_controller[] = {
15 #ifdef DVI_CTRL_SII164
16 	{
17 		.init = sii164_init_chip,
18 		.get_vendor_id = sii164_get_vendor_id,
19 		.get_device_id = sii164GetDeviceID,
20 #ifdef SII164_FULL_FUNCTIONS
21 		.reset_chip = sii164ResetChip,
22 		.get_chip_string = sii164GetChipString,
23 		.set_power = sii164SetPower,
24 		.enable_hot_plug_detection = sii164EnableHotPlugDetection,
25 		.is_connected = sii164IsConnected,
26 		.check_interrupt = sii164CheckInterrupt,
27 		.clear_interrupt = sii164ClearInterrupt,
28 #endif
29 	},
30 #endif
31 };
32 
dvi_init(unsigned char edge_select,unsigned char bus_select,unsigned char dual_edge_clk_select,unsigned char hsync_enable,unsigned char vsync_enable,unsigned char deskew_enable,unsigned char deskew_setting,unsigned char continuous_sync_enable,unsigned char pll_filter_enable,unsigned char pll_filter_value)33 int dvi_init(unsigned char edge_select,
34 	     unsigned char bus_select,
35 	     unsigned char dual_edge_clk_select,
36 	     unsigned char hsync_enable,
37 	     unsigned char vsync_enable,
38 	     unsigned char deskew_enable,
39 	     unsigned char deskew_setting,
40 	     unsigned char continuous_sync_enable,
41 	     unsigned char pll_filter_enable,
42 	     unsigned char pll_filter_value)
43 {
44 	struct dvi_ctrl_device *current_dvi_ctrl;
45 
46 	current_dvi_ctrl = dcft_supported_dvi_controller;
47 	if (current_dvi_ctrl->init) {
48 		return current_dvi_ctrl->init(edge_select,
49 					      bus_select,
50 					      dual_edge_clk_select,
51 					      hsync_enable,
52 					      vsync_enable,
53 					      deskew_enable,
54 					      deskew_setting,
55 					      continuous_sync_enable,
56 					      pll_filter_enable,
57 					      pll_filter_value);
58 	}
59 	return -1; /* error */
60 }
61 
62 #endif
63