【问题标题】:linux i2c module incomplete xfer (0x48) errorlinux i2c 模块不完整 xfer (0x48) 错误
【发布时间】:2013-09-24 15:28:42
【问题描述】:

我正在使用连接到 A13 嵌入式 linux 的 i2c 设备。我试图从寄存器中获取数据,但总是得到不完整的 xfer (0x48) 错误。我在 i2c-sunxi.c 文件中找到了错误代码。

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

我的i2c模块功能是;

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;
}

【问题讨论】:

  • 你能看到 I2C 总线上的任何设备吗?总线上设备的 I2C 地址是什么?

标签: linux linux-kernel embedded i2c


【解决方案1】:

尝试i2c-tools 包中的i2cdetecti2cget,众所周知做事正确。如果它也失败了,则设备行为不端。尝试在 LKML 中询问此问题,如果合法,您可能会发送补丁。

顺便说一句,您确定需要combined transfer 吗?也许分开的读写会做这件事?

xferSMBus-related term

【讨论】:

  • 感谢您的回复。但我必须在内核模块中执行 i2c 进程。我为我的设备编写了一个驱动程序,但由于此错误我无法连接 i2c。我不确定是否使用 i2c_transfer()。但我也尝试了 i2c_master_send() 函数。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-04-10
  • 2014-06-30
  • 1970-01-01
  • 1970-01-01
  • 2012-11-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多