drivers: gpio: sx1509b: convert to DT_<COMPAT>_<INSTANCE> defines

Convert sx1509b sensor driver to use new defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-02-06 09:19:05 -06:00 committed by Kumar Gala
parent 16dc36bb61
commit 34a2630141
4 changed files with 11 additions and 8 deletions

View file

@ -67,7 +67,7 @@ DEVICE_INIT(vdd_pwr_ctrl_init, "", pwr_ctrl_init, NULL, &vdd_pwr_ctrl_cfg,
#endif
static const struct pwr_ctrl_cfg ccs_vdd_pwr_ctrl_cfg = {
.port = CONFIG_GPIO_SX1509B_DEV_NAME,
.port = DT_SEMTECH_SX1509B_0_LABEL,
.pin = CCS_VDD_PWR_CTRL_GPIO_PIN,
};

View file

@ -1,3 +0,0 @@
#define CONFIG_GPIO_SX1509B_DEV_NAME DT_NORDIC_NRF_I2C_40003000_SEMTECH_SX1509B_3E_LABEL
#define CONFIG_GPIO_SX1509B_I2C_ADDR DT_NORDIC_NRF_I2C_40003000_SEMTECH_SX1509B_3E_BASE_ADDRESS
#define CONFIG_GPIO_SX1509B_I2C_MASTER_DEV_NAME DT_NORDIC_NRF_I2C_40003000_SEMTECH_SX1509B_3E_BUS_NAME

View file

@ -14,6 +14,12 @@
#include <misc/byteorder.h>
#include <misc/util.h>
#ifdef CONFIG_HAS_DTS_I2C
#define CONFIG_GPIO_SX1509B_DEV_NAME DT_SEMTECH_SX1509B_0_LABEL
#define CONFIG_GPIO_SX1509B_I2C_ADDR DT_SEMTECH_SX1509B_0_BASE_ADDRESS
#define CONFIG_GPIO_SX1509B_I2C_MASTER_DEV_NAME DT_SEMTECH_SX1509B_0_BUS_NAME
#endif
/** Cache of the output configuration and data of the pins */
struct gpio_sx1509b_pin_state {
u16_t input_disable;

View file

@ -90,10 +90,10 @@
#define DT_MAX_MAX30101_0_LABEL ""
#endif
#ifndef CONFIG_GPIO_SX1509B_DEV_NAME
#define CONFIG_GPIO_SX1509B_DEV_NAME ""
#define CONFIG_GPIO_SX1509B_I2C_ADDR 0
#define CONFIG_GPIO_SX1509B_I2C_MASTER_DEV_NAME ""
#ifndef DT_SEMTECH_SX1509B_0_LABEL
#define DT_SEMTECH_SX1509B_0_LABEL ""
#define DT_SEMTECH_SX1509B_0_BASE_ADDRESS 0
#define DT_SEMTECH_SX1509B_0_BUS_NAME ""
#endif
#ifndef DT_ST_LSM6DSL_0_LABEL