初级会员
- 积分
- 91
- 金钱
- 91
- 注册时间
- 2019-10-29
- 在线时间
- 31 小时
|
1金钱
spi_driver_register 返回0(注册成功)但是 probe 却无法跑起来
设备树
&spi0 {
tft4{
status = "disabled";
compatible = "z7linterttf";
spi-max-frequency = <20000000>;
};
};
int z7_probe(struct spi_device *spi)
{
debug("z7_probe\r\n");
return 0;
}
int z7_remove(struct spi_device *spi)
{
debug("z7_remove\r\n");
return 0;
}
static const struct spi_device_id z7_id_table[] = {
{"mt32323", 0},
{ }
};
static const struct of_device_id z7_of_table[] = {
{.compatible = "z7linter,spidev2"},
{ /* Sentinel */ }
};
static struct spi_driver myspi_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "myspi",
.of_match_table = z7_of_table,
},
.probe = z7_probe,
.remove = z7_remove,
.id_table = z7_id_table,
};
static int __init myspi_init(void)
{
int ret;
ret = spi_register_driver(&myspi_driver);
debug("myspi_init %d\r\n",ret);
return 0;
}
static void __exit myspi_exit(void)
{
debug("myspi_exit\r\n");
}
module_init(myspi_init);
module_exit(myspi_exit);
spi_driver_register 返回0(注册成功)但是 probe 却无法跑起来 请问问题出现在哪里?
|
最佳答案
查看完整内容[请看2#楼]
问题已经解决设备树编写有问题正确情况如下:
&spi0 {
is_decoded-cd = ;
num_cs = ;
status = "okay";
tft_12@0{
spi-max-frequency = ;
reg = ;
compatible = "zynq,spitft";
};
};
|