器件型号: AM62L-Linux-SDK
您好:
我在内核映像中静态编译了一个驱动程序。 驱动程序配置了 GPIO、该中断用于 检测电源故障和唤醒中断、以将器件从深度睡眠状态唤醒。 驱动程序工作正常、但我想在早期启动时运行它。
我尝试使用 Subsys_initcall_sync (test_driver_init)、并在早期看到加载了驱动程序。 但问题是驱动程序无法获得 GPIO。
static int boot_gpio_init (void)
{
结构 device_node *np;
NP = of_find_compatible 节点 (NULL、NULL、“test、node“);
IF(!NP)
RETURN-ENODEV;
INT pwr_boot_GPIO = of_get_named_GPIO (NP、“test-pin-GPIOs“、0);
of_node_put (NP);
IF (pwr_boot_GPIO < 0)
{
PR_err(“boot_GPIO_init:PWR_BOOT_GPIO %d\n“、pwr_boot_gpio);
返回 pwr_boot_GPIO;
}
IF (GPIO_REQUEST (pwr_boot_GPIO、“pfail-boot“))
return -EBUSY;
GPIO_DIRECTION_INPUT (pwr_BOOT_GPIO);
返回 0;
}
static int ___init test_driver_init (void)
{
boot_gpio_init();
返回 platform_driver_register (&test_driver);
}
Subsys_initcall_sync (test_driver_init);
输出为:
BOOT_GPIO_INIT:PWR_BOOT_GPIO –517 或 (-EPROBE_DEDER)。
我想知道是否有办法提前初始化 GPIO、中断和唤醒中断?
谢谢、
John Tobias