From 17ddd1714c61e1ef30b1c1df4af3af41b9f556c6 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 25 Jun 2019 15:53:47 -0400 Subject: [PATCH] cleanup: include/: move clock_control.h to drivers/clock_control.h move clock_control.h to drivers/clock_control.h and create a shim for backward-compatibility. No functional changes to the headers. A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES. Related to #16539 Signed-off-by: Anas Nashif --- drivers/can/can_mcux_flexcan.c | 2 +- drivers/can/can_stm32.c | 2 +- drivers/clock_control/beetle_clock_control.c | 2 +- .../clock_control/clock_control_mcux_ccm.c | 2 +- .../clock_control/clock_control_mcux_pcc.c | 2 +- .../clock_control/clock_control_mcux_scg.c | 2 +- .../clock_control/clock_control_mcux_sim.c | 2 +- .../clock_control/clock_control_rv32m1_pcc.c | 2 +- drivers/clock_control/clock_stm32_ll_common.c | 2 +- drivers/clock_control/clock_stm32_ll_mp1.c | 2 +- drivers/clock_control/clock_stm32f0_f3.c | 2 +- drivers/clock_control/clock_stm32f1.c | 2 +- drivers/clock_control/clock_stm32f2_f4_f7.c | 2 +- drivers/clock_control/clock_stm32l0_l1.c | 2 +- drivers/clock_control/clock_stm32l4_wb.c | 2 +- drivers/clock_control/nrf_power_clock.c | 2 +- .../clock_control/quark_se_clock_control.c | 2 +- drivers/counter/counter_ll_stm32_rtc.c | 2 +- drivers/counter/counter_nrfx_rtc.c | 2 +- drivers/entropy/entropy_stm32.c | 2 +- drivers/ethernet/eth_stm32_hal.c | 2 +- drivers/flash/flash_stm32.h | 2 +- drivers/gpio/gpio_dw.c | 2 +- drivers/gpio/gpio_rv32m1.c | 2 +- drivers/i2c/i2c_ll_stm32.c | 2 +- drivers/i2c/i2c_ll_stm32_v1.c | 2 +- drivers/i2c/i2c_ll_stm32_v2.c | 2 +- drivers/i2c/i2c_mchp_xec.c | 2 +- drivers/i2c/i2c_mcux_lpi2c.c | 2 +- drivers/i2c/i2c_rv32m1_lpi2c.c | 2 +- drivers/i2s/i2s_ll_stm32.c | 2 +- drivers/interrupt_controller/rv32m1_intmux.c | 2 +- drivers/led_strip/ws2812b_sw.c | 2 +- drivers/pinmux/stm32/pinmux_stm32.h | 2 +- drivers/rtc/rtc_ll_stm32.c | 2 +- drivers/sensor/nrf5/temp_nrf5.c | 2 +- drivers/serial/uart_mcux.c | 2 +- drivers/serial/uart_mcux_lpsci.c | 2 +- drivers/serial/uart_mcux_lpuart.c | 2 +- drivers/serial/uart_rv32m1_lpuart.c | 2 +- drivers/serial/uart_stm32.c | 2 +- drivers/spi/spi_dw.c | 2 +- drivers/spi/spi_ll_stm32.c | 2 +- drivers/spi/spi_mcux_dspi.c | 2 +- drivers/spi/spi_mcux_lpspi.c | 2 +- drivers/timer/nrf_rtc_timer.c | 2 +- drivers/timer/sam0_rtc_timer.c | 2 +- drivers/usb/device/usb_dc_nrfx.c | 2 +- drivers/watchdog/wdt_mcux_wdog.c | 2 +- .../platform/clock/nrf_802154_clock_zephyr.c | 2 +- include/clock_control.h | 207 +---------------- include/drivers/clock_control.h | 214 ++++++++++++++++++ .../drivers/clock_control/arm_clock_control.h | 2 +- .../clock_control/stm32_clock_control.h | 2 +- subsys/bluetooth/controller/hci/hci_driver.c | 2 +- subsys/bluetooth/controller/ll_sw/ctrl.c | 2 +- subsys/bluetooth/controller/ll_sw/ll.c | 2 +- subsys/bluetooth/controller/ll_sw/ll_test.c | 2 +- .../controller/ll_sw/nordic/lll/lll.c | 2 +- .../controller/ll_sw/nordic/lll/lll_clock.c | 2 +- .../controller/ll_sw/nordic/lll/lll_test.c | 2 +- .../i2c/i2c_slave_api/common/i2c_virtual.c | 2 +- 62 files changed, 278 insertions(+), 263 deletions(-) create mode 100644 include/drivers/clock_control.h diff --git a/drivers/can/can_mcux_flexcan.c b/drivers/can/can_mcux_flexcan.c index 8a607caf929..f38150ba187 100644 --- a/drivers/can/can_mcux_flexcan.c +++ b/drivers/can/can_mcux_flexcan.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/can/can_stm32.c b/drivers/can/can_stm32.c index a3d24faa5b3..8aa5281a93f 100644 --- a/drivers/can/can_stm32.c +++ b/drivers/can/can_stm32.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/clock_control/beetle_clock_control.c b/drivers/clock_control/beetle_clock_control.c index 077d92d5220..46cb04d64b8 100644 --- a/drivers/clock_control/beetle_clock_control.c +++ b/drivers/clock_control/beetle_clock_control.c @@ -13,7 +13,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/clock_control/clock_control_mcux_ccm.c b/drivers/clock_control/clock_control_mcux_ccm.c index 36b9b0404d3..e783edfa6d0 100644 --- a/drivers/clock_control/clock_control_mcux_ccm.c +++ b/drivers/clock_control/clock_control_mcux_ccm.c @@ -5,7 +5,7 @@ */ #include #include -#include +#include #include #include diff --git a/drivers/clock_control/clock_control_mcux_pcc.c b/drivers/clock_control/clock_control_mcux_pcc.c index 1f94cee2950..52b35198454 100644 --- a/drivers/clock_control/clock_control_mcux_pcc.c +++ b/drivers/clock_control/clock_control_mcux_pcc.c @@ -9,7 +9,7 @@ #include #include -#include +#include #include #define LOG_LEVEL CONFIG_CLOCK_CONTROL_LOG_LEVEL diff --git a/drivers/clock_control/clock_control_mcux_scg.c b/drivers/clock_control/clock_control_mcux_scg.c index e0cc6fb5e3f..46d17cdc4e4 100644 --- a/drivers/clock_control/clock_control_mcux_scg.c +++ b/drivers/clock_control/clock_control_mcux_scg.c @@ -7,7 +7,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include diff --git a/drivers/clock_control/clock_control_mcux_sim.c b/drivers/clock_control/clock_control_mcux_sim.c index 559c39c8c80..8af0db184b8 100644 --- a/drivers/clock_control/clock_control_mcux_sim.c +++ b/drivers/clock_control/clock_control_mcux_sim.c @@ -5,7 +5,7 @@ */ #include #include -#include +#include #include #include diff --git a/drivers/clock_control/clock_control_rv32m1_pcc.c b/drivers/clock_control/clock_control_rv32m1_pcc.c index 128fa5d9753..17ba409381d 100644 --- a/drivers/clock_control/clock_control_rv32m1_pcc.c +++ b/drivers/clock_control/clock_control_rv32m1_pcc.c @@ -5,7 +5,7 @@ */ #include #include -#include +#include #include #define LOG_LEVEL CONFIG_CLOCK_CONTROL_LOG_LEVEL diff --git a/drivers/clock_control/clock_stm32_ll_common.c b/drivers/clock_control/clock_stm32_ll_common.c index b93cd658eb6..5ddd7d03b80 100644 --- a/drivers/clock_control/clock_stm32_ll_common.c +++ b/drivers/clock_control/clock_stm32_ll_common.c @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include "clock_stm32_ll_common.h" diff --git a/drivers/clock_control/clock_stm32_ll_mp1.c b/drivers/clock_control/clock_stm32_ll_mp1.c index 718aa229cfd..c7dcdec9696 100644 --- a/drivers/clock_control/clock_stm32_ll_mp1.c +++ b/drivers/clock_control/clock_stm32_ll_mp1.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/clock_control/clock_stm32f0_f3.c b/drivers/clock_control/clock_stm32f0_f3.c index 6dd74df020d..a4f953c55df 100644 --- a/drivers/clock_control/clock_stm32f0_f3.c +++ b/drivers/clock_control/clock_stm32f0_f3.c @@ -7,7 +7,7 @@ #include -#include +#include #include #include #include "clock_stm32_ll_common.h" diff --git a/drivers/clock_control/clock_stm32f1.c b/drivers/clock_control/clock_stm32f1.c index ae0f426c460..79c174da31e 100644 --- a/drivers/clock_control/clock_stm32f1.c +++ b/drivers/clock_control/clock_stm32f1.c @@ -7,7 +7,7 @@ #include -#include +#include #include #include #include "clock_stm32_ll_common.h" diff --git a/drivers/clock_control/clock_stm32f2_f4_f7.c b/drivers/clock_control/clock_stm32f2_f4_f7.c index e044c5c074c..a8b3c0e665a 100644 --- a/drivers/clock_control/clock_stm32f2_f4_f7.c +++ b/drivers/clock_control/clock_stm32f2_f4_f7.c @@ -7,7 +7,7 @@ #include -#include +#include #include #include #include "clock_stm32_ll_common.h" diff --git a/drivers/clock_control/clock_stm32l0_l1.c b/drivers/clock_control/clock_stm32l0_l1.c index 58e4800a7ff..35979ff1a71 100644 --- a/drivers/clock_control/clock_stm32l0_l1.c +++ b/drivers/clock_control/clock_stm32l0_l1.c @@ -7,7 +7,7 @@ #include -#include +#include #include #include #include "clock_stm32_ll_common.h" diff --git a/drivers/clock_control/clock_stm32l4_wb.c b/drivers/clock_control/clock_stm32l4_wb.c index 3c8134f1120..9a2ed4352f9 100644 --- a/drivers/clock_control/clock_stm32l4_wb.c +++ b/drivers/clock_control/clock_stm32l4_wb.c @@ -7,7 +7,7 @@ #include -#include +#include #include #include #include "clock_stm32_ll_common.h" diff --git a/drivers/clock_control/nrf_power_clock.c b/drivers/clock_control/nrf_power_clock.c index 592d064826f..696d562e55f 100644 --- a/drivers/clock_control/nrf_power_clock.c +++ b/drivers/clock_control/nrf_power_clock.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #if defined(CONFIG_USB) && defined(CONFIG_SOC_NRF52840) diff --git a/drivers/clock_control/quark_se_clock_control.c b/drivers/clock_control/quark_se_clock_control.c index 6cdce338963..9106075974e 100644 --- a/drivers/clock_control/quark_se_clock_control.c +++ b/drivers/clock_control/quark_se_clock_control.c @@ -16,7 +16,7 @@ #include -#include +#include #include #define LOG_LEVEL CONFIG_CLOCK_CONTROL_LOG_LEVEL diff --git a/drivers/counter/counter_ll_stm32_rtc.c b/drivers/counter/counter_ll_stm32_rtc.c index fb9c699adc3..46b13d5f22b 100644 --- a/drivers/counter/counter_ll_stm32_rtc.c +++ b/drivers/counter/counter_ll_stm32_rtc.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/counter/counter_nrfx_rtc.c b/drivers/counter/counter_nrfx_rtc.c index 8113764e61e..e69b02d7930 100644 --- a/drivers/counter/counter_nrfx_rtc.c +++ b/drivers/counter/counter_nrfx_rtc.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ #include -#include +#include #include #include #ifdef DPPI_PRESENT diff --git a/drivers/entropy/entropy_stm32.c b/drivers/entropy/entropy_stm32.c index 68ae97d75ee..ea08d273a99 100644 --- a/drivers/entropy/entropy_stm32.c +++ b/drivers/entropy/entropy_stm32.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #if !defined(CONFIG_SOC_SERIES_STM32L4X) && !defined(CONFIG_SOC_SERIES_STM32F4X) && !defined(CONFIG_SOC_SERIES_STM32F7X) diff --git a/drivers/ethernet/eth_stm32_hal.c b/drivers/ethernet/eth_stm32_hal.c index 7af4e861e53..cb496540c40 100644 --- a/drivers/ethernet/eth_stm32_hal.c +++ b/drivers/ethernet/eth_stm32_hal.c @@ -21,7 +21,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include #include #include -#include +#include #include #include "eth_stm32_hal_priv.h" diff --git a/drivers/flash/flash_stm32.h b/drivers/flash/flash_stm32.h index 4eed71929be..09bb9d27d82 100644 --- a/drivers/flash/flash_stm32.h +++ b/drivers/flash/flash_stm32.h @@ -13,7 +13,7 @@ #if defined(CONFIG_SOC_SERIES_STM32L4X) || \ defined(CONFIG_SOC_SERIES_STM32F0X) || \ defined(CONFIG_SOC_SERIES_STM32F3X) -#include +#include #include #endif diff --git a/drivers/gpio/gpio_dw.c b/drivers/gpio/gpio_dw.c index dd14332df09..6562654c10a 100644 --- a/drivers/gpio/gpio_dw.c +++ b/drivers/gpio/gpio_dw.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #ifdef CONFIG_SHARED_IRQ #include diff --git a/drivers/gpio/gpio_rv32m1.c b/drivers/gpio/gpio_rv32m1.c index 419bdf28143..bf287133c83 100644 --- a/drivers/gpio/gpio_rv32m1.c +++ b/drivers/gpio/gpio_rv32m1.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include "gpio_utils.h" diff --git a/drivers/i2c/i2c_ll_stm32.c b/drivers/i2c/i2c_ll_stm32.c index 7f934480a1b..abb954fae44 100644 --- a/drivers/i2c/i2c_ll_stm32.c +++ b/drivers/i2c/i2c_ll_stm32.c @@ -6,7 +6,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/i2c/i2c_ll_stm32_v1.c b/drivers/i2c/i2c_ll_stm32_v1.c index 510d5070e6b..cea35ee2e45 100644 --- a/drivers/i2c/i2c_ll_stm32_v1.c +++ b/drivers/i2c/i2c_ll_stm32_v1.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/i2c/i2c_ll_stm32_v2.c b/drivers/i2c/i2c_ll_stm32_v2.c index 5aebc763da3..ce8336a6214 100644 --- a/drivers/i2c/i2c_ll_stm32_v2.c +++ b/drivers/i2c/i2c_ll_stm32_v2.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/i2c/i2c_mchp_xec.c b/drivers/i2c/i2c_mchp_xec.c index e16e0fb4e5c..8f7d2352ba5 100644 --- a/drivers/i2c/i2c_mchp_xec.c +++ b/drivers/i2c/i2c_mchp_xec.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include #include #include diff --git a/drivers/i2c/i2c_mcux_lpi2c.c b/drivers/i2c/i2c_mcux_lpi2c.c index 4dd93572e5e..1f5a3c0a03b 100644 --- a/drivers/i2c/i2c_mcux_lpi2c.c +++ b/drivers/i2c/i2c_mcux_lpi2c.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/i2c/i2c_rv32m1_lpi2c.c b/drivers/i2c/i2c_rv32m1_lpi2c.c index ee937397919..141098ca2ca 100644 --- a/drivers/i2c/i2c_rv32m1_lpi2c.c +++ b/drivers/i2c/i2c_rv32m1_lpi2c.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include #include LOG_MODULE_REGISTER(rv32m1_lpi2c); diff --git a/drivers/i2s/i2s_ll_stm32.c b/drivers/i2s/i2s_ll_stm32.c index 5f3b0b0638d..7cd8dc10234 100644 --- a/drivers/i2s/i2s_ll_stm32.c +++ b/drivers/i2s/i2s_ll_stm32.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "i2s_ll_stm32.h" #include diff --git a/drivers/interrupt_controller/rv32m1_intmux.c b/drivers/interrupt_controller/rv32m1_intmux.c index 5a6611cbba3..057550cbf99 100644 --- a/drivers/interrupt_controller/rv32m1_intmux.c +++ b/drivers/interrupt_controller/rv32m1_intmux.c @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/led_strip/ws2812b_sw.c b/drivers/led_strip/ws2812b_sw.c index 56539b5430c..0a86025e4f5 100644 --- a/drivers/led_strip/ws2812b_sw.c +++ b/drivers/led_strip/ws2812b_sw.c @@ -16,7 +16,7 @@ LOG_MODULE_REGISTER(ws2812b_sw); #include #include #include -#include +#include #define BLOCKING ((void *)1) diff --git a/drivers/pinmux/stm32/pinmux_stm32.h b/drivers/pinmux/stm32/pinmux_stm32.h index 6c9a8882f2c..1ad074d13b7 100644 --- a/drivers/pinmux/stm32/pinmux_stm32.h +++ b/drivers/pinmux/stm32/pinmux_stm32.h @@ -13,7 +13,7 @@ #include #include -#include +#include #ifdef CONFIG_SOC_SERIES_STM32F1X #include #else diff --git a/drivers/rtc/rtc_ll_stm32.c b/drivers/rtc/rtc_ll_stm32.c index e4adc32e7f5..2f8b0600dea 100644 --- a/drivers/rtc/rtc_ll_stm32.c +++ b/drivers/rtc/rtc_ll_stm32.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/sensor/nrf5/temp_nrf5.c b/drivers/sensor/nrf5/temp_nrf5.c index bfaa3fe436d..97f3983c22b 100644 --- a/drivers/sensor/nrf5/temp_nrf5.c +++ b/drivers/sensor/nrf5/temp_nrf5.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL diff --git a/drivers/serial/uart_mcux.c b/drivers/serial/uart_mcux.c index cc1c86f49d8..ddb4dc882a6 100644 --- a/drivers/serial/uart_mcux.c +++ b/drivers/serial/uart_mcux.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/serial/uart_mcux_lpsci.c b/drivers/serial/uart_mcux_lpsci.c index 52eaa73aece..c7f450b5c39 100644 --- a/drivers/serial/uart_mcux_lpsci.c +++ b/drivers/serial/uart_mcux_lpsci.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/serial/uart_mcux_lpuart.c b/drivers/serial/uart_mcux_lpuart.c index 786a2e6d453..c00cc1dbf94 100644 --- a/drivers/serial/uart_mcux_lpuart.c +++ b/drivers/serial/uart_mcux_lpuart.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/serial/uart_rv32m1_lpuart.c b/drivers/serial/uart_rv32m1_lpuart.c index e2fcbb998b5..a4a6b943917 100644 --- a/drivers/serial/uart_rv32m1_lpuart.c +++ b/drivers/serial/uart_rv32m1_lpuart.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index edfd34e8b42..f1e5bcbf5a7 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/spi/spi_dw.c b/drivers/spi/spi_dw.c index c6c5a810699..600ca20c3d0 100644 --- a/drivers/spi/spi_dw.c +++ b/drivers/spi/spi_dw.c @@ -33,7 +33,7 @@ LOG_MODULE_REGISTER(spi_dw); #include #include -#include +#include #include #ifdef CONFIG_IOAPIC diff --git a/drivers/spi/spi_ll_stm32.c b/drivers/spi/spi_ll_stm32.c index 67ecb323360..874d6ce52b6 100644 --- a/drivers/spi/spi_ll_stm32.c +++ b/drivers/spi/spi_ll_stm32.c @@ -16,7 +16,7 @@ LOG_MODULE_REGISTER(spi_ll_stm32); #include #include -#include +#include #include "spi_ll_stm32.h" diff --git a/drivers/spi/spi_mcux_dspi.c b/drivers/spi/spi_mcux_dspi.c index 70e2f9a6b3f..d2a0238eae4 100644 --- a/drivers/spi/spi_mcux_dspi.c +++ b/drivers/spi/spi_mcux_dspi.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #define LOG_LEVEL CONFIG_SPI_LOG_LEVEL diff --git a/drivers/spi/spi_mcux_lpspi.c b/drivers/spi/spi_mcux_lpspi.c index 24fde146baf..47b4ef60493 100644 --- a/drivers/spi/spi_mcux_lpspi.c +++ b/drivers/spi/spi_mcux_lpspi.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #define LOG_LEVEL CONFIG_SPI_LOG_LEVEL diff --git a/drivers/timer/nrf_rtc_timer.c b/drivers/timer/nrf_rtc_timer.c index 2287ad4472b..9f300b57344 100644 --- a/drivers/timer/nrf_rtc_timer.c +++ b/drivers/timer/nrf_rtc_timer.c @@ -6,7 +6,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/timer/sam0_rtc_timer.c b/drivers/timer/sam0_rtc_timer.c index 561b75f034b..4fb0ef4c236 100644 --- a/drivers/timer/sam0_rtc_timer.c +++ b/drivers/timer/sam0_rtc_timer.c @@ -15,7 +15,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/usb/device/usb_dc_nrfx.c b/drivers/usb/device/usb_dc_nrfx.c index c455daa4dbc..ef9b7641de1 100644 --- a/drivers/usb/device/usb_dc_nrfx.c +++ b/drivers/usb/device/usb_dc_nrfx.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/watchdog/wdt_mcux_wdog.c b/drivers/watchdog/wdt_mcux_wdog.c index 71a49132786..89da6f58d44 100644 --- a/drivers/watchdog/wdt_mcux_wdog.c +++ b/drivers/watchdog/wdt_mcux_wdog.c @@ -6,7 +6,7 @@ */ #include -#include +#include #include #define LOG_LEVEL CONFIG_WDT_LOG_LEVEL diff --git a/ext/hal/nordic/drivers/nrf_radio_802154/platform/clock/nrf_802154_clock_zephyr.c b/ext/hal/nordic/drivers/nrf_radio_802154/platform/clock/nrf_802154_clock_zephyr.c index bca6bafaba9..a3c6e26fdea 100644 --- a/ext/hal/nordic/drivers/nrf_radio_802154/platform/clock/nrf_802154_clock_zephyr.c +++ b/ext/hal/nordic/drivers/nrf_radio_802154/platform/clock/nrf_802154_clock_zephyr.c @@ -41,7 +41,7 @@ #include #include -#include +#include static bool hfclk_is_running; static bool lfclk_is_running; diff --git a/include/clock_control.h b/include/clock_control.h index 49354aaed4b..f8821be591e 100644 --- a/include/clock_control.h +++ b/include/clock_control.h @@ -1,214 +1,15 @@ -/* clock_control.h - public clock controller driver API */ - /* - * Copyright (c) 2015 Intel Corporation + * Copyright (c) 2019 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ - #ifndef ZEPHYR_INCLUDE_CLOCK_CONTROL_H_ #define ZEPHYR_INCLUDE_CLOCK_CONTROL_H_ -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { +#ifndef CONFIG_COMPAT_INCLUDES +#warning "This header file has moved, include instead." #endif -/* Clock control API */ - -/* Used to select all subsystem of a clock controller */ -#define CLOCK_CONTROL_SUBSYS_ALL NULL - -/** - * @brief Current clock status. - */ -enum clock_control_status { - CLOCK_CONTROL_STATUS_STARTING, - CLOCK_CONTROL_STATUS_OFF, - CLOCK_CONTROL_STATUS_ON, - CLOCK_CONTROL_STATUS_UNKNOWN -}; - -typedef void (*clock_control_cb_t)(struct device *dev, void *user_data); - -/** - * @cond INTERNAL_HIDDEN - */ -#define Z_CLOCK_CONTROL_ASYNC_DATA_INITIALIZER(_cb, _user_data) \ - { \ - .cb = cb, \ - .user_data = _user_data \ - } -/** - * INTERNAL_HIDDEN @endcond - */ - -/** - * Define and initialize clock_control async data. - * - * @param name Name of the data. - * @param cb Callback. - * @param user_data User data - */ -#define CLOCK_CONTROL_ASYNC_DATA_DEFINE(name, cb, user_data) \ - struct clock_control_async_data name = \ - Z_CLOCK_CONTROL_ASYNC_DATA_INITIALIZER(cb, user_data) - -/** - * @brief Clock control data used for asynchronous clock enabling. - * - * @param node Used internally for linking asynchronous requests. - * @param cb Callback called when clock is started. - * @param user_data User data passed as an argument in the callback. - */ -struct clock_control_async_data { - sys_snode_t node; - clock_control_cb_t cb; - void *user_data; -}; - -/** - * clock_control_subsys_t is a type to identify a clock controller sub-system. - * Such data pointed is opaque and relevant only to the clock controller - * driver instance being used. - */ -typedef void *clock_control_subsys_t; - -typedef int (*clock_control)(struct device *dev, clock_control_subsys_t sys); - -typedef int (*clock_control_get)(struct device *dev, - clock_control_subsys_t sys, - u32_t *rate); - -typedef int (*clock_control_async_on_fn)(struct device *dev, - clock_control_subsys_t sys, - struct clock_control_async_data *data); - -typedef enum clock_control_status (*clock_control_get_status_fn)( - struct device *dev, - clock_control_subsys_t sys); - -struct clock_control_driver_api { - clock_control on; - clock_control off; - clock_control_async_on_fn async_on; - clock_control_get get_rate; - clock_control_get_status_fn get_status; -}; - -/** - * @brief Enable the clock of a sub-system controlled by the device - * @param dev Pointer to the device structure for the clock controller driver - * instance - * @param sys A pointer to an opaque data representing the sub-system - */ -static inline int clock_control_on(struct device *dev, - clock_control_subsys_t sys) -{ - const struct clock_control_driver_api *api = - (const struct clock_control_driver_api *)dev->driver_api; - - return api->on(dev, sys); -} - -/** - * @brief Disable the clock of a sub-system controlled by the device - * @param dev Pointer to the device structure for the clock controller driver - * instance - * @param sys A pointer to an opaque data representing the sub-system - */ -static inline int clock_control_off(struct device *dev, - clock_control_subsys_t sys) -{ - const struct clock_control_driver_api *api = - (const struct clock_control_driver_api *)dev->driver_api; - - return api->off(dev, sys); -} - -/** - * @brief Request clock to start with notification when clock has been started. - * - * User can request delayed start by providing exact information when clock - * should be ready. Driver ensures that clock is ready before requested time. - * It is the driver responsibility to take into account clock startup time. - * When clock is already running user callback will be called from the context - * of the function call else it is called from other context (e.g. clock - * interrupt). - * - * @param dev Device. - * @param sys A pointer to an opaque data representing the sub-system. - * @param data Data structure containing a callback that is called when - * action is performed. Structure content must be valid until - * clock is started and user callback is called. Can be NULL. - * - * @retval 0 if clock is started or already running. - * @retval -EBUSY if same request already scheduled and not yet completed. - * @retval -ENOTSUP if not supported. - */ -static inline int clock_control_async_on(struct device *dev, - clock_control_subsys_t sys, - struct clock_control_async_data *data) -{ - const struct clock_control_driver_api *api = - (const struct clock_control_driver_api *)dev->driver_api; - - if (!api->async_on) { - return -ENOTSUP; - } - - return api->async_on(dev, sys, data); -} - -/** - * @brief Get clock status. - * - * @param dev Device. - * @param sys A pointer to an opaque data representing the sub-system. - * - * @return Status. - */ -static inline enum clock_control_status clock_control_get_status( - struct device *dev, - clock_control_subsys_t sys) -{ - const struct clock_control_driver_api *api = - (const struct clock_control_driver_api *)dev->driver_api; - - if (!api->get_status) { - return CLOCK_CONTROL_STATUS_UNKNOWN; - } - - return api->get_status(dev, sys); -} - -/** - * @brief Obtain the clock rate of given sub-system - * @param dev Pointer to the device structure for the clock controller driver - * instance - * @param sys A pointer to an opaque data representing the sub-system - * @param[out] rate Subsystem clock rate - */ -static inline int clock_control_get_rate(struct device *dev, - clock_control_subsys_t sys, - u32_t *rate) -{ - const struct clock_control_driver_api *api = - (const struct clock_control_driver_api *)dev->driver_api; - - __ASSERT(api->get_rate != NULL, "%s not implemented for device %s", - __func__, dev->config->name); - - return api->get_rate(dev, sys, rate); -} - -#ifdef __cplusplus -} -#endif +#include #endif /* ZEPHYR_INCLUDE_CLOCK_CONTROL_H_ */ diff --git a/include/drivers/clock_control.h b/include/drivers/clock_control.h new file mode 100644 index 00000000000..8afa589113f --- /dev/null +++ b/include/drivers/clock_control.h @@ -0,0 +1,214 @@ +/* clock_control.h - public clock controller driver API */ + +/* + * Copyright (c) 2015 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_H_ +#define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_H_ + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Clock control API */ + +/* Used to select all subsystem of a clock controller */ +#define CLOCK_CONTROL_SUBSYS_ALL NULL + +/** + * @brief Current clock status. + */ +enum clock_control_status { + CLOCK_CONTROL_STATUS_STARTING, + CLOCK_CONTROL_STATUS_OFF, + CLOCK_CONTROL_STATUS_ON, + CLOCK_CONTROL_STATUS_UNKNOWN +}; + +typedef void (*clock_control_cb_t)(struct device *dev, void *user_data); + +/** + * @cond INTERNAL_HIDDEN + */ +#define Z_CLOCK_CONTROL_ASYNC_DATA_INITIALIZER(_cb, _user_data) \ + { \ + .cb = cb, \ + .user_data = _user_data \ + } +/** + * INTERNAL_HIDDEN @endcond + */ + +/** + * Define and initialize clock_control async data. + * + * @param name Name of the data. + * @param cb Callback. + * @param user_data User data + */ +#define CLOCK_CONTROL_ASYNC_DATA_DEFINE(name, cb, user_data) \ + struct clock_control_async_data name = \ + Z_CLOCK_CONTROL_ASYNC_DATA_INITIALIZER(cb, user_data) + +/** + * @brief Clock control data used for asynchronous clock enabling. + * + * @param node Used internally for linking asynchronous requests. + * @param cb Callback called when clock is started. + * @param user_data User data passed as an argument in the callback. + */ +struct clock_control_async_data { + sys_snode_t node; + clock_control_cb_t cb; + void *user_data; +}; + +/** + * clock_control_subsys_t is a type to identify a clock controller sub-system. + * Such data pointed is opaque and relevant only to the clock controller + * driver instance being used. + */ +typedef void *clock_control_subsys_t; + +typedef int (*clock_control)(struct device *dev, clock_control_subsys_t sys); + +typedef int (*clock_control_get)(struct device *dev, + clock_control_subsys_t sys, + u32_t *rate); + +typedef int (*clock_control_async_on_fn)(struct device *dev, + clock_control_subsys_t sys, + struct clock_control_async_data *data); + +typedef enum clock_control_status (*clock_control_get_status_fn)( + struct device *dev, + clock_control_subsys_t sys); + +struct clock_control_driver_api { + clock_control on; + clock_control off; + clock_control_async_on_fn async_on; + clock_control_get get_rate; + clock_control_get_status_fn get_status; +}; + +/** + * @brief Enable the clock of a sub-system controlled by the device + * @param dev Pointer to the device structure for the clock controller driver + * instance + * @param sys A pointer to an opaque data representing the sub-system + */ +static inline int clock_control_on(struct device *dev, + clock_control_subsys_t sys) +{ + const struct clock_control_driver_api *api = + (const struct clock_control_driver_api *)dev->driver_api; + + return api->on(dev, sys); +} + +/** + * @brief Disable the clock of a sub-system controlled by the device + * @param dev Pointer to the device structure for the clock controller driver + * instance + * @param sys A pointer to an opaque data representing the sub-system + */ +static inline int clock_control_off(struct device *dev, + clock_control_subsys_t sys) +{ + const struct clock_control_driver_api *api = + (const struct clock_control_driver_api *)dev->driver_api; + + return api->off(dev, sys); +} + +/** + * @brief Request clock to start with notification when clock has been started. + * + * User can request delayed start by providing exact information when clock + * should be ready. Driver ensures that clock is ready before requested time. + * It is the driver responsibility to take into account clock startup time. + * When clock is already running user callback will be called from the context + * of the function call else it is called from other context (e.g. clock + * interrupt). + * + * @param dev Device. + * @param sys A pointer to an opaque data representing the sub-system. + * @param data Data structure containing a callback that is called when + * action is performed. Structure content must be valid until + * clock is started and user callback is called. Can be NULL. + * + * @retval 0 if clock is started or already running. + * @retval -EBUSY if same request already scheduled and not yet completed. + * @retval -ENOTSUP if not supported. + */ +static inline int clock_control_async_on(struct device *dev, + clock_control_subsys_t sys, + struct clock_control_async_data *data) +{ + const struct clock_control_driver_api *api = + (const struct clock_control_driver_api *)dev->driver_api; + + if (!api->async_on) { + return -ENOTSUP; + } + + return api->async_on(dev, sys, data); +} + +/** + * @brief Get clock status. + * + * @param dev Device. + * @param sys A pointer to an opaque data representing the sub-system. + * + * @return Status. + */ +static inline enum clock_control_status clock_control_get_status( + struct device *dev, + clock_control_subsys_t sys) +{ + const struct clock_control_driver_api *api = + (const struct clock_control_driver_api *)dev->driver_api; + + if (!api->get_status) { + return CLOCK_CONTROL_STATUS_UNKNOWN; + } + + return api->get_status(dev, sys); +} + +/** + * @brief Obtain the clock rate of given sub-system + * @param dev Pointer to the device structure for the clock controller driver + * instance + * @param sys A pointer to an opaque data representing the sub-system + * @param[out] rate Subsystem clock rate + */ +static inline int clock_control_get_rate(struct device *dev, + clock_control_subsys_t sys, + u32_t *rate) +{ + const struct clock_control_driver_api *api = + (const struct clock_control_driver_api *)dev->driver_api; + + __ASSERT(api->get_rate != NULL, "%s not implemented for device %s", + __func__, dev->config->name); + + return api->get_rate(dev, sys, rate); +} + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_H_ */ diff --git a/include/drivers/clock_control/arm_clock_control.h b/include/drivers/clock_control/arm_clock_control.h index af0e88e25b3..c9663072847 100644 --- a/include/drivers/clock_control/arm_clock_control.h +++ b/include/drivers/clock_control/arm_clock_control.h @@ -7,7 +7,7 @@ #ifndef ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ARM_CLOCK_CONTROL_H_ #define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_ARM_CLOCK_CONTROL_H_ -#include +#include /** * @file diff --git a/include/drivers/clock_control/stm32_clock_control.h b/include/drivers/clock_control/stm32_clock_control.h index d3d4584fa4c..63bd1045715 100644 --- a/include/drivers/clock_control/stm32_clock_control.h +++ b/include/drivers/clock_control/stm32_clock_control.h @@ -9,7 +9,7 @@ #ifndef ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_STM32_CLOCK_CONTROL_H_ #define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_STM32_CLOCK_CONTROL_H_ -#include +#include #include /* common clock control device name for all STM32 chips */ diff --git a/subsys/bluetooth/controller/hci/hci_driver.c b/subsys/bluetooth/controller/hci/hci_driver.c index 05ee9eb3684..325d8940478 100644 --- a/subsys/bluetooth/controller/hci/hci_driver.c +++ b/subsys/bluetooth/controller/hci/hci_driver.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/subsys/bluetooth/controller/ll_sw/ctrl.c b/subsys/bluetooth/controller/ll_sw/ctrl.c index 4b91fc052a0..88009ce4808 100644 --- a/subsys/bluetooth/controller/ll_sw/ctrl.c +++ b/subsys/bluetooth/controller/ll_sw/ctrl.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/subsys/bluetooth/controller/ll_sw/ll.c b/subsys/bluetooth/controller/ll_sw/ll.c index 5e4f9425231..4354d65de76 100644 --- a/subsys/bluetooth/controller/ll_sw/ll.c +++ b/subsys/bluetooth/controller/ll_sw/ll.c @@ -10,7 +10,7 @@ #include #include -#include +#include #ifdef CONFIG_CLOCK_CONTROL_NRF #include #endif diff --git a/subsys/bluetooth/controller/ll_sw/ll_test.c b/subsys/bluetooth/controller/ll_sw/ll_test.c index 15cbe61ccab..6978f8c23db 100644 --- a/subsys/bluetooth/controller/ll_sw/ll_test.c +++ b/subsys/bluetooth/controller/ll_sw/ll_test.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "hal/cpu.h" #include "hal/cntr.h" diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c index 0a03fd4cbfd..ab263c5b07e 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include "hal/ccm.h" diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_clock.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_clock.c index cb6d40922c2..cd84a26b83e 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_clock.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_clock.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #define LOG_MODULE_NAME bt_ctlr_llsw_nordic_lll_clock diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c index 268eb1af9aa..4a17e491d9a 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_test.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "hal/cpu.h" #include "hal/cntr.h" diff --git a/tests/drivers/i2c/i2c_slave_api/common/i2c_virtual.c b/tests/drivers/i2c/i2c_slave_api/common/i2c_virtual.c index b80a480d42d..81c6d9526e3 100644 --- a/tests/drivers/i2c/i2c_slave_api/common/i2c_virtual.c +++ b/tests/drivers/i2c/i2c_slave_api/common/i2c_virtual.c @@ -5,7 +5,7 @@ */ #include -#include +#include #include #include #include