]> git.hungrycats.org Git - linux/commit
drm/amd/display: Replace repeated no-native-i2c checks with force_i2c_over_aux field
authorWenjing Liu <wenjing.liu@amd.com>
Wed, 10 Jun 2026 02:21:16 +0000 (22:21 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2026 15:31:10 +0000 (11:31 -0400)
commit7a39b1c3b2e6b27f4230a20ccf9ac5a2737fa8b0
treee7cdbdb9262e7c3fad459f27adfa402ad524a448
parentd37d3555ddec6a8f9ec91a7c204e3358446dc86f
drm/amd/display: Replace repeated no-native-i2c checks with force_i2c_over_aux field

[Why]
The compound condition checking dp_connector_no_native_i2c
and no_ddc_pin was duplicated across many files, obscuring
intent at every call site.

[How]
Add bool force_i2c_over_aux to struct dc_link, initialized
once during link creation. Add link_get_ddc_aux_inst()
helper to select the correct aux instance. Wire into
link_service via construct_link_service_ddc(). Replace all
duplicated condition checks and aux instance selection
blocks with the new field and helper. No functional change.

Reviewed-by: Nevenko Stupar <nevenko.stupar@amd.com>
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com>
Signed-off-by: George Zhang <george.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 files changed:
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
drivers/gpu/drm/amd/display/dc/inc/link_service.h
drivers/gpu/drm/amd/display/dc/link/link_factory.c
drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.c
drivers/gpu/drm/amd/display/dc/link/protocols/link_ddc.h
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_panel_replay.c
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
drivers/gpu/drm/amd/display/modules/power/power.c
drivers/gpu/drm/amd/display/modules/power/power_abm.c