系统自带的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"); } |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-25 19:53
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.