From 83f78d2ee16d33fa580a815916fbaf08a339cf72 Mon Sep 17 00:00:00 2001 From: Andrew McRae Date: Wed, 8 Dec 2021 13:34:39 +1100 Subject: it8xxx2: Restore raw_kb config to common it8xxx2 config Restore keyboard scanning config to common it8xxx2 config. Projects that do not have keyboards can disable it separately. V2 - remove keyboard config from drawcia_riscv. BUG=b:209324248 TEST=zmake configure -b krabby BRANCH=none Signed-off-by: Andrew McRae Change-Id: Iab6844b696ce49c5700a8479df47542705a90643 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3322214 Reviewed-by: Jeremy Bettis --- zephyr/boards/riscv/it8xxx2/it8xxx2.dts | 17 +++++++++++++ zephyr/projects/corsola/BUILD.py | 1 - zephyr/projects/corsola/gpio_krabby.dts | 18 ++++++++++++++ zephyr/projects/corsola/kb_krabby.dts | 43 --------------------------------- zephyr/projects/drawcia_riscv/BUILD.py | 2 +- zephyr/projects/drawcia_riscv/kb.dts | 24 ------------------ 6 files changed, 36 insertions(+), 69 deletions(-) delete mode 100644 zephyr/projects/corsola/kb_krabby.dts delete mode 100644 zephyr/projects/drawcia_riscv/kb.dts diff --git a/zephyr/boards/riscv/it8xxx2/it8xxx2.dts b/zephyr/boards/riscv/it8xxx2/it8xxx2.dts index 82b5bbc7f1..29fb718f70 100644 --- a/zephyr/boards/riscv/it8xxx2/it8xxx2.dts +++ b/zephyr/boards/riscv/it8xxx2/it8xxx2.dts @@ -18,6 +18,19 @@ zephyr,flash = &flash0; zephyr,flash-controller = &flashctrl; }; + + /* Override keyboard scanning */ + soc { + /delete-node/ kscan@f01d00; + + cros_kb_raw: cros-kb-raw@f01d00 { + compatible = "ite,it8xxx2-cros-kb-raw"; + reg = <0x00f01d00 0x29>; + label = "CROS_KB_RAW_0"; + interrupt-parent = <&intc>; + interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; + }; + }; }; &uart1 { @@ -29,3 +42,7 @@ &ite_uart1_wrapper { status = "okay"; }; + +&cros_kb_raw { + status = "okay"; /* Override in project dts if not required */ +}; diff --git a/zephyr/projects/corsola/BUILD.py b/zephyr/projects/corsola/BUILD.py index 4ee076bee3..beb7e3ab7c 100644 --- a/zephyr/projects/corsola/BUILD.py +++ b/zephyr/projects/corsola/BUILD.py @@ -30,7 +30,6 @@ register_corsola_project( here / "battery_krabby.dts", here / "gpio_krabby.dts", here / "i2c_krabby.dts", - here / "kb_krabby.dts", here / "motionsense_krabby.dts", here / "pwm_krabby.dts", ], diff --git a/zephyr/projects/corsola/gpio_krabby.dts b/zephyr/projects/corsola/gpio_krabby.dts index 0fed46c405..1b93376582 100644 --- a/zephyr/projects/corsola/gpio_krabby.dts +++ b/zephyr/projects/corsola/gpio_krabby.dts @@ -4,6 +4,7 @@ */ #include +#include / { gpiox: gpio@0 { @@ -281,6 +282,23 @@ }; }; + ec-mkbp-host-event-wakeup-mask { + compatible = "ec-wake-mask-event"; + wakeup-mask = <( + HOST_EVENT_MASK(HOST_EVENT_AC_CONNECTED) | + HOST_EVENT_MASK(HOST_EVENT_AC_DISCONNECTED) | + HOST_EVENT_MASK(HOST_EVENT_LID_OPEN) | + HOST_EVENT_MASK(HOST_EVENT_POWER_BUTTON) | + HOST_EVENT_MASK(HOST_EVENT_HANG_DETECT) | + HOST_EVENT_MASK(HOST_EVENT_MODE_CHANGE))>; + }; + + ec-mkbp-event-wakeup-mask { + compatible = "ec-wake-mask-event"; + wakeup-mask = <(MKBP_EVENT_KEY_MATRIX | + MKBP_EVENT_HOST_EVENT)>; + }; + hibernate-wake-pins { compatible = "cros-ec,hibernate-wake-pins"; wakeup-pins = <&ac_present diff --git a/zephyr/projects/corsola/kb_krabby.dts b/zephyr/projects/corsola/kb_krabby.dts deleted file mode 100644 index 7e4c501df5..0000000000 --- a/zephyr/projects/corsola/kb_krabby.dts +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include - -/ { - ec-mkbp-host-event-wakeup-mask { - compatible = "ec-wake-mask-event"; - wakeup-mask = <( - HOST_EVENT_MASK(HOST_EVENT_AC_CONNECTED) | - HOST_EVENT_MASK(HOST_EVENT_AC_DISCONNECTED) | - HOST_EVENT_MASK(HOST_EVENT_LID_OPEN) | - HOST_EVENT_MASK(HOST_EVENT_POWER_BUTTON) | - HOST_EVENT_MASK(HOST_EVENT_HANG_DETECT) | - HOST_EVENT_MASK(HOST_EVENT_MODE_CHANGE))>; - }; - - ec-mkbp-event-wakeup-mask { - compatible = "ec-wake-mask-event"; - wakeup-mask = <(MKBP_EVENT_KEY_MATRIX | - MKBP_EVENT_HOST_EVENT)>; - }; - - /* Override keyboard scanning */ - soc { - /delete-node/ kscan@f01d00; - - cros_kb_raw: cros-kb-raw@f01d00 { - compatible = "ite,it8xxx2-cros-kb-raw"; - reg = <0x00f01d00 0x29>; - label = "CROS_KB_RAW_0"; - interrupt-parent = <&intc>; - interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; - status = "disabled"; - }; - }; -}; - -&cros_kb_raw { - status = "okay"; -}; diff --git a/zephyr/projects/drawcia_riscv/BUILD.py b/zephyr/projects/drawcia_riscv/BUILD.py index d2515ece06..ef839c0927 100644 --- a/zephyr/projects/drawcia_riscv/BUILD.py +++ b/zephyr/projects/drawcia_riscv/BUILD.py @@ -7,5 +7,5 @@ register_binman_project( project_name="drawcia_riscv", zephyr_board="it8xxx2", - dts_overlays=["gpio.dts", "kb.dts"], + dts_overlays=["gpio.dts"], ) diff --git a/zephyr/projects/drawcia_riscv/kb.dts b/zephyr/projects/drawcia_riscv/kb.dts deleted file mode 100644 index 6fce08f43b..0000000000 --- a/zephyr/projects/drawcia_riscv/kb.dts +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/ { - /* Override keyboard scanning */ - soc { - /delete-node/ kscan@f01d00; - - cros_kb_raw: cros-kb-raw@f01d00 { - compatible = "ite,it8xxx2-cros-kb-raw"; - reg = <0x00f01d00 0x29>; - label = "CROS_KB_RAW_0"; - interrupt-parent = <&intc>; - interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; - status = "disabled"; - }; - }; -}; - -&cros_kb_raw { - status = "okay"; -}; -- cgit v1.2.1