summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorDino Li <dino.li@ite.com.tw>2016-05-05 13:37:39 +0800
committerchrome-bot <chrome-bot@chromium.org>2016-05-06 18:58:21 -0700
commit26afde33310bf3cff88d9fc44bd4648426c00336 (patch)
tree7a9b39ef2e1681c099a8d8877dd573e8f6394b3a /chip
parent3391ef950a0ba7daf069fb760daadb872ca71cfe (diff)
downloadchrome-ec-26afde33310bf3cff88d9fc44bd4648426c00336.tar.gz
keyboard: it83xx: add COL02 inverted feature
The other chips support this feature so we implement it too. Signed-off-by: Dino Li <dino.li@ite.com.tw> BRANCH=none BUG=none TEST=The behavior of kso2 is inverted if define 'CONFIG_KEYBOARD_COL2_INVERTED'. Change-Id: I70d1694ca7d3d10278a484a632e88dc204b71b23 Reviewed-on: https://chromium-review.googlesource.com/342488 Commit-Ready: Dino Li <dino.li@ite.com.tw> Tested-by: Dino Li <dino.li@ite.com.tw> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/it83xx/keyboard_raw.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/chip/it83xx/keyboard_raw.c b/chip/it83xx/keyboard_raw.c
index 42f877ffcc..9c5d1028ae 100644
--- a/chip/it83xx/keyboard_raw.c
+++ b/chip/it83xx/keyboard_raw.c
@@ -29,8 +29,13 @@ void keyboard_raw_init(void)
/* bit2, 1 enables the internal pull-up of the KSI[7:0] pins. */
IT83XX_KBS_KSICTRL = 0x04;
+#ifdef CONFIG_KEYBOARD_COL2_INVERTED
+ /* KSO[2] is high, others are low. */
+ IT83XX_KBS_KSOL = (1 << 2);
+#else
/* KSO[7:0] pins low. */
IT83XX_KBS_KSOL = 0x00;
+#endif
/* KSO[15:8] pins low. */
IT83XX_KBS_KSOH1 = 0x00;
@@ -74,6 +79,10 @@ test_mockable void keyboard_raw_drive_column(int col)
else
mask = 0xffff ^ (1 << col);
+#ifdef CONFIG_KEYBOARD_COL2_INVERTED
+ /* KSO[2] is inverted. */
+ mask ^= (1 << 2);
+#endif
IT83XX_KBS_KSOL = mask & 0xff;
IT83XX_KBS_KSOH1 = (mask >> 8) & 0xff;
}