Skip to content

Commit 6c19cd7

Browse files
committed
input: atmel_ptc: set PTC line as input
When requesting GPIOs to reserve the PTC line, set them as input to be sure to get the right direction. TODO: conversion to gpio descriptors Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
1 parent 2bbed15 commit 6c19cd7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/input/misc/atmel_ptc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ static int atmel_ptc_request_pins(struct atmel_ptc *ptc)
518518
if (ptc->x_lines_requested[j])
519519
continue;
520520

521-
if (gpio_request(ptc->pins->x_lines[j].id, ptc->pins->x_lines[j].name)) {
521+
if (gpio_request_one(ptc->pins->x_lines[j].id, GPIOF_DIR_IN, ptc->pins->x_lines[j].name)) {
522522
dev_err(ptc->dev, "Can't get %s\n", ptc->pins->x_lines[j].name);
523523
return -ENXIO;
524524
}
@@ -529,7 +529,7 @@ static int atmel_ptc_request_pins(struct atmel_ptc *ptc)
529529
if (ptc->y_lines_requested[j])
530530
continue;
531531

532-
if (gpio_request(ptc->pins->y_lines[j].id, ptc->pins->y_lines[j].name)) {
532+
if (gpio_request_one(ptc->pins->y_lines[j].id, GPIOF_DIR_IN, ptc->pins->y_lines[j].name)) {
533533
dev_err(ptc->dev, "Can't get %s\n", ptc->pins->y_lines[j].name);
534534
return -ENXIO;
535535
}

0 commit comments

Comments
 (0)