summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-11-14 14:48:22 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-16 10:50:30 +0000
commit5ddb5d2ea879164a420fb7f4335d5c9d12fdf6cd (patch)
tree3d74eb966fc1b667a0cb38c95038343a56b6ee93
parent2bbef559d259197864a6610b04d2745274f47315 (diff)
downloadchrome-ec-5ddb5d2ea879164a420fb7f4335d5c9d12fdf6cd.tar.gz
zephyr/shim: Sort header files
Sort all headers in zephyr/test with the clang-format rules used by the zephyr project. BRANCH=None BUG=b:247100970 TEST=CQ Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I5fefbad560d33e2e8be1b02d0db618a19fdd403d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4024019 Reviewed-by: Tomasz Michalec <tmichalec@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r--zephyr/shim/chip/it8xxx2/clock.c7
-rw-r--r--zephyr/shim/chip/it8xxx2/gpio.c5
-rw-r--r--zephyr/shim/chip/it8xxx2/keyboard_raw.c9
-rw-r--r--zephyr/shim/chip/it8xxx2/power_policy.c7
-rw-r--r--zephyr/shim/chip/mchp/clock.c7
-rw-r--r--zephyr/shim/chip/mchp/gpio.c3
-rw-r--r--zephyr/shim/chip/mchp/keyboard_raw.c9
-rw-r--r--zephyr/shim/chip/mchp/system.c6
-rw-r--r--zephyr/shim/chip/mchp/system_download_from_flash.c7
-rw-r--r--zephyr/shim/chip/mchp/system_external_storage.c11
-rw-r--r--zephyr/shim/chip/npcx/clock.c7
-rw-r--r--zephyr/shim/chip/npcx/gpio.c11
-rw-r--r--zephyr/shim/chip/npcx/keyboard_raw.c9
-rw-r--r--zephyr/shim/chip/npcx/npcx_monitor/npcx_monitor.c6
-rw-r--r--zephyr/shim/chip/npcx/power_policy.c9
-rw-r--r--zephyr/shim/chip/npcx/shi.c15
-rw-r--r--zephyr/shim/chip/npcx/system.c6
-rw-r--r--zephyr/shim/chip/npcx/system_download_from_flash.c9
-rw-r--r--zephyr/shim/chip/npcx/system_external_storage.c6
-rw-r--r--zephyr/shim/core/cortex-m/irq_command.c3
-rw-r--r--zephyr/shim/core/cortex-m/mpu.c7
-rw-r--r--zephyr/shim/include/charger/chg_isl923x.h3
-rw-r--r--zephyr/shim/include/charger/chg_isl9241.h3
-rw-r--r--zephyr/shim/include/charger/chg_rt9490.h3
-rw-r--r--zephyr/shim/include/charger/chg_sm5803.h3
-rw-r--r--zephyr/shim/include/charger_chips.h1
-rw-r--r--zephyr/shim/include/config_chip.h1
-rw-r--r--zephyr/shim/include/cros_cbi.h2
-rw-r--r--zephyr/shim/include/motionsense_sensors.h3
-rw-r--r--zephyr/shim/include/motionsense_sensors_defs.h4
-rw-r--r--zephyr/shim/include/temp_sensor/temp_sensor.h5
-rw-r--r--zephyr/shim/include/usbc/ppc.h7
-rw-r--r--zephyr/shim/include/usbc/tcpc_anx7447.h3
-rw-r--r--zephyr/shim/include/usbc/tcpc_anx7447_emul.h3
-rw-r--r--zephyr/shim/include/usbc/tcpc_ccgxxf.h3
-rw-r--r--zephyr/shim/include/usbc/tcpc_fusb302.h3
-rw-r--r--zephyr/shim/include/usbc/tcpc_generic_emul.h4
-rw-r--r--zephyr/shim/include/usbc/tcpc_it8xxx2.h3
-rw-r--r--zephyr/shim/include/usbc/tcpc_nct38xx.h3
-rw-r--r--zephyr/shim/include/usbc/tcpc_ps8xxx.h3
-rw-r--r--zephyr/shim/include/usbc/tcpc_ps8xxx_emul.h3
-rw-r--r--zephyr/shim/include/usbc/tcpc_rt1718s.h3
-rw-r--r--zephyr/shim/include/usbc/tcpci.h4
-rw-r--r--zephyr/shim/include/usbc/usb_muxes.h5
-rw-r--r--zephyr/shim/include/zephyr_hooks_shim.h6
-rw-r--r--zephyr/shim/include/zephyr_host_command.h3
-rw-r--r--zephyr/shim/include/zephyr_shim.h3
-rw-r--r--zephyr/shim/include/zephyr_write_protect.h1
-rw-r--r--zephyr/shim/src/adc.c5
-rw-r--r--zephyr/shim/src/battery.c4
-rw-r--r--zephyr/shim/src/bb_retimer_usb_mux.c5
-rw-r--r--zephyr/shim/src/bc12.c5
-rw-r--r--zephyr/shim/src/bc12_pi3usb9201.c5
-rw-r--r--zephyr/shim/src/bc12_rt9490.c3
-rw-r--r--zephyr/shim/src/cbi/cbi_eeprom.c6
-rw-r--r--zephyr/shim/src/cbi/cros_cbi.c3
-rw-r--r--zephyr/shim/src/cbi/cros_cbi_fw_config.c4
-rw-r--r--zephyr/shim/src/cbi/cros_cbi_ssfc.c4
-rw-r--r--zephyr/shim/src/charger.c3
-rw-r--r--zephyr/shim/src/chipset_api.c3
-rw-r--r--zephyr/shim/src/chipset_state_check.h2
-rw-r--r--zephyr/shim/src/console.c7
-rw-r--r--zephyr/shim/src/console_buffer.c4
-rw-r--r--zephyr/shim/src/crc.c4
-rw-r--r--zephyr/shim/src/espi.c24
-rw-r--r--zephyr/shim/src/fan.c12
-rw-r--r--zephyr/shim/src/flash.c11
-rw-r--r--zephyr/shim/src/gpio.c2
-rw-r--r--zephyr/shim/src/gpio_int.c2
-rw-r--r--zephyr/shim/src/hooks.c11
-rw-r--r--zephyr/shim/src/host_command.c4
-rw-r--r--zephyr/shim/src/hwtimer.c5
-rw-r--r--zephyr/shim/src/i2c.c6
-rw-r--r--zephyr/shim/src/ioex.c3
-rw-r--r--zephyr/shim/src/ioex_drv.c12
-rw-r--r--zephyr/shim/src/keyboard_raw.c9
-rw-r--r--zephyr/shim/src/keyscan.c6
-rw-r--r--zephyr/shim/src/led_driver/led.c3
-rw-r--r--zephyr/shim/src/log_backend_console_buffer.c6
-rw-r--r--zephyr/shim/src/motionsense_sensors.c7
-rw-r--r--zephyr/shim/src/panic.c8
-rw-r--r--zephyr/shim/src/power.c4
-rw-r--r--zephyr/shim/src/ppc.c7
-rw-r--r--zephyr/shim/src/pwm_hc.c12
-rw-r--r--zephyr/shim/src/pwm_led.c1
-rw-r--r--zephyr/shim/src/rtc.c6
-rw-r--r--zephyr/shim/src/switchcap_gpio.c3
-rw-r--r--zephyr/shim/src/switchcap_ln9310.c5
-rw-r--r--zephyr/shim/src/system.c11
-rw-r--r--zephyr/shim/src/tasks.c12
-rw-r--r--zephyr/shim/src/tcpc.c7
-rw-r--r--zephyr/shim/src/tcpc_nct38xx.c6
-rw-r--r--zephyr/shim/src/thermal.c2
-rw-r--r--zephyr/shim/src/usb_muxes.c5
-rw-r--r--zephyr/shim/src/usba.c3
-rw-r--r--zephyr/shim/src/watchdog.c10
96 files changed, 299 insertions, 240 deletions
diff --git a/zephyr/shim/chip/it8xxx2/clock.c b/zephyr/shim/chip/it8xxx2/clock.c
index 14dbc0e7eb..a4df87dc1d 100644
--- a/zephyr/shim/chip/it8xxx2/clock.c
+++ b/zephyr/shim/chip/it8xxx2/clock.c
@@ -3,15 +3,16 @@
* found in the LICENSE file.
*/
+#include "module_id.h"
+
#include <zephyr/device.h>
#include <zephyr/drivers/clock_control.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
-#include <soc.h>
-#include <soc/ite_it8xxx2/reg_def_cros.h>
#include <zephyr/sys/util.h>
-#include "module_id.h"
+#include <soc.h>
+#include <soc/ite_it8xxx2/reg_def_cros.h>
LOG_MODULE_REGISTER(shim_clock, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/chip/it8xxx2/gpio.c b/zephyr/shim/chip/it8xxx2/gpio.c
index 7106b2a294..16eb7a3963 100644
--- a/zephyr/shim/chip/it8xxx2/gpio.c
+++ b/zephyr/shim/chip/it8xxx2/gpio.c
@@ -3,14 +3,13 @@
* found in the LICENSE file.
*/
+#include "gpio/gpio.h"
+
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/kernel.h>
-
#include <zephyr/logging/log.h>
-#include "gpio/gpio.h"
-
LOG_MODULE_REGISTER(shim_cros_gpio, LOG_LEVEL_ERR);
static const struct unused_pin_config unused_pin_configs[] = {
diff --git a/zephyr/shim/chip/it8xxx2/keyboard_raw.c b/zephyr/shim/chip/it8xxx2/keyboard_raw.c
index 0a117cda14..5fe99b7efa 100644
--- a/zephyr/shim/chip/it8xxx2/keyboard_raw.c
+++ b/zephyr/shim/chip/it8xxx2/keyboard_raw.c
@@ -5,13 +5,14 @@
/* Functions needed by keyboard scanner module for Chrome EC */
+#include "drivers/cros_kb_raw.h"
+#include "keyboard_raw.h"
+
#include <zephyr/device.h>
-#include <zephyr/logging/log.h>
-#include <soc.h>
#include <zephyr/kernel.h>
+#include <zephyr/logging/log.h>
-#include "drivers/cros_kb_raw.h"
-#include "keyboard_raw.h"
+#include <soc.h>
/**
* Return true if the current value of the given input GPIO port is zero
diff --git a/zephyr/shim/chip/it8xxx2/power_policy.c b/zephyr/shim/chip/it8xxx2/power_policy.c
index c8efb0ca96..c6e73d53a4 100644
--- a/zephyr/shim/chip/it8xxx2/power_policy.c
+++ b/zephyr/shim/chip/it8xxx2/power_policy.c
@@ -3,12 +3,13 @@
* found in the LICENSE file.
*/
+#include "system.h"
+
+#include <zephyr/kernel.h>
#include <zephyr/pm/pm.h>
#include <zephyr/pm/policy.h>
-#include <soc.h>
-#include <zephyr/kernel.h>
-#include "system.h"
+#include <soc.h>
static const struct pm_state_info pm_states[] =
PM_STATE_INFO_LIST_FROM_DT_CPU(DT_NODELABEL(cpu0));
diff --git a/zephyr/shim/chip/mchp/clock.c b/zephyr/shim/chip/mchp/clock.c
index 6ee4cd931c..5fb39bfd43 100644
--- a/zephyr/shim/chip/mchp/clock.c
+++ b/zephyr/shim/chip/mchp/clock.c
@@ -3,15 +3,16 @@
* found in the LICENSE file.
*/
+#include "clock_chip.h"
+#include "module_id.h"
+
#include <zephyr/device.h>
#include <zephyr/drivers/clock_control.h>
#include <zephyr/dt-bindings/clock/mchp_xec_pcr.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
-#include <soc.h>
-#include "clock_chip.h"
-#include "module_id.h"
+#include <soc.h>
LOG_MODULE_REGISTER(shim_clock, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/chip/mchp/gpio.c b/zephyr/shim/chip/mchp/gpio.c
index 7801c6f7cc..d772a566d8 100644
--- a/zephyr/shim/chip/mchp/gpio.c
+++ b/zephyr/shim/chip/mchp/gpio.c
@@ -3,11 +3,12 @@
* found in the LICENSE file.
*/
+#include "gpio/gpio.h"
+
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
-#include "gpio/gpio.h"
LOG_MODULE_REGISTER(shim_cros_gpio, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/chip/mchp/keyboard_raw.c b/zephyr/shim/chip/mchp/keyboard_raw.c
index 95ad642d12..9183e4d7dd 100644
--- a/zephyr/shim/chip/mchp/keyboard_raw.c
+++ b/zephyr/shim/chip/mchp/keyboard_raw.c
@@ -5,13 +5,14 @@
/* Functions needed by keyboard scanner module for Chrome EC */
+#include "drivers/cros_kb_raw.h"
+#include "keyboard_raw.h"
+
#include <zephyr/device.h>
-#include <zephyr/logging/log.h>
-#include <soc.h>
#include <zephyr/kernel.h>
+#include <zephyr/logging/log.h>
-#include "drivers/cros_kb_raw.h"
-#include "keyboard_raw.h"
+#include <soc.h>
/**
* Return true if the current value of the given input GPIO port is zero
diff --git a/zephyr/shim/chip/mchp/system.c b/zephyr/shim/chip/mchp/system.c
index 35ba806533..6e5da9aa80 100644
--- a/zephyr/shim/chip/mchp/system.c
+++ b/zephyr/shim/chip/mchp/system.c
@@ -3,12 +3,12 @@
* found in the LICENSE file.
*/
-#include <zephyr/drivers/bbram.h>
-#include <zephyr/logging/log.h>
-
#include "system.h"
#include "system_chip.h"
+#include <zephyr/drivers/bbram.h>
+#include <zephyr/logging/log.h>
+
LOG_MODULE_REGISTER(shim_xec_system, LOG_LEVEL_ERR);
#define GET_BBRAM_OFS(node) DT_PROP(DT_PATH(named_bbram_regions, node), offset)
diff --git a/zephyr/shim/chip/mchp/system_download_from_flash.c b/zephyr/shim/chip/mchp/system_download_from_flash.c
index 51cdc5aab6..8f6304274f 100644
--- a/zephyr/shim/chip/mchp/system_download_from_flash.c
+++ b/zephyr/shim/chip/mchp/system_download_from_flash.c
@@ -2,13 +2,14 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include <zephyr/dt-bindings/clock/npcx_clock.h>
-#include <stdnoreturn.h>
-
#include "common.h"
#include "soc.h"
#include "system_chip.h"
+#include <zephyr/dt-bindings/clock/npcx_clock.h>
+
+#include <stdnoreturn.h>
+
/* Modules Map */
#define WDT_NODE DT_INST(0, microchip_xec_watchdog)
#define STRUCT_WDT_REG_BASE_ADDR ((struct wdt_regs *)(DT_REG_ADDR(WDT_NODE)))
diff --git a/zephyr/shim/chip/mchp/system_external_storage.c b/zephyr/shim/chip/mchp/system_external_storage.c
index 4250b05fe3..5887e045a4 100644
--- a/zephyr/shim/chip/mchp/system_external_storage.c
+++ b/zephyr/shim/chip/mchp/system_external_storage.c
@@ -3,15 +3,16 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
-#include <zephyr/drivers/bbram.h>
-#include <soc.h>
-
#include "clock_chip.h"
#include "common.h"
+#include "config_chip.h"
#include "system.h"
#include "system_chip.h"
-#include "config_chip.h"
+
+#include <zephyr/devicetree.h>
+#include <zephyr/drivers/bbram.h>
+
+#include <soc.h>
#define MCHP_ECRO_WORD 0x4F524345u /* ASCII ECRO */
#define MCHP_ECRW_WORD 0x57524345u /* ASCII ECRW */
diff --git a/zephyr/shim/chip/npcx/clock.c b/zephyr/shim/chip/npcx/clock.c
index fc483ef775..2a6fe27ef4 100644
--- a/zephyr/shim/chip/npcx/clock.c
+++ b/zephyr/shim/chip/npcx/clock.c
@@ -3,15 +3,16 @@
* found in the LICENSE file.
*/
+#include "clock_chip.h"
+#include "module_id.h"
+
#include <zephyr/device.h>
#include <zephyr/drivers/clock_control.h>
#include <zephyr/dt-bindings/clock/npcx_clock.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
-#include <soc.h>
-#include "clock_chip.h"
-#include "module_id.h"
+#include <soc.h>
LOG_MODULE_REGISTER(shim_clock, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/chip/npcx/gpio.c b/zephyr/shim/chip/npcx/gpio.c
index 850123e17b..1d51c00f61 100644
--- a/zephyr/shim/chip/npcx/gpio.c
+++ b/zephyr/shim/chip/npcx/gpio.c
@@ -3,16 +3,15 @@
* found in the LICENSE file.
*/
+#include "gpio/gpio.h"
+#include "soc_gpio.h"
+#include "util.h"
+
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/kernel.h>
-#include <zephyr/shell/shell.h>
-
#include <zephyr/logging/log.h>
-
-#include "gpio/gpio.h"
-#include "soc_gpio.h"
-#include "util.h"
+#include <zephyr/shell/shell.h>
LOG_MODULE_REGISTER(shim_cros_gpio, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/chip/npcx/keyboard_raw.c b/zephyr/shim/chip/npcx/keyboard_raw.c
index 4d43134482..1f01952ab9 100644
--- a/zephyr/shim/chip/npcx/keyboard_raw.c
+++ b/zephyr/shim/chip/npcx/keyboard_raw.c
@@ -5,15 +5,16 @@
/* Functions needed by keyboard scanner module for Chrome EC */
+#include "drivers/cros_kb_raw.h"
+#include "keyboard_raw.h"
+
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
+#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
+
#include <soc.h>
#include <soc_gpio.h>
-#include <zephyr/kernel.h>
-
-#include "drivers/cros_kb_raw.h"
-#include "keyboard_raw.h"
/**
* Return true if the current value of the given input GPIO port is zero
diff --git a/zephyr/shim/chip/npcx/npcx_monitor/npcx_monitor.c b/zephyr/shim/chip/npcx/npcx_monitor/npcx_monitor.c
index e3fecc0cbd..3062ed98a4 100644
--- a/zephyr/shim/chip/npcx/npcx_monitor/npcx_monitor.c
+++ b/zephyr/shim/chip/npcx/npcx_monitor/npcx_monitor.c
@@ -5,12 +5,14 @@
* NPCX SoC spi flash update tool - monitor firmware
*/
-#include <stdint.h>
-#include <zephyr/sys/util.h>
#include "config_chip.h"
#include "npcx_monitor.h"
#include "registers.h"
+#include <stdint.h>
+
+#include <zephyr/sys/util.h>
+
/*
* TODO(b/197162681): This was copied from chip/npcx/spiflashfw but this
* needs to be moved to Zephyr upstream
diff --git a/zephyr/shim/chip/npcx/power_policy.c b/zephyr/shim/chip/npcx/power_policy.c
index aea6e62d30..29ebcbd542 100644
--- a/zephyr/shim/chip/npcx/power_policy.c
+++ b/zephyr/shim/chip/npcx/power_policy.c
@@ -3,14 +3,15 @@
* found in the LICENSE file.
*/
+#include "console.h"
+#include "cros_version.h"
+#include "system.h"
+
#include <zephyr/kernel.h>
#include <zephyr/pm/pm.h>
#include <zephyr/pm/policy.h>
-#include <soc.h>
-#include "console.h"
-#include "cros_version.h"
-#include "system.h"
+#include <soc.h>
static const struct pm_state_info residency_info[] =
PM_STATE_INFO_LIST_FROM_DT_CPU(DT_NODELABEL(cpu0));
diff --git a/zephyr/shim/chip/npcx/shi.c b/zephyr/shim/chip/npcx/shi.c
index 8bec57252d..0cecc2c56e 100644
--- a/zephyr/shim/chip/npcx/shi.c
+++ b/zephyr/shim/chip/npcx/shi.c
@@ -5,19 +5,20 @@
/* Functions needed by Serial Host Interface module for Chrome EC */
-#include <zephyr/device.h>
-#include <zephyr/dt-bindings/clock/npcx_clock.h>
-#include <zephyr/logging/log.h>
-#include <soc.h>
-#include <zephyr/kernel.h>
-
-#include <ap_power/ap_power.h>
#include "chipset.h"
#include "drivers/cros_shi.h"
#include "hooks.h"
#include "host_command.h"
#include "system.h"
+#include <zephyr/device.h>
+#include <zephyr/dt-bindings/clock/npcx_clock.h>
+#include <zephyr/kernel.h>
+#include <zephyr/logging/log.h>
+
+#include <ap_power/ap_power.h>
+#include <soc.h>
+
LOG_MODULE_REGISTER(shim_cros_shi, LOG_LEVEL_DBG);
#define SHI_NODE DT_NODELABEL(shi)
diff --git a/zephyr/shim/chip/npcx/system.c b/zephyr/shim/chip/npcx/system.c
index 2240acea54..1fbdca0803 100644
--- a/zephyr/shim/chip/npcx/system.c
+++ b/zephyr/shim/chip/npcx/system.c
@@ -3,12 +3,12 @@
* found in the LICENSE file.
*/
-#include <zephyr/drivers/bbram.h>
-#include <zephyr/logging/log.h>
-
#include "system.h"
#include "system_chip.h"
+#include <zephyr/drivers/bbram.h>
+#include <zephyr/logging/log.h>
+
LOG_MODULE_REGISTER(shim_npcx_system, LOG_LEVEL_ERR);
static void chip_bbram_status_check(void)
diff --git a/zephyr/shim/chip/npcx/system_download_from_flash.c b/zephyr/shim/chip/npcx/system_download_from_flash.c
index 1aef9560d1..53e22d4839 100644
--- a/zephyr/shim/chip/npcx/system_download_from_flash.c
+++ b/zephyr/shim/chip/npcx/system_download_from_flash.c
@@ -2,14 +2,15 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include <zephyr/dt-bindings/clock/npcx_clock.h>
-#include <stdnoreturn.h>
-#include <zephyr/sys/__assert.h>
-
#include "common.h"
#include "soc.h"
#include "system_chip.h"
+#include <zephyr/dt-bindings/clock/npcx_clock.h>
+#include <zephyr/sys/__assert.h>
+
+#include <stdnoreturn.h>
+
/* Modules Map */
#define NPCX_PMC_BASE_ADDR 0x4000D000
#define NPCX_GDMA_BASE_ADDR 0x40011000
diff --git a/zephyr/shim/chip/npcx/system_external_storage.c b/zephyr/shim/chip/npcx/system_external_storage.c
index 81e1968cf4..d3b2d26362 100644
--- a/zephyr/shim/chip/npcx/system_external_storage.c
+++ b/zephyr/shim/chip/npcx/system_external_storage.c
@@ -3,15 +3,15 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
-#include <zephyr/drivers/syscon.h>
-
#include "clock_chip.h"
#include "common.h"
#include "rom_chip.h"
#include "system.h"
#include "system_chip.h"
+#include <zephyr/devicetree.h>
+#include <zephyr/drivers/syscon.h>
+
/* TODO (b:179900857) Make this implementation not npcx specific. */
static const struct device *mdc_dev = DEVICE_DT_GET(DT_NODELABEL(mdc));
diff --git a/zephyr/shim/core/cortex-m/irq_command.c b/zephyr/shim/core/cortex-m/irq_command.c
index 1cf1a213e4..651f804800 100644
--- a/zephyr/shim/core/cortex-m/irq_command.c
+++ b/zephyr/shim/core/cortex-m/irq_command.c
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/arch/arm/aarch32/cortex_m/cmsis.h>
#include "console.h"
+#include <zephyr/arch/arm/aarch32/cortex_m/cmsis.h>
+
/* IRQ counters */
int irq_count[CONFIG_NUM_IRQS];
diff --git a/zephyr/shim/core/cortex-m/mpu.c b/zephyr/shim/core/cortex-m/mpu.c
index 8025227700..601961225c 100644
--- a/zephyr/shim/core/cortex-m/mpu.c
+++ b/zephyr/shim/core/cortex-m/mpu.c
@@ -3,13 +3,12 @@
* found in the LICENSE file.
*/
-#include <zephyr/arch/arm/aarch32/cortex_m/cmsis.h>
-#include <zephyr/arch/cpu.h>
-#include <zephyr/init.h>
-
#include "config.h"
#include "mpu.h"
+#include <zephyr/arch/arm/aarch32/cortex_m/cmsis.h>
+#include <zephyr/arch/cpu.h>
+#include <zephyr/init.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(shim_mpu, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/include/charger/chg_isl923x.h b/zephyr/shim/include/charger/chg_isl923x.h
index b0323cd1b8..9156e574de 100644
--- a/zephyr/shim/include/charger/chg_isl923x.h
+++ b/zephyr/shim/include/charger/chg_isl923x.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "driver/charger/isl923x_public.h"
+#include <zephyr/devicetree.h>
+
#define ISL923X_CHG_COMPAT intersil_isl923x
#define ISL923X_EMUL_COMPAT cros_isl923x_emul
diff --git a/zephyr/shim/include/charger/chg_isl9241.h b/zephyr/shim/include/charger/chg_isl9241.h
index 711a581c2f..c6d2239038 100644
--- a/zephyr/shim/include/charger/chg_isl9241.h
+++ b/zephyr/shim/include/charger/chg_isl9241.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "driver/charger/isl9241_public.h"
+#include <zephyr/devicetree.h>
+
#define ISL9241_CHG_COMPAT intersil_isl9241
#define CHG_CONFIG_ISL9241(id) \
diff --git a/zephyr/shim/include/charger/chg_rt9490.h b/zephyr/shim/include/charger/chg_rt9490.h
index 3ac596d482..44d81eac48 100644
--- a/zephyr/shim/include/charger/chg_rt9490.h
+++ b/zephyr/shim/include/charger/chg_rt9490.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "driver/charger/rt9490.h"
+#include <zephyr/devicetree.h>
+
#define RT9490_CHG_COMPAT richtek_rt9490
#define RT9490_EMUL_COMPAT zephyr_rt9490_emul
diff --git a/zephyr/shim/include/charger/chg_sm5803.h b/zephyr/shim/include/charger/chg_sm5803.h
index 65ef066970..853dd06a63 100644
--- a/zephyr/shim/include/charger/chg_sm5803.h
+++ b/zephyr/shim/include/charger/chg_sm5803.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "driver/charger/sm5803.h"
+#include <zephyr/devicetree.h>
+
#define SM5803_CHG_COMPAT siliconmitus_sm5803
#define CHG_CONFIG_SM5803(id) \
diff --git a/zephyr/shim/include/charger_chips.h b/zephyr/shim/include/charger_chips.h
index b24fa246bf..503a53330d 100644
--- a/zephyr/shim/include/charger_chips.h
+++ b/zephyr/shim/include/charger_chips.h
@@ -7,6 +7,7 @@
#define __CROS_EC_CHARGER_CHIPS_H
#include "charger.h"
+
#include <zephyr/devicetree.h>
extern const struct charger_config_t chg_chips_alt[];
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 7f56d9c342..7b3abce82e 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -15,6 +15,7 @@
#line 16
#include <zephyr/devicetree.h>
+
#include <autoconf.h>
#define SENSOR_NODE DT_PATH(motionsense_sensor)
diff --git a/zephyr/shim/include/cros_cbi.h b/zephyr/shim/include/cros_cbi.h
index 6f5bfd4d70..603be590c1 100644
--- a/zephyr/shim/include/cros_cbi.h
+++ b/zephyr/shim/include/cros_cbi.h
@@ -6,9 +6,9 @@
#ifndef __CROS_EC_CROS_CBI_H
#define __CROS_EC_CROS_CBI_H
-#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
+#include <zephyr/kernel.h>
/*
* Macros are _INST_ types, so require DT_DRV_COMPAT to be defined.
diff --git a/zephyr/shim/include/motionsense_sensors.h b/zephyr/shim/include/motionsense_sensors.h
index e00eae426e..f83a8c63ad 100644
--- a/zephyr/shim/include/motionsense_sensors.h
+++ b/zephyr/shim/include/motionsense_sensors.h
@@ -6,9 +6,10 @@
#ifndef __CROS_EC_MOTIONSENSE_SENSORS_H
#define __CROS_EC_MOTIONSENSE_SENSORS_H
-#include <zephyr/devicetree.h>
#include "motion_sense.h"
+#include <zephyr/devicetree.h>
+
extern struct motion_sensor_t motion_sensors_alt[];
/*
diff --git a/zephyr/shim/include/motionsense_sensors_defs.h b/zephyr/shim/include/motionsense_sensors_defs.h
index ac0fc6bf56..b4b0274237 100644
--- a/zephyr/shim/include/motionsense_sensors_defs.h
+++ b/zephyr/shim/include/motionsense_sensors_defs.h
@@ -6,10 +6,10 @@
#ifndef __CROS_EC_MOTIONSENSE_SENSORS_DEFS_H
#define __CROS_EC_MOTIONSENSE_SENSORS_DEFS_H
-#include <zephyr/devicetree.h>
-
#include "common.h"
+#include <zephyr/devicetree.h>
+
#define SENSOR_ID(id) DT_CAT(SENSOR_, id)
/* Define the SENSOR_ID if:
diff --git a/zephyr/shim/include/temp_sensor/temp_sensor.h b/zephyr/shim/include/temp_sensor/temp_sensor.h
index a6cdfb5524..c4770ce767 100644
--- a/zephyr/shim/include/temp_sensor/temp_sensor.h
+++ b/zephyr/shim/include/temp_sensor/temp_sensor.h
@@ -6,9 +6,10 @@
#ifndef ZEPHYR_SHIM_INCLUDE_TEMP_SENSOR_TEMP_SENSOR_H_
#define ZEPHYR_SHIM_INCLUDE_TEMP_SENSOR_TEMP_SENSOR_H_
-#include <zephyr/devicetree.h>
-#include "include/temp_sensor.h"
#include "charger/chg_rt9490.h"
+#include "include/temp_sensor.h"
+
+#include <zephyr/devicetree.h>
#ifdef CONFIG_PLATFORM_EC_TEMP_SENSOR
diff --git a/zephyr/shim/include/usbc/ppc.h b/zephyr/shim/include/usbc/ppc.h
index 28e518a3ef..fa38145f66 100644
--- a/zephyr/shim/include/usbc/ppc.h
+++ b/zephyr/shim/include/usbc/ppc.h
@@ -6,15 +6,16 @@
#ifndef ZEPHYR_CHROME_USBC_PPC_H
#define ZEPHYR_CHROME_USBC_PPC_H
-#include <zephyr/device.h>
-#include <zephyr/devicetree.h>
-#include "usbc/ppc_rt1739.h"
#include "usbc/ppc_nx20p348x.h"
+#include "usbc/ppc_rt1739.h"
#include "usbc/ppc_sn5s330.h"
#include "usbc/ppc_syv682x.h"
#include "usbc/utils.h"
#include "usbc_ppc.h"
+#include <zephyr/device.h>
+#include <zephyr/devicetree.h>
+
extern struct ppc_config_t ppc_chips_alt[];
#define ALT_PPC_CHIP_CHK(usbc_id, usb_port_num) \
diff --git a/zephyr/shim/include/usbc/tcpc_anx7447.h b/zephyr/shim/include/usbc/tcpc_anx7447.h
index b45e03393c..89076c8c49 100644
--- a/zephyr/shim/include/usbc/tcpc_anx7447.h
+++ b/zephyr/shim/include/usbc/tcpc_anx7447.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "tcpm/anx7447_public.h"
+#include <zephyr/devicetree.h>
+
#define ANX7447_TCPC_COMPAT analogix_anx7447_tcpc
#define TCPC_CONFIG_ANX7447(id) \
diff --git a/zephyr/shim/include/usbc/tcpc_anx7447_emul.h b/zephyr/shim/include/usbc/tcpc_anx7447_emul.h
index 78322a7329..f8ca60de6e 100644
--- a/zephyr/shim/include/usbc/tcpc_anx7447_emul.h
+++ b/zephyr/shim/include/usbc/tcpc_anx7447_emul.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "driver/tcpm/anx7447_public.h"
+#include <zephyr/devicetree.h>
+
#define ANX7447_EMUL_COMPAT cros_anx7447_emul
#define TCPC_CONFIG_ANX7447_EMUL(id) \
diff --git a/zephyr/shim/include/usbc/tcpc_ccgxxf.h b/zephyr/shim/include/usbc/tcpc_ccgxxf.h
index 0c02cf6846..fb7bdcabcf 100644
--- a/zephyr/shim/include/usbc/tcpc_ccgxxf.h
+++ b/zephyr/shim/include/usbc/tcpc_ccgxxf.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "driver/tcpm/ccgxxf.h"
+#include <zephyr/devicetree.h>
+
#define CCGXXF_TCPC_COMPAT cypress_ccgxxf
#define TCPC_CONFIG_CCGXXF(id) \
diff --git a/zephyr/shim/include/usbc/tcpc_fusb302.h b/zephyr/shim/include/usbc/tcpc_fusb302.h
index a2e512d938..fa309051cd 100644
--- a/zephyr/shim/include/usbc/tcpc_fusb302.h
+++ b/zephyr/shim/include/usbc/tcpc_fusb302.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "driver/tcpm/fusb302.h"
+#include <zephyr/devicetree.h>
+
#define FUSB302_TCPC_COMPAT fairchild_fusb302
#define TCPC_CONFIG_FUSB302(id) \
diff --git a/zephyr/shim/include/usbc/tcpc_generic_emul.h b/zephyr/shim/include/usbc/tcpc_generic_emul.h
index 7dc46c51ba..9000dfdf20 100644
--- a/zephyr/shim/include/usbc/tcpc_generic_emul.h
+++ b/zephyr/shim/include/usbc/tcpc_generic_emul.h
@@ -3,10 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
-
#include "driver/tcpm/tcpci.h"
+#include <zephyr/devicetree.h>
+
#define TCPCI_EMUL_COMPAT cros_tcpci_generic_emul
#define TCPC_CONFIG_TCPCI_EMUL(id) \
diff --git a/zephyr/shim/include/usbc/tcpc_it8xxx2.h b/zephyr/shim/include/usbc/tcpc_it8xxx2.h
index c619656667..b9084782e0 100644
--- a/zephyr/shim/include/usbc/tcpc_it8xxx2.h
+++ b/zephyr/shim/include/usbc/tcpc_it8xxx2.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "driver/tcpm/it8xxx2_pd_public.h"
+#include <zephyr/devicetree.h>
+
#define IT8XXX2_TCPC_COMPAT ite_it8xxx2_usbpd
#define TCPC_CONFIG_IT8XXX2(id) \
diff --git a/zephyr/shim/include/usbc/tcpc_nct38xx.h b/zephyr/shim/include/usbc/tcpc_nct38xx.h
index 87ba3379c8..7a0752904e 100644
--- a/zephyr/shim/include/usbc/tcpc_nct38xx.h
+++ b/zephyr/shim/include/usbc/tcpc_nct38xx.h
@@ -6,9 +6,10 @@
#ifndef __CROS_EC_TCPC_NCT38XX_H
#define __CROS_EC_TCPC_NCT38XX_H
-#include <zephyr/devicetree.h>
#include "driver/tcpm/nct38xx.h"
+#include <zephyr/devicetree.h>
+
#define NCT38XX_TCPC_COMPAT nuvoton_nct38xx
#define TCPC_CONFIG_NCT38XX(id) \
diff --git a/zephyr/shim/include/usbc/tcpc_ps8xxx.h b/zephyr/shim/include/usbc/tcpc_ps8xxx.h
index 1a457af09b..7d3b9c6ccc 100644
--- a/zephyr/shim/include/usbc/tcpc_ps8xxx.h
+++ b/zephyr/shim/include/usbc/tcpc_ps8xxx.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "driver/tcpm/ps8xxx_public.h"
+#include <zephyr/devicetree.h>
+
#define PS8XXX_COMPAT parade_ps8xxx
#define TCPC_CONFIG_PS8XXX(id) \
diff --git a/zephyr/shim/include/usbc/tcpc_ps8xxx_emul.h b/zephyr/shim/include/usbc/tcpc_ps8xxx_emul.h
index fbd2e4bfd1..b1ea6f1705 100644
--- a/zephyr/shim/include/usbc/tcpc_ps8xxx_emul.h
+++ b/zephyr/shim/include/usbc/tcpc_ps8xxx_emul.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "driver/tcpm/ps8xxx_public.h"
+#include <zephyr/devicetree.h>
+
#define PS8XXX_EMUL_COMPAT cros_ps8xxx_emul
#define TCPC_CONFIG_PS8XXX_EMUL(id) \
diff --git a/zephyr/shim/include/usbc/tcpc_rt1718s.h b/zephyr/shim/include/usbc/tcpc_rt1718s.h
index 794fb99480..861b474ecf 100644
--- a/zephyr/shim/include/usbc/tcpc_rt1718s.h
+++ b/zephyr/shim/include/usbc/tcpc_rt1718s.h
@@ -3,9 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
#include "tcpm/rt1718s_public.h"
+#include <zephyr/devicetree.h>
+
#define RT1718S_TCPC_COMPAT richtek_rt1718s_tcpc
#define TCPC_CONFIG_RT1718S(id) \
diff --git a/zephyr/shim/include/usbc/tcpci.h b/zephyr/shim/include/usbc/tcpci.h
index 67138dbe99..15cea4b332 100644
--- a/zephyr/shim/include/usbc/tcpci.h
+++ b/zephyr/shim/include/usbc/tcpci.h
@@ -3,10 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
-
#include "driver/tcpm/tcpci.h"
+#include <zephyr/devicetree.h>
+
#define TCPCI_COMPAT cros_ec_tcpci
#define TCPC_CONFIG_TCPCI(id) \
diff --git a/zephyr/shim/include/usbc/usb_muxes.h b/zephyr/shim/include/usbc/usb_muxes.h
index 132ce77e91..6ee9c691a8 100644
--- a/zephyr/shim/include/usbc/usb_muxes.h
+++ b/zephyr/shim/include/usbc/usb_muxes.h
@@ -6,8 +6,6 @@
#ifndef ZEPHYR_CHROME_USBC_USB_MUXES_H
#define ZEPHYR_CHROME_USBC_USB_MUXES_H
-#include <zephyr/devicetree.h>
-#include <zephyr/sys/util_macro.h>
#include "usb_mux.h"
#include "usbc/amd_fp6_usb_mux.h"
#include "usbc/anx7447_usb_mux.h"
@@ -21,6 +19,9 @@
#include "usbc/utils.h"
#include "usbc/virtual_usb_mux.h"
+#include <zephyr/devicetree.h>
+#include <zephyr/sys/util_macro.h>
+
/**
* @brief List of USB mux drivers compatibles and their configurations. Each
* element of list has to have (compatible, config) format.
diff --git a/zephyr/shim/include/zephyr_hooks_shim.h b/zephyr/shim/include/zephyr_hooks_shim.h
index f3949787bd..f1c25c6e8f 100644
--- a/zephyr/shim/include/zephyr_hooks_shim.h
+++ b/zephyr/shim/include/zephyr_hooks_shim.h
@@ -8,12 +8,12 @@
#endif
#define __CROS_EC_ZEPHYR_HOOKS_SHIM_H
-#include <zephyr/init.h>
-#include <zephyr/kernel.h>
-
#include "common.h"
#include "cros_version.h"
+#include <zephyr/init.h>
+#include <zephyr/kernel.h>
+
/**
* The internal data structure stored for a deferred function.
*/
diff --git a/zephyr/shim/include/zephyr_host_command.h b/zephyr/shim/include/zephyr_host_command.h
index e2f0a7c296..9271c6c368 100644
--- a/zephyr/shim/include/zephyr_host_command.h
+++ b/zephyr/shim/include/zephyr_host_command.h
@@ -10,9 +10,10 @@
#endif
#define __CROS_EC_ZEPHYR_HOST_COMMAND_H
-#include <zephyr/init.h>
#include <stdbool.h>
+#include <zephyr/init.h>
+
/* Initializes and runs the host command handler loop. */
void host_command_task(void *u);
diff --git a/zephyr/shim/include/zephyr_shim.h b/zephyr/shim/include/zephyr_shim.h
index 3e12568155..dce1706c5b 100644
--- a/zephyr/shim/include/zephyr_shim.h
+++ b/zephyr/shim/include/zephyr_shim.h
@@ -6,9 +6,10 @@
#ifndef __BOARD_H
#define __BOARD_H
-#include <zephyr/devicetree.h>
#include "common.h"
+#include <zephyr/devicetree.h>
+
/* Included shimed version of gpio signal. */
#include "gpio_signal.h"
diff --git a/zephyr/shim/include/zephyr_write_protect.h b/zephyr/shim/include/zephyr_write_protect.h
index 227af16bd0..59a305a0f9 100644
--- a/zephyr/shim/include/zephyr_write_protect.h
+++ b/zephyr/shim/include/zephyr_write_protect.h
@@ -8,6 +8,7 @@
#include "gpio/gpio_int.h"
#include "gpio_signal.h"
+
#include <zephyr/drivers/gpio.h>
/**
diff --git a/zephyr/shim/src/adc.c b/zephyr/shim/src/adc.c
index 9d5e64376c..b448823eee 100644
--- a/zephyr/shim/src/adc.c
+++ b/zephyr/shim/src/adc.c
@@ -3,11 +3,12 @@
* found in the LICENSE file.
*/
+#include "adc.h"
+#include "zephyr_adc.h"
+
#include <zephyr/devicetree/io-channels.h>
#include <zephyr/drivers/adc.h>
#include <zephyr/logging/log.h>
-#include "adc.h"
-#include "zephyr_adc.h"
LOG_MODULE_REGISTER(shim_adc, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/src/battery.c b/zephyr/shim/src/battery.c
index 98c0877770..c70610a9e9 100644
--- a/zephyr/shim/src/battery.c
+++ b/zephyr/shim/src/battery.c
@@ -3,10 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
-
#include "battery_fuel_gauge.h"
+#include <zephyr/devicetree.h>
+
#define NODE_FUEL_GAUGE(node) \
{ \
.manuf_name = DT_PROP(node, manuf_name), \
diff --git a/zephyr/shim/src/bb_retimer_usb_mux.c b/zephyr/shim/src/bb_retimer_usb_mux.c
index 638a961ed1..2f45a5ee0f 100644
--- a/zephyr/shim/src/bb_retimer_usb_mux.c
+++ b/zephyr/shim/src/bb_retimer_usb_mux.c
@@ -3,11 +3,12 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
-#include <zephyr/sys/util_macro.h>
#include "usb_mux.h"
#include "usbc/usb_muxes.h"
+#include <zephyr/devicetree.h>
+#include <zephyr/sys/util_macro.h>
+
/**
* This prevents creating struct usb_mux bb_controls[] for platforms that didn't
* migrate USB mux configuration to DTS yet.
diff --git a/zephyr/shim/src/bc12.c b/zephyr/shim/src/bc12.c
index 6542a166eb..12b45d2197 100644
--- a/zephyr/shim/src/bc12.c
+++ b/zephyr/shim/src/bc12.c
@@ -3,14 +3,15 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
+#include "usb_charge.h"
#include "usbc/bc12_pi3usb9201.h"
#include "usbc/bc12_rt1718s.h"
#include "usbc/bc12_rt1739.h"
#include "usbc/bc12_rt9490.h"
#include "usbc/tcpc_rt1718s.h"
#include "usbc/utils.h"
-#include "usb_charge.h"
+
+#include <zephyr/devicetree.h>
#if DT_HAS_COMPAT_STATUS_OKAY(RT1718S_BC12_COMPAT) || \
DT_HAS_COMPAT_STATUS_OKAY(RT1739_BC12_COMPAT) || \
diff --git a/zephyr/shim/src/bc12_pi3usb9201.c b/zephyr/shim/src/bc12_pi3usb9201.c
index cd79e8d4bd..d41fcc3212 100644
--- a/zephyr/shim/src/bc12_pi3usb9201.c
+++ b/zephyr/shim/src/bc12_pi3usb9201.c
@@ -5,15 +5,16 @@
#define DT_DRV_COMPAT pericom_pi3usb9201
-#include <zephyr/devicetree.h>
#include "bc12/pi3usb9201_public.h"
#include "gpio/gpio_int.h"
#include "hooks.h"
+#include "i2c/i2c.h"
#include "task.h"
#include "usb_charge.h"
#include "usb_pd.h"
#include "usbc/utils.h"
-#include "i2c/i2c.h"
+
+#include <zephyr/devicetree.h>
#define USBC_PORT_BC12(usbc_id, bc12_id) \
[USBC_PORT_NEW(usbc_id)] = { \
diff --git a/zephyr/shim/src/bc12_rt9490.c b/zephyr/shim/src/bc12_rt9490.c
index df10fb5570..0b30a5d2da 100644
--- a/zephyr/shim/src/bc12_rt9490.c
+++ b/zephyr/shim/src/bc12_rt9490.c
@@ -5,12 +5,13 @@
#define DT_DRV_COMPAT richtek_rt9490_bc12
-#include <zephyr/devicetree.h>
#include "driver/charger/rt9490.h"
#include "gpio/gpio_int.h"
#include "hooks.h"
#include "usbc/utils.h"
+#include <zephyr/devicetree.h>
+
#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT)
static void rt9490_bc12_enable_irqs(void)
diff --git a/zephyr/shim/src/cbi/cbi_eeprom.c b/zephyr/shim/src/cbi/cbi_eeprom.c
index 652c76f959..9cd0d0a955 100644
--- a/zephyr/shim/src/cbi/cbi_eeprom.c
+++ b/zephyr/shim/src/cbi/cbi_eeprom.c
@@ -3,13 +3,13 @@
* found in the LICENSE file.
*/
-#include <zephyr/drivers/eeprom.h>
-#include <zephyr/drivers/gpio.h>
-
#include "console.h"
#include "cros_board_info.h"
#include "write_protect.h"
+#include <zephyr/drivers/eeprom.h>
+#include <zephyr/drivers/gpio.h>
+
#define CBI_EEPROM_NODE DT_NODELABEL(cbi_eeprom)
BUILD_ASSERT(DT_NODE_EXISTS(CBI_EEPROM_NODE), "cbi_eeprom node not defined");
diff --git a/zephyr/shim/src/cbi/cros_cbi.c b/zephyr/shim/src/cbi/cros_cbi.c
index 5b90f9442d..e6fa3e8cd1 100644
--- a/zephyr/shim/src/cbi/cros_cbi.c
+++ b/zephyr/shim/src/cbi/cros_cbi.c
@@ -3,9 +3,8 @@
* found in the LICENSE file.
*/
-#include "cros_cbi.h"
-
#include "cros_board_info.h"
+#include "cros_cbi.h"
#include "hooks.h"
static void cros_cbi_ec_init(void)
diff --git a/zephyr/shim/src/cbi/cros_cbi_fw_config.c b/zephyr/shim/src/cbi/cros_cbi_fw_config.c
index 605c7ca0f7..8f6086eb58 100644
--- a/zephyr/shim/src/cbi/cros_cbi_fw_config.c
+++ b/zephyr/shim/src/cbi/cros_cbi_fw_config.c
@@ -3,11 +3,11 @@
* found in the LICENSE file.
*/
-#include <zephyr/logging/log.h>
-
#include "cros_board_info.h"
#include "cros_cbi.h"
+#include <zephyr/logging/log.h>
+
LOG_MODULE_REGISTER(cros_cbi_fw_config, LOG_LEVEL_ERR);
/*
diff --git a/zephyr/shim/src/cbi/cros_cbi_ssfc.c b/zephyr/shim/src/cbi/cros_cbi_ssfc.c
index 9158e9f215..f20ca457f4 100644
--- a/zephyr/shim/src/cbi/cros_cbi_ssfc.c
+++ b/zephyr/shim/src/cbi/cros_cbi_ssfc.c
@@ -3,11 +3,11 @@
* found in the LICENSE file.
*/
-#include <zephyr/logging/log.h>
-
#include "cros_board_info.h"
#include "cros_cbi.h"
+#include <zephyr/logging/log.h>
+
LOG_MODULE_REGISTER(cros_cbi_ssfc, LOG_LEVEL_ERR);
/* Actually, two "compatible" values are handle here - cros_ec_cbi_ssfc_value
diff --git a/zephyr/shim/src/charger.c b/zephyr/shim/src/charger.c
index 35ede5a8f7..9d6021ad7d 100644
--- a/zephyr/shim/src/charger.c
+++ b/zephyr/shim/src/charger.c
@@ -4,7 +4,6 @@
*/
#include "charger.h"
-#include <zephyr/devicetree.h>
#include "charger/chg_bq25710.h"
#include "charger/chg_isl923x.h"
#include "charger/chg_isl9241.h"
@@ -12,6 +11,8 @@
#include "charger/chg_sm5803.h"
#include "usbc/utils.h"
+#include <zephyr/devicetree.h>
+
#define CHG_CHIP_ENTRY(usbc_id, chg_id, config_fn) \
[USBC_PORT_NEW(usbc_id)] = config_fn(chg_id)
diff --git a/zephyr/shim/src/chipset_api.c b/zephyr/shim/src/chipset_api.c
index 6c48719a7f..925d13f6e1 100644
--- a/zephyr/shim/src/chipset_api.c
+++ b/zephyr/shim/src/chipset_api.c
@@ -5,10 +5,9 @@
/* Chipset interface APIs */
-#include "common.h"
-
#include "ap_power/ap_power_interface.h"
#include "chipset_state_check.h"
+#include "common.h"
int chipset_in_state(int state_mask)
{
diff --git a/zephyr/shim/src/chipset_state_check.h b/zephyr/shim/src/chipset_state_check.h
index 2d10b2ce4a..c33a3f9553 100644
--- a/zephyr/shim/src/chipset_state_check.h
+++ b/zephyr/shim/src/chipset_state_check.h
@@ -6,8 +6,8 @@
#ifndef __CHIPSET_STATE_CHECK_H__
#define __CHIPSET_STATE_CHECK_H__
-#include "chipset.h"
#include "ap_power/ap_power_interface.h"
+#include "chipset.h"
BUILD_ASSERT((int)AP_POWER_STATE_HARD_OFF == (int)CHIPSET_STATE_HARD_OFF);
BUILD_ASSERT((int)AP_POWER_STATE_SOFT_OFF == (int)CHIPSET_STATE_SOFT_OFF);
diff --git a/zephyr/shim/src/console.c b/zephyr/shim/src/console.c
index 4ac8e249cb..7bc8990789 100644
--- a/zephyr/shim/src/console.c
+++ b/zephyr/shim/src/console.c
@@ -9,13 +9,14 @@
#ifdef CONFIG_SHELL_BACKEND_DUMMY /* nocheck */
#include <zephyr/shell/shell_dummy.h> /* nocheck */
#endif
-#include <zephyr/shell/shell_uart.h>
#include <stdbool.h>
#include <string.h>
-#include <zephyr/sys/printk.h>
-#include <zephyr/sys/ring_buffer.h>
+
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
+#include <zephyr/shell/shell_uart.h>
+#include <zephyr/sys/printk.h>
+#include <zephyr/sys/ring_buffer.h>
/*
* TODO(b/238433667): Include EC printf functions
diff --git a/zephyr/shim/src/console_buffer.c b/zephyr/shim/src/console_buffer.c
index dad0031267..f5e80b2d20 100644
--- a/zephyr/shim/src/console_buffer.c
+++ b/zephyr/shim/src/console_buffer.c
@@ -3,12 +3,12 @@
* found in the LICENSE file.
*/
-#include <zephyr/kernel.h>
-
#include "common.h"
#include "console.h"
#include "ec_commands.h"
+#include <zephyr/kernel.h>
+
static char console_buf[CONFIG_PLATFORM_EC_HOSTCMD_CONSOLE_BUF_SIZE];
static uint32_t previous_snapshot_idx;
static uint32_t current_snapshot_idx;
diff --git a/zephyr/shim/src/crc.c b/zephyr/shim/src/crc.c
index f8ce335029..1e98c1cf3f 100644
--- a/zephyr/shim/src/crc.c
+++ b/zephyr/shim/src/crc.c
@@ -3,10 +3,10 @@
* found in the LICENSE file.
*/
-#include <zephyr/sys/crc.h>
-
#include "crc8.h"
+#include <zephyr/sys/crc.h>
+
/* Polynomial representation for x^8 + x^2 + x + 1 is 0x07 */
#define SMBUS_POLYNOMIAL 0x07
diff --git a/zephyr/shim/src/espi.c b/zephyr/shim/src/espi.c
index 6a8e18e262..9cc5de8f0b 100644
--- a/zephyr/shim/src/espi.c
+++ b/zephyr/shim/src/espi.c
@@ -3,17 +3,6 @@
* found in the LICENSE file.
*/
-#include <atomic.h>
-#include <zephyr/device.h>
-#include <zephyr/drivers/espi.h>
-#include <zephyr/drivers/gpio.h>
-#include <zephyr/logging/log.h>
-#include <zephyr/kernel.h>
-#include <stdint.h>
-
-#include <ap_power/ap_power.h>
-#include <ap_power/ap_power_events.h>
-#include <ap_power/ap_power_espi.h>
#include "acpi.h"
#include "chipset.h"
#include "common.h"
@@ -28,6 +17,19 @@
#include "timer.h"
#include "zephyr_espi_shim.h"
+#include <stdint.h>
+
+#include <zephyr/device.h>
+#include <zephyr/drivers/espi.h>
+#include <zephyr/drivers/gpio.h>
+#include <zephyr/kernel.h>
+#include <zephyr/logging/log.h>
+
+#include <ap_power/ap_power.h>
+#include <ap_power/ap_power_espi.h>
+#include <ap_power/ap_power_events.h>
+#include <atomic.h>
+
#define VWIRE_PULSE_TRIGGER_TIME \
CONFIG_PLATFORM_EC_HOST_INTERFACE_ESPI_DEFAULT_VW_WIDTH_US
diff --git a/zephyr/shim/src/fan.c b/zephyr/shim/src/fan.c
index a18a33beec..9bc36f878f 100644
--- a/zephyr/shim/src/fan.c
+++ b/zephyr/shim/src/fan.c
@@ -5,12 +5,6 @@
#define DT_DRV_COMPAT cros_ec_fans
-#include <zephyr/drivers/gpio.h>
-#include <zephyr/drivers/pwm.h>
-#include <zephyr/drivers/sensor.h>
-#include <zephyr/logging/log.h>
-#include <zephyr/sys/util_macro.h>
-
#include "fan.h"
#include "gpio_signal.h"
#include "hooks.h"
@@ -18,6 +12,12 @@
#include "system.h"
#include "util.h"
+#include <zephyr/drivers/gpio.h>
+#include <zephyr/drivers/pwm.h>
+#include <zephyr/drivers/sensor.h>
+#include <zephyr/logging/log.h>
+#include <zephyr/sys/util_macro.h>
+
LOG_MODULE_REGISTER(fan_shim, LOG_LEVEL_ERR);
BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1,
diff --git a/zephyr/shim/src/flash.c b/zephyr/shim/src/flash.c
index 8aa7deecf5..5b7079e450 100644
--- a/zephyr/shim/src/flash.c
+++ b/zephyr/shim/src/flash.c
@@ -3,17 +3,18 @@
* found in the LICENSE file.
*/
-#include <flash.h>
-#include <zephyr/kernel.h>
-#include <zephyr/logging/log.h>
-#include <zephyr/drivers/flash.h>
-
#include "console.h"
#include "drivers/cros_flash.h"
#include "registers.h"
#include "task.h"
#include "util.h"
+#include <zephyr/drivers/flash.h>
+#include <zephyr/kernel.h>
+#include <zephyr/logging/log.h>
+
+#include <flash.h>
+
LOG_MODULE_REGISTER(shim_flash, LOG_LEVEL_ERR);
#if !DT_HAS_CHOSEN(cros_ec_flash_controller)
diff --git a/zephyr/shim/src/gpio.c b/zephyr/shim/src/gpio.c
index d3aff5acb6..347640a7ab 100644
--- a/zephyr/shim/src/gpio.c
+++ b/zephyr/shim/src/gpio.c
@@ -11,11 +11,11 @@
#ifdef __REQUIRE_ZEPHYR_GPIOS__
#undef __REQUIRE_ZEPHYR_GPIOS__
#endif
+#include "cros_version.h"
#include "gpio.h"
#include "gpio/gpio.h"
#include "ioexpander.h"
#include "system.h"
-#include "cros_version.h"
LOG_MODULE_REGISTER(gpio_shim, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/src/gpio_int.c b/zephyr/shim/src/gpio_int.c
index 8406f3abe8..c6339b497c 100644
--- a/zephyr/shim/src/gpio_int.c
+++ b/zephyr/shim/src/gpio_int.c
@@ -11,10 +11,10 @@
#ifdef __REQUIRE_ZEPHYR_GPIOS__
#undef __REQUIRE_ZEPHYR_GPIOS__
#endif
+#include "cros_version.h"
#include "gpio.h"
#include "gpio/gpio.h"
#include "gpio/gpio_int.h"
-#include "cros_version.h"
LOG_MODULE_REGISTER(gpio_int, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/src/hooks.c b/zephyr/shim/src/hooks.c
index 3f11a578c5..b8f9b917e4 100644
--- a/zephyr/shim/src/hooks.c
+++ b/zephyr/shim/src/hooks.c
@@ -3,18 +3,19 @@
* found in the LICENSE file.
*/
-#include <zephyr/kernel.h>
-
-#include <ap_power/ap_power.h>
-#include <ap_power/ap_power_events.h>
#include "common.h"
#include "console.h"
#include "ec_tasks.h"
-#include "hooks.h"
#include "hook_types.h"
+#include "hooks.h"
#include "task.h"
#include "timer.h"
+#include <zephyr/kernel.h>
+
+#include <ap_power/ap_power.h>
+#include <ap_power/ap_power_events.h>
+
/*
* hook_registry maps each hook_type to the list of handlers for that hook type.
*
diff --git a/zephyr/shim/src/host_command.c b/zephyr/shim/src/host_command.c
index c5a51332a1..16f5ae66d8 100644
--- a/zephyr/shim/src/host_command.c
+++ b/zephyr/shim/src/host_command.c
@@ -3,11 +3,11 @@
* found in the LICENSE file.
*/
-#include <zephyr/kernel.h>
-
#include "host_command.h"
#include "task.h"
+#include <zephyr/kernel.h>
+
struct host_command *zephyr_find_host_command(int command)
{
STRUCT_SECTION_FOREACH(host_command, cmd)
diff --git a/zephyr/shim/src/hwtimer.c b/zephyr/shim/src/hwtimer.c
index d99f7a826b..cefbe4eb7f 100644
--- a/zephyr/shim/src/hwtimer.c
+++ b/zephyr/shim/src/hwtimer.c
@@ -3,10 +3,11 @@
* found in the LICENSE file.
*/
-#include <zephyr/kernel.h>
+#include "hwtimer.h"
+
#include <stdint.h>
-#include "hwtimer.h"
+#include <zephyr/kernel.h>
uint64_t __hw_clock_source_read64(void)
{
diff --git a/zephyr/shim/src/i2c.c b/zephyr/shim/src/i2c.c
index 0a9fc41397..53766f1683 100644
--- a/zephyr/shim/src/i2c.c
+++ b/zephyr/shim/src/i2c.c
@@ -3,13 +3,13 @@
* found in the LICENSE file.
*/
-#include <zephyr/sys/util.h>
-#include <zephyr/drivers/i2c.h>
-
#include "console.h"
#include "i2c.h"
#include "i2c/i2c.h"
+#include <zephyr/drivers/i2c.h>
+#include <zephyr/sys/util.h>
+
/*
* Initialize device bindings in i2c_devices.
* This macro should be called from within DT_FOREACH_CHILD.
diff --git a/zephyr/shim/src/ioex.c b/zephyr/shim/src/ioex.c
index a5d685bc48..2b8d3b2cc4 100644
--- a/zephyr/shim/src/ioex.c
+++ b/zephyr/shim/src/ioex.c
@@ -3,10 +3,11 @@
* found in the LICENSE file.
*/
+#include "common.h"
+
#include <zephyr/init.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
-#include "common.h"
#ifdef __REQUIRE_ZEPHYR_GPIOS__
#undef __REQUIRE_ZEPHYR_GPIOS__
#endif
diff --git a/zephyr/shim/src/ioex_drv.c b/zephyr/shim/src/ioex_drv.c
index 3baa4777fd..0f1db5eb31 100644
--- a/zephyr/shim/src/ioex_drv.c
+++ b/zephyr/shim/src/ioex_drv.c
@@ -6,24 +6,26 @@
#define DT_DRV_COMPAT cros_ioex_port
#define DT_DRV_COMPAT_CHIP cros_ioex_chip
+#include <errno.h>
+
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/i2c.h>
-#include <errno.h>
#ifdef __REQUIRE_ZEPHYR_GPIOS__
#undef __REQUIRE_ZEPHYR_GPIOS__
#endif
+#include "common.h"
+#include "config.h"
#include "gpio.h"
+#include "i2c.h"
+#include "ioexpander.h"
+
#include <zephyr/drivers/gpio/gpio_utils.h>
#include <zephyr/init.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util.h>
-#include "common.h"
-#include "config.h"
-#include "i2c.h"
-#include "ioexpander.h"
/* Include drivers if enabled */
#ifdef CONFIG_PLATFORM_EC_IOEX_CCGXXF
diff --git a/zephyr/shim/src/keyboard_raw.c b/zephyr/shim/src/keyboard_raw.c
index 7d27e5ce39..73b3c2acaf 100644
--- a/zephyr/shim/src/keyboard_raw.c
+++ b/zephyr/shim/src/keyboard_raw.c
@@ -5,13 +5,14 @@
/* Functions needed by keyboard scanner module for Chrome EC */
+#include "drivers/cros_kb_raw.h"
+#include "keyboard_raw.h"
+
#include <zephyr/device.h>
-#include <zephyr/logging/log.h>
-#include <soc.h>
#include <zephyr/kernel.h>
+#include <zephyr/logging/log.h>
-#include "drivers/cros_kb_raw.h"
-#include "keyboard_raw.h"
+#include <soc.h>
LOG_MODULE_REGISTER(shim_cros_kb_raw, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/src/keyscan.c b/zephyr/shim/src/keyscan.c
index 514885379b..78a3e440be 100644
--- a/zephyr/shim/src/keyscan.c
+++ b/zephyr/shim/src/keyscan.c
@@ -5,11 +5,13 @@
#define DT_DRV_COMPAT cros_keyscan
+#include "keyboard_scan.h"
+
#include <assert.h>
+
#include <zephyr/kernel.h>
-#include <soc.h>
-#include "keyboard_scan.h"
+#include <soc.h>
#if DT_NODE_EXISTS(DT_INST(0, cros_keyscan))
diff --git a/zephyr/shim/src/led_driver/led.c b/zephyr/shim/src/led_driver/led.c
index 011632ac83..d673aa4c2e 100644
--- a/zephyr/shim/src/led_driver/led.c
+++ b/zephyr/shim/src/led_driver/led.c
@@ -5,8 +5,6 @@
* Power and battery LED control.
*/
-#include <zephyr/drivers/gpio.h>
-
#include "battery.h"
#include "charge_manager.h"
#include "charge_state.h"
@@ -21,6 +19,7 @@
#include "util.h"
#include <zephyr/devicetree.h>
+#include <zephyr/drivers/gpio.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(led, LOG_LEVEL_ERR);
diff --git a/zephyr/shim/src/log_backend_console_buffer.c b/zephyr/shim/src/log_backend_console_buffer.c
index ee6992f916..3f455469c4 100644
--- a/zephyr/shim/src/log_backend_console_buffer.c
+++ b/zephyr/shim/src/log_backend_console_buffer.c
@@ -3,11 +3,11 @@
* found in the LICENSE file.
*/
+#include "console.h"
+
#include <zephyr/logging/log_backend.h>
-#include <zephyr/logging/log_output.h>
#include <zephyr/logging/log_backend_std.h>
-
-#include "console.h"
+#include <zephyr/logging/log_output.h>
static uint8_t
char_out_buf[CONFIG_PLATFORM_EC_LOG_BACKEND_CONSOLE_BUFFER_TMP_BUF_SIZE];
diff --git a/zephyr/shim/src/motionsense_sensors.c b/zephyr/shim/src/motionsense_sensors.c
index 8d886192ac..72bb677af6 100644
--- a/zephyr/shim/src/motionsense_sensors.c
+++ b/zephyr/shim/src/motionsense_sensors.c
@@ -3,14 +3,15 @@
* found in the LICENSE file.
*/
-#include <zephyr/logging/log.h>
-#include "common.h"
#include "accelgyro.h"
+#include "common.h"
#include "cros_cbi.h"
-#include "hooks.h"
#include "gpio/gpio_int.h"
+#include "hooks.h"
#include "motionsense_sensors.h"
+#include <zephyr/logging/log.h>
+
LOG_MODULE_REGISTER(shim_cros_motionsense_sensors);
#define SENSOR_MUTEX_NODE DT_PATH(motionsense_mutex)
diff --git a/zephyr/shim/src/panic.c b/zephyr/shim/src/panic.c
index 9ff8a46f62..2ac8328e9e 100644
--- a/zephyr/shim/src/panic.c
+++ b/zephyr/shim/src/panic.c
@@ -3,14 +3,14 @@
* found in the LICENSE file.
*/
+#include "common.h"
+#include "panic.h"
+
#include <zephyr/arch/cpu.h>
#include <zephyr/fatal.h>
+#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/logging/log_ctrl.h>
-#include <zephyr/kernel.h>
-
-#include "common.h"
-#include "panic.h"
/*
* Arch-specific configuration
diff --git a/zephyr/shim/src/power.c b/zephyr/shim/src/power.c
index 51ae788d98..ab58cf391d 100644
--- a/zephyr/shim/src/power.c
+++ b/zephyr/shim/src/power.c
@@ -3,12 +3,12 @@
* found in the LICENSE file.
*/
-#include <zephyr/sys/util.h>
-
#include "console.h"
#include "power.h"
#include "power/power.h"
+#include <zephyr/sys/util.h>
+
#define GEN_POWER_SIGNAL_STRUCT_ENTRY_GPIO(cid) \
DT_STRING_UPPER_TOKEN(DT_PROP(cid, power_gpio_pin), enum_name)
#define GEN_POWER_SIGNAL_STRUCT_ENTRY_FLAGS(cid) \
diff --git a/zephyr/shim/src/ppc.c b/zephyr/shim/src/ppc.c
index c4c54d002f..c15c6900b1 100644
--- a/zephyr/shim/src/ppc.c
+++ b/zephyr/shim/src/ppc.c
@@ -3,14 +3,15 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
-#include "usbc_ppc.h"
+#include "usbc/ppc.h"
#include "usbc/ppc_aoz1380.h"
#include "usbc/ppc_nx20p348x.h"
#include "usbc/ppc_rt1739.h"
#include "usbc/ppc_sn5s330.h"
#include "usbc/ppc_syv682x.h"
-#include "usbc/ppc.h"
+#include "usbc_ppc.h"
+
+#include <zephyr/devicetree.h>
#if DT_HAS_COMPAT_STATUS_OKAY(AOZ1380_COMPAT) || \
DT_HAS_COMPAT_STATUS_OKAY(NX20P348X_COMPAT) || \
diff --git a/zephyr/shim/src/pwm_hc.c b/zephyr/shim/src/pwm_hc.c
index c0350c733f..3c7b2f1737 100644
--- a/zephyr/shim/src/pwm_hc.c
+++ b/zephyr/shim/src/pwm_hc.c
@@ -3,20 +3,20 @@
* found in the LICENSE file.
*/
-#include <zephyr/device.h>
-#include <zephyr/devicetree.h>
-#include <zephyr/drivers/pwm.h>
-#include <zephyr/logging/log.h>
-
#include "common.h"
#include "console.h"
#include "drivers/cros_displight.h"
#include "ec_commands.h"
#include "host_command.h"
-#include "pwm.h"
#include "keyboard_backlight.h"
+#include "pwm.h"
#include "util.h"
+#include <zephyr/device.h>
+#include <zephyr/devicetree.h>
+#include <zephyr/drivers/pwm.h>
+#include <zephyr/logging/log.h>
+
LOG_MODULE_REGISTER(pwm_shim, LOG_LEVEL_ERR);
#define HAS_PWM_GENERIC_CHANNEL(compat) \
diff --git a/zephyr/shim/src/pwm_led.c b/zephyr/shim/src/pwm_led.c
index 498c543ffb..81cc3a9c28 100644
--- a/zephyr/shim/src/pwm_led.c
+++ b/zephyr/shim/src/pwm_led.c
@@ -6,6 +6,7 @@
#define DT_DRV_COMPAT cros_ec_pwm_leds
#include <string.h>
+
#include <zephyr/devicetree.h>
#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT)
diff --git a/zephyr/shim/src/rtc.c b/zephyr/shim/src/rtc.c
index c8a0511c95..3acf6a3bb6 100644
--- a/zephyr/shim/src/rtc.c
+++ b/zephyr/shim/src/rtc.c
@@ -3,9 +3,6 @@
* found in the LICENSE file.
*/
-#include <zephyr/logging/log.h>
-#include <zephyr/kernel.h>
-
#include "console.h"
#include "drivers/cros_rtc.h"
#include "hooks.h"
@@ -13,6 +10,9 @@
#include "system.h"
#include "util.h"
+#include <zephyr/kernel.h>
+#include <zephyr/logging/log.h>
+
LOG_MODULE_REGISTER(shim_cros_rtc, LOG_LEVEL_ERR);
#define CROS_RTC_NODE DT_CHOSEN(cros_rtc)
diff --git a/zephyr/shim/src/switchcap_gpio.c b/zephyr/shim/src/switchcap_gpio.c
index 23bed493c8..54d69a3672 100644
--- a/zephyr/shim/src/switchcap_gpio.c
+++ b/zephyr/shim/src/switchcap_gpio.c
@@ -3,10 +3,11 @@
* found in the LICENSE file.
*/
+#include "common.h"
+
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/kernel.h>
-#include "common.h"
/* TODO(b/218600962): Consolidate switchcap code. */
diff --git a/zephyr/shim/src/switchcap_ln9310.c b/zephyr/shim/src/switchcap_ln9310.c
index 7c5fd4ed8d..f3b037bfd4 100644
--- a/zephyr/shim/src/switchcap_ln9310.c
+++ b/zephyr/shim/src/switchcap_ln9310.c
@@ -3,11 +3,12 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
-#include <zephyr/drivers/gpio.h>
#include "common.h"
#include "ln9310.h"
+#include <zephyr/devicetree.h>
+#include <zephyr/drivers/gpio.h>
+
/* TODO(b/218600962): Consolidate switchcap code. */
#if DT_NODE_EXISTS(DT_PATH(switchcap))
diff --git a/zephyr/shim/src/system.c b/zephyr/shim/src/system.c
index 99f4f4c3e1..0b47782b42 100644
--- a/zephyr/shim/src/system.c
+++ b/zephyr/shim/src/system.c
@@ -3,17 +3,18 @@
* found in the LICENSE file.
*/
-#include <zephyr/device.h>
-#include <zephyr/drivers/bbram.h>
-#include <drivers/cros_system.h>
-#include <zephyr/logging/log.h>
-
#include "common.h"
#include "console.h"
#include "cros_version.h"
#include "system.h"
#include "watchdog.h"
+#include <zephyr/device.h>
+#include <zephyr/drivers/bbram.h>
+#include <zephyr/logging/log.h>
+
+#include <drivers/cros_system.h>
+
#define BBRAM_REGION_PD0 DT_PATH(named_bbram_regions, pd0)
#define BBRAM_REGION_PD1 DT_PATH(named_bbram_regions, pd1)
#define BBRAM_REGION_PD2 DT_PATH(named_bbram_regions, pd2)
diff --git a/zephyr/shim/src/tasks.c b/zephyr/shim/src/tasks.c
index a03cf4daa8..68ebbbc482 100644
--- a/zephyr/shim/src/tasks.c
+++ b/zephyr/shim/src/tasks.c
@@ -3,15 +3,15 @@
* found in the LICENSE file.
*/
-#include <zephyr/kernel.h>
-#include <zephyr/init.h>
-#include <zephyr/sys/atomic.h>
-#include <zephyr/shell/shell.h>
-
#include "common.h"
#include "host_command.h"
-#include "timer.h"
#include "task.h"
+#include "timer.h"
+
+#include <zephyr/init.h>
+#include <zephyr/kernel.h>
+#include <zephyr/shell/shell.h>
+#include <zephyr/sys/atomic.h>
/* Ensure that the idle task is at lower priority than lowest priority task. */
BUILD_ASSERT(EC_TASK_PRIORITY(EC_TASK_PRIO_LOWEST) < K_IDLE_PRIO,
diff --git a/zephyr/shim/src/tcpc.c b/zephyr/shim/src/tcpc.c
index ba251a196b..eecad4d6ad 100644
--- a/zephyr/shim/src/tcpc.c
+++ b/zephyr/shim/src/tcpc.c
@@ -3,10 +3,8 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
-#include <zephyr/sys/util.h>
-#include "usb_pd_tcpm.h"
#include "usb_pd.h"
+#include "usb_pd_tcpm.h"
#include "usbc/tcpc_anx7447.h"
#include "usbc/tcpc_anx7447_emul.h"
#include "usbc/tcpc_ccgxxf.h"
@@ -20,6 +18,9 @@
#include "usbc/tcpci.h"
#include "usbc/utils.h"
+#include <zephyr/devicetree.h>
+#include <zephyr/sys/util.h>
+
#define HAS_TCPC_PROP(usbc_id) \
COND_CODE_1(DT_NODE_HAS_PROP(usbc_id, tcpc), (|| 1), ())
diff --git a/zephyr/shim/src/tcpc_nct38xx.c b/zephyr/shim/src/tcpc_nct38xx.c
index 9580759a6c..5d3f5ac25c 100644
--- a/zephyr/shim/src/tcpc_nct38xx.c
+++ b/zephyr/shim/src/tcpc_nct38xx.c
@@ -3,13 +3,13 @@
* found in the LICENSE file.
*/
-#include <zephyr/device.h>
-#include <zephyr/devicetree.h>
-
#include "config.h"
#include "usbc/tcpc_nct38xx.h"
#include "usbc/utils.h"
+#include <zephyr/device.h>
+#include <zephyr/devicetree.h>
+
#define GPIO_DEV_WITH_COMMA(id) DEVICE_DT_GET(DT_PHANDLE(id, gpio_dev)),
#define GPIO_DEV_BINDING(usbc_id, tcpc_id) \
diff --git a/zephyr/shim/src/thermal.c b/zephyr/shim/src/thermal.c
index abe6b7da9e..fd1b0bfb52 100644
--- a/zephyr/shim/src/thermal.c
+++ b/zephyr/shim/src/thermal.c
@@ -3,9 +3,9 @@
* found in the LICENSE file.
*/
+#include "ec_commands.h"
#include "temp_sensor.h"
#include "temp_sensor/temp_sensor.h"
-#include "ec_commands.h"
#define THERMAL_CONFIG(node_id) \
[TEMP_SENSOR_ID(node_id)] = { \
diff --git a/zephyr/shim/src/usb_muxes.c b/zephyr/shim/src/usb_muxes.c
index 3f81e97787..af86cec0cd 100644
--- a/zephyr/shim/src/usb_muxes.c
+++ b/zephyr/shim/src/usb_muxes.c
@@ -3,11 +3,12 @@
* found in the LICENSE file.
*/
-#include <zephyr/devicetree.h>
-#include <zephyr/sys/util_macro.h>
#include "usb_mux.h"
#include "usbc/usb_muxes.h"
+#include <zephyr/devicetree.h>
+#include <zephyr/sys/util_macro.h>
+
/**
* This prevents creating struct usb_mux usb_muxes[] for platforms that didn't
* migrate USB mux configuration to DTS yet.
diff --git a/zephyr/shim/src/usba.c b/zephyr/shim/src/usba.c
index c8c056bad0..a7360a9ddb 100644
--- a/zephyr/shim/src/usba.c
+++ b/zephyr/shim/src/usba.c
@@ -5,9 +5,10 @@
#define DT_DRV_COMPAT cros_ec_usba_port_enable_pins
-#include <zephyr/devicetree.h>
#include "hooks.h"
+#include <zephyr/devicetree.h>
+
#define PIN(node_id, prop, idx) \
GPIO_SIGNAL(DT_PHANDLE_BY_IDX(node_id, prop, idx)),
diff --git a/zephyr/shim/src/watchdog.c b/zephyr/shim/src/watchdog.c
index eb82f228d5..413ba50484 100644
--- a/zephyr/shim/src/watchdog.c
+++ b/zephyr/shim/src/watchdog.c
@@ -3,15 +3,15 @@
* found in the LICENSE file.
*/
-#include <zephyr/device.h>
-#include <zephyr/drivers/watchdog.h>
-#include <zephyr/logging/log.h>
-#include <zephyr/kernel.h>
-
#include "config.h"
#include "hooks.h"
#include "watchdog.h"
+#include <zephyr/device.h>
+#include <zephyr/drivers/watchdog.h>
+#include <zephyr/kernel.h>
+#include <zephyr/logging/log.h>
+
LOG_MODULE_REGISTER(watchdog_shim, LOG_LEVEL_ERR);
#define wdt DEVICE_DT_GET(DT_CHOSEN(cros_ec_watchdog))