Attempt to fix write

This commit is contained in:
Adam Honse
2022-09-29 19:30:42 -05:00
parent 55349eab1b
commit 6ea107f868

View File

@@ -170,6 +170,7 @@ s32 i2c_smbus_amdadl::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int s
break;
case I2C_SMBUS_BLOCK_DATA:
return -1;
data_size = data->block[0];
pI2C->pcData = (char*)&data->block[1];
break;
@@ -196,7 +197,12 @@ s32 i2c_smbus_amdadl::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int s
else
{
pI2C->iAction = ADL_DL_I2C_ACTIONWRITE;
pI2C->iDataSize = data_size;
pI2C->iDataSize = data_size + 1;
pI2C->pcData = i2c_buf;
i2c_buf[0] = command;
memcpy(&i2c_buf[1], data, data_size);
ret = ADL2_Display_WriteAndReadI2C(context, PrimaryDisplay, pI2C);
}