Skip to content

Commit cbd0028

Browse files
alexdeuchergregkh
authored andcommitted
drm/radeon/kms: fix up gpio i2c mask bits for r4xx
commit 6c47e5c upstream. Fixes i2c test failures when i2c_algo_bit.bit_test=1. The hw doesn't actually require a mask, so just set it to the default mask bits for r1xx-r4xx radeon ddc. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 1485507 commit cbd0028

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎drivers/gpu/drm/radeon/radeon_atombios.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ static inline struct radeon_i2c_bus_rec radeon_lookup_i2c_gpio(struct radeon_dev
8585
for (i = 0; i < num_indices; i++) {
8686
gpio = &i2c_info->asGPIO_Info[i];
8787

88+
/* r4xx mask is technically not used by the hw, so patch in the legacy mask bits */
89+
if ((rdev->family == CHIP_R420) ||
90+
(rdev->family == CHIP_R423) ||
91+
(rdev->family == CHIP_RV410)) {
92+
if ((le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x0018) ||
93+
(le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x0019) ||
94+
(le16_to_cpu(gpio->usClkMaskRegisterIndex) == 0x001a)) {
95+
gpio->ucClkMaskShift = 0x19;
96+
gpio->ucDataMaskShift = 0x18;
97+
}
98+
}
99+
88100
/* some evergreen boards have bad data for this entry */
89101
if (ASIC_IS_DCE4(rdev)) {
90102
if ((i == 7) &&

0 commit comments

Comments
 (0)