matrix_keypad 矩阵按键驱动分析
//主要函数调用过程
matrix_keypad_probe
matrix_keypad_parse_dt //根据设备树构造 pdata
pdata->num_row_gpios = nrow = of_gpio_named_count(np, "row-gpios");
pdata->num_col_gpios = ncol = of_gpio_named_count(np, "col-gpios");
of_get_property(np, "linux,no-autorepeat", NULL)
of_get_property(np, "linux,wakeup", NULL)
of_get_property(np, "gpio-activelow", NULL)
of_property_read_u32(np, "debounce-delay-ms", &pdata->debounce_ms);
of_property_read_u32(np, "col-scan-delay-us",&pdata->col_scan_delay_us);
for (i = 0; i < pdata->num_row_gpios; i++)
gpios[i] = of_get_named_gpio(np, "row-gpios", i);
for (i = 0; i < pdata->num_col_gpios; i++)
gpios[pdata->num_row_gpios + i] = of_get_named_gpio(np, "col-gpios", i)
matrix_keypad_build_keymap
matrix_keypad_parse_of_keymap
还没有评论,来说两句吧...