drivers: adc: adc_mcp320x: Rename defines to remove DT_ prefix
We want to limit DT_ prefix to macros from devicetree.h and generation. So rename DT_INST_MCP320X* to just INST_DT_MCP320X*. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
b9e6339a4e
commit
8639469339
|
@ -316,7 +316,7 @@ static const struct adc_driver_api mcp320x_adc_api = {
|
|||
#endif
|
||||
};
|
||||
|
||||
#define DT_INST_MCP320X(inst, t) DT_INST(inst, microchip_mcp##t)
|
||||
#define INST_DT_MCP320X(inst, t) DT_INST(inst, microchip_mcp##t)
|
||||
|
||||
#define MCP320X_DEVICE(t, n, ch) \
|
||||
static struct mcp320x_data mcp##t##_data_##n = { \
|
||||
|
@ -325,29 +325,29 @@ static const struct adc_driver_api mcp320x_adc_api = {
|
|||
ADC_CONTEXT_INIT_SYNC(mcp##t##_data_##n, ctx), \
|
||||
}; \
|
||||
static const struct mcp320x_config mcp##t##_config_##n = { \
|
||||
.spi_dev_name = DT_BUS_LABEL(DT_INST_MCP320X(n, t)), \
|
||||
.spi_dev_name = DT_BUS_LABEL(INST_DT_MCP320X(n, t)), \
|
||||
.spi_cs_dev_name = \
|
||||
UTIL_AND( \
|
||||
DT_SPI_DEV_HAS_CS_GPIOS(DT_INST_MCP320X(n, t)), \
|
||||
DT_SPI_DEV_CS_GPIOS_LABEL(DT_INST_MCP320X(n, t)) \
|
||||
DT_SPI_DEV_HAS_CS_GPIOS(INST_DT_MCP320X(n, t)), \
|
||||
DT_SPI_DEV_CS_GPIOS_LABEL(INST_DT_MCP320X(n, t)) \
|
||||
), \
|
||||
.spi_cs_pin = \
|
||||
UTIL_AND( \
|
||||
DT_SPI_DEV_HAS_CS_GPIOS(DT_INST_MCP320X(n, t)), \
|
||||
DT_SPI_DEV_CS_GPIOS_PIN(DT_INST_MCP320X(n, t)) \
|
||||
DT_SPI_DEV_HAS_CS_GPIOS(INST_DT_MCP320X(n, t)), \
|
||||
DT_SPI_DEV_CS_GPIOS_PIN(INST_DT_MCP320X(n, t)) \
|
||||
), \
|
||||
.spi_cfg = { \
|
||||
.operation = (SPI_OP_MODE_MASTER | SPI_TRANSFER_MSB | \
|
||||
SPI_WORD_SET(8)), \
|
||||
.frequency = DT_PROP(DT_INST_MCP320X(n, t), \
|
||||
.frequency = DT_PROP(INST_DT_MCP320X(n, t), \
|
||||
spi_max_frequency), \
|
||||
.slave = DT_REG_ADDR(DT_INST_MCP320X(n, t)), \
|
||||
.slave = DT_REG_ADDR(INST_DT_MCP320X(n, t)), \
|
||||
.cs = &mcp##t##_data_##n.spi_cs, \
|
||||
}, \
|
||||
.channels = ch, \
|
||||
}; \
|
||||
DEVICE_AND_API_INIT(mcp##t##_##n, \
|
||||
DT_LABEL(DT_INST_MCP320X(n, t)), \
|
||||
DT_LABEL(INST_DT_MCP320X(n, t)), \
|
||||
&mcp320x_init, &mcp##t##_data_##n, \
|
||||
&mcp##t##_config_##n, POST_KERNEL, \
|
||||
CONFIG_ADC_MCP320X_INIT_PRIORITY, \
|
||||
|
@ -365,8 +365,8 @@ static const struct adc_driver_api mcp320x_adc_api = {
|
|||
|
||||
#define CALL_WITH_ARG(arg, expr) expr(arg);
|
||||
|
||||
#define DT_INST_MCP320X_FOREACH(t, inst_expr) \
|
||||
#define INST_DT_MCP320X_FOREACH(t, inst_expr) \
|
||||
UTIL_LISTIFY(DT_NUM_INST(microchip_mcp##t), CALL_WITH_ARG, inst_expr)
|
||||
|
||||
DT_INST_MCP320X_FOREACH(3204, MCP3204_DEVICE);
|
||||
DT_INST_MCP320X_FOREACH(3208, MCP3208_DEVICE);
|
||||
INST_DT_MCP320X_FOREACH(3204, MCP3204_DEVICE);
|
||||
INST_DT_MCP320X_FOREACH(3208, MCP3208_DEVICE);
|
||||
|
|
Loading…
Reference in a new issue