WARNING: at drivers/gpio/gpiolib. c: 101 gpio_ensure_requested + 0x5c/0x118 (), gpio0x5c
When you use the key program implemented by the input subsystem, the following error is reported every time the key is interrupted:
--- Input_key_handler ---
------------ [Cut here] ------------
WARNING: at drivers/gpio/gpiolib. c: 101 gpio_ensure_requested + 0x5c/0x118 ()
Autorequest GPIO-145
The source code is as follows:
Irqreturn_t input_key_handler (int irqno, void * dev_id) {int value; printk ("--- % s --- \ n", _ FUNCTION __); value = gpio_direction_input (EXYNOS4_GPX1 (1); printk ("--- <DRV> --- % d \ n", value); input_report_key (input_key, KEY_HOME ,! Value); input_sync (input_key); return IRQ_HANDLED ;}
This problem occurs because you did not apply before using gpio_direction_input.
Two solutions:
1. Use gpio_request to apply for gpio before use
2. Change gpio_direction_input to gpio_get_value.