Bilal Tonga
Bilal Tonga

Reputation: 78

linux i2c module incomplete xfer (0x48) error

I am working i2c Device connected to A13 embedded linux.I tried to just get data from register but always get incomplete xfer (0x48) error.i found the error code in i2c-sunxi.c file.

case 0x48: /* SLA+R has been transmitted; NOT ACK has been received */
err_code = 0x48;//err,wakeup the thread

my i2c module function is;

unsigned char buf[1] = { 0 };

struct i2c_msg msgs[] = {
{ this_client->addr, 0, 1, buf },   /* setup read ptr */
{ this_client->addr, I2C_M_RD, 1, buf },    /* read status + date */
};

/* read registers */
if ((i2c_transfer(this_client->adapter, msgs, 2)) != 2) {
dev_err(&this_client->dev, "%s: read error\n", __func__);
return -EIO;
}

Upvotes: 2

Views: 2229

Answers (1)

Andrei Moiseev
Andrei Moiseev

Reputation: 4094

Try i2cdetect and i2cget from i2c-tools package, it is known to do things right. If it fails too, the device misbehaves. Try to ask this in LKML, you might event send a patch, if it's legal.

BTW, are you sure you need a combined transfer? Maybe separate read and write would do the thing?

And xfer is a SMBus-related term.

Upvotes: 1

Related Questions