请教一下大家,为什么我的触摸驱动成功运行了初始化,却不运行probe,这是为什么?
附信息:
[ 2.165299] hub 2-0:1.0: 1 port detected
[ 2.172932] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[ 2.181757] hy46xx_ts_init xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[ 2.189186] Successfully added driver hy46xx_ts
代码:
static struct i2c_driver hy46xx_ts_driver = {
.driver = {
.name = HY46XX_NAME,
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(hy46xx_dt_match),
.pm = &hy46xx_ts_pm_ops,
},
.probe = hy46xx_ts_probe,
.remove = hy46xx_ts_remove,
.id_table = hy46xx_ts_id,
};
/************************************************************/
static int __init hy46xx_ts_init(void)
{
int ret;
printk("hy46xx_ts_init xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n");
ret = i2c_add_driver(&hy46xx_ts_driver);
if (ret) {
printk(KERN_WARNING "Adding hy46xx driver failed "
"(errno = %d)\n", ret);
} else {
pr_info("Successfully added driver %s\n",
hy46xx_ts_driver.driver.name);
}
return ret;
}
我在probe入口处加了打印,它根本不运行,然后我又在i2c-core-base.c
static int i2c_device_probe(struct device *dev)
{
struct i2c_client *client = i2c_verify_client(dev);
struct i2c_driver *driver;
int status;
printk("i2c driver name i2c_device_probe xxxxxxxxxxxxxxxxxxxxxxxxx\n");
if (!client)
return 0;
driver = to_i2c_driver(dev->driver);
printk("i2c driver name = %x xxxxxxxxxxxxxxxxxxxxxxxxx\n",driver->driver.name);
if (!client->irq && !driver->disable_i2c_core_irq_mapping) {
int irq = -ENOENT;
这个函数里也加了打印,它也不运行。我就不知道这是 为什么了。
哪位大神有空,帮我瞄一下喔。。。谢谢。
离线
问题已解决。。。原来 是匹配名字与设备树中的名字中,多出一个字符。。。。。因为多出这个字符,导致无法匹配,故找不到设备。从而导致无法运行probe,
离线