diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-12-21 21:18:35 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-22 15:38:57 +1000 |
commit | cdadd2753aa792649ac6853e3ca5771ed5a02158 (patch) | |
tree | 73aa8ec4d7180504d989fd952dc4601fc37ac74e | |
parent | 6161649bc23a45f43ba886464e54c8eeb573f9b5 (diff) |
fix i2c gpio lookup
-rw-r--r-- | atombios_tables.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/atombios_tables.c b/atombios_tables.c index 1169296..f291a02 100644 --- a/atombios_tables.c +++ b/atombios_tables.c @@ -183,18 +183,22 @@ char *router_object_names[] = { "NONE", void radeon_lookup_gpio(struct atom_context *ctx, uint8_t id) { - ATOM_GPIO_I2C_ASSIGMENT gpio; + ATOM_GPIO_I2C_ASSIGMENT *gpio; int index = GetIndexIntoMasterTable(DATA, GPIO_I2C_Info); struct _ATOM_GPIO_I2C_INFO *i2c_info; uint16_t data_offset; + int i; atom_parse_data_header(ctx, index, NULL, NULL, NULL, &data_offset); i2c_info = (struct _ATOM_GPIO_I2C_INFO *)(ctx->bios + data_offset); - gpio = i2c_info->asGPIO_Info[id]; + for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) { + gpio = &i2c_info->asGPIO_Info[i]; - printf(" GPIO %d: %04x\n", id, gpio.usClkMaskRegisterIndex *4); + if (gpio->sucI2cId.ucAccess == id) + printf(" GPIO 0x%02x: 0x%04x\n", id, gpio->usClkMaskRegisterIndex *4); + } } static void radeon_print_object(uint16_t obj) @@ -341,12 +345,14 @@ void radeon_dump_bios_object_table(struct atom_context *ctx) case ATOM_I2C_RECORD_TYPE: { ATOM_I2C_RECORD *i2c_record = (ATOM_I2C_RECORD *)record; + ATOM_I2C_ID_CONFIG_ACCESS *i2c_config = + (ATOM_I2C_ID_CONFIG_ACCESS *)&i2c_record->sucI2cId; printf(" ATOM_I2C_RECORD_TYPE\n"); printf(" i2c mux:%d engine:%d hw_cap:%d\n", i2c_record->sucI2cId.bfI2C_LineMux, i2c_record->sucI2cId.bfHW_EngineID, i2c_record->sucI2cId.bfHW_Capable); - radeon_lookup_gpio(ctx, i2c_record->sucI2cId.bfI2C_LineMux); + radeon_lookup_gpio(ctx, i2c_config->ucAccess); } break; case ATOM_HPD_INT_RECORD_TYPE: |