diff options
author | Keith Short <keithshort@chromium.org> | 2022-02-24 08:36:48 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-02-25 01:38:00 +0000 |
commit | 2f79338fee0c1ecf3964bd82f39cb2c319083f17 (patch) | |
tree | 86f7fe789efdbe6a243aea24a77fa090ebd5c235 /zephyr/include/drivers/cros_kb_raw.h | |
parent | fdd28a51a218d50d76caf833ec46cff61fc4a699 (diff) | |
download | chrome-ec-2f79338fee0c1ecf3964bd82f39cb2c319083f17.tar.gz |
zephyr: keyboard: set active low flag for column 2
Explicitly set the active low flag for the column 2 output pin. Modify
cros_kb_raw_set_col2() to drive the logic level instead of the physical
state of the pin when CONFIG_PLATFORM_EC_KEYBOARD_COL2_INVERTED is
enabled.
BUG=b:218904113
BRANCH=none
TEST=Verify all keypresses on herobrine using "ksstat on"
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: If6098226d5551c2a3aa8374f7b17e2fad396c006
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3488786
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Reviewed-by: Andrew McRae <amcrae@google.com>
Diffstat (limited to 'zephyr/include/drivers/cros_kb_raw.h')
-rw-r--r-- | zephyr/include/drivers/cros_kb_raw.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/zephyr/include/drivers/cros_kb_raw.h b/zephyr/include/drivers/cros_kb_raw.h index d7c2b94f1f..ca6cfbc486 100644 --- a/zephyr/include/drivers/cros_kb_raw.h +++ b/zephyr/include/drivers/cros_kb_raw.h @@ -174,21 +174,24 @@ static inline int z_impl_cros_kb_raw_enable_interrupt(const struct device *dev, } /** - * @brief Set the physical value of the keyboard column 2 output. + * @brief Set the logical level of the keyboard column 2 output. * - * When CONFIG_PLATFORM_EC_KEYBOARD_COL2_INVERTED is enabled, the keyboard - * driver must invert the column 2 output. + * When CONFIG_PLATFORM_EC_KEYBOARD_COL2_INVERTED is enabled, the column 2 + * output connects to the Google Security Chip and must use push-pull operation. + * Typically the column 2 signal is also inverted in this configuration so the + * board devicetree should set the GPIO_ACTIVE_LOW flag on GPIO pointed to by + * gpio-kbd-kso2. * - * @param value Physical value to set to the pin + * @param value Logical level to set to the pin */ -static inline void cros_kb_raw_set_col2(int value) +static inline void cros_kb_raw_set_col2(int level) { #if defined CONFIG_PLATFORM_EC_KEYBOARD_COL2_INVERTED && \ DT_NODE_EXISTS(KBD_KS02_NODE) const struct gpio_dt_spec *kbd_dt_spec = GPIO_DT_FROM_NODE(KBD_KS02_NODE); - gpio_pin_set_raw(kbd_dt_spec->port, kbd_dt_spec->pin, value); + gpio_pin_set(kbd_dt_spec->port, kbd_dt_spec->pin, level); #endif } |