input: gpio_kbd_matrix: do not enable interrupt if there's no callbacks
Change the gpio_kbd_matrix_set_detect_mode to skip setting gpio interrupts if we don't have callbacks configured. This is the case if the driver is running in poll or scan mode. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
parent
27d519b260
commit
f69641f7d2
|
@ -143,6 +143,10 @@ static void gpio_kbd_matrix_set_detect_mode(const struct device *dev, bool enabl
|
|||
return;
|
||||
}
|
||||
|
||||
if (cfg->gpio_cb == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < common->row_size; i++) {
|
||||
const struct gpio_dt_spec *gpio = &cfg->row_gpio[i];
|
||||
|
||||
|
|
Loading…
Reference in a new issue