From a5f2df8b6390c16295baa9e207afa42791ffba35 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 16 Mar 2011 18:58:54 -0400 Subject: [PATCH 2/2] drm/radeon/kms: fix i2c line map on rn50 servers rn50/rv100 servers often use an alternate gpio i2c line map. While the connector table says CRT2_DDC, it really uses DVI_DDC. Signed-off-by: Alex Deucher Cc: stable@kernel.org --- drivers/gpu/drm/radeon/r100.c | 6 ++++++ drivers/gpu/drm/radeon/radeon.h | 1 + drivers/gpu/drm/radeon/radeon_combios.c | 10 +++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 56deae5..45852f8 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -3948,6 +3948,12 @@ int r100_init(struct radeon_device *rdev) return -EINVAL; /* Set asic errata */ r100_errata(rdev); + /* some rn50/rv100 server asics have a different gpio i2c map */ + /* TODO: which ones? */ + if (ASIC_IS_RN50(rdev)) + rdev->use_gpio_5_6_for_ddc = true; + else + rdev->use_gpio_5_6_for_ddc = false; /* Initialize clocks */ radeon_get_clock_info(rdev->ddev); /* initialize AGP */ diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 9ce54e3..5c6dfcb 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -1152,6 +1152,7 @@ struct radeon_device { /* BIOS */ uint8_t *bios; bool is_atom_bios; + bool use_gpio_5_6_for_ddc; uint16_t bios_header_start; struct radeon_bo *stollen_vga_memory; /* Register mmio */ diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index cf7c8d5..940a47a 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c @@ -530,9 +530,13 @@ static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rde ddc_line = RADEON_GPIO_MONID; break; case DDC_CRT2: - if (rdev->family == CHIP_RS300 || - rdev->family == CHIP_RS400 || - rdev->family == CHIP_RS480) + if (rdev->use_gpio_5_6_for_ddc) { + /* Some RN50 and RV100 server boards */ + ddc_line = RADEON_GPIO_DVI_DDC; + ddc = DDC_DVI; + } else if (rdev->family == CHIP_RS300 || + rdev->family == CHIP_RS400 || + rdev->family == CHIP_RS480) ddc_line = RADEON_GPIO_MONID; else if (rdev->family >= CHIP_R300) { ddc_line = RADEON_GPIO_DVI_DDC; -- 1.7.1.1