嵌入式爱好者

pps节点生成

2023-1-16 13:27| 发布者: 会飞的大灰狼| 查看: 157| 评论: 0

类目: 知识库  >  A40i/T3系列产品     文档编号: 895

系统自带的pps功能只有pps0虚拟节点,他并没有接收设备树关于pps的设备描述
如果需要pps1节点,需要手动注册pps的device设备
在linux-3.10/drivers/pps/clients/pps-gpio.c添加
static struct pps_gpio_platform_data pps_gpio_info = {
        .assert_falling_edge    = 0,
        .capture_clear         = 0,
        .gpio_pin              = 271,
        .gpio_label            = "PPS-Trigger",

};
static struct platform_device pps_gpio = {
        .name = "pps-gpio",
        .id   = 271,
        .dev  = {
                .platform_data = &pps_gpio_info,
        },

};
static int __init pps_gpio_init(void)
{
        int ret = platform_driver_register(&pps_gpio_driver);
        if (ret < 0)
                pr_err("failed to register platform driver\n");
        platform_device_register(&pps_gpio);
        return ret;
}
static void __exit pps_gpio_exit(void)
{
        platform_driver_unregister(&pps_gpio_driver);
        platform_device_unregister(&pps_gpio);
        pr_debug("unregistered platform driver\n");

}




已解决

未解决

只是看看

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-5-2 13:03

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部