drm/radeon/kms/evergreen: work around bad data in some i2c tables
Subsystems (2)
PATCH 1/1 drm/radeon/kms/evergreen: work around bad data in some i2c tables
The 7th entry in a lot of evergreen i2c gpio tables is partially zeroed. Fix the entry.
Should fix the missing ddc entry in:
https://bugs.freedesktop.org/show_bug.cgi?id=29255
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/radeon/radeon_atombios.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/radeon_atombios.c +27 -0
@@ -85,6 +85,19 @@ static inline struct radeon_i2c_bus_rec radeon_lookup_i2c_gpio(struct radeon_devfor (i =0 ; i < num_indices; i++) { gpio = &i2c_info->asGPIO_Info[i]; +/* some evergreen boards have bad data for this entry */ +if (ASIC_IS_DCE4 (rdev)) { +if ((i ==7 ) && + (gpio->usClkMaskRegisterIndex ==0x1936 ) && + (gpio->sucI2cId.ucAccess ==0 )) { + gpio->sucI2cId.ucAccess =0x97 ; + gpio->ucDataMaskShift =8 ; + gpio->ucDataEnShift =8 ; + gpio->ucDataY_Shift =8 ; + gpio->ucDataA_Shift =8 ; + } + } +if (gpio->sucI2cId.ucAccess == id) { i2c.mask_clk_reg =le16_to_cpu (gpio->usClkMaskRegisterIndex) *4 ; i2c.mask_data_reg =le16_to_cpu (gpio->usDataMaskRegisterIndex) *4 ;
@@ -147,6 +160,20 @@ void radeon_atombios_i2c_init(struct radeon_device *rdev)for (i =0 ; i < num_indices; i++) { gpio = &i2c_info->asGPIO_Info[i]; i2c.valid = false; + +/* some evergreen boards have bad data for this entry */ +if (ASIC_IS_DCE4 (rdev)) { +if ((i ==7 ) && + (gpio->usClkMaskRegisterIndex ==0x1936 ) && + (gpio->sucI2cId.ucAccess ==0 )) { + gpio->sucI2cId.ucAccess =0x97 ; + gpio->ucDataMaskShift =8 ; + gpio->ucDataEnShift =8 ; + gpio->ucDataY_Shift =8 ; + gpio->ucDataA_Shift =8 ; + } + } + i2c.mask_clk_reg =le16_to_cpu (gpio->usClkMaskRegisterIndex) *4 ; i2c.mask_data_reg =le16_to_cpu (gpio->usDataMaskRegisterIndex) *4 ; i2c.en_clk_reg =le16_to_cpu (gpio->usClkEnRegisterIndex) *4 ;
Signature · 1 line
1.7.1.1