[i2c] Question about vt82c596 SMBus driver (Via I2c Bus driver)

Jean Delvare khali at linux-fr.org
Thu Oct 2 16:53:44 CEST 2008

Hi Prakash,

On Thu, 2 Oct 2008 09:52:42 -0400, Mortha, Prakash wrote:
> In the patch I sent to you, I used the approach where I need to send
> MSByte first and then LSByte for I2C_SMBUS_PROC_CALL case.
> If we need to keep this in accordance with other cases, We need to
> interchange the below lines: ( in i2c-viapro.patch)
> 		outb_p((data->word & 0xff00) >> 8, SMBHSTDAT0);
> 		outb_p(data->word & 0xff, SMBHSTDAT1);

The SMBus specification says that LSB always goes first when sending or
receiving a 16-byte word. i2c-core and individual i2c bus drivers must
follow this specification, even though most I2C slave devices actually
transmit the MSB first. It is the responsibility of the I2C chip driver
(or user-space in the case of i2c-dev) to swap the bytes if needed. See
for example the lm75 driver.

Jean Delvare

More information about the i2c mailing list