summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
diff options
context:
space:
mode:
authorKen Wang <Qingqing.Wang@amd.com>2016-07-11 08:33:40 +0300
committerAlex Deucher <alexander.deucher@amd.com>2016-07-14 23:39:35 +0300
commiteeade25ad029cb1f31f27f8e0ddc9bb9c22b5537 (patch)
tree5227533a1921dea0e81a5459c3d423bab1c27883 /drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
parent795c2109c287123dfc3bc987d20daef32d77e4d1 (diff)
downloadlinux-eeade25ad029cb1f31f27f8e0ddc9bb9c22b5537.tar.xz
drm/amdgpu: fix power distribution issue for Polaris10 XT
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/atombios_i2c.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/atombios_i2c.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
index 13cdb01e9b45..bc56c8a181e6 100644
--- a/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
+++ b/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
@@ -156,3 +156,18 @@ u32 amdgpu_atombios_i2c_func(struct i2c_adapter *adap)
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
}
+void amdgpu_atombios_i2c_channel_trans(struct amdgpu_device* adev, u8 slave_addr, u8 line_number, u8 offset, u8 data)
+{
+ PROCESS_I2C_CHANNEL_TRANSACTION_PS_ALLOCATION args;
+ int index = GetIndexIntoMasterTable(COMMAND, ProcessI2cChannelTransaction);
+
+ args.ucRegIndex = offset;
+ args.lpI2CDataOut = data;
+ args.ucFlag = 1;
+ args.ucI2CSpeed = TARGET_HW_I2C_CLOCK;
+ args.ucTransBytes = 1;
+ args.ucSlaveAddr = slave_addr;
+ args.ucLineNumber = line_number;
+
+ amdgpu_atom_execute_table(adev->mode_info.atom_context, index, (uint32_t *)&args);
+}