rambi: Keyboard output column 2 must be inverted

The Silego chip used on Rambi inverts column 2.  So the EC should pull the signal low when NOT scanning column 2, and release it at all other times.

BUG=chrome-os-partner:23198
BRANCH=none
TEST=not yet; need to probe on scope

Change-Id: If6a784493533f11ae54d18f27591697e69aa2282
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/172674
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Randall Spangler
2013-10-08 12:31:05 -07:00
committed by chrome-internal-fetch
parent 27e063ea10
commit a1191b92d2
3 changed files with 25 additions and 17 deletions

View File

@@ -13,6 +13,7 @@
#define CONFIG_BOARD_VERSION
#define CONFIG_CMD_GSV
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_KEYBOARD_COL2_INVERTED
#define CONFIG_KEYBOARD_PROTOCOL_8042
#define CONFIG_LED_COMMON
#undef CONFIG_PECI

View File

@@ -53,23 +53,22 @@ void keyboard_raw_task_start(void)
test_mockable void keyboard_raw_drive_column(int col)
{
if (col == KEYBOARD_COLUMN_NONE) {
/* Tri-state all outputs */
LM4_GPIO_DATA(LM4_GPIO_P, 0xff) = 0xff;
LM4_GPIO_DATA(LM4_GPIO_Q, 0x1f) = 0x1f;
} else if (col == KEYBOARD_COLUMN_ALL) {
/* Assert all outputs */
LM4_GPIO_DATA(LM4_GPIO_P, 0xff) = 0;
LM4_GPIO_DATA(LM4_GPIO_Q, 0x1f) = 0;
} else {
/* Assert a single output */
LM4_GPIO_DATA(LM4_GPIO_P, 0xff) = 0xff;
LM4_GPIO_DATA(LM4_GPIO_Q, 0x1f) = 0x1f;
if (col < 8)
LM4_GPIO_DATA(LM4_GPIO_P, 1 << col) = 0;
else
LM4_GPIO_DATA(LM4_GPIO_Q, 1 << (col - 8)) = 0;
}
int mask;
if (col == KEYBOARD_COLUMN_NONE)
mask = 0x1fff; /* Tri-state all outputs */
else if (col == KEYBOARD_COLUMN_ALL)
mask = 0; /* Assert all outputs */
else
mask = 0x1fff ^ (1 << col); /* Assert a single output */
#ifdef CONFIG_KEYBOARD_COL2_INVERTED
/* Invert column 2 output */
mask ^= (1 << 2);
#endif
LM4_GPIO_DATA(LM4_GPIO_P, 0xff) = mask & 0xff;
LM4_GPIO_DATA(LM4_GPIO_Q, 0x1f) = (mask >> 8) & 0x1f;
}
test_mockable int keyboard_raw_read_rows(void)

View File

@@ -426,6 +426,14 @@
/*****************************************************************************/
/* Keyboard config */
/*
* The Silego reset chip sits in between the EC and the physical keyboard on
* column 2. To save power in low-power modes, some Silego variants require
* the signal to be inverted so that the open-drain output from the EC isn't
* costing power due to the pull-up resistor in the Silego.
*/
#undef CONFIG_KEYBOARD_COL2_INVERTED
/* Enable extra debugging output from keyboard modules */
#undef CONFIG_KEYBOARD_DEBUG