Lines Matching refs:ast
16 static bool ast_astdp_is_connected(struct ast_device *ast) in ast_astdp_is_connected() argument
18 if (!ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xDF, AST_IO_VGACRDF_HPD)) in ast_astdp_is_connected()
25 struct ast_device *ast = data; in ast_astdp_read_edid_block() local
37 mutex_lock(&ast->modeset_lock); in ast_astdp_read_edid_block()
40 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xe5, (u8)~AST_IO_VGACRE5_EDID_READ_DONE, 0x00); in ast_astdp_read_edid_block()
58 ast_set_index_reg(ast, AST_IO_VGACRI, 0xe4, vgacre4); in ast_astdp_read_edid_block()
79 vgacrd7 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xd7); in ast_astdp_read_edid_block()
81 vgacrd6 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xd6); in ast_astdp_read_edid_block()
91 ediddata[0] = ast_get_index_reg(ast, AST_IO_VGACRI, 0xd8); in ast_astdp_read_edid_block()
92 ediddata[1] = ast_get_index_reg(ast, AST_IO_VGACRI, 0xd9); in ast_astdp_read_edid_block()
93 ediddata[2] = ast_get_index_reg(ast, AST_IO_VGACRI, 0xda); in ast_astdp_read_edid_block()
94 ediddata[3] = ast_get_index_reg(ast, AST_IO_VGACRI, 0xdb); in ast_astdp_read_edid_block()
116 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xe5, (u8)~AST_IO_VGACRE5_EDID_READ_DONE, in ast_astdp_read_edid_block()
119 mutex_unlock(&ast->modeset_lock); in ast_astdp_read_edid_block()
127 int ast_dp_launch(struct ast_device *ast) in ast_dp_launch() argument
129 struct drm_device *dev = &ast->base; in ast_dp_launch()
133 u8 vgacrd1 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xd1); in ast_dp_launch()
145 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xe5, in ast_dp_launch()
152 static bool ast_dp_get_phy_sleep(struct ast_device *ast) in ast_dp_get_phy_sleep() argument
154 u8 vgacre3 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xe3); in ast_dp_get_phy_sleep()
159 static void ast_dp_set_phy_sleep(struct ast_device *ast, bool sleep) in ast_dp_set_phy_sleep() argument
166 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xe3, (u8)~AST_IO_VGACRE3_DP_PHY_SLEEP, in ast_dp_set_phy_sleep()
171 static void ast_dp_link_training(struct ast_device *ast) in ast_dp_link_training() argument
173 struct drm_device *dev = &ast->base; in ast_dp_link_training()
182 vgacrdc = ast_get_index_reg(ast, AST_IO_VGACRI, 0xdc); in ast_dp_link_training()
189 static bool __ast_dp_wait_enable(struct ast_device *ast, bool enabled) in __ast_dp_wait_enable() argument
201 vgacrdf = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xdf, in __ast_dp_wait_enable()
210 static void ast_dp_set_enable(struct ast_device *ast, bool enabled) in ast_dp_set_enable() argument
212 struct drm_device *dev = &ast->base; in ast_dp_set_enable()
218 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xe3, (u8)~AST_IO_VGACRE3_DP_VIDEO_ENABLE, in ast_dp_set_enable()
221 drm_WARN_ON(dev, !__ast_dp_wait_enable(ast, enabled)); in ast_dp_set_enable()
226 struct ast_device *ast = to_ast_device(crtc->dev); in ast_dp_set_mode() local
292 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xE0, ASTDP_AND_CLEAR_MASK, in ast_dp_set_mode()
294 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xE1, ASTDP_AND_CLEAR_MASK, ASTDP_MISC1); in ast_dp_set_mode()
295 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xE2, ASTDP_AND_CLEAR_MASK, ModeIdx); in ast_dp_set_mode()
298 static void ast_wait_for_vretrace(struct ast_device *ast) in ast_wait_for_vretrace() argument
304 vgair1 = ast_io_read8(ast, AST_IO_VGAIR1_R); in ast_wait_for_vretrace()
330 struct ast_device *ast = to_ast_device(encoder->dev); in ast_astdp_encoder_helper_atomic_enable() local
331 struct ast_connector *ast_connector = &ast->output.astdp.connector; in ast_astdp_encoder_helper_atomic_enable()
334 ast_dp_set_phy_sleep(ast, false); in ast_astdp_encoder_helper_atomic_enable()
335 ast_dp_link_training(ast); in ast_astdp_encoder_helper_atomic_enable()
337 ast_wait_for_vretrace(ast); in ast_astdp_encoder_helper_atomic_enable()
338 ast_dp_set_enable(ast, true); in ast_astdp_encoder_helper_atomic_enable()
345 struct ast_device *ast = to_ast_device(encoder->dev); in ast_astdp_encoder_helper_atomic_disable() local
347 ast_dp_set_enable(ast, false); in ast_astdp_encoder_helper_atomic_disable()
348 ast_dp_set_phy_sleep(ast, true); in ast_astdp_encoder_helper_atomic_disable()
367 struct ast_device *ast = to_ast_device(connector->dev); in ast_astdp_connector_helper_get_modes() local
370 drm_edid = drm_edid_read_custom(connector, ast_astdp_read_edid_block, ast); in ast_astdp_connector_helper_get_modes()
395 struct ast_device *ast = to_ast_device(connector->dev); in ast_astdp_connector_helper_detect_ctx() local
399 mutex_lock(&ast->modeset_lock); in ast_astdp_connector_helper_detect_ctx()
401 phy_sleep = ast_dp_get_phy_sleep(ast); in ast_astdp_connector_helper_detect_ctx()
403 ast_dp_set_phy_sleep(ast, false); in ast_astdp_connector_helper_detect_ctx()
405 if (ast_astdp_is_connected(ast)) in ast_astdp_connector_helper_detect_ctx()
409 ast_dp_set_phy_sleep(ast, true); in ast_astdp_connector_helper_detect_ctx()
411 mutex_unlock(&ast->modeset_lock); in ast_astdp_connector_helper_detect_ctx()
437 int ast_astdp_output_init(struct ast_device *ast) in ast_astdp_output_init() argument
439 struct drm_device *dev = &ast->base; in ast_astdp_output_init()
440 struct drm_crtc *crtc = &ast->crtc; in ast_astdp_output_init()
448 encoder = &ast->output.astdp.encoder; in ast_astdp_output_init()
459 ast_connector = &ast->output.astdp.connector; in ast_astdp_output_init()