i2c input设备读写出错

Creator_莫言 Creator_莫言 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我添加了一个i2c的键盘,probe函数调用后,里面读写i2c就会出错:

	
static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {
{
I2C_BOARD_INFO("rtc-pcf8563", 0x51),
.type = "pcf8563",
},
{
I2C_BOARD_INFO("tca8424_keypad", 0x3b),
.type = "tca8424_keypad" ,
.irq = MX53_TCA6416_IRQ,
.platform_data = &tca8424_date,
}
};

i2c_register_board_info(2, mxc_i2c2_board_info,
ARRAY_SIZE(mxc_i2c2_board_info));

tca8424_keypad_probe()
{
....
int reg, error;
error = tca8424_read_byte(keypad_data, REG_HID_DESCRIP_LEN_L, ®);
if(error < 0)
printk("reg = 0x%x\n",reg);
....
}

这里读寄存器一直失败,
[ 53.020690] tca8424_keypad 2-003b: tca8424_read_byte failed, reg: 1, error: -110
[ 53.030669] tca8424_keypad: probe of 2-003b failed with error -110
请问添加一个i2c设备,从设备地址设置正确后,还需要其他设置吗?从设备地址正确了不就可以读写从设备了吗?那为什么还会读写出错呢。刚接触i2c,望大神不吝赐教!
...全文
评论 5
收藏 已收藏
分享
返回顶部