drivers: tests: replace usage of spi_is_ready with spi_is_ready_dt
`spi_is_ready` function is being deprecated in favor of `spi_is_ready_dt` so let's replace the old usage in the tree. Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
This commit is contained in:
parent
5170c16e5c
commit
e077fb73ec
58 changed files with 59 additions and 59 deletions
|
|
@ -940,7 +940,7 @@ static int lmp90xxx_init(const struct device *dev)
|
||||||
/* Force INST1 + UAB on first access */
|
/* Force INST1 + UAB on first access */
|
||||||
data->ura = LMP90XXX_INVALID_URA;
|
data->ura = LMP90XXX_INVALID_URA;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -274,7 +274,7 @@ static int mcp320x_init(const struct device *dev)
|
||||||
|
|
||||||
k_sem_init(&data->sem, 0, 1);
|
k_sem_init(&data->sem, 0, 1);
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -521,7 +521,7 @@ static int bt_spi_init(const struct device *unused)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(unused);
|
ARG_UNUSED(unused);
|
||||||
|
|
||||||
if (!spi_is_ready(&bus)) {
|
if (!spi_is_ready_dt(&bus)) {
|
||||||
LOG_ERR("SPI device not ready");
|
LOG_ERR("SPI device not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -953,7 +953,7 @@ static int mcp2515_init(const struct device *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!spi_is_ready(&dev_cfg->bus)) {
|
if (!spi_is_ready_dt(&dev_cfg->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", dev_cfg->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", dev_cfg->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ static int dacx0508_init(const struct device *dev)
|
||||||
struct dacx0508_data *data = dev->data;
|
struct dacx0508_data *data = dev->data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -351,7 +351,7 @@ static int ili9xxx_init(const struct device *dev)
|
||||||
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->spi)) {
|
if (!spi_is_ready_dt(&config->spi)) {
|
||||||
LOG_ERR("SPI device is not ready");
|
LOG_ERR("SPI device is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,7 @@ static int max7219_init(const struct device *dev)
|
||||||
struct max7219_data *dev_data = dev->data;
|
struct max7219_data *dev_data = dev->data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!spi_is_ready(&dev_config->spi)) {
|
if (!spi_is_ready_dt(&dev_config->spi)) {
|
||||||
LOG_ERR("SPI device not ready");
|
LOG_ERR("SPI device not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -449,7 +449,7 @@ static int st7735r_init(const struct device *dev)
|
||||||
const struct st7735r_config *config = dev->config;
|
const struct st7735r_config *config = dev->config;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,7 @@ static int st7789v_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct st7789v_config *config = dev->config;
|
const struct st7789v_config *config = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI device not ready");
|
LOG_ERR("SPI device not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,7 @@ static int ls0xx_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct ls0xx_config *config = dev->config;
|
const struct ls0xx_config *config = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ static inline bool ssd1306_bus_ready(const struct device *dev)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return spi_is_ready(&config->bus);
|
return spi_is_ready_dt(&config->bus);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int ssd1306_write_bus(const struct device *dev,
|
static inline int ssd1306_write_bus(const struct device *dev,
|
||||||
|
|
|
||||||
|
|
@ -844,7 +844,7 @@ static int ssd16xx_init(const struct device *dev)
|
||||||
|
|
||||||
LOG_DBG("");
|
LOG_DBG("");
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -618,7 +618,7 @@ static int uc81xx_init(const struct device *dev)
|
||||||
|
|
||||||
LOG_DBG("");
|
LOG_DBG("");
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ static bool eeprom_at25_bus_is_ready(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct eeprom_at2x_config *config = dev->config;
|
const struct eeprom_at2x_config *config = dev->config;
|
||||||
|
|
||||||
return spi_is_ready(&config->bus.spi);
|
return spi_is_ready_dt(&config->bus.spi);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int eeprom_at25_rdsr(const struct device *dev, uint8_t *status)
|
static int eeprom_at25_rdsr(const struct device *dev, uint8_t *status)
|
||||||
|
|
|
||||||
|
|
@ -675,7 +675,7 @@ int dsa_hw_init(struct ksz8xxx_data *pdev)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_DSA_SPI)
|
#if defined(CONFIG_DSA_SPI)
|
||||||
if (!spi_is_ready(&pdev->spi)) {
|
if (!spi_is_ready_dt(&pdev->spi)) {
|
||||||
LOG_ERR("SPI bus %s is not ready",
|
LOG_ERR("SPI bus %s is not ready",
|
||||||
pdev->spi.bus->name);
|
pdev->spi.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
|
||||||
|
|
@ -782,7 +782,7 @@ static int eth_enc28j60_init(const struct device *dev)
|
||||||
struct eth_enc28j60_runtime *context = dev->data;
|
struct eth_enc28j60_runtime *context = dev->data;
|
||||||
|
|
||||||
/* SPI config */
|
/* SPI config */
|
||||||
if (!spi_is_ready(&config->spi)) {
|
if (!spi_is_ready_dt(&config->spi)) {
|
||||||
LOG_ERR("SPI master port %s not ready", config->spi.bus->name);
|
LOG_ERR("SPI master port %s not ready", config->spi.bus->name);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -656,7 +656,7 @@ static int enc424j600_init(const struct device *dev)
|
||||||
context->dev = dev;
|
context->dev = dev;
|
||||||
|
|
||||||
/* SPI config */
|
/* SPI config */
|
||||||
if (!spi_is_ready(&config->spi)) {
|
if (!spi_is_ready_dt(&config->spi)) {
|
||||||
LOG_ERR("SPI master port %s not ready", config->spi.bus->name);
|
LOG_ERR("SPI master port %s not ready", config->spi.bus->name);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -473,7 +473,7 @@ static int w5500_init(const struct device *dev)
|
||||||
const struct w5500_config *config = dev->config;
|
const struct w5500_config *config = dev->config;
|
||||||
struct w5500_runtime *ctx = dev->data;
|
struct w5500_runtime *ctx = dev->data;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->spi)) {
|
if (!spi_is_ready_dt(&config->spi)) {
|
||||||
LOG_ERR("SPI master port %s not ready", config->spi.bus->name);
|
LOG_ERR("SPI master port %s not ready", config->spi.bus->name);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -542,7 +542,7 @@ static int spi_flash_at45_init(const struct device *dev)
|
||||||
const struct spi_flash_at45_config *dev_config = dev->config;
|
const struct spi_flash_at45_config *dev_config = dev->config;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (!spi_is_ready(&dev_config->bus)) {
|
if (!spi_is_ready_dt(&dev_config->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", dev_config->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", dev_config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1139,7 +1139,7 @@ static int spi_nor_configure(const struct device *dev)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* Validate bus and CS is ready */
|
/* Validate bus and CS is ready */
|
||||||
if (!spi_is_ready(&cfg->spi)) {
|
if (!spi_is_ready_dt(&cfg->spi)) {
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -359,7 +359,7 @@ static int mcp23s17_init(const struct device *dev)
|
||||||
const struct mcp23s17_config *config = dev->config;
|
const struct mcp23s17_config *config = dev->config;
|
||||||
struct mcp23s17_drv_data *drv_data = dev->data;
|
struct mcp23s17_drv_data *drv_data = dev->data;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ static int mcp23sxx_bus_is_ready(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct mcp23xxx_config *config = dev->config;
|
const struct mcp23xxx_config *config = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus.spi)) {
|
if (!spi_is_ready_dt(&config->bus.spi)) {
|
||||||
LOG_ERR("SPI bus %s not ready", config->bus.spi.bus->name);
|
LOG_ERR("SPI bus %s not ready", config->bus.spi.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ static int gpio_sn74hc595_init(const struct device *dev)
|
||||||
const struct gpio_sn74hc595_config *config = dev->config;
|
const struct gpio_sn74hc595_config *config = dev->config;
|
||||||
struct gpio_sn74hc595_drv_data *drv_data = dev->data;
|
struct gpio_sn74hc595_drv_data *drv_data = dev->data;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -744,7 +744,7 @@ static int cc1200_init(const struct device *dev)
|
||||||
}
|
}
|
||||||
gpio_pin_configure_dt(&config->interrupt, GPIO_INPUT);
|
gpio_pin_configure_dt(&config->interrupt, GPIO_INPUT);
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI bus %s is not ready", config->bus.bus->name);
|
LOG_ERR("SPI bus %s is not ready", config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -989,7 +989,7 @@ static int cc2520_init(const struct device *dev)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!spi_is_ready(&cfg->bus)) {
|
if (!spi_is_ready_dt(&cfg->bus)) {
|
||||||
LOG_ERR("SPI bus %s not ready", cfg->bus.bus->name);
|
LOG_ERR("SPI bus %s not ready", cfg->bus.bus->name);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1494,7 +1494,7 @@ static int dw1000_init(const struct device *dev)
|
||||||
memcpy(&ctx->spi_cfg_slow, &hi_cfg->bus.config, sizeof(ctx->spi_cfg_slow));
|
memcpy(&ctx->spi_cfg_slow, &hi_cfg->bus.config, sizeof(ctx->spi_cfg_slow));
|
||||||
ctx->spi_cfg_slow.frequency = DWT_SPI_SLOW_FREQ;
|
ctx->spi_cfg_slow.frequency = DWT_SPI_SLOW_FREQ;
|
||||||
|
|
||||||
if (!spi_is_ready(&hi_cfg->bus)) {
|
if (!spi_is_ready_dt(&hi_cfg->bus)) {
|
||||||
LOG_ERR("SPI device not ready");
|
LOG_ERR("SPI device not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1381,7 +1381,7 @@ static int mcr20a_init(const struct device *dev)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("Configuring SPI failed");
|
LOG_ERR("Configuring SPI failed");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -964,7 +964,7 @@ static inline int configure_spi(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct rf2xx_config *conf = dev->config;
|
const struct rf2xx_config *conf = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&conf->spi)) {
|
if (!spi_is_ready_dt(&conf->spi)) {
|
||||||
LOG_ERR("SPI bus %s is not ready",
|
LOG_ERR("SPI bus %s is not ready",
|
||||||
conf->spi.bus->name);
|
conf->spi.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ static int apa102_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct apa102_config *config = dev->config;
|
const struct apa102_config *config = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ static int lpd880x_strip_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct lpd880x_config *config = dev->config;
|
const struct lpd880x_config *config = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI device %s not ready", config->bus.bus->name);
|
LOG_ERR("SPI device %s not ready", config->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ static int tlc5971_init(const struct device *dev)
|
||||||
const struct tlc5971_config *cfg = dev->config;
|
const struct tlc5971_config *cfg = dev->config;
|
||||||
struct tlc5971_data *data = dev->data;
|
struct tlc5971_data *data = dev->data;
|
||||||
|
|
||||||
if (!spi_is_ready(&cfg->bus)) {
|
if (!spi_is_ready_dt(&cfg->bus)) {
|
||||||
LOG_ERR("%s: SPI device %s not ready", dev->name, cfg->bus.bus->name);
|
LOG_ERR("%s: SPI device %s not ready", dev->name, cfg->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ static int ws2812_spi_init(const struct device *dev)
|
||||||
const struct ws2812_spi_cfg *cfg = dev_cfg(dev);
|
const struct ws2812_spi_cfg *cfg = dev_cfg(dev);
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
if (!spi_is_ready(&cfg->bus)) {
|
if (!spi_is_ready_dt(&cfg->bus)) {
|
||||||
LOG_ERR("SPI device %s not ready", cfg->bus.bus->name);
|
LOG_ERR("SPI device %s not ready", cfg->bus.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -449,7 +449,7 @@ static int sx126x_lora_init(const struct device *dev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_ERR("SPI device not ready");
|
LOG_ERR("SPI device not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -582,7 +582,7 @@ static int sx127x_lora_init(const struct device *dev)
|
||||||
int ret;
|
int ret;
|
||||||
uint8_t regval;
|
uint8_t regval;
|
||||||
|
|
||||||
if (!spi_is_ready(&dev_config.bus)) {
|
if (!spi_is_ready_dt(&dev_config.bus)) {
|
||||||
LOG_ERR("SPI device not ready");
|
LOG_ERR("SPI device not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ int ft8xx_drv_init(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!spi_is_ready(&spi)) {
|
if (!spi_is_ready_dt(&spi)) {
|
||||||
LOG_ERR("SPI bus %s not ready", spi.bus->name);
|
LOG_ERR("SPI bus %s not ready", spi.bus->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ static int adxl345_reg_access_i2c(const struct device *dev, uint8_t cmd, uint8_t
|
||||||
#if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi)
|
#if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi)
|
||||||
static bool adxl345_bus_is_ready_spi(const union adxl345_bus *bus)
|
static bool adxl345_bus_is_ready_spi(const union adxl345_bus *bus)
|
||||||
{
|
{
|
||||||
return spi_is_ready(&bus->spi);
|
return spi_is_ready_dt(&bus->spi);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int adxl345_reg_access_spi(const struct device *dev, uint8_t cmd, uint8_t reg_addr,
|
static int adxl345_reg_access_spi(const struct device *dev, uint8_t cmd, uint8_t reg_addr,
|
||||||
|
|
|
||||||
|
|
@ -708,7 +708,7 @@ static int adxl362_init(const struct device *dev)
|
||||||
uint8_t value;
|
uint8_t value;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->bus)) {
|
if (!spi_is_ready_dt(&config->bus)) {
|
||||||
LOG_DBG("spi device not ready: %s", config->bus.bus->name);
|
LOG_DBG("spi device not ready: %s", config->bus.bus->name);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ int adxl372_spi_init(const struct device *dev)
|
||||||
|
|
||||||
data->hw_tf = &adxl372_spi_transfer_fn;
|
data->hw_tf = &adxl372_spi_transfer_fn;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->spi)) {
|
if (!spi_is_ready_dt(&config->spi)) {
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ LOG_MODULE_DECLARE(BME280, CONFIG_SENSOR_LOG_LEVEL);
|
||||||
|
|
||||||
static int bme280_bus_check_spi(const union bme280_bus *bus)
|
static int bme280_bus_check_spi(const union bme280_bus *bus)
|
||||||
{
|
{
|
||||||
return spi_is_ready(&bus->spi) ? 0 : -ENODEV;
|
return spi_is_ready_dt(&bus->spi) ? 0 : -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bme280_reg_read_spi(const union bme280_bus *bus,
|
static int bme280_reg_read_spi(const union bme280_bus *bus,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ LOG_MODULE_DECLARE(bme680, CONFIG_SENSOR_LOG_LEVEL);
|
||||||
|
|
||||||
static int bme680_bus_check_spi(const union bme680_bus *bus)
|
static int bme680_bus_check_spi(const union bme680_bus *bus)
|
||||||
{
|
{
|
||||||
return spi_is_ready(&bus->spi) ? 0 : -ENODEV;
|
return spi_is_ready_dt(&bus->spi) ? 0 : -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int bme680_set_mem_page(const struct device *dev, uint8_t addr)
|
static inline int bme680_set_mem_page(const struct device *dev, uint8_t addr)
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ bool bmi160_bus_ready_spi(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct bmi160_cfg *cfg = dev->config;
|
const struct bmi160_cfg *cfg = dev->config;
|
||||||
|
|
||||||
return spi_is_ready(&cfg->bus.spi);
|
return spi_is_ready_dt(&cfg->bus.spi);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bmi160_read_spi(const struct device *dev,
|
int bmi160_read_spi(const struct device *dev,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ LOG_MODULE_DECLARE(bmi270, CONFIG_SENSOR_LOG_LEVEL);
|
||||||
|
|
||||||
static int bmi270_bus_check_spi(const union bmi270_bus *bus)
|
static int bmi270_bus_check_spi(const union bmi270_bus *bus)
|
||||||
{
|
{
|
||||||
return spi_is_ready(&bus->spi) ? 0 : -ENODEV;
|
return spi_is_ready_dt(&bus->spi) ? 0 : -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bmi270_reg_read_spi(const union bmi270_bus *bus,
|
static int bmi270_reg_read_spi(const union bmi270_bus *bus,
|
||||||
|
|
|
||||||
|
|
@ -605,7 +605,7 @@ static int bmp388_init(const struct device *dev)
|
||||||
#if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi)
|
#if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi)
|
||||||
/* Verify the SPI bus */
|
/* Verify the SPI bus */
|
||||||
if (is_spi) {
|
if (is_spi) {
|
||||||
if (!spi_is_ready(&cfg->spi)) {
|
if (!spi_is_ready_dt(&cfg->spi)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ int i3g4250d_spi_init(const struct device *dev)
|
||||||
struct i3g4250d_data *i3g4250d = dev->data;
|
struct i3g4250d_data *i3g4250d = dev->data;
|
||||||
const struct i3g4250d_device_config *cfg = dev->config;
|
const struct i3g4250d_device_config *cfg = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&cfg->spi)) {
|
if (!spi_is_ready_dt(&cfg->spi)) {
|
||||||
LOG_ERR("spi not ready");
|
LOG_ERR("spi not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -392,7 +392,7 @@ static int icm42605_init(const struct device *dev)
|
||||||
struct icm42605_data *drv_data = dev->data;
|
struct icm42605_data *drv_data = dev->data;
|
||||||
const struct icm42605_config *cfg = dev->config;
|
const struct icm42605_config *cfg = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&cfg->spi)) {
|
if (!spi_is_ready_dt(&cfg->spi)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -621,7 +621,7 @@ static int icm42670_init(const struct device *dev)
|
||||||
struct icm42670_data *data = dev->data;
|
struct icm42670_data *data = dev->data;
|
||||||
const struct icm42670_config *cfg = dev->config;
|
const struct icm42670_config *cfg = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&cfg->spi)) {
|
if (!spi_is_ready_dt(&cfg->spi)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ int iis2dh_spi_init(const struct device *dev)
|
||||||
struct iis2dh_data *data = dev->data;
|
struct iis2dh_data *data = dev->data;
|
||||||
const struct iis2dh_device_config *config = dev->config;
|
const struct iis2dh_device_config *config = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->spi)) {
|
if (!spi_is_ready_dt(&config->spi)) {
|
||||||
LOG_ERR("Bus device is not ready");
|
LOG_ERR("Bus device is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ int iis2mdc_spi_init(const struct device *dev)
|
||||||
struct iis2mdc_data *data = dev->data;
|
struct iis2mdc_data *data = dev->data;
|
||||||
const struct iis2mdc_dev_config *const cfg = dev->config;
|
const struct iis2mdc_dev_config *const cfg = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&cfg->spi)) {
|
if (!spi_is_ready_dt(&cfg->spi)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ static int iis3dhhc_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct iis3dhhc_config * const config = dev->config;
|
const struct iis3dhhc_config * const config = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->spi)) {
|
if (!spi_is_ready_dt(&config->spi)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ int iis3dhhc_spi_init(const struct device *dev)
|
||||||
struct iis3dhhc_data *data = dev->data;
|
struct iis3dhhc_data *data = dev->data;
|
||||||
const struct iis3dhhc_config *config = dev->config;
|
const struct iis3dhhc_config *config = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->spi)) {
|
if (!spi_is_ready_dt(&config->spi)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ int ism330dhcx_spi_init(const struct device *dev)
|
||||||
struct ism330dhcx_data *data = dev->data;
|
struct ism330dhcx_data *data = dev->data;
|
||||||
const struct ism330dhcx_config *cfg = dev->config;
|
const struct ism330dhcx_config *cfg = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&cfg->spi)) {
|
if (!spi_is_ready_dt(&cfg->spi)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ int lis2dh_spi_init(const struct device *dev)
|
||||||
|
|
||||||
data->hw_tf = &lis2dh_spi_transfer_fn;
|
data->hw_tf = &lis2dh_spi_transfer_fn;
|
||||||
|
|
||||||
if (!spi_is_ready(&cfg->bus_cfg.spi)) {
|
if (!spi_is_ready_dt(&cfg->bus_cfg.spi)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ int lsm6dsl_spi_init(const struct device *dev)
|
||||||
|
|
||||||
data->hw_tf = &lsm6dsl_spi_transfer_fn;
|
data->hw_tf = &lsm6dsl_spi_transfer_fn;
|
||||||
|
|
||||||
if (!spi_is_ready(&cfg->bus_cfg.spi)) {
|
if (!spi_is_ready_dt(&cfg->bus_cfg.spi)) {
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ static int max6675_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct max6675_config *config = dev->config;
|
const struct max6675_config *config = dev->config;
|
||||||
|
|
||||||
if (!spi_is_ready(&config->spi)) {
|
if (!spi_is_ready_dt(&config->spi)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ static int ms5607_spi_read_adc(const struct ms5607_config *config, uint32_t *val
|
||||||
|
|
||||||
static int ms5607_spi_check(const struct ms5607_config *config)
|
static int ms5607_spi_check(const struct ms5607_config *config)
|
||||||
{
|
{
|
||||||
if (!spi_is_ready(&config->bus_cfg.spi)) {
|
if (!spi_is_ready_dt(&config->bus_cfg.spi)) {
|
||||||
LOG_DBG("SPI bus not ready");
|
LOG_DBG("SPI bus not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ int eswifi_spi_init(struct eswifi_dev *eswifi)
|
||||||
gpio_pin_configure_dt(&cfg->dr, GPIO_INPUT);
|
gpio_pin_configure_dt(&cfg->dr, GPIO_INPUT);
|
||||||
|
|
||||||
/* SPI BUS */
|
/* SPI BUS */
|
||||||
if (!spi_is_ready(&cfg->bus)) {
|
if (!spi_is_ready_dt(&cfg->bus)) {
|
||||||
LOG_ERR("SPI bus is not ready");
|
LOG_ERR("SPI bus is not ready");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ int8_t nm_bus_init(void *pvinit)
|
||||||
/* Not implemented */
|
/* Not implemented */
|
||||||
#elif defined CONF_WINC_USE_SPI
|
#elif defined CONF_WINC_USE_SPI
|
||||||
/* setup SPI device */
|
/* setup SPI device */
|
||||||
if (!spi_is_ready(&winc1500_config.spi)) {
|
if (!spi_is_ready_dt(&winc1500_config.spi)) {
|
||||||
LOG_ERR("spi device binding");
|
LOG_ERR("spi device binding");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -543,7 +543,7 @@ ZTEST(spi_loopback, test_spi_loopback)
|
||||||
&async_evt, &caller, NULL,
|
&async_evt, &caller, NULL,
|
||||||
K_PRIO_COOP(7), 0, K_NO_WAIT);
|
K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||||
#endif
|
#endif
|
||||||
zassert_true(spi_is_ready(&spi_slow), "Slow spi lookback device is not ready");
|
zassert_true(spi_is_ready_dt(&spi_slow), "Slow spi lookback device is not ready");
|
||||||
|
|
||||||
LOG_INF("SPI test slow config");
|
LOG_INF("SPI test slow config");
|
||||||
|
|
||||||
|
|
@ -560,7 +560,7 @@ ZTEST(spi_loopback, test_spi_loopback)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
zassert_true(spi_is_ready(&spi_fast), "Fast spi lookback device is not ready");
|
zassert_true(spi_is_ready_dt(&spi_fast), "Fast spi lookback device is not ready");
|
||||||
|
|
||||||
LOG_INF("SPI test fast config");
|
LOG_INF("SPI test fast config");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue