Skip to content
Permalink
Browse files

cleanup: include/: move spi.h to drivers/spi.h

move spi.h to drivers/spi.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 <anas.nashif@intel.com>
  • Loading branch information...
nashif committed Jun 25, 2019
1 parent 8c1f89f commit bd70f6f1ed1f6b6f7234fda11940abc45cbfbc97
Showing with 481 additions and 466 deletions.
  1. +1 −1 drivers/bluetooth/hci/spi.c
  2. +1 −1 drivers/can/can_mcp2515.c
  3. +1 −1 drivers/display/display_ili9340.c
  4. +1 −1 drivers/display/ssd1673.c
  5. +1 −1 drivers/ethernet/eth_enc28j60.c
  6. +1 −1 drivers/flash/spi_flash_w25qxxdv.c
  7. +1 −1 drivers/flash/spi_nor.c
  8. +1 −1 drivers/ieee802154/ieee802154_cc1200.c
  9. +1 −1 drivers/ieee802154/ieee802154_cc1200.h
  10. +1 −1 drivers/ieee802154/ieee802154_cc2520.h
  11. +1 −1 drivers/ieee802154/ieee802154_mcr20a.h
  12. +1 −1 drivers/led_strip/apa102.c
  13. +1 −1 drivers/led_strip/lpd880x.c
  14. +1 −1 drivers/led_strip/ws2812.c
  15. +1 −1 drivers/sensor/adxl362/adxl362.c
  16. +1 −1 drivers/sensor/adxl362/adxl362.h
  17. +1 −1 drivers/sensor/adxl372/adxl372.c
  18. +1 −1 drivers/sensor/adxl372/adxl372.h
  19. +1 −1 drivers/sensor/bme280/bme280.c
  20. +1 −1 drivers/sensor/bmi160/bmi160.h
  21. +1 −1 drivers/sensor/lis2dh/lis2dh.h
  22. +1 −1 drivers/sensor/lis2ds12/lis2ds12_spi.c
  23. +1 −1 drivers/sensor/lis2dw12/lis2dw12.c
  24. +1 −1 drivers/sensor/lis2dw12/lis2dw12.h
  25. +1 −1 drivers/sensor/lsm6dsl/lsm6dsl_spi.c
  26. +1 −1 drivers/spi/spi_cc13xx_cc26xx.c
  27. +1 −1 drivers/spi/spi_context.h
  28. +1 −1 drivers/spi/spi_dw.c
  29. +1 −1 drivers/spi/spi_dw.h
  30. +1 −1 drivers/spi/spi_handlers.c
  31. +1 −1 drivers/spi/spi_intel.c
  32. +1 −1 drivers/spi/spi_ll_stm32.c
  33. +1 −1 drivers/spi/spi_mcux_dspi.c
  34. +1 −1 drivers/spi/spi_mcux_lpspi.c
  35. +1 −1 drivers/spi/spi_nrfx_spi.c
  36. +1 −1 drivers/spi/spi_nrfx_spim.c
  37. +1 −1 drivers/spi/spi_nrfx_spis.c
  38. +1 −1 drivers/spi/spi_sam.c
  39. +1 −1 drivers/spi/spi_sam0.c
  40. +1 −1 drivers/spi/spi_sifive.h
  41. +1 −1 drivers/wifi/eswifi/eswifi_bus_spi.c
  42. +1 −1 drivers/wifi/winc1500/wifi_winc1500_nm_bsp_internal.h
  43. +1 −1 drivers/wifi/winc1500/wifi_winc1500_nm_bus_wrapper.c
  44. +425 −0 include/drivers/spi.h
  45. +4 −414 include/spi.h
  46. +1 −1 samples/bluetooth/hci_spi/src/main.c
  47. +1 −1 samples/boards/96b_argonkey/sensors/src/main.c
  48. +1 −1 samples/drivers/led_apa102/src/main.c
  49. +1 −1 samples/drivers/led_lpd8806/src/main.c
  50. +1 −1 samples/drivers/led_ws2812/src/main.c
  51. +1 −1 samples/drivers/spi_fujitsu_fram/src/main.c
  52. +1 −1 subsys/disk/disk_access_sdhc.c
  53. +1 −1 tests/application_development/cpp/src/main.cpp
  54. +1 −1 tests/drivers/spi/spi_loopback/src/spi.c
@@ -8,7 +8,7 @@


#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <init.h> #include <init.h>
#include <spi.h> #include <drivers/spi.h>
#include <misc/byteorder.h> #include <misc/byteorder.h>
#include <misc/util.h> #include <misc/util.h>


@@ -6,7 +6,7 @@


#include <kernel.h> #include <kernel.h>
#include <device.h> #include <device.h>
#include <spi.h> #include <drivers/spi.h>
#include <drivers/gpio.h> #include <drivers/gpio.h>


#define LOG_LEVEL CONFIG_CAN_LOG_LEVEL #define LOG_LEVEL CONFIG_CAN_LOG_LEVEL
@@ -14,7 +14,7 @@ LOG_MODULE_REGISTER(display_ili9340);


#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <misc/byteorder.h> #include <misc/byteorder.h>
#include <spi.h> #include <drivers/spi.h>
#include <string.h> #include <string.h>


struct ili9340_data { struct ili9340_data {
@@ -13,7 +13,7 @@ LOG_MODULE_REGISTER(ssd1673);
#include <display.h> #include <display.h>
#include <init.h> #include <init.h>
#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <spi.h> #include <drivers/spi.h>
#include <misc/byteorder.h> #include <misc/byteorder.h>


#include "ssd1673_regs.h" #include "ssd1673_regs.h"
@@ -16,7 +16,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <spi.h> #include <drivers/spi.h>
#include <net/net_pkt.h> #include <net/net_pkt.h>
#include <net/net_if.h> #include <net/net_if.h>
#include <net/ethernet.h> #include <net/ethernet.h>
@@ -7,7 +7,7 @@
#include <errno.h> #include <errno.h>


#include <drivers/flash.h> #include <drivers/flash.h>
#include <spi.h> #include <drivers/spi.h>
#include <init.h> #include <init.h>
#include <string.h> #include <string.h>
#include "spi_flash_w25qxxdv_defs.h" #include "spi_flash_w25qxxdv_defs.h"
@@ -8,7 +8,7 @@


#include <errno.h> #include <errno.h>
#include <drivers/flash.h> #include <drivers/flash.h>
#include <spi.h> #include <drivers/spi.h>
#include <init.h> #include <init.h>
#include <string.h> #include <string.h>
#include "spi_nor.h" #include "spi_nor.h"
@@ -26,7 +26,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <string.h> #include <string.h>
#include <random/rand32.h> #include <random/rand32.h>


#include <spi.h> #include <drivers/spi.h>
#include <drivers/gpio.h> #include <drivers/gpio.h>


#include <net/ieee802154_radio.h> #include <net/ieee802154_radio.h>
@@ -11,7 +11,7 @@


#include <linker/sections.h> #include <linker/sections.h>
#include <sys/atomic.h> #include <sys/atomic.h>
#include <spi.h> #include <drivers/spi.h>


#include <ieee802154/cc1200.h> #include <ieee802154/cc1200.h>


@@ -11,7 +11,7 @@


#include <linker/sections.h> #include <linker/sections.h>
#include <sys/atomic.h> #include <sys/atomic.h>
#include <spi.h> #include <drivers/spi.h>


#include <ieee802154/cc2520.h> #include <ieee802154/cc2520.h>


@@ -12,7 +12,7 @@


#include <linker/sections.h> #include <linker/sections.h>
#include <sys/atomic.h> #include <sys/atomic.h>
#include <spi.h> #include <drivers/spi.h>


/* Runtime context structure /* Runtime context structure
*************************** ***************************
@@ -6,7 +6,7 @@


#include <errno.h> #include <errno.h>
#include <drivers/led_strip.h> #include <drivers/led_strip.h>
#include <spi.h> #include <drivers/spi.h>


struct apa102_data { struct apa102_data {
struct device *spi; struct device *spi;
@@ -29,7 +29,7 @@ LOG_MODULE_REGISTER(lpd880x);


#include <zephyr.h> #include <zephyr.h>
#include <device.h> #include <device.h>
#include <spi.h> #include <drivers/spi.h>
#include <misc/util.h> #include <misc/util.h>


/* /*
@@ -14,7 +14,7 @@ LOG_MODULE_REGISTER(ws2812);


#include <zephyr.h> #include <zephyr.h>
#include <device.h> #include <device.h>
#include <spi.h> #include <drivers/spi.h>
#include <misc/util.h> #include <misc/util.h>


/* /*
@@ -12,7 +12,7 @@
#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <misc/byteorder.h> #include <misc/byteorder.h>
#include <misc/__assert.h> #include <misc/__assert.h>
#include <spi.h> #include <drivers/spi.h>
#include <logging/log.h> #include <logging/log.h>


#include "adxl362.h" #include "adxl362.h"
@@ -10,7 +10,7 @@
#include <zephyr/types.h> #include <zephyr/types.h>
#include <device.h> #include <device.h>
#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <spi.h> #include <drivers/spi.h>


#define ADXL362_SLAVE_ID 1 #define ADXL362_SLAVE_ID 1


@@ -12,7 +12,7 @@
#include <misc/printk.h> #include <misc/printk.h>
#include <misc/__assert.h> #include <misc/__assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <spi.h> #include <drivers/spi.h>
#include <drivers/i2c.h> #include <drivers/i2c.h>
#include <logging/log.h> #include <logging/log.h>


@@ -10,7 +10,7 @@
#include <zephyr/types.h> #include <zephyr/types.h>
#include <device.h> #include <device.h>
#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <spi.h> #include <drivers/spi.h>
#include <drivers/i2c.h> #include <drivers/i2c.h>
#include <misc/util.h> #include <misc/util.h>


@@ -17,7 +17,7 @@
#ifdef DT_BOSCH_BME280_BUS_I2C #ifdef DT_BOSCH_BME280_BUS_I2C
#include <drivers/i2c.h> #include <drivers/i2c.h>
#elif defined DT_BOSCH_BME280_BUS_SPI #elif defined DT_BOSCH_BME280_BUS_SPI
#include <spi.h> #include <drivers/spi.h>
#endif #endif
#include <logging/log.h> #include <logging/log.h>


@@ -9,7 +9,7 @@
#define ZEPHYR_DRIVERS_SENSOR_BMI160_BMI160_H_ #define ZEPHYR_DRIVERS_SENSOR_BMI160_BMI160_H_


#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <spi.h> #include <drivers/spi.h>
#include <misc/util.h> #include <misc/util.h>


/* registers */ /* registers */
@@ -19,7 +19,7 @@
#define LIS2DH_BUS_DEV_NAME DT_INST_0_ST_LIS2DH_BUS_NAME #define LIS2DH_BUS_DEV_NAME DT_INST_0_ST_LIS2DH_BUS_NAME


#if defined(DT_ST_LIS2DH_BUS_SPI) #if defined(DT_ST_LIS2DH_BUS_SPI)
#include <spi.h> #include <drivers/spi.h>


#define LIS2DH_SPI_READ_BIT BIT(7) #define LIS2DH_SPI_READ_BIT BIT(7)
#define LIS2DH_SPI_AUTOINC_ADDR BIT(6) #define LIS2DH_SPI_AUTOINC_ADDR BIT(6)
@@ -10,7 +10,7 @@




#include <string.h> #include <string.h>
#include <spi.h> #include <drivers/spi.h>
#include "lis2ds12.h" #include "lis2ds12.h"
#include <logging/log.h> #include <logging/log.h>


@@ -15,7 +15,7 @@
#include <drivers/sensor.h> #include <drivers/sensor.h>


#if defined(DT_ST_LIS2DW12_BUS_SPI) #if defined(DT_ST_LIS2DW12_BUS_SPI)
#include <spi.h> #include <drivers/spi.h>
#elif defined(DT_ST_LIS2DW12_BUS_I2C) #elif defined(DT_ST_LIS2DW12_BUS_I2C)
#include <drivers/i2c.h> #include <drivers/i2c.h>
#endif #endif
@@ -11,7 +11,7 @@
#ifndef ZEPHYR_DRIVERS_SENSOR_LIS2DW12_LIS2DW12_H_ #ifndef ZEPHYR_DRIVERS_SENSOR_LIS2DW12_LIS2DW12_H_
#define ZEPHYR_DRIVERS_SENSOR_LIS2DW12_LIS2DW12_H_ #define ZEPHYR_DRIVERS_SENSOR_LIS2DW12_LIS2DW12_H_


#include <spi.h> #include <drivers/spi.h>
#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <misc/util.h> #include <misc/util.h>
#include <drivers/sensor.h> #include <drivers/sensor.h>
@@ -8,7 +8,7 @@
*/ */


#include <string.h> #include <string.h>
#include <spi.h> #include <drivers/spi.h>
#include "lsm6dsl.h" #include "lsm6dsl.h"
#include <logging/log.h> #include <logging/log.h>


@@ -8,7 +8,7 @@
#include <logging/log.h> #include <logging/log.h>
LOG_MODULE_REGISTER(spi_cc13xx_cc26xx); LOG_MODULE_REGISTER(spi_cc13xx_cc26xx);


#include <spi.h> #include <drivers/spi.h>
#include <sys_clock.h> #include <sys_clock.h>


#include <driverlib/prcm.h> #include <driverlib/prcm.h>
@@ -13,7 +13,7 @@
#define ZEPHYR_DRIVERS_SPI_SPI_CONTEXT_H_ #define ZEPHYR_DRIVERS_SPI_SPI_CONTEXT_H_


#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <spi.h> #include <drivers/spi.h>


#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -40,7 +40,7 @@ LOG_MODULE_REGISTER(spi_dw);
#include <drivers/interrupt_controller/ioapic.h> #include <drivers/interrupt_controller/ioapic.h>
#endif #endif


#include <spi.h> #include <drivers/spi.h>


#include "spi_dw.h" #include "spi_dw.h"
#include "spi_context.h" #include "spi_context.h"
@@ -9,7 +9,7 @@
#ifndef ZEPHYR_DRIVERS_SPI_SPI_DW_H_ #ifndef ZEPHYR_DRIVERS_SPI_SPI_DW_H_
#define ZEPHYR_DRIVERS_SPI_SPI_DW_H_ #define ZEPHYR_DRIVERS_SPI_SPI_DW_H_


#include <spi.h> #include <drivers/spi.h>


#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */


#include <spi.h> #include <drivers/spi.h>
#include <syscall_handler.h> #include <syscall_handler.h>
#include <string.h> #include <string.h>


@@ -23,7 +23,7 @@ LOG_MODULE_REGISTER(spi_intel);
#include <sys/sys_io.h> #include <sys/sys_io.h>
#include <power/power.h> #include <power/power.h>


#include <spi.h> #include <drivers/spi.h>
#include "spi_intel.h" #include "spi_intel.h"


#ifdef CONFIG_IOAPIC #ifdef CONFIG_IOAPIC
@@ -12,7 +12,7 @@ LOG_MODULE_REGISTER(spi_ll_stm32);
#include <kernel.h> #include <kernel.h>
#include <soc.h> #include <soc.h>
#include <errno.h> #include <errno.h>
#include <spi.h> #include <drivers/spi.h>
#include <toolchain.h> #include <toolchain.h>


#include <clock_control/stm32_clock_control.h> #include <clock_control/stm32_clock_control.h>
@@ -6,7 +6,7 @@
*/ */


#include <errno.h> #include <errno.h>
#include <spi.h> #include <drivers/spi.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <fsl_dspi.h> #include <fsl_dspi.h>


@@ -5,7 +5,7 @@
*/ */


#include <errno.h> #include <errno.h>
#include <spi.h> #include <drivers/spi.h>
#include <drivers/clock_control.h> #include <drivers/clock_control.h>
#include <fsl_lpspi.h> #include <fsl_lpspi.h>


@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */


#include <spi.h> #include <drivers/spi.h>
#include <nrfx_spi.h> #include <nrfx_spi.h>


#define LOG_DOMAIN "spi_nrfx_spi" #define LOG_DOMAIN "spi_nrfx_spi"
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */


#include <spi.h> #include <drivers/spi.h>
#include <nrfx_spim.h> #include <nrfx_spim.h>
#include <string.h> #include <string.h>


@@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */


#include <spi.h> #include <drivers/spi.h>
#include <nrfx_spis.h> #include <nrfx_spis.h>


#define LOG_DOMAIN "spi_nrfx_spis" #define LOG_DOMAIN "spi_nrfx_spis"
@@ -12,7 +12,7 @@ LOG_MODULE_REGISTER(spi_sam);
#include "spi_context.h" #include "spi_context.h"
#include <errno.h> #include <errno.h>
#include <device.h> #include <device.h>
#include <spi.h> #include <drivers/spi.h>
#include <soc.h> #include <soc.h>


#define SAM_SPI_CHIP_SELECT_COUNT 4 #define SAM_SPI_CHIP_SELECT_COUNT 4
@@ -11,7 +11,7 @@ LOG_MODULE_REGISTER(spi_sam0);
#include "spi_context.h" #include "spi_context.h"
#include <errno.h> #include <errno.h>
#include <device.h> #include <device.h>
#include <spi.h> #include <drivers/spi.h>
#include <soc.h> #include <soc.h>
#include <drivers/dma.h> #include <drivers/dma.h>


@@ -11,7 +11,7 @@


#include <sys/sys_io.h> #include <sys/sys_io.h>
#include <device.h> #include <device.h>
#include <spi.h> #include <drivers/spi.h>


#define SPI_CFG(dev) ((struct spi_sifive_cfg *) ((dev)->config->config_info)) #define SPI_CFG(dev) ((struct spi_sifive_cfg *) ((dev)->config->config_info))
#define SPI_DATA(dev) ((struct spi_sifive_data *) ((dev)->driver_data)) #define SPI_DATA(dev) ((struct spi_sifive_data *) ((dev)->driver_data))
@@ -13,7 +13,7 @@ LOG_MODULE_REGISTER(wifi_eswifi_bus_spi);
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <spi.h> #include <drivers/spi.h>


#include "eswifi.h" #include "eswifi.h"


@@ -9,7 +9,7 @@


#include <device.h> #include <device.h>
#include <drivers/gpio.h> #include <drivers/gpio.h>
#include <spi.h> #include <drivers/spi.h>


#include <wifi/winc1500.h> #include <wifi/winc1500.h>


@@ -12,7 +12,7 @@ LOG_MODULE_REGISTER(winc1500);
#include <stdint.h> #include <stdint.h>


#include <device.h> #include <device.h>
#include <spi.h> #include <drivers/spi.h>


#include "wifi_winc1500_nm_bsp_internal.h" #include "wifi_winc1500_nm_bsp_internal.h"


0 comments on commit bd70f6f

Please sign in to comment.
You can’t perform that action at this time.