drivers: audio: Port to the new timeout API

Port the I2S and DMIC drivers to the new timeout API so that they do
not need to enable legacy timeouts.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2020-05-04 13:13:36 +02:00 committed by Carles Cufí
commit 9ba20dd48e
8 changed files with 20 additions and 15 deletions

View file

@ -384,7 +384,7 @@ static int i2s_stm32_read(struct device *dev, void **mem_block, size_t *size)
if (dev_data->rx.state != I2S_STATE_ERROR) {
ret = k_sem_take(&dev_data->rx.sem,
K_MSEC(dev_data->rx.cfg.timeout));
SYS_TIMEOUT_MS(dev_data->rx.cfg.timeout));
if (ret < 0) {
return ret;
}
@ -410,7 +410,8 @@ static int i2s_stm32_write(struct device *dev, void *mem_block, size_t size)
return -EIO;
}
ret = k_sem_take(&dev_data->tx.sem, K_MSEC(dev_data->tx.cfg.timeout));
ret = k_sem_take(&dev_data->tx.sem,
SYS_TIMEOUT_MS(dev_data->tx.cfg.timeout));
if (ret < 0) {
return ret;
}