Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: add SW_USE_I2C_REG request.

[Description]
This is for DC_I2c arbitration use between HW use/SW use and DMCU use.

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Charlene Liu and committed by
Alex Deucher
f5ce9f3c 8dea4960

+8 -2
+5 -2
drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
··· 268 268 struct dce_i2c_hw *dce_i2c_hw) 269 269 { 270 270 uint32_t i2c_setup_limit = I2C_SETUP_TIME_LIMIT_DCE; 271 + /* we have checked I2c not used by DMCU, set SW use I2C REQ to 1 to indicate SW using it*/ 272 + REG_UPDATE(DC_I2C_ARBITRATION, DC_I2C_SW_USE_I2C_REG_REQ, 1); 271 273 272 274 if (dce_i2c_hw->setup_limit != 0) 273 275 i2c_setup_limit = dce_i2c_hw->setup_limit; ··· 324 322 325 323 set_speed(dce_i2c_hw, dce_i2c_hw->original_speed); 326 324 327 - /* Release I2C */ 328 - REG_UPDATE(DC_I2C_ARBITRATION, DC_I2C_SW_DONE_USING_I2C_REG, 1); 329 325 330 326 /* Reset HW engine */ 331 327 { ··· 343 343 /* HW I2c engine - clock gating feature */ 344 344 if (!dce_i2c_hw->engine_keep_power_up_count) 345 345 REG_UPDATE_N(SETUP, 1, FN(SETUP, DC_I2C_DDC1_ENABLE), 0); 346 + /* Release I2C after reset, so HW or DMCU could use it */ 347 + REG_UPDATE_2(DC_I2C_ARBITRATION, DC_I2C_SW_DONE_USING_I2C_REG, 1, 348 + DC_I2C_SW_USE_I2C_REG_REQ, 0); 346 349 347 350 } 348 351
+3
drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.h
··· 105 105 I2C_SF(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_DATA_DRIVE_SEL, mask_sh),\ 106 106 I2C_SF(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_INTRA_TRANSACTION_DELAY, mask_sh),\ 107 107 I2C_SF(DC_I2C_DDC1_SETUP, DC_I2C_DDC1_INTRA_BYTE_DELAY, mask_sh),\ 108 + I2C_SF(DC_I2C_ARBITRATION, DC_I2C_SW_USE_I2C_REG_REQ, mask_sh),\ 108 109 I2C_SF(DC_I2C_ARBITRATION, DC_I2C_SW_DONE_USING_I2C_REG, mask_sh),\ 109 110 I2C_SF(DC_I2C_ARBITRATION, DC_I2C_NO_QUEUED_SW_GO, mask_sh),\ 110 111 I2C_SF(DC_I2C_ARBITRATION, DC_I2C_SW_PRIORITY, mask_sh),\ ··· 147 146 uint8_t DC_I2C_DDC1_INTRA_TRANSACTION_DELAY; 148 147 uint8_t DC_I2C_DDC1_INTRA_BYTE_DELAY; 149 148 uint8_t DC_I2C_SW_DONE_USING_I2C_REG; 149 + uint8_t DC_I2C_SW_USE_I2C_REG_REQ; 150 150 uint8_t DC_I2C_NO_QUEUED_SW_GO; 151 151 uint8_t DC_I2C_SW_PRIORITY; 152 152 uint8_t DC_I2C_SOFT_RESET; ··· 186 184 uint32_t DC_I2C_DDC1_INTRA_TRANSACTION_DELAY; 187 185 uint32_t DC_I2C_DDC1_INTRA_BYTE_DELAY; 188 186 uint32_t DC_I2C_SW_DONE_USING_I2C_REG; 187 + uint32_t DC_I2C_SW_USE_I2C_REG_REQ; 189 188 uint32_t DC_I2C_NO_QUEUED_SW_GO; 190 189 uint32_t DC_I2C_SW_PRIORITY; 191 190 uint32_t DC_I2C_SOFT_RESET;