How to use the matrix_keypad.h file for a custom keypad driver?

▼魔方 西西 提交于 2019-12-23 05:10:48

问题


can i emulate a custom keypad with input_dev (from input.h)

//an example with just one key.
button_dev = input_allocate_device();
    if (!button_dev) {
        printk(KERN_ERR "button.c: Not enough memory\n");
        error = -ENOMEM;
        goto err_free_irq;
    }

    button_dev->evbit[0] = BIT_MASK(EV_KEY);
    button_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);

or i will have to use matrix_keypad header file?If yes then How?

来源:https://stackoverflow.com/questions/45382982/how-to-use-the-matrix-keypad-h-file-for-a-custom-keypad-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!