aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-08-05 21:21:17 -0400
committerDave Airlie <airlied@redhat.com>2010-08-09 20:46:49 -0400
commit179e8078a768be8c18539bebe44dd94447142ccf (patch)
treeb35ebacaeda1207f9ec20aff97dab12f3f10c810 /drivers/gpu
parentf376b94fbc0a313a606748206340cbef6c2adf6b (diff)
drm/radeon/kms: rework combios i2c handling
Handle asic specific table to hw mappings in combios_setup_i2c_bus() directly. This allows us to remove most of the combios quirks and clean up the i2c bus setup. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_combios.c415
1 files changed, 168 insertions, 247 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index 18c84cf3eafa..885dcfac1838 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -479,21 +479,67 @@ radeon_combios_get_hardcoded_edid(struct radeon_device *rdev)
479 return NULL; 479 return NULL;
480} 480}
481 481
482/* standard i2c gpio lines */
483#define RADEON_I2C_MONID_ID 0
484#define RADEON_I2C_DVI_ID 1
485#define RADEON_I2C_VGA_ID 2
486#define RADEON_I2C_CRT2_ID 3
487#define RADEON_I2C_MM_ID 4
488/* custom defined gpio lines */
489#define RADEON_I2C_LCD_ID 5 /* ddc for laptop panels */
490#define RADEON_I2C_GPIO_ID 6 /* rs4xx gpio ddc */
491#define RADEON_I2C_DVO_ID 7 /* i2c bus for dvo */
492
493static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rdev, 482static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rdev,
494 int ddc_line) 483 enum radeon_combios_ddc ddc,
484 u32 clk_mask,
485 u32 data_mask)
495{ 486{
496 struct radeon_i2c_bus_rec i2c; 487 struct radeon_i2c_bus_rec i2c;
488 int ddc_line = 0;
489
490 /* ddc id = mask reg
491 * DDC_NONE_DETECTED = none
492 * DDC_DVI = RADEON_GPIO_DVI_DDC
493 * DDC_VGA = RADEON_GPIO_VGA_DDC
494 * DDC_LCD = RADEON_GPIOPAD_MASK
495 * DDC_GPIO = RADEON_MDGPIO_MASK
496 * r1xx/r2xx
497 * DDC_MONID = RADEON_GPIO_MONID
498 * DDC_CRT2 = RADEON_GPIO_CRT2_DDC
499 * r3xx
500 * DDC_MONID = RADEON_GPIO_MONID
501 * DDC_CRT2 = RADEON_GPIO_DVI_DDC
502 * rs3xx/rs4xx
503 * DDC_MONID = RADEON_GPIOPAD_MASK
504 * DDC_CRT2 = RADEON_GPIO_MONID
505 */
506 switch (ddc) {
507 case DDC_NONE_DETECTED:
508 default:
509 ddc_line = 0;
510 break;
511 case DDC_DVI:
512 ddc_line = RADEON_GPIO_DVI_DDC;
513 break;
514 case DDC_VGA:
515 ddc_line = RADEON_GPIO_VGA_DDC;
516 break;
517 case DDC_LCD:
518 ddc_line = RADEON_GPIOPAD_MASK;
519 break;
520 case DDC_GPIO:
521 ddc_line = RADEON_MDGPIO_MASK;
522 break;
523 case DDC_MONID:
524 if (rdev->family == CHIP_RS300 ||
525 rdev->family == CHIP_RS400 ||
526 rdev->family == CHIP_RS480)
527 ddc_line = RADEON_GPIOPAD_MASK;
528 else
529 ddc_line = RADEON_GPIO_MONID;
530 break;
531 case DDC_CRT2:
532 if (rdev->family == CHIP_RS300 ||
533 rdev->family == CHIP_RS400 ||
534 rdev->family == CHIP_RS480)
535 ddc_line = RADEON_GPIO_MONID;
536 else if (rdev->family >= CHIP_R300) {
537 ddc_line = RADEON_GPIO_DVI_DDC;
538 ddc = DDC_DVI;
539 } else
540 ddc_line = RADEON_GPIO_CRT2_DDC;
541 break;
542 }
497 543
498 if (ddc_line == RADEON_GPIOPAD_MASK) { 544 if (ddc_line == RADEON_GPIOPAD_MASK) {
499 i2c.mask_clk_reg = RADEON_GPIOPAD_MASK; 545 i2c.mask_clk_reg = RADEON_GPIOPAD_MASK;
@@ -514,15 +560,6 @@ static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rde
514 i2c.y_clk_reg = RADEON_MDGPIO_Y; 560 i2c.y_clk_reg = RADEON_MDGPIO_Y;
515 i2c.y_data_reg = RADEON_MDGPIO_Y; 561 i2c.y_data_reg = RADEON_MDGPIO_Y;
516 } else { 562 } else {
517 i2c.mask_clk_mask = RADEON_GPIO_EN_1;
518 i2c.mask_data_mask = RADEON_GPIO_EN_0;
519 i2c.a_clk_mask = RADEON_GPIO_A_1;
520 i2c.a_data_mask = RADEON_GPIO_A_0;
521 i2c.en_clk_mask = RADEON_GPIO_EN_1;
522 i2c.en_data_mask = RADEON_GPIO_EN_0;
523 i2c.y_clk_mask = RADEON_GPIO_Y_1;
524 i2c.y_data_mask = RADEON_GPIO_Y_0;
525
526 i2c.mask_clk_reg = ddc_line; 563 i2c.mask_clk_reg = ddc_line;
527 i2c.mask_data_reg = ddc_line; 564 i2c.mask_data_reg = ddc_line;
528 i2c.a_clk_reg = ddc_line; 565 i2c.a_clk_reg = ddc_line;
@@ -533,6 +570,26 @@ static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rde
533 i2c.y_data_reg = ddc_line; 570 i2c.y_data_reg = ddc_line;
534 } 571 }
535 572
573 if (clk_mask && data_mask) {
574 i2c.mask_clk_mask = clk_mask;
575 i2c.mask_data_mask = data_mask;
576 i2c.a_clk_mask = clk_mask;
577 i2c.a_data_mask = data_mask;
578 i2c.en_clk_mask = clk_mask;
579 i2c.en_data_mask = data_mask;
580 i2c.y_clk_mask = clk_mask;
581 i2c.y_data_mask = data_mask;
582 } else {
583 i2c.mask_clk_mask = RADEON_GPIO_EN_1;
584 i2c.mask_data_mask = RADEON_GPIO_EN_0;
585 i2c.a_clk_mask = RADEON_GPIO_A_1;
586 i2c.a_data_mask = RADEON_GPIO_A_0;
587 i2c.en_clk_mask = RADEON_GPIO_EN_1;
588 i2c.en_data_mask = RADEON_GPIO_EN_0;
589 i2c.y_clk_mask = RADEON_GPIO_Y_1;
590 i2c.y_data_mask = RADEON_GPIO_Y_0;
591 }
592
536 switch (rdev->family) { 593 switch (rdev->family) {
537 case CHIP_R100: 594 case CHIP_R100:
538 case CHIP_RV100: 595 case CHIP_RV100:
@@ -611,23 +668,7 @@ static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rde
611 } 668 }
612 i2c.mm_i2c = false; 669 i2c.mm_i2c = false;
613 670
614 switch (ddc_line) { 671 i2c.i2c_id = ddc;
615 case RADEON_GPIO_MONID:
616 i2c.i2c_id = RADEON_I2C_MONID_ID;
617 break;
618 case RADEON_GPIO_DVI_DDC:
619 i2c.i2c_id = RADEON_I2C_DVI_ID;
620 break;
621 case RADEON_GPIO_VGA_DDC:
622 i2c.i2c_id = RADEON_I2C_VGA_ID;
623 break;
624 case RADEON_GPIO_CRT2_DDC:
625 i2c.i2c_id = RADEON_I2C_CRT2_ID;
626 break;
627 default:
628 i2c.i2c_id = 0xff;
629 break;
630 }
631 i2c.hpd = RADEON_HPD_NONE; 672 i2c.hpd = RADEON_HPD_NONE;
632 673
633 if (ddc_line) 674 if (ddc_line)
@@ -643,23 +684,55 @@ void radeon_combios_i2c_init(struct radeon_device *rdev)
643 struct drm_device *dev = rdev->ddev; 684 struct drm_device *dev = rdev->ddev;
644 struct radeon_i2c_bus_rec i2c; 685 struct radeon_i2c_bus_rec i2c;
645 686
646 i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_MONID);
647 rdev->i2c_bus[0] = radeon_i2c_create(dev, &i2c, "MONID");
648
649 i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC);
650 rdev->i2c_bus[1] = radeon_i2c_create(dev, &i2c, "DVI_DDC");
651 687
652 i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 688 i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
653 rdev->i2c_bus[2] = radeon_i2c_create(dev, &i2c, "VGA_DDC"); 689 rdev->i2c_bus[0] = radeon_i2c_create(dev, &i2c, "DVI_DDC");
654 690
655 i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); 691 i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
656 rdev->i2c_bus[3] = radeon_i2c_create(dev, &i2c, "CRT2_DDC"); 692 rdev->i2c_bus[1] = radeon_i2c_create(dev, &i2c, "VGA_DDC");
657 693
658 i2c.valid = true; 694 i2c.valid = true;
659 i2c.hw_capable = true; 695 i2c.hw_capable = true;
660 i2c.mm_i2c = true; 696 i2c.mm_i2c = true;
661 i2c.i2c_id = RADEON_I2C_MM_ID; 697 i2c.i2c_id = 0xa0;
662 rdev->i2c_bus[4] = radeon_i2c_create(dev, &i2c, "MM_I2C"); 698 rdev->i2c_bus[2] = radeon_i2c_create(dev, &i2c, "MM_I2C");
699
700 if (rdev->family == CHIP_RS300 ||
701 rdev->family == CHIP_RS400 ||
702 rdev->family == CHIP_RS480) {
703 u16 offset;
704 u8 id, blocks, clk, data;
705 int i;
706
707 i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0);
708 rdev->i2c_bus[3] = radeon_i2c_create(dev, &i2c, "MONID");
709
710 offset = combios_get_table_offset(dev, COMBIOS_I2C_INFO_TABLE);
711 if (offset) {
712 blocks = RBIOS8(offset + 2);
713 for (i = 0; i < blocks; i++) {
714 id = RBIOS8(offset + 3 + (i * 5) + 0);
715 if (id == 136) {
716 clk = RBIOS8(offset + 3 + (i * 5) + 3);
717 data = RBIOS8(offset + 3 + (i * 5) + 4);
718 i2c = combios_setup_i2c_bus(rdev, DDC_MONID,
719 clk, data);
720 rdev->i2c_bus[4] = radeon_i2c_create(dev, &i2c, "GPIOPAD_MASK");
721 break;
722 }
723 }
724 }
725
726 } else if (rdev->family >= CHIP_R300) {
727 i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0);
728 rdev->i2c_bus[3] = radeon_i2c_create(dev, &i2c, "MONID");
729 } else {
730 i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0);
731 rdev->i2c_bus[3] = radeon_i2c_create(dev, &i2c, "MONID");
732
733 i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0);
734 rdev->i2c_bus[4] = radeon_i2c_create(dev, &i2c, "CRT2_DDC");
735 }
663} 736}
664 737
665bool radeon_combios_get_clock_info(struct drm_device *dev) 738bool radeon_combios_get_clock_info(struct drm_device *dev)
@@ -1299,7 +1372,7 @@ bool radeon_legacy_get_ext_tmds_info_from_table(struct radeon_encoder *encoder,
1299 struct radeon_i2c_bus_rec i2c_bus; 1372 struct radeon_i2c_bus_rec i2c_bus;
1300 1373
1301 /* default for macs */ 1374 /* default for macs */
1302 i2c_bus = combios_setup_i2c_bus(rdev, RADEON_GPIO_MONID); 1375 i2c_bus = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0);
1303 tmds->i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus); 1376 tmds->i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus);
1304 1377
1305 /* XXX some macs have duallink chips */ 1378 /* XXX some macs have duallink chips */
@@ -1321,49 +1394,16 @@ bool radeon_legacy_get_ext_tmds_info_from_combios(struct radeon_encoder *encoder
1321 struct drm_device *dev = encoder->base.dev; 1394 struct drm_device *dev = encoder->base.dev;
1322 struct radeon_device *rdev = dev->dev_private; 1395 struct radeon_device *rdev = dev->dev_private;
1323 uint16_t offset; 1396 uint16_t offset;
1324 uint8_t ver, id, blocks, clk, data; 1397 uint8_t ver;
1325 int i;
1326 enum radeon_combios_ddc gpio; 1398 enum radeon_combios_ddc gpio;
1327 struct radeon_i2c_bus_rec i2c_bus; 1399 struct radeon_i2c_bus_rec i2c_bus;
1328 1400
1329 tmds->i2c_bus = NULL; 1401 tmds->i2c_bus = NULL;
1330 if (rdev->flags & RADEON_IS_IGP) { 1402 if (rdev->flags & RADEON_IS_IGP) {
1331 offset = combios_get_table_offset(dev, COMBIOS_I2C_INFO_TABLE); 1403 i2c_bus = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0);
1332 if (offset) { 1404 tmds->i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus);
1333 ver = RBIOS8(offset); 1405 tmds->dvo_chip = DVO_SIL164;
1334 DRM_INFO("GPIO Table revision: %d\n", ver); 1406 tmds->slave_addr = 0x70 >> 1; /* 7 bit addressing */
1335 blocks = RBIOS8(offset + 2);
1336 for (i = 0; i < blocks; i++) {
1337 id = RBIOS8(offset + 3 + (i * 5) + 0);
1338 if (id == 136) {
1339 clk = RBIOS8(offset + 3 + (i * 5) + 3);
1340 data = RBIOS8(offset + 3 + (i * 5) + 4);
1341 i2c_bus.valid = true;
1342 i2c_bus.mask_clk_mask = (1 << clk);
1343 i2c_bus.mask_data_mask = (1 << data);
1344 i2c_bus.a_clk_mask = (1 << clk);
1345 i2c_bus.a_data_mask = (1 << data);
1346 i2c_bus.en_clk_mask = (1 << clk);
1347 i2c_bus.en_data_mask = (1 << data);
1348 i2c_bus.y_clk_mask = (1 << clk);
1349 i2c_bus.y_data_mask = (1 << data);
1350 i2c_bus.mask_clk_reg = RADEON_GPIOPAD_MASK;
1351 i2c_bus.mask_data_reg = RADEON_GPIOPAD_MASK;
1352 i2c_bus.a_clk_reg = RADEON_GPIOPAD_A;
1353 i2c_bus.a_data_reg = RADEON_GPIOPAD_A;
1354 i2c_bus.en_clk_reg = RADEON_GPIOPAD_EN;
1355 i2c_bus.en_data_reg = RADEON_GPIOPAD_EN;
1356 i2c_bus.y_clk_reg = RADEON_GPIOPAD_Y;
1357 i2c_bus.y_data_reg = RADEON_GPIOPAD_Y;
1358 i2c_bus.i2c_id = RADEON_I2C_DVO_ID;
1359 radeon_i2c_add(rdev, &i2c_bus, "DVO");
1360 tmds->i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus);
1361 tmds->dvo_chip = DVO_SIL164;
1362 tmds->slave_addr = 0x70 >> 1; /* 7 bit addressing */
1363 break;
1364 }
1365 }
1366 }
1367 } else { 1407 } else {
1368 offset = combios_get_table_offset(dev, COMBIOS_EXT_TMDS_INFO_TABLE); 1408 offset = combios_get_table_offset(dev, COMBIOS_EXT_TMDS_INFO_TABLE);
1369 if (offset) { 1409 if (offset) {
@@ -1372,38 +1412,15 @@ bool radeon_legacy_get_ext_tmds_info_from_combios(struct radeon_encoder *encoder
1372 tmds->slave_addr = RBIOS8(offset + 4 + 2); 1412 tmds->slave_addr = RBIOS8(offset + 4 + 2);
1373 tmds->slave_addr >>= 1; /* 7 bit addressing */ 1413 tmds->slave_addr >>= 1; /* 7 bit addressing */
1374 gpio = RBIOS8(offset + 4 + 3); 1414 gpio = RBIOS8(offset + 4 + 3);
1375 switch (gpio) { 1415 if (gpio == DDC_LCD) {
1376 case DDC_MONID: 1416 /* MM i2c */
1377 i2c_bus = combios_setup_i2c_bus(rdev, RADEON_GPIO_MONID);
1378 tmds->i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus);
1379 break;
1380 case DDC_DVI:
1381 i2c_bus = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC);
1382 tmds->i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus);
1383 break;
1384 case DDC_VGA:
1385 i2c_bus = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC);
1386 tmds->i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus);
1387 break;
1388 case DDC_CRT2:
1389 /* R3xx+ chips don't have GPIO_CRT2_DDC gpio pad */
1390 if (rdev->family >= CHIP_R300)
1391 i2c_bus = combios_setup_i2c_bus(rdev, RADEON_GPIO_MONID);
1392 else
1393 i2c_bus = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC);
1394 tmds->i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus);
1395 break;
1396 case DDC_LCD: /* MM i2c */
1397 i2c_bus.valid = true; 1417 i2c_bus.valid = true;
1398 i2c_bus.hw_capable = true; 1418 i2c_bus.hw_capable = true;
1399 i2c_bus.mm_i2c = true; 1419 i2c_bus.mm_i2c = true;
1400 i2c_bus.i2c_id = RADEON_I2C_MM_ID; 1420 i2c_bus.i2c_id = 0xa0;
1401 tmds->i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus); 1421 } else
1402 break; 1422 i2c_bus = combios_setup_i2c_bus(rdev, gpio, 0, 0);
1403 default: 1423 tmds->i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus);
1404 DRM_ERROR("Unsupported gpio %d\n", gpio);
1405 break;
1406 }
1407 } 1424 }
1408 } 1425 }
1409 1426
@@ -1485,7 +1502,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1485 /* these are the most common settings */ 1502 /* these are the most common settings */
1486 if (rdev->flags & RADEON_SINGLE_CRTC) { 1503 if (rdev->flags & RADEON_SINGLE_CRTC) {
1487 /* VGA - primary dac */ 1504 /* VGA - primary dac */
1488 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 1505 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
1489 hpd.hpd = RADEON_HPD_NONE; 1506 hpd.hpd = RADEON_HPD_NONE;
1490 radeon_add_legacy_encoder(dev, 1507 radeon_add_legacy_encoder(dev,
1491 radeon_get_encoder_id(dev, 1508 radeon_get_encoder_id(dev,
@@ -1500,7 +1517,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1500 &hpd); 1517 &hpd);
1501 } else if (rdev->flags & RADEON_IS_MOBILITY) { 1518 } else if (rdev->flags & RADEON_IS_MOBILITY) {
1502 /* LVDS */ 1519 /* LVDS */
1503 ddc_i2c = combios_setup_i2c_bus(rdev, 0); 1520 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_NONE_DETECTED, 0, 0);
1504 hpd.hpd = RADEON_HPD_NONE; 1521 hpd.hpd = RADEON_HPD_NONE;
1505 radeon_add_legacy_encoder(dev, 1522 radeon_add_legacy_encoder(dev,
1506 radeon_get_encoder_id(dev, 1523 radeon_get_encoder_id(dev,
@@ -1515,7 +1532,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1515 &hpd); 1532 &hpd);
1516 1533
1517 /* VGA - primary dac */ 1534 /* VGA - primary dac */
1518 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 1535 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
1519 hpd.hpd = RADEON_HPD_NONE; 1536 hpd.hpd = RADEON_HPD_NONE;
1520 radeon_add_legacy_encoder(dev, 1537 radeon_add_legacy_encoder(dev,
1521 radeon_get_encoder_id(dev, 1538 radeon_get_encoder_id(dev,
@@ -1530,7 +1547,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1530 &hpd); 1547 &hpd);
1531 } else { 1548 } else {
1532 /* DVI-I - tv dac, int tmds */ 1549 /* DVI-I - tv dac, int tmds */
1533 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); 1550 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
1534 hpd.hpd = RADEON_HPD_1; 1551 hpd.hpd = RADEON_HPD_1;
1535 radeon_add_legacy_encoder(dev, 1552 radeon_add_legacy_encoder(dev,
1536 radeon_get_encoder_id(dev, 1553 radeon_get_encoder_id(dev,
@@ -1551,7 +1568,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1551 &hpd); 1568 &hpd);
1552 1569
1553 /* VGA - primary dac */ 1570 /* VGA - primary dac */
1554 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 1571 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
1555 hpd.hpd = RADEON_HPD_NONE; 1572 hpd.hpd = RADEON_HPD_NONE;
1556 radeon_add_legacy_encoder(dev, 1573 radeon_add_legacy_encoder(dev,
1557 radeon_get_encoder_id(dev, 1574 radeon_get_encoder_id(dev,
@@ -1587,7 +1604,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1587 DRM_INFO("Connector Table: %d (ibook)\n", 1604 DRM_INFO("Connector Table: %d (ibook)\n",
1588 rdev->mode_info.connector_table); 1605 rdev->mode_info.connector_table);
1589 /* LVDS */ 1606 /* LVDS */
1590 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); 1607 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
1591 hpd.hpd = RADEON_HPD_NONE; 1608 hpd.hpd = RADEON_HPD_NONE;
1592 radeon_add_legacy_encoder(dev, 1609 radeon_add_legacy_encoder(dev,
1593 radeon_get_encoder_id(dev, 1610 radeon_get_encoder_id(dev,
@@ -1599,7 +1616,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1599 CONNECTOR_OBJECT_ID_LVDS, 1616 CONNECTOR_OBJECT_ID_LVDS,
1600 &hpd); 1617 &hpd);
1601 /* VGA - TV DAC */ 1618 /* VGA - TV DAC */
1602 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 1619 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
1603 hpd.hpd = RADEON_HPD_NONE; 1620 hpd.hpd = RADEON_HPD_NONE;
1604 radeon_add_legacy_encoder(dev, 1621 radeon_add_legacy_encoder(dev,
1605 radeon_get_encoder_id(dev, 1622 radeon_get_encoder_id(dev,
@@ -1628,7 +1645,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1628 DRM_INFO("Connector Table: %d (powerbook external tmds)\n", 1645 DRM_INFO("Connector Table: %d (powerbook external tmds)\n",
1629 rdev->mode_info.connector_table); 1646 rdev->mode_info.connector_table);
1630 /* LVDS */ 1647 /* LVDS */
1631 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); 1648 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
1632 hpd.hpd = RADEON_HPD_NONE; 1649 hpd.hpd = RADEON_HPD_NONE;
1633 radeon_add_legacy_encoder(dev, 1650 radeon_add_legacy_encoder(dev,
1634 radeon_get_encoder_id(dev, 1651 radeon_get_encoder_id(dev,
@@ -1640,7 +1657,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1640 CONNECTOR_OBJECT_ID_LVDS, 1657 CONNECTOR_OBJECT_ID_LVDS,
1641 &hpd); 1658 &hpd);
1642 /* DVI-I - primary dac, ext tmds */ 1659 /* DVI-I - primary dac, ext tmds */
1643 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 1660 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
1644 hpd.hpd = RADEON_HPD_2; /* ??? */ 1661 hpd.hpd = RADEON_HPD_2; /* ??? */
1645 radeon_add_legacy_encoder(dev, 1662 radeon_add_legacy_encoder(dev,
1646 radeon_get_encoder_id(dev, 1663 radeon_get_encoder_id(dev,
@@ -1677,7 +1694,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1677 DRM_INFO("Connector Table: %d (powerbook internal tmds)\n", 1694 DRM_INFO("Connector Table: %d (powerbook internal tmds)\n",
1678 rdev->mode_info.connector_table); 1695 rdev->mode_info.connector_table);
1679 /* LVDS */ 1696 /* LVDS */
1680 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); 1697 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
1681 hpd.hpd = RADEON_HPD_NONE; 1698 hpd.hpd = RADEON_HPD_NONE;
1682 radeon_add_legacy_encoder(dev, 1699 radeon_add_legacy_encoder(dev,
1683 radeon_get_encoder_id(dev, 1700 radeon_get_encoder_id(dev,
@@ -1689,7 +1706,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1689 CONNECTOR_OBJECT_ID_LVDS, 1706 CONNECTOR_OBJECT_ID_LVDS,
1690 &hpd); 1707 &hpd);
1691 /* DVI-I - primary dac, int tmds */ 1708 /* DVI-I - primary dac, int tmds */
1692 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 1709 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
1693 hpd.hpd = RADEON_HPD_1; /* ??? */ 1710 hpd.hpd = RADEON_HPD_1; /* ??? */
1694 radeon_add_legacy_encoder(dev, 1711 radeon_add_legacy_encoder(dev,
1695 radeon_get_encoder_id(dev, 1712 radeon_get_encoder_id(dev,
@@ -1725,7 +1742,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1725 DRM_INFO("Connector Table: %d (powerbook vga)\n", 1742 DRM_INFO("Connector Table: %d (powerbook vga)\n",
1726 rdev->mode_info.connector_table); 1743 rdev->mode_info.connector_table);
1727 /* LVDS */ 1744 /* LVDS */
1728 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); 1745 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
1729 hpd.hpd = RADEON_HPD_NONE; 1746 hpd.hpd = RADEON_HPD_NONE;
1730 radeon_add_legacy_encoder(dev, 1747 radeon_add_legacy_encoder(dev,
1731 radeon_get_encoder_id(dev, 1748 radeon_get_encoder_id(dev,
@@ -1737,7 +1754,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1737 CONNECTOR_OBJECT_ID_LVDS, 1754 CONNECTOR_OBJECT_ID_LVDS,
1738 &hpd); 1755 &hpd);
1739 /* VGA - primary dac */ 1756 /* VGA - primary dac */
1740 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 1757 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
1741 hpd.hpd = RADEON_HPD_NONE; 1758 hpd.hpd = RADEON_HPD_NONE;
1742 radeon_add_legacy_encoder(dev, 1759 radeon_add_legacy_encoder(dev,
1743 radeon_get_encoder_id(dev, 1760 radeon_get_encoder_id(dev,
@@ -1766,7 +1783,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1766 DRM_INFO("Connector Table: %d (mini external tmds)\n", 1783 DRM_INFO("Connector Table: %d (mini external tmds)\n",
1767 rdev->mode_info.connector_table); 1784 rdev->mode_info.connector_table);
1768 /* DVI-I - tv dac, ext tmds */ 1785 /* DVI-I - tv dac, ext tmds */
1769 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); 1786 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0);
1770 hpd.hpd = RADEON_HPD_2; /* ??? */ 1787 hpd.hpd = RADEON_HPD_2; /* ??? */
1771 radeon_add_legacy_encoder(dev, 1788 radeon_add_legacy_encoder(dev,
1772 radeon_get_encoder_id(dev, 1789 radeon_get_encoder_id(dev,
@@ -1803,7 +1820,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1803 DRM_INFO("Connector Table: %d (mini internal tmds)\n", 1820 DRM_INFO("Connector Table: %d (mini internal tmds)\n",
1804 rdev->mode_info.connector_table); 1821 rdev->mode_info.connector_table);
1805 /* DVI-I - tv dac, int tmds */ 1822 /* DVI-I - tv dac, int tmds */
1806 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); 1823 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0);
1807 hpd.hpd = RADEON_HPD_1; /* ??? */ 1824 hpd.hpd = RADEON_HPD_1; /* ??? */
1808 radeon_add_legacy_encoder(dev, 1825 radeon_add_legacy_encoder(dev,
1809 radeon_get_encoder_id(dev, 1826 radeon_get_encoder_id(dev,
@@ -1839,7 +1856,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1839 DRM_INFO("Connector Table: %d (imac g5 isight)\n", 1856 DRM_INFO("Connector Table: %d (imac g5 isight)\n",
1840 rdev->mode_info.connector_table); 1857 rdev->mode_info.connector_table);
1841 /* DVI-D - int tmds */ 1858 /* DVI-D - int tmds */
1842 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_MONID); 1859 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0);
1843 hpd.hpd = RADEON_HPD_1; /* ??? */ 1860 hpd.hpd = RADEON_HPD_1; /* ??? */
1844 radeon_add_legacy_encoder(dev, 1861 radeon_add_legacy_encoder(dev,
1845 radeon_get_encoder_id(dev, 1862 radeon_get_encoder_id(dev,
@@ -1851,7 +1868,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1851 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D, 1868 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D,
1852 &hpd); 1869 &hpd);
1853 /* VGA - tv dac */ 1870 /* VGA - tv dac */
1854 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); 1871 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
1855 hpd.hpd = RADEON_HPD_NONE; 1872 hpd.hpd = RADEON_HPD_NONE;
1856 radeon_add_legacy_encoder(dev, 1873 radeon_add_legacy_encoder(dev,
1857 radeon_get_encoder_id(dev, 1874 radeon_get_encoder_id(dev,
@@ -1880,7 +1897,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1880 DRM_INFO("Connector Table: %d (emac)\n", 1897 DRM_INFO("Connector Table: %d (emac)\n",
1881 rdev->mode_info.connector_table); 1898 rdev->mode_info.connector_table);
1882 /* VGA - primary dac */ 1899 /* VGA - primary dac */
1883 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 1900 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
1884 hpd.hpd = RADEON_HPD_NONE; 1901 hpd.hpd = RADEON_HPD_NONE;
1885 radeon_add_legacy_encoder(dev, 1902 radeon_add_legacy_encoder(dev,
1886 radeon_get_encoder_id(dev, 1903 radeon_get_encoder_id(dev,
@@ -1892,7 +1909,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1892 CONNECTOR_OBJECT_ID_VGA, 1909 CONNECTOR_OBJECT_ID_VGA,
1893 &hpd); 1910 &hpd);
1894 /* VGA - tv dac */ 1911 /* VGA - tv dac */
1895 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); 1912 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0);
1896 hpd.hpd = RADEON_HPD_NONE; 1913 hpd.hpd = RADEON_HPD_NONE;
1897 radeon_add_legacy_encoder(dev, 1914 radeon_add_legacy_encoder(dev,
1898 radeon_get_encoder_id(dev, 1915 radeon_get_encoder_id(dev,
@@ -1921,7 +1938,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1921 DRM_INFO("Connector Table: %d (rn50-power)\n", 1938 DRM_INFO("Connector Table: %d (rn50-power)\n",
1922 rdev->mode_info.connector_table); 1939 rdev->mode_info.connector_table);
1923 /* VGA - primary dac */ 1940 /* VGA - primary dac */
1924 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 1941 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
1925 hpd.hpd = RADEON_HPD_NONE; 1942 hpd.hpd = RADEON_HPD_NONE;
1926 radeon_add_legacy_encoder(dev, 1943 radeon_add_legacy_encoder(dev,
1927 radeon_get_encoder_id(dev, 1944 radeon_get_encoder_id(dev,
@@ -1932,7 +1949,7 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1932 DRM_MODE_CONNECTOR_VGA, &ddc_i2c, 1949 DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
1933 CONNECTOR_OBJECT_ID_VGA, 1950 CONNECTOR_OBJECT_ID_VGA,
1934 &hpd); 1951 &hpd);
1935 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC); 1952 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_CRT2, 0, 0);
1936 hpd.hpd = RADEON_HPD_NONE; 1953 hpd.hpd = RADEON_HPD_NONE;
1937 radeon_add_legacy_encoder(dev, 1954 radeon_add_legacy_encoder(dev,
1938 radeon_get_encoder_id(dev, 1955 radeon_get_encoder_id(dev,
@@ -1962,33 +1979,6 @@ static bool radeon_apply_legacy_quirks(struct drm_device *dev,
1962 struct radeon_i2c_bus_rec *ddc_i2c, 1979 struct radeon_i2c_bus_rec *ddc_i2c,
1963 struct radeon_hpd *hpd) 1980 struct radeon_hpd *hpd)
1964{ 1981{
1965 struct radeon_device *rdev = dev->dev_private;
1966
1967 /* XPRESS DDC quirks */
1968 if ((rdev->family == CHIP_RS400 ||
1969 rdev->family == CHIP_RS480) &&
1970 ddc_i2c->mask_clk_reg == RADEON_GPIO_CRT2_DDC)
1971 *ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_MONID);
1972 else if ((rdev->family == CHIP_RS400 ||
1973 rdev->family == CHIP_RS480) &&
1974 ddc_i2c->mask_clk_reg == RADEON_GPIO_MONID) {
1975 *ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIOPAD_MASK);
1976 ddc_i2c->mask_clk_mask = (0x20 << 8);
1977 ddc_i2c->mask_data_mask = 0x80;
1978 ddc_i2c->a_clk_mask = (0x20 << 8);
1979 ddc_i2c->a_data_mask = 0x80;
1980 ddc_i2c->en_clk_mask = (0x20 << 8);
1981 ddc_i2c->en_data_mask = 0x80;
1982 ddc_i2c->y_clk_mask = (0x20 << 8);
1983 ddc_i2c->y_data_mask = 0x80;
1984 ddc_i2c->i2c_id = RADEON_I2C_GPIO_ID;
1985 radeon_i2c_add(rdev, ddc_i2c, "GPIO_DDC");
1986 }
1987
1988 /* R3xx+ chips don't have GPIO_CRT2_DDC gpio pad */
1989 if ((rdev->family >= CHIP_R300) &&
1990 ddc_i2c->mask_clk_reg == RADEON_GPIO_CRT2_DDC)
1991 *ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC);
1992 1982
1993 /* Certain IBM chipset RN50s have a BIOS reporting two VGAs, 1983 /* Certain IBM chipset RN50s have a BIOS reporting two VGAs,
1994 one with VGA DDC and one with CRT2 DDC. - kill the CRT2 DDC one */ 1984 one with VGA DDC and one with CRT2 DDC. - kill the CRT2 DDC one */
@@ -2092,27 +2082,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
2092 connector = (tmp >> 12) & 0xf; 2082 connector = (tmp >> 12) & 0xf;
2093 2083
2094 ddc_type = (tmp >> 8) & 0xf; 2084 ddc_type = (tmp >> 8) & 0xf;
2095 switch (ddc_type) { 2085 ddc_i2c = combios_setup_i2c_bus(rdev, ddc_type, 0, 0);
2096 case DDC_MONID:
2097 ddc_i2c =
2098 combios_setup_i2c_bus(rdev, RADEON_GPIO_MONID);
2099 break;
2100 case DDC_DVI:
2101 ddc_i2c =
2102 combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC);
2103 break;
2104 case DDC_VGA:
2105 ddc_i2c =
2106 combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC);
2107 break;
2108 case DDC_CRT2:
2109 ddc_i2c =
2110 combios_setup_i2c_bus(rdev, RADEON_GPIO_CRT2_DDC);
2111 break;
2112 default:
2113 ddc_i2c.valid = false;
2114 break;
2115 }
2116 2086
2117 switch (connector) { 2087 switch (connector) {
2118 case CONNECTOR_PROPRIETARY_LEGACY: 2088 case CONNECTOR_PROPRIETARY_LEGACY:
@@ -2282,7 +2252,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
2282 0), 2252 0),
2283 ATOM_DEVICE_DFP1_SUPPORT); 2253 ATOM_DEVICE_DFP1_SUPPORT);
2284 2254
2285 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_DVI_DDC); 2255 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_DVI, 0, 0);
2286 hpd.hpd = RADEON_HPD_1; 2256 hpd.hpd = RADEON_HPD_1;
2287 radeon_add_legacy_connector(dev, 2257 radeon_add_legacy_connector(dev,
2288 0, 2258 0,
@@ -2302,7 +2272,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
2302 ATOM_DEVICE_CRT1_SUPPORT, 2272 ATOM_DEVICE_CRT1_SUPPORT,
2303 1), 2273 1),
2304 ATOM_DEVICE_CRT1_SUPPORT); 2274 ATOM_DEVICE_CRT1_SUPPORT);
2305 ddc_i2c = combios_setup_i2c_bus(rdev, RADEON_GPIO_VGA_DDC); 2275 ddc_i2c = combios_setup_i2c_bus(rdev, DDC_VGA, 0, 0);
2306 hpd.hpd = RADEON_HPD_NONE; 2276 hpd.hpd = RADEON_HPD_NONE;
2307 radeon_add_legacy_connector(dev, 2277 radeon_add_legacy_connector(dev,
2308 0, 2278 0,
@@ -2335,74 +2305,25 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
2335 if (lcd_ddc_info) { 2305 if (lcd_ddc_info) {
2336 ddc_type = RBIOS8(lcd_ddc_info + 2); 2306 ddc_type = RBIOS8(lcd_ddc_info + 2);
2337 switch (ddc_type) { 2307 switch (ddc_type) {
2338 case DDC_MONID:
2339 ddc_i2c =
2340 combios_setup_i2c_bus
2341 (rdev, RADEON_GPIO_MONID);
2342 break;
2343 case DDC_DVI:
2344 ddc_i2c =
2345 combios_setup_i2c_bus
2346 (rdev, RADEON_GPIO_DVI_DDC);
2347 break;
2348 case DDC_VGA:
2349 ddc_i2c =
2350 combios_setup_i2c_bus
2351 (rdev, RADEON_GPIO_VGA_DDC);
2352 break;
2353 case DDC_CRT2:
2354 ddc_i2c =
2355 combios_setup_i2c_bus
2356 (rdev, RADEON_GPIO_CRT2_DDC);
2357 break;
2358 case DDC_LCD: 2308 case DDC_LCD:
2359 ddc_i2c = 2309 ddc_i2c =
2360 combios_setup_i2c_bus 2310 combios_setup_i2c_bus(rdev,
2361 (rdev, RADEON_GPIOPAD_MASK); 2311 DDC_LCD,
2362 ddc_i2c.mask_clk_mask = 2312 RBIOS32(lcd_ddc_info + 3),
2363 RBIOS32(lcd_ddc_info + 3); 2313 RBIOS32(lcd_ddc_info + 7));
2364 ddc_i2c.mask_data_mask =
2365 RBIOS32(lcd_ddc_info + 7);
2366 ddc_i2c.a_clk_mask =
2367 RBIOS32(lcd_ddc_info + 3);
2368 ddc_i2c.a_data_mask =
2369 RBIOS32(lcd_ddc_info + 7);
2370 ddc_i2c.en_clk_mask =
2371 RBIOS32(lcd_ddc_info + 3);
2372 ddc_i2c.en_data_mask =
2373 RBIOS32(lcd_ddc_info + 7);
2374 ddc_i2c.y_clk_mask =
2375 RBIOS32(lcd_ddc_info + 3);
2376 ddc_i2c.y_data_mask =
2377 RBIOS32(lcd_ddc_info + 7);
2378 ddc_i2c.i2c_id = RADEON_I2C_LCD_ID;
2379 radeon_i2c_add(rdev, &ddc_i2c, "LCD"); 2314 radeon_i2c_add(rdev, &ddc_i2c, "LCD");
2380 break; 2315 break;
2381 case DDC_GPIO: 2316 case DDC_GPIO:
2382 ddc_i2c = 2317 ddc_i2c =
2383 combios_setup_i2c_bus 2318 combios_setup_i2c_bus(rdev,
2384 (rdev, RADEON_MDGPIO_MASK); 2319 DDC_GPIO,
2385 ddc_i2c.mask_clk_mask = 2320 RBIOS32(lcd_ddc_info + 3),
2386 RBIOS32(lcd_ddc_info + 3); 2321 RBIOS32(lcd_ddc_info + 7));
2387 ddc_i2c.mask_data_mask =
2388 RBIOS32(lcd_ddc_info + 7);
2389 ddc_i2c.a_clk_mask =
2390 RBIOS32(lcd_ddc_info + 3);
2391 ddc_i2c.a_data_mask =
2392 RBIOS32(lcd_ddc_info + 7);
2393 ddc_i2c.en_clk_mask =
2394 RBIOS32(lcd_ddc_info + 3);
2395 ddc_i2c.en_data_mask =
2396 RBIOS32(lcd_ddc_info + 7);
2397 ddc_i2c.y_clk_mask =
2398 RBIOS32(lcd_ddc_info + 3);
2399 ddc_i2c.y_data_mask =
2400 RBIOS32(lcd_ddc_info + 7);
2401 ddc_i2c.i2c_id = RADEON_I2C_LCD_ID;
2402 radeon_i2c_add(rdev, &ddc_i2c, "LCD"); 2322 radeon_i2c_add(rdev, &ddc_i2c, "LCD");
2403 break; 2323 break;
2404 default: 2324 default:
2405 ddc_i2c.valid = false; 2325 ddc_i2c =
2326 combios_setup_i2c_bus(rdev, ddc_type, 0, 0);
2406 break; 2327 break;
2407 } 2328 }
2408 DRM_DEBUG_KMS("LCD DDC Info Table found!\n"); 2329 DRM_DEBUG_KMS("LCD DDC Info Table found!\n");