@@ -54,6 +54,7 @@ static void init_enable_spread_spectrum_on_ppll(struct bios_parser *bp);
5454static void init_adjust_display_pll (struct bios_parser * bp );
5555static void init_select_crtc_source (struct bios_parser * bp );
5656static void init_dac_encoder_control (struct bios_parser * bp );
57+ static void init_dac_load_detection (struct bios_parser * bp );
5758static void init_dac_output_control (struct bios_parser * bp );
5859static void init_set_crtc_timing (struct bios_parser * bp );
5960static void init_enable_crtc (struct bios_parser * bp );
@@ -72,6 +73,7 @@ void dal_bios_parser_init_cmd_tbl(struct bios_parser *bp)
7273 init_adjust_display_pll (bp );
7374 init_select_crtc_source (bp );
7475 init_dac_encoder_control (bp );
76+ init_dac_load_detection (bp );
7577 init_dac_output_control (bp );
7678 init_set_crtc_timing (bp );
7779 init_enable_crtc (bp );
@@ -1902,6 +1904,96 @@ static enum bp_result dac2_encoder_control_v1(
19021904 return result ;
19031905}
19041906
1907+ /*******************************************************************************
1908+ ********************************************************************************
1909+ **
1910+ ** DAC LOAD DETECTION
1911+ **
1912+ ********************************************************************************
1913+ *******************************************************************************/
1914+
1915+ static enum bp_result dac_load_detection_v1 (
1916+ struct bios_parser * bp ,
1917+ struct bp_load_detection_parameters * bp_params );
1918+
1919+ static enum bp_result dac_load_detection_v3 (
1920+ struct bios_parser * bp ,
1921+ struct bp_load_detection_parameters * bp_params );
1922+
1923+ static void init_dac_load_detection (struct bios_parser * bp )
1924+ {
1925+ switch (BIOS_CMD_TABLE_PARA_REVISION (DAC_LoadDetection )) {
1926+ case 1 :
1927+ case 2 :
1928+ bp -> cmd_tbl .dac_load_detection = dac_load_detection_v1 ;
1929+ break ;
1930+ case 3 :
1931+ default :
1932+ bp -> cmd_tbl .dac_load_detection = dac_load_detection_v3 ;
1933+ break ;
1934+ }
1935+ }
1936+
1937+ static void dac_load_detect_prepare_params (
1938+ struct _DAC_LOAD_DETECTION_PS_ALLOCATION * params ,
1939+ enum engine_id engine_id ,
1940+ uint16_t device_id ,
1941+ uint8_t misc )
1942+ {
1943+ uint8_t dac_type = ENGINE_ID_DACA ;
1944+
1945+ if (engine_id == ENGINE_ID_DACB )
1946+ dac_type = ATOM_DAC_B ;
1947+
1948+ params -> sDacload .usDeviceID = cpu_to_le16 (device_id );
1949+ params -> sDacload .ucDacType = dac_type ;
1950+ params -> sDacload .ucMisc = misc ;
1951+ }
1952+
1953+ static enum bp_result dac_load_detection_v1 (
1954+ struct bios_parser * bp ,
1955+ struct bp_load_detection_parameters * bp_params )
1956+ {
1957+ enum bp_result result = BP_RESULT_FAILURE ;
1958+ DAC_LOAD_DETECTION_PS_ALLOCATION params ;
1959+
1960+ dac_load_detect_prepare_params (
1961+ & params ,
1962+ bp_params -> engine_id ,
1963+ bp_params -> device_id ,
1964+ 0 );
1965+
1966+ if (EXEC_BIOS_CMD_TABLE (DAC_LoadDetection , params ))
1967+ result = BP_RESULT_OK ;
1968+
1969+ return result ;
1970+ }
1971+
1972+ static enum bp_result dac_load_detection_v3 (
1973+ struct bios_parser * bp ,
1974+ struct bp_load_detection_parameters * bp_params )
1975+ {
1976+ enum bp_result result = BP_RESULT_FAILURE ;
1977+ DAC_LOAD_DETECTION_PS_ALLOCATION params ;
1978+
1979+ uint8_t misc = 0 ;
1980+
1981+ if (bp_params -> device_id == ATOM_DEVICE_CV_SUPPORT ||
1982+ bp_params -> device_id == ATOM_DEVICE_TV1_SUPPORT )
1983+ misc = DAC_LOAD_MISC_YPrPb ;
1984+
1985+ dac_load_detect_prepare_params (
1986+ & params ,
1987+ bp_params -> engine_id ,
1988+ bp_params -> device_id ,
1989+ misc );
1990+
1991+ if (EXEC_BIOS_CMD_TABLE (DAC_LoadDetection , params ))
1992+ result = BP_RESULT_OK ;
1993+
1994+ return result ;
1995+ }
1996+
19051997/*******************************************************************************
19061998 ********************************************************************************
19071999 **
0 commit comments