初级会员
- 积分
- 91
- 金钱
- 91
- 注册时间
- 2019-10-29
- 在线时间
- 31 小时
|
20金钱
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);
root@hdmi_gpio:/# find -name *spi*
./sys/devices/soc0/amba/e0006000.spi
./sys/devices/soc0/amba/e0006000.spi/spi_master
./sys/devices/soc0/amba/e0006000.spi/spi_master/spi0
./sys/devices/soc0/amba/e0006000.spi/spi_master/spi0/statistics/spi_sync
./sys/devices/soc0/amba/e0006000.spi/spi_master/spi0/statistics/spi_async
./sys/devices/soc0/amba/e0006000.spi/spi_master/spi0/statistics/spi_sync_immediate
./sys/class/spidev
./sys/class/spi_master
./sys/class/spi_master/spi0
./sys/firmware/devicetree/base/amba/spi@e000d000
./sys/firmware/devicetree/base/amba/spi@e0007000
./sys/firmware/devicetree/base/amba/spi@e0006000
./sys/firmware/devicetree/base/amba/spi@e0006000/tft4/spi-max-frequency
./sys/firmware/devicetree/base/aliases/spi0
./sys/bus/platform/devices/e0006000.spi
./sys/bus/platform/drivers/zynq-qspi
./sys/bus/platform/drivers/cdns-spi
./sys/bus/platform/drivers/cdns-spi/e0006000.spi
./sys/bus/platform/drivers/xilinx_spi
./sys/bus/spi
./sys/bus/spi/drivers/spidev
./sys/module/spidev
./usr/lib/qt5/qml/QtQuick/Controls/Styles/Base/images/spinner_small.png
./usr/lib/qt5/qml/QtQuick/Controls/Styles/Base/images/spinner_large.png
./usr/lib/qt5/qml/QtQuick/Controls/Styles/Base/images/spinner_medium.png
./usr/share/qt5/examples/widgets/widgets/stylesheet/images/spindown_hover.png
./usr/share/qt5/examples/widgets/widgets/stylesheet/images/spinup_hover.png
./usr/share/qt5/examples/widgets/widgets/stylesheet/images/spinup.png
./usr/share/qt5/examples/widgets/widgets/stylesheet/images/spinup_off.png
./usr/share/qt5/examples/widgets/widgets/stylesheet/images/spindown_off.png
./usr/share/qt5/examples/widgets/widgets/stylesheet/images/spindown_pressed.png
./usr/share/qt5/examples/widgets/widgets/stylesheet/images/spindown.png
./usr/share/qt5/examples/widgets/widgets/stylesheet/images/spinup_pressed.png
./usr/share/qt5/examples/widgets/widgets/icons/iconsizespinbox.cpp
./usr/share/qt5/examples/widgets/widgets/icons/iconsizespinbox.h
./usr/share/qt5/examples/widgets/widgets/spinboxes
./usr/share/qt5/examples/widgets/widgets/spinboxes/spinboxes.pro
./usr/share/qt5/examples/widgets/widgets/spinboxes/spinboxes
./usr/share/qt5/examples/widgets/itemviews/spinboxdelegate
./usr/share/qt5/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate
./usr/share/qt5/examples/widgets/itemviews/spinboxdelegate/spinboxdelegate.pro
./proc/irq/27/e0006000.spi
spi_driver_register 返回0(注册成功)但是 probe 却无法跑起来 请问问题出现在哪里?
|
最佳答案
查看完整内容[请看2#楼]
问题已经解决设备树编写有问题正确情况如下:
&spi0 {
is_decoded-cd = ;
num_cs = ;
status = "okay";
tft_12@0{
spi-max-frequency = ;
reg = ;
compatible = "zynq,spitft";
};
};
|