BBB DT based approach

浪尽此生 提交于 2019-12-04 15:07:36

You need to prepare a structure of type struct of_device_id and use the compatible property on that. Try in the following manner :

static struct of_device_id my_devs[] = {
    { .compatible = "my_gpio" }, /* This should be the name given in the device tree */
    { }
};
MODULE_DEVICE_TABLE(of, my_devs);

Now build the platform_driver structure, and pass the above table into it :

static struct platform_driver my_plat_driver = {
    .probe = my_probe,
    .remove = my_remove,
    .driver = {
        .name = "my_gpio_driver",    /* This name is for sysfs, not for matching */
        .of_match_table = my_devs    /* This turns out as the matching logic */   
    }
};

May be your board support doesn't understand this protocol, so a node is needed to put in a place where the platform code actually processes it. Please go through below discussion and add a "virtual-devices" node in dtb , hope it would help.

http://web.archiveorange.com/archive/v/9IQA2s6aeZUFXdm6P87Z

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!