@@ -997,10 +997,10 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
997997 case DRM_MODE_DPMS_ON :
998998 ast_set_index_reg_mask (ast , AST_IO_SEQ_PORT , 0x01 , 0xdf , 0 );
999999 ast_set_index_reg_mask (ast , AST_IO_CRTC_PORT , 0xb6 , 0xfc , 0 );
1000- if (ast -> tx_chip_type == AST_TX_DP501 )
1000+ if (ast -> tx_chip_types & AST_TX_DP501_BIT )
10011001 ast_set_dp501_video_output (crtc -> dev , 1 );
10021002
1003- if (ast -> tx_chip_type == AST_TX_ASTDP ) {
1003+ if (ast -> tx_chip_types & AST_TX_ASTDP_BIT ) {
10041004 ast_dp_power_on_off (crtc -> dev , AST_DP_POWER_ON );
10051005 ast_wait_for_vretrace (ast );
10061006 ast_dp_set_on_off (crtc -> dev , 1 );
@@ -1012,17 +1012,17 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
10121012 case DRM_MODE_DPMS_SUSPEND :
10131013 case DRM_MODE_DPMS_OFF :
10141014 ch = mode ;
1015- if (ast -> tx_chip_type == AST_TX_DP501 )
1015+ if (ast -> tx_chip_types & AST_TX_DP501_BIT )
10161016 ast_set_dp501_video_output (crtc -> dev , 0 );
1017- break ;
10181017
1019- if (ast -> tx_chip_type == AST_TX_ASTDP ) {
1018+ if (ast -> tx_chip_types & AST_TX_ASTDP_BIT ) {
10201019 ast_dp_set_on_off (crtc -> dev , 0 );
10211020 ast_dp_power_on_off (crtc -> dev , AST_DP_POWER_OFF );
10221021 }
10231022
10241023 ast_set_index_reg_mask (ast , AST_IO_SEQ_PORT , 0x01 , 0xdf , 0x20 );
10251024 ast_set_index_reg_mask (ast , AST_IO_CRTC_PORT , 0xb6 , 0xfc , ch );
1025+ break ;
10261026 }
10271027}
10281028
@@ -1155,7 +1155,7 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
11551155 ast_crtc_load_lut (ast , crtc );
11561156
11571157 //Set Aspeed Display-Port
1158- if (ast -> tx_chip_type == AST_TX_ASTDP )
1158+ if (ast -> tx_chip_types & AST_TX_ASTDP_BIT )
11591159 ast_dp_set_mode (crtc , vbios_mode_info );
11601160
11611161 mutex_unlock (& ast -> ioregs_lock );
@@ -1739,22 +1739,26 @@ int ast_mode_config_init(struct ast_private *ast)
17391739
17401740 ast_crtc_init (dev );
17411741
1742- switch (ast -> tx_chip_type ) {
1743- case AST_TX_NONE :
1742+ if (ast -> tx_chip_types & AST_TX_NONE_BIT ) {
17441743 ret = ast_vga_output_init (ast );
1745- break ;
1746- case AST_TX_SIL164 :
1744+ if (ret )
1745+ return ret ;
1746+ }
1747+ if (ast -> tx_chip_types & AST_TX_SIL164_BIT ) {
17471748 ret = ast_sil164_output_init (ast );
1748- break ;
1749- case AST_TX_DP501 :
1749+ if (ret )
1750+ return ret ;
1751+ }
1752+ if (ast -> tx_chip_types & AST_TX_DP501_BIT ) {
17501753 ret = ast_dp501_output_init (ast );
1751- break ;
1752- case AST_TX_ASTDP :
1754+ if (ret )
1755+ return ret ;
1756+ }
1757+ if (ast -> tx_chip_types & AST_TX_ASTDP_BIT ) {
17531758 ret = ast_astdp_output_init (ast );
1754- break ;
1759+ if (ret )
1760+ return ret ;
17551761 }
1756- if (ret )
1757- return ret ;
17581762
17591763 drm_mode_config_reset (dev );
17601764
0 commit comments