From f5f30a22c676f1450052cd7d9451ff650818ba3f Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Fri, 8 Mar 2013 14:33:47 -0800 Subject: [PATCH] stm32: Move KB_INPUTS to board.h This moves KB_INPUTS from keyboard_scan.c to board.h where KB_OUTPUTS is #defined. Although we use the same 13x8 keyboard matrix on all platforms, KB_OUTPUTS is defined on a per-board basis due to its usage in keyboard_test. BUG=none BRANCH=none TEST=locally compiled Change-Id: I0d66705d2959c7824b96cc8aae55368eca39a21a Signed-off-by: David Hendricks Reviewed-on: https://gerrit.chromium.org/gerrit/44970 Reviewed-by: Vincent Palatin --- board/daisy/board.h | 3 ++- board/snow/board.h | 3 ++- board/spring/board.h | 3 ++- chip/stm32/keyboard_scan.c | 2 -- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/board/daisy/board.h b/board/daisy/board.h index da85579d7d..3194a2de70 100644 --- a/board/daisy/board.h +++ b/board/daisy/board.h @@ -35,7 +35,8 @@ #define USB_CHARGE_PORT_COUNT 0 -/* EC drives 13 outputs to keyboard matrix */ +/* EC drives 13 outputs to the keyboard matrix and reads 8 inputs/interrupts */ +#define KB_INPUTS 8 #define KB_OUTPUTS 13 /* Charging */ diff --git a/board/snow/board.h b/board/snow/board.h index 072b5ec40e..27837b665a 100644 --- a/board/snow/board.h +++ b/board/snow/board.h @@ -38,7 +38,8 @@ #define USB_CHARGE_PORT_COUNT 0 -/* EC drives 13 outputs to keyboard matrix */ +/* EC drives 13 outputs to the keyboard matrix and reads 8 inputs/interrupts */ +#define KB_INPUTS 8 #define KB_OUTPUTS 13 /* Charging */ diff --git a/board/spring/board.h b/board/spring/board.h index 836e175e5a..cc1b675141 100644 --- a/board/spring/board.h +++ b/board/spring/board.h @@ -41,7 +41,8 @@ /* By default, enable all console messages except keyboard */ #define CC_DEFAULT (CC_ALL & ~CC_MASK(CC_KEYSCAN)) -/* EC drives 13 outputs to keyboard matrix */ +/* EC drives 13 outputs to the keyboard matrix and reads 8 inputs/interrupts */ +#define KB_INPUTS 8 #define KB_OUTPUTS 13 /* Charging */ diff --git a/chip/stm32/keyboard_scan.c b/chip/stm32/keyboard_scan.c index 9b9b4f0bc0..8fc92edfb8 100644 --- a/chip/stm32/keyboard_scan.c +++ b/chip/stm32/keyboard_scan.c @@ -32,8 +32,6 @@ enum { /* 0 ~ 12 for the corresponding output */ }; -#define KB_INPUTS 8 - /* Mask of external interrupts on input lines */ static unsigned int irq_mask;