OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3688|回复: 3

[XILINX] spi_driver_register 返回0(注册成功)但是 probe 却无法跑起来

[复制链接]

8

主题

26

帖子

0

精华

初级会员

Rank: 2

积分
91
金钱
91
注册时间
2019-10-29
在线时间
31 小时
发表于 2022-8-15 17:07:18 | 显示全部楼层 |阅读模式
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"; }; };
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

8

主题

26

帖子

0

精华

初级会员

Rank: 2

积分
91
金钱
91
注册时间
2019-10-29
在线时间
31 小时
 楼主| 发表于 2022-8-15 17:07:19 | 显示全部楼层
问题已经解决设备树编写有问题正确情况如下:
&spi0 {
    is_decoded-cd = <0>;
    num_cs = <1>;
    status = "okay";

    tft_12@0{
        spi-max-frequency = <8000000>;
        reg = <0>;
        compatible = "zynq,spitft";

    };
};
回复

使用道具 举报

2

主题

45

帖子

0

精华

论坛元老

Rank: 8Rank: 8

积分
4168
金钱
4168
注册时间
2013-12-27
在线时间
448 小时
发表于 2022-8-18 09:45:59 | 显示全部楼层
status = "disabled";
回复

使用道具 举报

8

主题

26

帖子

0

精华

初级会员

Rank: 2

积分
91
金钱
91
注册时间
2019-10-29
在线时间
31 小时
 楼主| 发表于 2022-8-18 17:48:08 | 显示全部楼层

???什么意思?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-11-23 12:36

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表