summaryrefslogtreecommitdiff
path: root/src/radeon_atombios.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-02-01 10:07:43 -0500
committerAlex Deucher <alexdeucher@gmail.com>2010-02-01 12:07:26 -0500
commitbd8e04cb7b39f38b6958273582a9b324a9f0759a (patch)
treefa5fdead8a41fd4c5f80d5f74d811c140777c02b /src/radeon_atombios.c
parent8ad40d3c32ad5b91725bd37fcade6bed504df421 (diff)
evergreen: add atom support for digital outputs
analog is already supported by the existing code.
Diffstat (limited to 'src/radeon_atombios.c')
-rw-r--r--src/radeon_atombios.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index d6c58bc3..7bf98153 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1590,6 +1590,69 @@ rhdAtomParseI2CRecord(ScrnInfoPtr pScrn, atomBiosHandlePtr handle,
return RADEONLookupGPIOLineForDDC(pScrn, Record->sucI2cId.bfI2C_LineMux);
}
+static uint8_t
+radeon_lookup_hpd_id(ScrnInfoPtr pScrn, ATOM_HPD_INT_RECORD *record)
+{
+ RADEONInfoPtr info = RADEONPTR (pScrn);
+ unsigned short size;
+ uint8_t hpd = 0;
+ int i, num_indices;
+ struct _ATOM_GPIO_PIN_LUT *gpio_info;
+ ATOM_GPIO_PIN_ASSIGNMENT *pin;
+ atomDataTablesPtr atomDataPtr;
+ uint8_t crev, frev;
+ uint32_t reg;
+
+ atomDataPtr = info->atomBIOS->atomDataPtr;
+
+ if (!rhdAtomGetTableRevisionAndSize(
+ &(atomDataPtr->GPIO_Pin_LUT->sHeader),
+ &crev,&frev,&size)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No GPIO Pin Table found!\n");
+ return hpd;
+ }
+
+ num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) / sizeof(ATOM_GPIO_PIN_ASSIGNMENT);
+
+ if (IS_DCE4_VARIANT)
+ reg = EVERGREEN_DC_GPIO_HPD_A;
+ else
+ reg = AVIVO_DC_GPIO_HPD_A;
+
+ gpio_info = atomDataPtr->GPIO_Pin_LUT;
+ for (i = 0; i < num_indices; i++) {
+ pin = &gpio_info->asGPIO_Pin[i];
+ if (record->ucHPDIntGPIOID == pin->ucGPIO_ID) {
+ if ((pin->usGpioPin_AIndex * 4) == reg) {
+ switch (pin->ucGpioPinBitShift) {
+ case 0:
+ default:
+ hpd = 0;
+ break;
+ case 8:
+ hpd = 1;
+ break;
+ case 16:
+ hpd = 2;
+ break;
+ case 24:
+ hpd = 3;
+ break;
+ case 26:
+ hpd = 4;
+ break;
+ case 28:
+ hpd = 5;
+ break;
+ }
+ break;
+ }
+ }
+ }
+
+ return hpd;
+}
+
static void RADEONApplyATOMQuirks(ScrnInfoPtr pScrn, int index)
{
RADEONInfoPtr info = RADEONPTR (pScrn);
@@ -1935,6 +1998,9 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn)
(ATOM_I2C_RECORD *)Record, j);
break;
case ATOM_HPD_INT_RECORD_TYPE:
+ info->BiosConnector[i].hpd_id =
+ radeon_lookup_hpd_id(pScrn,
+ (ATOM_HPD_INT_RECORD *)Record);
break;
case ATOM_CONNECTOR_DEVICE_TAG_RECORD_TYPE:
break;