<commit_before># Copyright 2020 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.

# Note: this cmake system implements only a zephyr module, and is not
# intended to build a complete EC.  To build projects in platform/ec,
# you should continue to use the Makefile system.
#
# Googlers can find the design doc at go/zephyr-shim.

if(NOT DEFINED ZEPHYR_CURRENT_MODULE_DIR)
  message(FATAL_ERROR "This Cmake system implements only a Zephyr module, and
          should not be invoked directly.  Please continue to use the Makefile
          system for non-Zephyr builds.")
endif()

set(PLATFORM_EC "${ZEPHYR_CURRENT_MODULE_DIR}" CACHE PATH
    "Path to the platform/ec repo.")
# Zephyr 2.3 will set ZEPHYR_CURRENT_MODULE_DIR to the directory of the
# CMakeLists.txt file, whereas 2.4 will set it to the actual module
# directory.  Try to detect the condition by searching for
# zephyr/module.yml.
if(NOT EXISTS "${PLATFORM_EC}/zephyr/module.yml")
  set(PLATFORM_EC "${PLATFORM_EC}/..")
  assert_exists("${PLATFORM_EC}/zephyr/module.yml")
endif()

if(DEFINED CONFIG_PLATFORM_EC)
  # Build the EC's expected ec_version.h file.
  set(ec_version_file "${CMAKE_BINARY_DIR}/ec/include/generated/ec_version.h")
  # Create the command used to generate the ec_version.h file.
  add_custom_command(
          OUTPUT ${ec_version_file}
          COMMAND ${PLATFORM_EC}/util/getversion.sh BOARD=${BOARD} > ${ec_version_file}
          WORKING_DIRECTORY ${PLATFORM_EC}
  )
  # Create a custom target that will depend on the file.
  add_custom_target(generate_ec_version DEPENDS ${ec_version_file})

  # Create a local library (ec_version) that will be a pure interface library
  # and will depend on the custom target that generates the ec_version.h file.
  add_library(ec_version INTERFACE)
  add_dependencies(ec_version generate_ec_version)

  # Register the library with zephyr so that it generates the file at build
  # time. Also, append the include directory so we can include ec_version.h.
  zephyr_append_cmake_library(ec_version)
  zephyr_include_directories("${CMAKE_BINARY_DIR}/ec/include/generated")
endif()

zephyr_include_directories(include)

zephyr_include_directories_ifdef(
  CONFIG_PLATFORM_EC
  "${PLATFORM_EC}/zephyr/shim/include"
  "${PLATFORM_EC}/fuzz"
  "${PLATFORM_EC}/test"
  "${PLATFORM_EC}/include"
  "${PLATFORM_EC}/include/driver")

add_subdirectory("app")
add_subdirectory("drivers")

add_subdirectory_ifdef(CONFIG_PLATFORM_EC "shim")

# CONFIG_PLATFORM_EC files that don't relate to something below should be
# included here, sorted by filename. This is common functionality which is
# supported by all boards and emulators (including unit tests) using the shim
# layer.
zephyr_sources_ifdef(CONFIG_PLATFORM_EC         "${PLATFORM_EC}/common/base32.c"
                                                "${PLATFORM_EC}/common/printf.c"
                                                "${PLATFORM_EC}/common/queue.c"
                                                "${PLATFORM_EC}/common/shared_mem.c"
                                                "${PLATFORM_EC}/common/version.c")

# Now include files that depend on or relate to other CONFIG options, sorted by
# CONFIG
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ACPI    "${PLATFORM_EC}/common/acpi.c"
                                                "${PLATFORM_EC}/common/ec_features.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY "${PLATFORM_EC}/common/battery.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE
                                                "${PLATFORM_EC}/common/battery_fuel_gauge.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY_SMART
                                                "${PLATFORM_EC}/driver/battery/smart.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BC12_DETECT_PI3USB9201
                                                "${PLATFORM_EC}/driver/bc12/pi3usb9201.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_ISL9241
                                                "${PLATFORM_EC}/driver/charger/isl9241.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CHARGE_MANAGER
                                                "${PLATFORM_EC}/common/charger.c"
                                                "${PLATFORM_EC}/common/charge_manager.c"
                                                "${PLATFORM_EC}/common/charge_state_v2.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CHARGE_RAMP_SW
                                                "${PLATFORM_EC}/common/charge_ramp.c"
                                                "${PLATFORM_EC}/common/charge_ramp_sw.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CBI     "${PLATFORM_EC}/common/cbi.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ
                                                "${PLATFORM_EC}/common/chipset.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ESPI    "${PLATFORM_EC}/common/espi.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC         "${PLATFORM_EC}/common/extpower_common.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_EXTPOWER_GPIO
                                                "${PLATFORM_EC}/common/extpower_gpio.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_FLASH   "${PLATFORM_EC}/common/flash.c"
                                                "${PLATFORM_EC}/common/spi_flash_reg.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD "${PLATFORM_EC}/common/host_command.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD "${PLATFORM_EC}/common/host_event_commands.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_I2C     "${PLATFORM_EC}/common/i2c_controller.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD
                                                "${PLATFORM_EC}/common/keyboard_scan.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_8042
                                                "${PLATFORM_EC}/common/keyboard_8042.c"
                                                "${PLATFORM_EC}/common/keyboard_8042_sharedlib.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_LID_SWITCH
                                                "${PLATFORM_EC}/common/lid_switch.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_PORT80  "${PLATFORM_EC}/common/port80.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWER_BUTTON
                                                "${PLATFORM_EC}/common/power_button.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ
                                                "${PLATFORM_EC}/power/common.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ_COMETLAKE
                                                "${PLATFORM_EC}/power/cometlake.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ_ICELAKE
                                                "${PLATFORM_EC}/power/icelake.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ_INTEL
                                                "${PLATFORM_EC}/common/power_button_x86.c"
                                                "${PLATFORM_EC}/power/intel_x86.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_TIMER   "${PLATFORM_EC}/common/timer.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_CHARGER
                                                "${PLATFORM_EC}/common/usb_charger.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PORT_POWER_DUMB
                                                "${PLATFORM_EC}/common/usb_port_power_dumb.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_POWER_DELIVERY
                                                "${PLATFORM_EC}/common/usb_common.c"
                                                "${PLATFORM_EC}/common/usbc/usbc_task.c"
                                                "${PLATFORM_EC}/common/usbc/usb_sm.c"
                                                "${PLATFORM_EC}/common/usbc_intr_task.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CONSOLE_CMD_PD
                                                "${PLATFORM_EC}/common/usbc/usb_pd_console.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_RETIMER_INTEL_BB
                                                "${PLATFORM_EC}/driver/retimer/bb_retimer.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_SS_MUX
                                                "${PLATFORM_EC}/driver/usb_mux/usb_mux.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_MUX_VIRTUAL
                                                "${PLATFORM_EC}/driver/usb_mux/virtual.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TBT_COMPAT_MODE
                                                "${PLATFORM_EC}/common/usbc/tbt_alt_mode.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_USB4
                                                "${PLATFORM_EC}/common/usbc/usb_mode.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_OCP
                                                "${PLATFORM_EC}/common/usbc_ocp.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_ALT_MODE_DFP
                                                "${PLATFORM_EC}/common/usb_pd_alt_mode_dfp.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_ALT_MODE_UFP
                                                "${PLATFORM_EC}/common/usb_pd_alt_mode_ufp.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_DUAL_ROLE
                                                "${PLATFORM_EC}/common/usb_pd_dual_role.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_HOST_CMD
                                                "${PLATFORM_EC}/common/usb_pd_host_cmd.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_VPD "${PLATFORM_EC}/common/usbc/usb_tc_vpd_sm.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_CTVPD
                                                "${PLATFORM_EC}/common/usbc/usb_tc_ctvpd_sm.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_DRP_ACC_TRYSRC
                                                "${PLATFORM_EC}/common/usbc/usb_tc_drp_acc_trysrc_sm.c"
                                                "${PLATFORM_EC}/common/usbc/usb_pe_drp_sm.c"
                                                "${PLATFORM_EC}/common/usbc/usb_pd_dpm.c"
                                                "${PLATFORM_EC}/common/usbc/dp_alt_mode.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PRL_SM
                                                "${PLATFORM_EC}/common/usbc/usb_prl_sm.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TCPM_PS8815
                                                "${PLATFORM_EC}/driver/tcpm/ps8xxx.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TCPM_RT1715
                                                "${PLATFORM_EC}/driver/tcpm/rt1715.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TCPM_TUSB422
                                                "${PLATFORM_EC}/driver/tcpm/tusb422.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TCPM_TCPCI
                                                "${PLATFORM_EC}/driver/tcpm/tcpci.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_PPC
                                                "${PLATFORM_EC}/common/usbc_ppc.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_PPC_SN5S330
                                                "${PLATFORM_EC}/driver/ppc/sn5s330.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_PPC_SYV682X
                                                "${PLATFORM_EC}/driver/ppc/syv682x.c")

