summaryrefslogtreecommitdiff
path: root/chip/stm32/keyboard_raw.c
diff options
context:
space:
mode:
authorChris Zhong <zyw@rock-chips.com>2014-09-30 16:22:45 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-02 20:51:05 +0000
commit4be45e962cba218c07944dd97935361be9017224 (patch)
tree90170a7c9473ca0515332f5099accf9fca2912c9 /chip/stm32/keyboard_raw.c
parent7a8891268daed617ad55198618ea2486a291fcdd (diff)
downloadchrome-ec-4be45e962cba218c07944dd97935361be9017224.tar.gz
stm32: invert keyboard col2 option
Silego variant in pinky rev2 require the signal to be inverted. BUG=None TEST=on pinky-rev2: all keys from col2 work correctly BRANCH=None Change-Id: I83a029b4e9c6b4770e83f30b170595d45ea40cca Signed-off-by: Chris Zhong <zyw@rock-chips.com> Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/220314
Diffstat (limited to 'chip/stm32/keyboard_raw.c')
-rw-r--r--chip/stm32/keyboard_raw.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/chip/stm32/keyboard_raw.c b/chip/stm32/keyboard_raw.c
index bc810e2a04..4ac7f2dcb2 100644
--- a/chip/stm32/keyboard_raw.c
+++ b/chip/stm32/keyboard_raw.c
@@ -86,6 +86,13 @@ test_mockable void keyboard_raw_drive_column(int out)
}
}
+ #ifdef CONFIG_KEYBOARD_COL2_INVERTED
+ if (bsrr & (gpio_list[GPIO_KB_OUT02].mask << 16 |
+ gpio_list[GPIO_KB_OUT02].mask))
+ bsrr ^= (gpio_list[GPIO_KB_OUT02].mask << 16 |
+ gpio_list[GPIO_KB_OUT02].mask);
+ #endif
+
if (bsrr)
STM32_GPIO_BSRR(kb_out_ports[i]) = bsrr;