devicetree: Rename spi cs gpio macros

Rename the DT_*_CS_* macro's to DT_*_CS_GPIOS_* to be more clear.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-03-26 08:57:28 -05:00 committed by Kumar Gala
commit 1c3ed6dab6
4 changed files with 42 additions and 41 deletions

View file

@ -27,15 +27,15 @@ extern "C" {
* @param spi node identifier for a SPI bus controller
* @return 1 if it has a cs-gpios property, 0 otherwise
*/
#define DT_SPI_HAS_CS(spi) DT_NODE_HAS_PROP(spi, cs_gpios)
#define DT_SPI_HAS_CS_GPIOS(spi) DT_NODE_HAS_PROP(spi, cs_gpios)
/**
* @brief The number of chip select GPIOs in a SPI controller
* @param spi node identifier for a SPI bus controller
* @return The length of its cs-gpios, or 0 if it doesn't have one
*/
#define DT_SPI_NUM_CS(spi) \
COND_CODE_1(DT_SPI_HAS_CS(spi), \
#define DT_SPI_NUM_CS_GPIOS(spi) \
COND_CODE_1(DT_SPI_HAS_CS_GPIOS(spi), \
(DT_PROP_LEN(spi, cs_gpios)), (0))
/**
@ -44,15 +44,15 @@ extern "C" {
* @return 1 if the SPI device's bus DT_BUS(spi_dev) has a CS
* pin at index DT_REG_ADDR(spi_dev), 0 otherwise
*/
#define DT_SPI_DEV_HAS_CS(spi_dev) DT_SPI_HAS_CS(DT_BUS(spi_dev))
#define DT_SPI_DEV_HAS_CS_GPIOS(spi_dev) DT_SPI_HAS_CS_GPIOS(DT_BUS(spi_dev))
/**
* @brief Get GPIO controller name for a SPI device's chip select
* DT_SPI_DEV_HAS_CS(spi_dev) must expand to 1.
* DT_SPI_DEV_HAS_CS_GPIOS(spi_dev) must expand to 1.
* @brief spi_dev a SPI device node identifier
* @return label property of spi_dev's chip select GPIO controller
*/
#define DT_SPI_DEV_CS_GPIO_LABEL(spi_dev) \
#define DT_SPI_DEV_CS_GPIOS_LABEL(spi_dev) \
DT_GPIO_LABEL_BY_IDX(DT_BUS(spi_dev), cs_gpios, DT_REG_ADDR(spi_dev))
/**
@ -62,7 +62,7 @@ extern "C" {
* @brief spi_dev a SPI device node identifier
* @return pin number of spi_dev's chip select GPIO
*/
#define DT_SPI_DEV_CS_GPIO_PIN(spi_dev) \
#define DT_SPI_DEV_CS_GPIOS_PIN(spi_dev) \
DT_GPIO_PIN_BY_IDX(DT_BUS(spi_dev), cs_gpios, DT_REG_ADDR(spi_dev))
/**
@ -72,43 +72,44 @@ extern "C" {
* @brief spi_dev a SPI device node identifier
* @return flags value of spi_dev's chip select GPIO specifier
*/
#define DT_SPI_DEV_CS_GPIO_FLAGS(spi_dev) \
#define DT_SPI_DEV_CS_GPIOS_FLAGS(spi_dev) \
DT_GPIO_FLAGS_BY_IDX(DT_BUS(spi_dev), cs_gpios, DT_REG_ADDR(spi_dev))
/**
* @brief Equivalent to DT_SPI_DEV_HAS_CS(DT_DRV_INST(inst))
* @brief Equivalent to DT_SPI_DEV_HAS_CS_GPIOS(DT_DRV_INST(inst))
* @param inst instance number
* @return 1 if the instance's bus has a CS pin at index
* DT_INST_REG_ADDR(inst), 0 otherwise
*/
#define DT_INST_SPI_DEV_HAS_CS(inst) DT_SPI_DEV_HAS_CS(DT_DRV_INST(inst))
#define DT_INST_SPI_DEV_HAS_CS_GPIOS(inst) \
DT_SPI_DEV_HAS_CS_GPIOS(DT_DRV_INST(inst))
/**
* @brief Get GPIO controller name for a SPI device instance
* This is equivalent to DT_SPI_DEV_CS_GPIO_LABEL(DT_DRV_INST(inst)).
* This is equivalent to DT_SPI_DEV_CS_GPIOS_LABEL(DT_DRV_INST(inst)).
* @brief inst instance number
* @return label property of the instance's chip select GPIO controller
*/
#define DT_INST_SPI_DEV_CS_GPIO_LABEL(inst) \
DT_SPI_DEV_CS_GPIO_LABEL(DT_DRV_INST(inst))
#define DT_INST_SPI_DEV_CS_GPIOS_LABEL(inst) \
DT_SPI_DEV_CS_GPIOS_LABEL(DT_DRV_INST(inst))
/**
* @brief Get GPIO specifier "pin" value for a SPI device instance
* This is equivalent to DT_SPI_DEV_CS_GPIO_PIN(DT_DRV_INST(inst)).
* This is equivalent to DT_SPI_DEV_CS_GPIOS_PIN(DT_DRV_INST(inst)).
* @brief inst a SPI device instance number
* @return pin number of the instance's chip select GPIO
*/
#define DT_INST_SPI_DEV_CS_GPIO_PIN(inst) \
DT_SPI_DEV_CS_GPIO_PIN(DT_DRV_INST(inst))
#define DT_INST_SPI_DEV_CS_GPIOS_PIN(inst) \
DT_SPI_DEV_CS_GPIOS_PIN(DT_DRV_INST(inst))
/**
* @brief Get GPIO specifier "flags" value for a SPI device instance
* This is equivalent to DT_SPI_DEV_CS_GPIO_FLAGS(DT_DRV_INST(inst)).
* This is equivalent to DT_SPI_DEV_CS_GPIOS_FLAGS(DT_DRV_INST(inst)).
* @brief inst a SPI device instance number
* @return flags value of the instance's chip select GPIO specifier
*/
#define DT_INST_SPI_DEV_CS_GPIO_FLAGS(inst) \
DT_SPI_DEV_CS_GPIO_FLAGS(DT_DRV_INST(inst))
#define DT_INST_SPI_DEV_CS_GPIOS_FLAGS(inst) \
DT_SPI_DEV_CS_GPIOS_FLAGS(DT_DRV_INST(inst))
/**
* @}