From 58008e49b6ef5b75965fe4abc507597066860e64 Mon Sep 17 00:00:00 2001 From: Eric Yilun Lin Date: Fri, 7 Apr 2023 16:26:53 +0800 Subject: kingler: add usbc test This CL adds the initial USB-C tests on kingler BUG=b:272664811 TEST=twister -ci zephyr/test Change-Id: I14395ce84442f40e6fd05f7c14a2814fb24ebb9a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4483240 Reviewed-by: Ting Shen Tested-by: Eric Yilun Lin Auto-Submit: Eric Yilun Lin Commit-Queue: Ting Shen --- zephyr/program/corsola/include/variant_db_detection.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'zephyr/program/corsola/include/variant_db_detection.h') diff --git a/zephyr/program/corsola/include/variant_db_detection.h b/zephyr/program/corsola/include/variant_db_detection.h index e98ba3067d..cf86e1ae1c 100644 --- a/zephyr/program/corsola/include/variant_db_detection.h +++ b/zephyr/program/corsola/include/variant_db_detection.h @@ -8,6 +8,8 @@ #ifndef __CROS_EC_CORSOLA_DB_DETECTION_H #define __CROS_EC_CORSOLA_DB_DETECTION_H +#include + enum corsola_db_type { CORSOLA_DB_UNINIT = -1, CORSOLA_DB_NONE, @@ -16,19 +18,19 @@ enum corsola_db_type { CORSOLA_DB_COUNT, }; -#ifdef CONFIG_VARIANT_CORSOLA_DB_DETECTION /* * Get the connected daughterboard type. * * @return The daughterboard type. */ +#ifdef CONFIG_VARIANT_CORSOLA_DB_DETECTION enum corsola_db_type corsola_get_db_type(void); -#else +#elif !defined(CONFIG_TEST) inline enum corsola_db_type corsola_get_db_type(void) { return CORSOLA_DB_NONE; -}; -#endif /* CONFIG_VARIANT_CORSOLA_DB_DETECTION */ +} +#endif /* return the adjusted port count for board overridden usbc/charger functions. */ -- cgit v1.2.1 From efe0fbc416966340abae6539df8b2ab5a7e5a219 Mon Sep 17 00:00:00 2001 From: lschyi Date: Mon, 15 May 2023 15:37:12 +0800 Subject: corsola: Fix reported USB-C ports for no DB design with DB detection on The definition of `CORSOLA_DB_NONE` was settled to no DB in the project in the previous CL "corsola: Update implementation for no daughter board ", and the USB-C counts is determined by dts settings in previous CL " corosla: Improve USB-C port configuration". This introduces a reported port number mismatch when the DB detection is enabled, and the desired detection result is no DB in the design. Extend the DB status enum with `CORSOLA_DB_NO_DETECTION` to properly describe the different DB status, and fix the reported USB-C port logic. BUG=b:282625153 TEST=`zmake build --clobber` Change-Id: Idd55381759677272e0bfc7b270647d759642ce01 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4530326 Reviewed-by: Ting Shen Tested-by: Sung-Chi Li Commit-Queue: Sung-Chi Li --- zephyr/program/corsola/include/variant_db_detection.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'zephyr/program/corsola/include/variant_db_detection.h') diff --git a/zephyr/program/corsola/include/variant_db_detection.h b/zephyr/program/corsola/include/variant_db_detection.h index cf86e1ae1c..fb468126ef 100644 --- a/zephyr/program/corsola/include/variant_db_detection.h +++ b/zephyr/program/corsola/include/variant_db_detection.h @@ -12,6 +12,9 @@ enum corsola_db_type { CORSOLA_DB_UNINIT = -1, + /* CORSOLA_DB_NO_DETECTION means there is no detection involved in. */ + CORSOLA_DB_NO_DETECTION, + /* CORSOLA_DB_NONE means there is no DB in the design. */ CORSOLA_DB_NONE, CORSOLA_DB_TYPEC, CORSOLA_DB_HDMI, @@ -28,7 +31,7 @@ enum corsola_db_type corsola_get_db_type(void); #elif !defined(CONFIG_TEST) inline enum corsola_db_type corsola_get_db_type(void) { - return CORSOLA_DB_NONE; + return CORSOLA_DB_NO_DETECTION; } #endif -- cgit v1.2.1