summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormick_hsiao <mick_hsiao@compal.corp-partner.google.com>2023-05-11 16:43:13 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-11 17:42:02 +0000
commit454f4b32f8b010b9267d6c47f81502dfdffc6a24 (patch)
tree242ee8fc1bfed50c01ae1eb53fe0c1b0226b9af3
parentdd85dd9df8e3aec6db277eb1ad2074d3ae010bde (diff)
downloadchrome-ec-454f4b32f8b010b9267d6c47f81502dfdffc6a24.tar.gz
Uldren: update fw config
Update cbi config to let DB works, Also remove fan code, because uldren doesn't have fan design BUG=b:273159459 TEST=DB can charge and read usb Change-Id: I9da2c3fd7eedc44cfcaad89d32c393cc528feff2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4522690 Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Tested-by: Mick Hsiao <mick_hsiao@compal.corp-partner.google.com> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org>
-rw-r--r--zephyr/program/nissa/CMakeLists.txt1
-rw-r--r--zephyr/program/nissa/uldren/cbi.dtsi46
-rw-r--r--zephyr/program/nissa/uldren/src/fan.c41
3 files changed, 25 insertions, 63 deletions
diff --git a/zephyr/program/nissa/CMakeLists.txt b/zephyr/program/nissa/CMakeLists.txt
index e2f85139bf..cd45f00a3a 100644
--- a/zephyr/program/nissa/CMakeLists.txt
+++ b/zephyr/program/nissa/CMakeLists.txt
@@ -118,7 +118,6 @@ if(DEFINED CONFIG_BOARD_ULDREN)
"uldren/src/kb_backlight.c"
"uldren/src/keyboard.c"
)
- zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_FAN "uldren/src/fan.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USBC "uldren/src/usbc.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER "uldren/src/charger.c")
endif()
diff --git a/zephyr/program/nissa/uldren/cbi.dtsi b/zephyr/program/nissa/uldren/cbi.dtsi
index 9d865a38bb..02aa0607f9 100644
--- a/zephyr/program/nissa/uldren/cbi.dtsi
+++ b/zephyr/program/nissa/uldren/cbi.dtsi
@@ -7,44 +7,47 @@
/* Uldren-specific fw_config fields. */
nissa-fw-config {
/*
- * FW_CONFIG field to enable KB back light or not.
+ * FW_CONFIG field to enable USB DB.
*/
- kb-bl {
- enum-name = "FW_KB_BL";
- start = <4>;
- size = <1>;
+ sub-board {
+ enum-name = "FW_SUB_BOARD";
+ start = <1>;
+ size = <2>;
- no-kb-bl {
+ sub-board-1 {
compatible = "cros-ec,cbi-fw-config-value";
- enum-name = "FW_KB_BL_NOT_PRESENT";
+ enum-name = "FW_SUB_BOARD_1";
value = <0>;
- default;
};
- kb-bl-present {
+ sub-board-2 {
compatible = "cros-ec,cbi-fw-config-value";
- enum-name = "FW_KB_BL_PRESENT";
- value = <1>;
+ enum-name = "FW_SUB_BOARD_2";
+ value = <3>;
+ };
+ sub-board-3 {
+ compatible = "cros-ec,cbi-fw-config-value";
+ enum-name = "FW_SUB_BOARD_3";
+ value = <2>;
};
};
-
/*
- * FW_CONFIG field to enable USB DB.
+ * FW_CONFIG field to enable KB back light or not.
*/
- db-usb {
- enum-name = "FW_DB_USB";
- start = <6>;
+ kb-bl {
+ enum-name = "FW_KB_BL";
+ start = <5>;
size = <1>;
- no-db-usb {
+ no-kb-bl {
compatible = "cros-ec,cbi-fw-config-value";
- enum-name = "FW_DB_USB_NOT_PRESENT";
+ enum-name = "FW_KB_BL_NOT_PRESENT";
value = <0>;
+ default;
};
- db-usb-present {
+ kb-bl-present {
compatible = "cros-ec,cbi-fw-config-value";
- enum-name = "FW_DB_USB_PRESENT";
+ enum-name = "FW_KB_BL_PRESENT";
value = <1>;
- default;
};
};
@@ -67,5 +70,6 @@
value = <1>;
};
};
+/delete-node/ fan;
};
};
diff --git a/zephyr/program/nissa/uldren/src/fan.c b/zephyr/program/nissa/uldren/src/fan.c
deleted file mode 100644
index 32f9d3c65e..0000000000
--- a/zephyr/program/nissa/uldren/src/fan.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright 2023 The ChromiumOS Authors
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "cros_cbi.h"
-#include "fan.h"
-#include "gpio/gpio.h"
-#include "hooks.h"
-
-#include <zephyr/devicetree.h>
-#include <zephyr/drivers/gpio.h>
-#include <zephyr/logging/log.h>
-
-LOG_MODULE_DECLARE(nissa, CONFIG_NISSA_LOG_LEVEL);
-
-/*
- * Nirwen fan support
- */
-static void fan_init(void)
-{
- int ret;
- uint32_t val;
- /*
- * Retrieve the fan config.
- */
- ret = cros_cbi_get_fw_config(FW_FAN, &val);
- if (ret != 0) {
- LOG_ERR("Error retrieving CBI FW_CONFIG field %d", FW_FAN);
- return;
- }
- if (val != FW_FAN_PRESENT) {
- /* Disable the fan */
- fan_set_count(0);
- } else {
- /* Configure the fan enable GPIO */
- gpio_pin_configure_dt(GPIO_DT_FROM_NODELABEL(gpio_fan_enable),
- GPIO_OUTPUT);
- }
-}
-DECLARE_HOOK(HOOK_INIT, fan_init, HOOK_PRIO_POST_FIRST);