linux i2c 模块不完整 xfer (0x48) 错误

标签 linux linux-kernel embedded i2c

我正在使用连接到 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-tools 包中的i2cdetecti2cget,众所周知,它们可以正确地做事。如果它也失败了,设备就会出现异常。尝试在 LKML 中询问这个问题,如果合法的话,您可能会发送一个补丁。

顺便说一句,你确定你需要一个combined transfer吗? ?也许单独的读取和写入可以做到这一点?

xfer 是一个 SMBus-related term .

关于linux i2c 模块不完整 xfer (0x48) 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18896493/

相关文章:

linux - 我在哪里可以找到足够好的默认配置来编译 Linux 内核?

c - 字体压缩! RLE 或霍夫曼或什么都没有?

debugging - 避免消息队列溢出

linux - 伏创 : Mongodb installation- error in ppa chris-lea/zeromq/ubuntu xenial

linux - sed 用引号替换字符串

c - X86 PC 上的 RTLinux

android - 自定义Android内核显示黑屏

xml - 带有集成 XML 解析器的嵌入式 Web 服务器

c - 关于Linux C-UUID

c - 进程地址空间中 .so 和 a.out 文件的多个副本