aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ast/ast_dp501.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/ast/ast_dp501.c')
-rw-r--r--drivers/gpu/drm/ast/ast_dp501.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/drivers/gpu/drm/ast/ast_dp501.c b/drivers/gpu/drm/ast/ast_dp501.c
index 5da4b62285fa..76f07f38b941 100644
--- a/drivers/gpu/drm/ast/ast_dp501.c
+++ b/drivers/gpu/drm/ast/ast_dp501.c
@@ -379,11 +379,39 @@ static bool ast_init_dvo(struct drm_device *dev)
379 return true; 379 return true;
380} 380}
381 381
382
383static void ast_init_analog(struct drm_device *dev)
384{
385 struct ast_private *ast = dev->dev_private;
386 u32 data;
387
388 /*
389 * Set DAC source to VGA mode in SCU2C via the P2A
390 * bridge. First configure the P2U to target the SCU
391 * in case it isn't at this stage.
392 */
393 ast_write32(ast, 0xf004, 0x1e6e0000);
394 ast_write32(ast, 0xf000, 0x1);
395
396 /* Then unlock the SCU with the magic password */
397 ast_write32(ast, 0x12000, 0x1688a8a8);
398 ast_write32(ast, 0x12000, 0x1688a8a8);
399 ast_write32(ast, 0x12000, 0x1688a8a8);
400
401 /* Finally, clear bits [17:16] of SCU2c */
402 data = ast_read32(ast, 0x1202c);
403 data &= 0xfffcffff;
404 ast_write32(ast, 0, data);
405
406 /* Disable DVO */
407 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa3, 0xcf, 0x00);
408}
409
382void ast_init_3rdtx(struct drm_device *dev) 410void ast_init_3rdtx(struct drm_device *dev)
383{ 411{
384 struct ast_private *ast = dev->dev_private; 412 struct ast_private *ast = dev->dev_private;
385 u8 jreg; 413 u8 jreg;
386 u32 data; 414
387 if (ast->chip == AST2300 || ast->chip == AST2400) { 415 if (ast->chip == AST2300 || ast->chip == AST2400) {
388 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff); 416 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff);
389 switch (jreg & 0x0e) { 417 switch (jreg & 0x0e) {
@@ -399,12 +427,8 @@ void ast_init_3rdtx(struct drm_device *dev)
399 default: 427 default:
400 if (ast->tx_chip_type == AST_TX_SIL164) 428 if (ast->tx_chip_type == AST_TX_SIL164)
401 ast_init_dvo(dev); 429 ast_init_dvo(dev);
402 else { 430 else
403 ast_write32(ast, 0x12000, 0x1688a8a8); 431 ast_init_analog(dev);
404 data = ast_read32(ast, 0x1202c);
405 data &= 0xfffcffff;
406 ast_write32(ast, 0, data);
407 }
408 } 432 }
409 } 433 }
410} 434}