summaryrefslogtreecommitdiff
path: root/src/radeon_atombios.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_atombios.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_atombios.c')
-rw-r--r--src/radeon_atombios.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index 8c6c22a9..f0a3a31b 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1415,12 +1415,16 @@ RADEONLookupGPIOLineForDDC(ScrnInfoPtr pScrn, uint8_t id)
i2c.put_data_reg = le16_to_cpu(gpio.usDataEnRegisterIndex) * 4;
i2c.get_clk_reg = le16_to_cpu(gpio.usClkY_RegisterIndex) * 4;
i2c.get_data_reg = le16_to_cpu(gpio.usDataY_RegisterIndex) * 4;
+ i2c.a_clk_reg = le16_to_cpu(gpio.usClkA_RegisterIndex) * 4;
+ i2c.a_data_reg = le16_to_cpu(gpio.usDataA_RegisterIndex) * 4;
i2c.mask_clk_mask = (1 << gpio.ucClkMaskShift);
i2c.mask_data_mask = (1 << gpio.ucDataMaskShift);
i2c.put_clk_mask = (1 << gpio.ucClkEnShift);
i2c.put_data_mask = (1 << gpio.ucDataEnShift);
i2c.get_clk_mask = (1 << gpio.ucClkY_Shift);
i2c.get_data_mask = (1 << gpio.ucDataY_Shift);
+ i2c.a_clk_mask = (1 << gpio.ucClkA_Shift);
+ i2c.a_data_mask = (1 << gpio.ucDataA_Shift);
i2c.valid = TRUE;
#if 0
@@ -1430,16 +1434,16 @@ RADEONLookupGPIOLineForDDC(ScrnInfoPtr pScrn, uint8_t id)
ErrorF("put_data_reg: 0x%x\n", gpio.usDataEnRegisterIndex * 4);
ErrorF("get_clk_reg: 0x%x\n", gpio.usClkY_RegisterIndex * 4);
ErrorF("get_data_reg: 0x%x\n", gpio.usDataY_RegisterIndex * 4);
- ErrorF("other_clk_reg: 0x%x\n", gpio.usClkA_RegisterIndex * 4);
- ErrorF("other_data_reg: 0x%x\n", gpio.usDataA_RegisterIndex * 4);
+ ErrorF("a_clk_reg: 0x%x\n", gpio.usClkA_RegisterIndex * 4);
+ ErrorF("a_data_reg: 0x%x\n", gpio.usDataA_RegisterIndex * 4);
ErrorF("mask_clk_mask: %d\n", gpio.ucClkMaskShift);
ErrorF("mask_data_mask: %d\n", gpio.ucDataMaskShift);
ErrorF("put_clk_mask: %d\n", gpio.ucClkEnShift);
ErrorF("put_data_mask: %d\n", gpio.ucDataEnShift);
ErrorF("get_clk_mask: %d\n", gpio.ucClkY_Shift);
ErrorF("get_data_mask: %d\n", gpio.ucDataY_Shift);
- ErrorF("other_clk_mask: %d\n", gpio.ucClkA_Shift);
- ErrorF("other_data_mask: %d\n", gpio.ucDataA_Shift);
+ ErrorF("a_clk_mask: %d\n", gpio.ucClkA_Shift);
+ ErrorF("a_data_mask: %d\n", gpio.ucDataA_Shift);
#endif
return i2c;
@@ -1461,7 +1465,7 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn)
atomDataTablesPtr atomDataPtr;
ATOM_CONNECTOR_OBJECT_TABLE *con_obj;
ATOM_INTEGRATED_SYSTEM_INFO_V2 *igp_obj = NULL;
- int i, j, ddc_line = 0;
+ int i, j;
atomDataPtr = info->atomBIOS->atomDataPtr;
if (!rhdAtomGetTableRevisionAndSize((ATOM_COMMON_TABLE_HEADER *)(atomDataPtr->Object_Header), &crev, &frev, &size))