Patchwork [U-Boot,4/4] input: Add debugging for key matrix key codes

login
register
mail settings
Submitter Simon Glass
Date Sept. 28, 2012, 1:18 a.m.
Message ID <1348795123-24385-5-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/187687/
State Accepted, archived
Delegated to: Tom Rini
Headers show

Comments

Simon Glass - Sept. 28, 2012, 1:18 a.m.
These are read from the fdt - add a debug feature to display the mapping
on start-up.

See that we get debug output listing the keycodes

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 drivers/input/key_matrix.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/input/key_matrix.c b/drivers/input/key_matrix.c
index 287bf0d..946a186 100644
--- a/drivers/input/key_matrix.c
+++ b/drivers/input/key_matrix.c
@@ -145,6 +145,8 @@  static uchar *create_keymap(struct key_matrix *config, u32 *data, int len,
 		key_code = tmp & 0xffff;
 		entry = row * config->num_cols + col;
 		map[entry] = key_code;
+		debug("   map %d, %d: pos=%d, keycode=%d\n", row, col,
+		      entry, key_code);
 		if (pos && map_keycode == key_code)
 			*pos = entry;
 	}