summaryrefslogtreecommitdiff
path: root/src/radeon_bios.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2008-08-08 17:39:48 -0400
committerAlex Deucher <alexdeucher@gmail.com>2008-08-08 17:39:48 -0400
commit4dbdeea7c9316575fba26b41fd347452e42cdcf2 (patch)
treece773e84d6c353f0af7f29edfb00f961f8aab868 /src/radeon_bios.c
parent268c848130ec1770bb645a74197b6aca7fc95abc (diff)
Further cleanup and unification of i2c code
- unify the ddc and i2c code - add gpio mask support for legacy chips - remove the magic gpio dance for ancient monitors (if you have an ancient monitor that ddc stops working on let me know). This should speed up DDC on legacy chips. -- radeon sw gpio i2c -- 4 sets of gpio registers for clk and data and corresponding bit masks mask - locks the gpio for use by sw get - reads the value off the gpio pad put - sets the gpio direction to output a - "other stuff" On legacy chips you clear them if you want to use a gpio for i2c. In some cases they are used for the output value when the gpio in the output state.
Diffstat (limited to 'src/radeon_bios.c')
-rw-r--r--src/radeon_bios.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index a4b9ed68..b34a4217 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -433,7 +433,7 @@ static Bool RADEONGetATOMConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
RADEONInfoPtr info = RADEONPTR (pScrn);
if (!info->VBIOS) return FALSE;
-
+
if (RADEONGetATOMConnectorInfoFromBIOSObject(pScrn))
return TRUE;
@@ -468,14 +468,18 @@ static void RADEONApplyLegacyQuirks(ScrnInfoPtr pScrn, int index)
info->BiosConnector[index].ddc_i2c.valid = TRUE;
info->BiosConnector[index].ddc_i2c.mask_clk_mask = (0x20 << 8);
info->BiosConnector[index].ddc_i2c.mask_data_mask = 0x80;
+ info->BiosConnector[index].ddc_i2c.a_clk_mask = (0x20 << 8);
+ info->BiosConnector[index].ddc_i2c.a_data_mask = 0x80;
info->BiosConnector[index].ddc_i2c.put_clk_mask = (0x20 << 8);
info->BiosConnector[index].ddc_i2c.put_data_mask = 0x80;
info->BiosConnector[index].ddc_i2c.get_clk_mask = (0x20 << 8);
info->BiosConnector[index].ddc_i2c.get_data_mask = 0x80;
info->BiosConnector[index].ddc_i2c.mask_clk_reg = RADEON_GPIOPAD_MASK;
info->BiosConnector[index].ddc_i2c.mask_data_reg = RADEON_GPIOPAD_MASK;
- info->BiosConnector[index].ddc_i2c.put_clk_reg = RADEON_GPIOPAD_A;
- info->BiosConnector[index].ddc_i2c.put_data_reg = RADEON_GPIOPAD_A;
+ info->BiosConnector[index].ddc_i2c.a_clk_reg = RADEON_GPIOPAD_A;
+ info->BiosConnector[index].ddc_i2c.a_data_reg = RADEON_GPIOPAD_A;
+ info->BiosConnector[index].ddc_i2c.put_clk_reg = RADEON_GPIOPAD_EN;
+ info->BiosConnector[index].ddc_i2c.put_data_reg = RADEON_GPIOPAD_EN;
info->BiosConnector[index].ddc_i2c.get_clk_reg = RADEON_LCD_GPIO_Y_REG;
info->BiosConnector[index].ddc_i2c.get_data_reg = RADEON_LCD_GPIO_Y_REG;
}
@@ -645,10 +649,10 @@ static Bool RADEONGetLegacyConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
break;
case DDC_LCD:
info->BiosConnector[4].ddc_i2c = legacy_setup_i2c_bus(RADEON_LCD_GPIO_MASK);
- info->BiosConnector[4].ddc_i2c.mask_clk_mask =
- RADEON_BIOS32(tmp0 + 0x03) | RADEON_BIOS32(tmp0 + 0x07);
- info->BiosConnector[4].ddc_i2c.mask_data_mask =
- RADEON_BIOS32(tmp0 + 0x03) | RADEON_BIOS32(tmp0 + 0x07);
+ info->BiosConnector[4].ddc_i2c.mask_clk_mask = RADEON_BIOS32(tmp0 + 0x03);
+ info->BiosConnector[4].ddc_i2c.mask_data_mask = RADEON_BIOS32(tmp0 + 0x07);
+ info->BiosConnector[4].ddc_i2c.a_clk_mask = RADEON_BIOS32(tmp0 + 0x03);
+ info->BiosConnector[4].ddc_i2c.a_data_mask = RADEON_BIOS32(tmp0 + 0x07);
info->BiosConnector[4].ddc_i2c.put_clk_mask = RADEON_BIOS32(tmp0 + 0x03);
info->BiosConnector[4].ddc_i2c.put_data_mask = RADEON_BIOS32(tmp0 + 0x07);
info->BiosConnector[4].ddc_i2c.get_clk_mask = RADEON_BIOS32(tmp0 + 0x03);
@@ -656,10 +660,10 @@ static Bool RADEONGetLegacyConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
break;
case DDC_GPIO:
info->BiosConnector[4].ddc_i2c = legacy_setup_i2c_bus(RADEON_MDGPIO_EN_REG);
- info->BiosConnector[4].ddc_i2c.mask_clk_mask =
- RADEON_BIOS32(tmp0 + 0x03) | RADEON_BIOS32(tmp0 + 0x07);
- info->BiosConnector[4].ddc_i2c.mask_data_mask =
- RADEON_BIOS32(tmp0 + 0x03) | RADEON_BIOS32(tmp0 + 0x07);
+ info->BiosConnector[4].ddc_i2c.mask_clk_mask = RADEON_BIOS32(tmp0 + 0x03);
+ info->BiosConnector[4].ddc_i2c.mask_data_mask = RADEON_BIOS32(tmp0 + 0x07);
+ info->BiosConnector[4].ddc_i2c.a_clk_mask = RADEON_BIOS32(tmp0 + 0x03);
+ info->BiosConnector[4].ddc_i2c.a_data_mask = RADEON_BIOS32(tmp0 + 0x07);
info->BiosConnector[4].ddc_i2c.put_clk_mask = RADEON_BIOS32(tmp0 + 0x03);
info->BiosConnector[4].ddc_i2c.put_data_mask = RADEON_BIOS32(tmp0 + 0x07);
info->BiosConnector[4].ddc_i2c.get_clk_mask = RADEON_BIOS32(tmp0 + 0x03);
@@ -1194,12 +1198,16 @@ RADEONLookupI2CBlock(ScrnInfoPtr pScrn, int id)
i2c.mask_clk_mask = (1 << clock_shift);
i2c.mask_data_mask = (1 << data_shift);
+ i2c.a_clk_mask = (1 << clock_shift);
+ i2c.a_data_mask = (1 << data_shift);
i2c.put_clk_mask = (1 << clock_shift);
i2c.put_data_mask = (1 << data_shift);
i2c.get_clk_mask = (1 << clock_shift);
i2c.get_data_mask = (1 << data_shift);
i2c.mask_clk_reg = reg;
i2c.mask_data_reg = reg;
+ i2c.a_clk_reg = reg;
+ i2c.a_data_reg = reg;
i2c.put_clk_reg = reg;
i2c.put_data_reg = reg;
i2c.get_clk_reg = reg;