OSDN Git Service

drm/amd/display: refine i2c over aux
authorLewis Huang <Lewis.Huang@amd.com>
Wed, 7 Aug 2019 10:05:49 +0000 (18:05 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Sep 2019 22:54:46 +0000 (17:54 -0500)
commit4fd99f67f3c639b3c70365902fe2224cfb8d681f
treef34fba88fdc8649f17ecf7045d17376345756fef
parent8ac64f0af5ffc8ae8cf0c43415c147781733f30b
drm/amd/display: refine i2c over aux

[Why]
When user mode use i2c over aux through ADL or DDI, the function
dal_ddc_service_query_ddc_data will be called. There are two issues.

1. When read/write length > 16byte, current always return false because
the DEFAULT_AUX_MAX_DATA_SIZE != length.
2. When usermode only need to read data through i2c, driver will write
mot = true at the same address and cause i2c sink confused. Therefore
the following read command will get garbage.

[How]
1. Add function dal_dcc_submit_aux_command to handle length > 16 byte.
2. Check read size and write size when query ddc data.

Signed-off-by: Lewis Huang <Lewis.Huang@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h