drivers: audio: mpxxdtyy: Conver to use DT_ANY_INST_ON_BUS macro

Convert driver to use new DT_ANY_INST_ON_BUS(i2s) away from
DT_ST_MPXXDTYY_BUS_I2S.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-03-30 17:00:54 -05:00 committed by Kumar Gala
commit addaa802c1
3 changed files with 8 additions and 6 deletions

View file

@ -4,6 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#define DT_DRV_COMPAT st_mpxxdtyy
#include "mpxxdtyy.h" #include "mpxxdtyy.h"
#include <drivers/i2s.h> #include <drivers/i2s.h>
@ -11,7 +13,7 @@
#include <logging/log.h> #include <logging/log.h>
LOG_MODULE_DECLARE(mpxxdtyy); LOG_MODULE_DECLARE(mpxxdtyy);
#ifdef DT_ST_MPXXDTYY_BUS_I2S #if DT_ANY_INST_ON_BUS(i2s)
#define NUM_RX_BLOCKS 4 #define NUM_RX_BLOCKS 4
#define PDM_BLOCK_MAX_SIZE_BYTES 512 #define PDM_BLOCK_MAX_SIZE_BYTES 512
@ -138,4 +140,4 @@ int mpxxdtyy_i2s_configure(struct device *dev, struct dmic_cfg *cfg)
data->state = DMIC_STATE_CONFIGURED; data->state = DMIC_STATE_CONFIGURED;
return 0; return 0;
} }
#endif /* DT_ST_MPXXDTYY_BUS_I2S */ #endif /* DT_ANY_INST_ON_BUS(i2s) */

View file

@ -141,11 +141,11 @@ int sw_filter_lib_run(TPDMFilter_InitStruct *pdm_filter,
} }
static const struct _dmic_ops mpxxdtyy_driver_api = { static const struct _dmic_ops mpxxdtyy_driver_api = {
#ifdef DT_ST_MPXXDTYY_BUS_I2S #if DT_ANY_INST_ON_BUS(i2s)
.configure = mpxxdtyy_i2s_configure, .configure = mpxxdtyy_i2s_configure,
.trigger = mpxxdtyy_i2s_trigger, .trigger = mpxxdtyy_i2s_trigger,
.read = mpxxdtyy_i2s_read, .read = mpxxdtyy_i2s_read,
#endif /* DT_ST_MPXXDTYY_BUS_I2S */ #endif /* DT_ANY_INST_ON_BUS(i2s) */
}; };
static int mpxxdtyy_initialize(struct device *dev) static int mpxxdtyy_initialize(struct device *dev)

View file

@ -37,12 +37,12 @@ int sw_filter_lib_run(TPDMFilter_InitStruct *pdm_filter,
void *pdm_block, void *pcm_block, void *pdm_block, void *pcm_block,
size_t pdm_size, size_t pcm_size); size_t pdm_size, size_t pcm_size);
#ifdef DT_ST_MPXXDTYY_BUS_I2S #if DT_ANY_INST_ON_BUS(i2s)
int mpxxdtyy_i2s_read(struct device *dev, u8_t stream, void **buffer, int mpxxdtyy_i2s_read(struct device *dev, u8_t stream, void **buffer,
size_t *size, s32_t timeout); size_t *size, s32_t timeout);
int mpxxdtyy_i2s_trigger(struct device *dev, enum dmic_trigger cmd); int mpxxdtyy_i2s_trigger(struct device *dev, enum dmic_trigger cmd);
int mpxxdtyy_i2s_configure(struct device *dev, struct dmic_cfg *cfg); int mpxxdtyy_i2s_configure(struct device *dev, struct dmic_cfg *cfg);
#endif /* DT_ST_MPXXDTYY_BUS_I2S */ #endif /* DT_ANY_INST_ON_BUS(i2s) */
#ifdef __cplusplus #ifdef __cplusplus
} }