使用LInux内核自带的gpio-keys通用驱动,然后在mach-nux970.c中添加了按键平台设备并注册,其中部分代码:
static struct gpio_keys_button nuc970_buttons[] = {
{
.gpio = NUC970_PF11, /* K1 */
.code = KEY_A,
.desc = "Button 1",
.active_low = 1,
},
{
.gpio = NUC970_PF12, /* K2 */
.code = KEY_B,
.desc = "Button 2",
.active_low = 1, //按键按下时低电平
},
{
.gpio = NUC970_PF13, /* K3 */
.code = KEY_C,
.desc = "Button 3",
.active_low = 1,
},
{
.gpio = NUC970_PF14, /* K4 */
.code = KEY_D, //供应用程序识别的代码
.desc = "Power",
.active_low = 1,
}
板子启动后,打印错误:
gpio-keys gpio-keys: Failed to request GPIO 171, error -517
请问是不是gpio编号错误?
|