zephyr_sources_ifdef(CONFIG_SHELL               "${PLATFORM_EC}/common/gpio_commands.c")
<commit_msg>zephyr: Enable all the USB-C host commands<commit_after># Copyright 2020 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.

# Note: this cmake system implements only a zephyr module, and is not
# intended to build a complete EC.  To build projects in platform/ec,
# you should continue to use the Makefile system.
#
# Googlers can find the design doc at go/zephyr-shim.

if(NOT DEFINED ZEPHYR_CURRENT_MODULE_DIR)
  message(FATAL_ERROR "This Cmake system implements only a Zephyr module, and
          should not be invoked directly.  Please continue to use the Makefile
          system for non-Zephyr builds.")
endif()

set(PLATFORM_EC "${ZEPHYR_CURRENT_MODULE_DIR}" CACHE PATH
    "Path to the platform/ec repo.")
# Zephyr 2.3 will set ZEPHYR_CURRENT_MODULE_DIR to the directory of the
# CMakeLists.txt file, whereas 2.4 will set it to the actual module
# directory.  Try to detect the condition by searching for
# zephyr/module.yml.
if(NOT EXISTS "${PLATFORM_EC}/zephyr/module.yml")
  set(PLATFORM_EC "${PLATFORM_EC}/..")
  assert_exists("${PLATFORM_EC}/zephyr/module.yml")
endif()

if(DEFINED CONFIG_PLATFORM_EC)
  # Build the EC's expected ec_version.h file.
  set(ec_version_file "${CMAKE_BINARY_DIR}/ec/include/generated/ec_version.h")
  # Create the command used to generate the ec_version.h file.
  add_custom_command(
          OUTPUT ${ec_version_file}
          COMMAND ${PLATFORM_EC}/util/getversion.sh BOARD=${BOARD} > ${ec_version_file}
          WORKING_DIRECTORY ${PLATFORM_EC}
  )
  # Create a custom target that will depend on the file.
  add_custom_target(generate_ec_version DEPENDS ${ec_version_file})

  # Create a local library (ec_version) that will be a pure interface library
  # and will depend on the custom target that generates the ec_version.h file.
  add_library(ec_version INTERFACE)
  add_dependencies(ec_version generate_ec_version)

  # Register the library with zephyr so that it generates the file at build
  # time. Also, append the include directory so we can include ec_version.h.
  zephyr_append_cmake_library(ec_version)
  zephyr_include_directories("${CMAKE_BINARY_DIR}/ec/include/generated")
endif()

zephyr_include_directories(include)

zephyr_include_directories_ifdef(
  CONFIG_PLATFORM_EC
  "${PLATFORM_EC}/zephyr/shim/include"
  "${PLATFORM_EC}/fuzz"
  "${PLATFORM_EC}/test"
  "${PLATFORM_EC}/include"
  "${PLATFORM_EC}/include/driver")

add_subdirectory("app")
add_subdirectory("drivers")

add_subdirectory_ifdef(CONFIG_PLATFORM_EC "shim")

# CONFIG_PLATFORM_EC files that don't relate to something below should be
# included here, sorted by filename. This is common functionality which is
# supported by all boards and emulators (including unit tests) using the shim
# layer.
zephyr_sources_ifdef(CONFIG_PLATFORM_EC         "${PLATFORM_EC}/common/base32.c"
                                                "${PLATFORM_EC}/common/printf.c"
                                                "${PLATFORM_EC}/common/queue.c"
                                                "${PLATFORM_EC}/common/shared_mem.c"
                                                "${PLATFORM_EC}/common/version.c")

# Now include files that depend on or relate to other CONFIG options, sorted by
# CONFIG
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ACPI    "${PLATFORM_EC}/common/acpi.c"
                                                "${PLATFORM_EC}/common/ec_features.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY "${PLATFORM_EC}/common/battery.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE
                                                "${PLATFORM_EC}/common/battery_fuel_gauge.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY_SMART
                                                "${PLATFORM_EC}/driver/battery/smart.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BC12_DETECT_PI3USB9201
                                                "${PLATFORM_EC}/driver/bc12/pi3usb9201.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_ISL9241
                                                "${PLATFORM_EC}/driver/charger/isl9241.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CHARGE_MANAGER
                                                "${PLATFORM_EC}/common/charger.c"
                                                "${PLATFORM_EC}/common/charge_manager.c"
                                                "${PLATFORM_EC}/common/charge_state_v2.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CHARGE_RAMP_SW
                                                "${PLATFORM_EC}/common/charge_ramp.c"
                                                "${PLATFORM_EC}/common/charge_ramp_sw.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CBI     "${PLATFORM_EC}/common/cbi.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ
                                                "${PLATFORM_EC}/common/chipset.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_ESPI    "${PLATFORM_EC}/common/espi.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC         "${PLATFORM_EC}/common/extpower_common.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_EXTPOWER_GPIO
                                                "${PLATFORM_EC}/common/extpower_gpio.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_FLASH   "${PLATFORM_EC}/common/flash.c"
                                                "${PLATFORM_EC}/common/spi_flash_reg.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD "${PLATFORM_EC}/common/host_command.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD "${PLATFORM_EC}/common/host_event_commands.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_I2C     "${PLATFORM_EC}/common/i2c_controller.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD
                                                "${PLATFORM_EC}/common/keyboard_scan.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD_PROTOCOL_8042
                                                "${PLATFORM_EC}/common/keyboard_8042.c"
                                                "${PLATFORM_EC}/common/keyboard_8042_sharedlib.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_LID_SWITCH
                                                "${PLATFORM_EC}/common/lid_switch.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_PORT80  "${PLATFORM_EC}/common/port80.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWER_BUTTON
                                                "${PLATFORM_EC}/common/power_button.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ
                                                "${PLATFORM_EC}/power/common.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ_COMETLAKE
                                                "${PLATFORM_EC}/power/cometlake.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ_ICELAKE
                                                "${PLATFORM_EC}/power/icelake.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ_INTEL
                                                "${PLATFORM_EC}/common/power_button_x86.c"
                                                "${PLATFORM_EC}/power/intel_x86.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_TIMER   "${PLATFORM_EC}/common/timer.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_CHARGER
                                                "${PLATFORM_EC}/common/usb_charger.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PORT_POWER_DUMB
                                                "${PLATFORM_EC}/common/usb_port_power_dumb.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_POWER_DELIVERY
                                                "${PLATFORM_EC}/common/usb_common.c"
                                                "${PLATFORM_EC}/common/usbc/usbc_task.c"
                                                "${PLATFORM_EC}/common/usbc/usb_sm.c"
                                                "${PLATFORM_EC}/common/usbc_intr_task.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CONSOLE_CMD_PD
                                                "${PLATFORM_EC}/common/usbc/usb_pd_console.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_RETIMER_INTEL_BB
                                                "${PLATFORM_EC}/driver/retimer/bb_retimer.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_SS_MUX
                                                "${PLATFORM_EC}/driver/usb_mux/usb_mux.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_MUX_VIRTUAL
                                                "${PLATFORM_EC}/driver/usb_mux/virtual.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TBT_COMPAT_MODE
                                                "${PLATFORM_EC}/common/usbc/tbt_alt_mode.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_USB4
                                                "${PLATFORM_EC}/common/usbc/usb_mode.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_OCP
                                                "${PLATFORM_EC}/common/usbc_ocp.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_ALT_MODE_DFP
                                                "${PLATFORM_EC}/common/usb_pd_alt_mode_dfp.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_ALT_MODE_UFP
                                                "${PLATFORM_EC}/common/usb_pd_alt_mode_ufp.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_DUAL_ROLE
                                                "${PLATFORM_EC}/common/usb_pd_dual_role.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_HOST_CMD
                                                "${PLATFORM_EC}/common/usb_pd_host_cmd.c"
                                                "${PLATFORM_EC}/common/usbc/usb_pd_host.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_VPD "${PLATFORM_EC}/common/usbc/usb_tc_vpd_sm.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_CTVPD
                                                "${PLATFORM_EC}/common/usbc/usb_tc_ctvpd_sm.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_DRP_ACC_TRYSRC
                                                "${PLATFORM_EC}/common/usbc/usb_tc_drp_acc_trysrc_sm.c"
                                                "${PLATFORM_EC}/common/usbc/usb_pe_drp_sm.c"
                                                "${PLATFORM_EC}/common/usbc/usb_pd_dpm.c"
                                                "${PLATFORM_EC}/common/usbc/dp_alt_mode.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PRL_SM
                                                "${PLATFORM_EC}/common/usbc/usb_prl_sm.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TCPM_PS8815
                                                "${PLATFORM_EC}/driver/tcpm/ps8xxx.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TCPM_RT1715
                                                "${PLATFORM_EC}/driver/tcpm/rt1715.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TCPM_TUSB422
                                                "${PLATFORM_EC}/driver/tcpm/tusb422.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TCPM_TCPCI
                                                "${PLATFORM_EC}/driver/tcpm/tcpci.c")

zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_PPC
                                                "${PLATFORM_EC}/common/usbc_ppc.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_PPC_SN5S330
                                                "${PLATFORM_EC}/driver/ppc/sn5s330.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_PPC_SYV682X
                                                "${PLATFORM_EC}/driver/ppc/syv682x.c")

zephyr_sources_ifdef(CONFIG_SHELL               "${PLATFORM_EC}/common/gpio_commands.c")

{'fraction_non_alphanumeric': 0.08195075096053091, 'fraction_numerical': 0.007771568285015718, 'mean_word_length': 2.0982010009468417, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 230, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2720520', 'n_tokens_mistral': 7081, 'n_tokens_neox': 6964, 'n_words': 859}