driver/sensor: lsm6ds0: align driver to auto-generated dts macros

Use auto-generated device tree macros in LSM6DS0 driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
Armando Visconti 2019-01-31 11:06:16 +01:00 committed by Kumar Gala
parent 91786e96aa
commit 396ffbd86d
4 changed files with 8 additions and 12 deletions

View file

@ -8,7 +8,3 @@
#define DT_LPS25HB_DEV_NAME ARDUINO_I2C_ST_LPS25HB_PRESS_5D_LABEL
#define DT_LPS25HB_I2C_ADDR ARDUINO_I2C_ST_LPS25HB_PRESS_5D_BASE_ADDRESS
#define DT_LPS25HB_I2C_MASTER_DEV_NAME ARDUINO_I2C_ST_LPS25HB_PRESS_5D_BUS_NAME
#define DT_LSM6DS0_DEV_NAME ARDUINO_I2C_ST_LSM6DS0_6B_LABEL
#define DT_LSM6DS0_I2C_ADDR ARDUINO_I2C_ST_LSM6DS0_6B_BASE_ADDRESS
#define DT_LSM6DS0_I2C_MASTER_DEV_NAME ARDUINO_I2C_ST_LSM6DS0_6B_BUS_NAME

View file

@ -500,12 +500,12 @@ static int lsm6ds0_init(struct device *dev)
}
static const struct lsm6ds0_config lsm6ds0_config = {
.i2c_master_dev_name = DT_LSM6DS0_I2C_MASTER_DEV_NAME,
.i2c_slave_addr = DT_LSM6DS0_I2C_ADDR,
.i2c_master_dev_name = DT_ST_LSM6DS0_0_BUS_NAME,
.i2c_slave_addr = DT_ST_LSM6DS0_0_BASE_ADDRESS,
};
static struct lsm6ds0_data lsm6ds0_data;
DEVICE_AND_API_INIT(lsm6ds0, DT_LSM6DS0_DEV_NAME, lsm6ds0_init,
DEVICE_AND_API_INIT(lsm6ds0, DT_ST_LSM6DS0_0_LABEL, lsm6ds0_init,
&lsm6ds0_data, &lsm6ds0_config, POST_KERNEL,
CONFIG_SENSOR_INIT_PRIORITY, &lsm6ds0_api_funcs);

View file

@ -16,7 +16,7 @@ void main(void)
struct sensor_value magn_xyz[3], accel_xyz[3];
struct device *hts221 = device_get_binding(DT_ST_HTS221_0_LABEL);
struct device *lis3mdl = device_get_binding(DT_ST_LIS3MDL_MAGN_0_LABEL);
struct device *lsm6ds0 = device_get_binding(DT_LSM6DS0_DEV_NAME);
struct device *lsm6ds0 = device_get_binding(DT_ST_LSM6DS0_0_LABEL);
struct device *lps25hb = device_get_binding(DT_LPS25HB_DEV_NAME);
if (hts221 == NULL) {

View file

@ -79,10 +79,10 @@
#define DT_LPS25HB_I2C_MASTER_DEV_NAME ""
#endif
#ifndef DT_LSM6DS0_DEV_NAME
#define DT_LSM6DS0_DEV_NAME ""
#define DT_LSM6DS0_I2C_ADDR 0
#define DT_LSM6DS0_I2C_MASTER_DEV_NAME ""
#ifndef DT_ST_LSM6DS0_0_LABEL
#define DT_ST_LSM6DS0_0_LABEL ""
#define DT_ST_LSM6DS0_0_BUS_NAME ""
#define DT_ST_LSM6DS0_0_BASE_ADDRESS 0x19
#endif
#ifndef DT_MAX_MAX30101_0_LABEL