[PATCH 3/6] gpio_keys: detect keys pressed before booting

Vicente Bergas vicencb at gmail.com
Sat Mar 16 18:59:39 EDT 2013


If a key is pressed but not released before booting and the key is
connected to an active low gpio it's not detected. This patch solves
that.

Signed-off-by: Vicente Bergas <vicencb at gmail.com>
---
 drivers/input/gpio_keys.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/input/gpio_keys.c b/drivers/input/gpio_keys.c
index b02e0ed..b439111 100644
--- a/drivers/input/gpio_keys.c
+++ b/drivers/input/gpio_keys.c
@@ -86,6 +86,8 @@ static int __init gpio_keys_probe(struct device_d *dev)
 			return ret;
 		}
 		gpio_direction_input(gpio);
+		pdata->buttons[i].previous_state =
+			pdata->buttons[i].active_low;
 	}
 
 	pdata->poller.func = gpio_key_poller;
-- 
1.8.2




More information about the barebox mailing list