diff options
author | jeffrey <jeffrey_lin@pegatron.corp-partner.google.com> | 2022-12-09 15:00:17 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-12-14 02:53:16 +0000 |
commit | 20e9a58e021f119f3fe26f41958de3fdad21a28d (patch) | |
tree | bca716fb7d48bb3cc744b99a8a918080b5b976ee | |
parent | 26678364d986f03ee364cab27b5464d636f91be1 (diff) | |
download | chrome-ec-20e9a58e021f119f3fe26f41958de3fdad21a28d.tar.gz |
xivur: Implement keyboard function
Depend on design, no support keyboard backlight
modify keyboard function.
1.remove keyboard backlight
2.keyboard scan setting
BUG=b:261942045
TEST=zmake build xivur --clobber
BRANCH=nissa
Change-Id: I50261a6982a4b3456db83ba765529fc77726ddba
Signed-off-by: jeffrey <jeffrey_lin@pegatron.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4090776
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Reviewed-by: Andrew McRae <amcrae@google.com>
-rw-r--r-- | zephyr/program/nissa/xivur/generated.dtsi | 4 | ||||
-rw-r--r-- | zephyr/program/nissa/xivur/keyboard.dtsi | 14 | ||||
-rw-r--r-- | zephyr/program/nissa/xivur/overlay.dtsi | 1 | ||||
-rw-r--r-- | zephyr/program/nissa/xivur/project.conf | 3 | ||||
-rw-r--r-- | zephyr/program/nissa/xivur/src/keyboard.c | 18 |
5 files changed, 22 insertions, 18 deletions
diff --git a/zephyr/program/nissa/xivur/generated.dtsi b/zephyr/program/nissa/xivur/generated.dtsi index f968eeb375..ecbc1eaed2 100644 --- a/zephyr/program/nissa/xivur/generated.dtsi +++ b/zephyr/program/nissa/xivur/generated.dtsi @@ -105,10 +105,6 @@ gpio_ec_wp_odl: ec_wp_odl { gpios = <&gpioa 1 (GPIO_INPUT | GPIO_ACTIVE_LOW)>; }; - gpio_en_kb_bl: en_kb_bl { - gpios = <&gpioa 0 GPIO_OUTPUT>; - enum-name = "GPIO_EN_KEYBOARD_BACKLIGHT"; - }; gpio_en_pp3300_s5: en_pp3300_s5 { gpios = <&gpiob 6 GPIO_OUTPUT>; enum-name = "GPIO_TEMP_SENSOR_POWER"; diff --git a/zephyr/program/nissa/xivur/keyboard.dtsi b/zephyr/program/nissa/xivur/keyboard.dtsi index 00610e4e18..5248c4aaff 100644 --- a/zephyr/program/nissa/xivur/keyboard.dtsi +++ b/zephyr/program/nissa/xivur/keyboard.dtsi @@ -3,20 +3,6 @@ * found in the LICENSE file. */ -/ { - kblight { - compatible = "cros-ec,kblight-pwm"; - pwms = <&pwm6 6 PWM_HZ(2400) PWM_POLARITY_NORMAL>; - }; -}; - -&pwm6 { - status = "okay"; - clock-bus = "NPCX_CLOCK_BUS_LFCLK"; - pinctrl-0 = <&pwm6_gpc0>; - pinctrl-names = "default"; -}; - &cros_kb_raw { status = "okay"; /* No KSO2 (it's inverted and implemented by GPIO) */ diff --git a/zephyr/program/nissa/xivur/overlay.dtsi b/zephyr/program/nissa/xivur/overlay.dtsi index 079bf95f92..29cf96ad3f 100644 --- a/zephyr/program/nissa/xivur/overlay.dtsi +++ b/zephyr/program/nissa/xivur/overlay.dtsi @@ -266,6 +266,7 @@ <&gpio8 6 0>, <&gpio9 3 0>, <&gpio9 5 0>, + <&gpioa 0 0>, <&gpioa 2 0>, <&gpiob 1 0>, <&gpiob 7 0>, diff --git a/zephyr/program/nissa/xivur/project.conf b/zephyr/program/nissa/xivur/project.conf index 306f7a9bde..566878ef94 100644 --- a/zephyr/program/nissa/xivur/project.conf +++ b/zephyr/program/nissa/xivur/project.conf @@ -22,3 +22,6 @@ CONFIG_PLATFORM_EC_GMR_TABLET_MODE=n CONFIG_PLATFORM_EC_TABLET_MODE=n CONFIG_PLATFORM_EC_TABLET_MODE_SWITCH=n CONFIG_PLATFORM_EC_VOLUME_BUTTONS=n + +#Disable keyboard backlight +CONFIG_PLATFORM_EC_KBLIGHT_ENABLE_PIN=n diff --git a/zephyr/program/nissa/xivur/src/keyboard.c b/zephyr/program/nissa/xivur/src/keyboard.c index 2bc1d203a7..b7e6c2b482 100644 --- a/zephyr/program/nissa/xivur/src/keyboard.c +++ b/zephyr/program/nissa/xivur/src/keyboard.c @@ -4,6 +4,24 @@ */ #include "ec_commands.h" +#include "keyboard_scan.h" +#include "timer.h" + +/* Keyboard scan setting */ +__override struct keyboard_scan_config keyscan_config = { + /* Increase from 50 us, because KSO_02 passes through the H1. */ + .output_settle_us = 80, + /* Other values should be the same as the default configuration. */ + .debounce_down_us = 9 * MSEC, + .debounce_up_us = 30 * MSEC, + .scan_period_us = 3 * MSEC, + .min_post_scan_delay_us = 1000, + .poll_timeout_us = 100 * MSEC, + .actual_key_mask = { + 0x1c, 0xfe, 0xff, 0xff, 0xff, 0xf5, 0xff, + 0xa4, 0xff, 0xfe, 0x55, 0xfa, 0xca /* full set */ + }, +}; static const struct ec_response_keybd_config xivur_kb = { .num_top_row_keys = 10, |