forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
....@@ -22,7 +22,7 @@
2222 * Authors: Alex Deucher
2323 *
2424 */
25
-#include <drm/drmP.h>
25
+
2626 #include <drm/amdgpu_drm.h>
2727 #include "amdgpu.h"
2828 #include "atom.h"
....@@ -40,7 +40,7 @@
4040 u8 *buf, u8 num)
4141 {
4242 struct drm_device *dev = chan->dev;
43
- struct amdgpu_device *adev = dev->dev_private;
43
+ struct amdgpu_device *adev = drm_to_adev(dev);
4444 PROCESS_I2C_CHANNEL_TRANSACTION_PS_ALLOCATION args;
4545 int index = GetIndexIntoMasterTable(COMMAND, ProcessI2cChannelTransaction);
4646 unsigned char *base;
....@@ -76,11 +76,6 @@
7676 }
7777 args.lpI2CDataOut = cpu_to_le16(out);
7878 } else {
79
- if (num > ATOM_MAX_HW_I2C_READ) {
80
- DRM_ERROR("hw i2c: tried to read too many bytes (%d vs 255)\n", num);
81
- r = -EINVAL;
82
- goto done;
83
- }
8479 args.ucRegIndex = 0;
8580 args.lpI2CDataOut = 0;
8681 }