sensor: lps22hb: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert lps22hb sensor driver to use new defines so we can remove the dts_fixup.h code for it. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
0b93c68f79
commit
7b9bf08dce
|
@ -9,10 +9,6 @@
|
|||
* generated data matches the driver definitions.
|
||||
*/
|
||||
|
||||
#define DT_LPS22HB_DEV_NAME DT_ST_STM32_I2C_V1_40005800_ST_LPS22HB_PRESS_5D_LABEL
|
||||
#define DT_LPS22HB_I2C_ADDR DT_ST_STM32_I2C_V1_40005800_ST_LPS22HB_PRESS_5D_BASE_ADDRESS
|
||||
#define DT_LPS22HB_I2C_MASTER_DEV_NAME DT_ST_STM32_I2C_V1_40005800_ST_LPS22HB_PRESS_5D_BUS_NAME
|
||||
|
||||
#define DT_VL53L0X_NAME DT_ST_STM32_I2C_V1_40005800_ST_VL53L0X_29_LABEL
|
||||
#define DT_VL53L0X_I2C_ADDR DT_ST_STM32_I2C_V1_40005800_ST_VL53L0X_29_BASE_ADDRESS
|
||||
#define DT_VL53L0X_I2C_MASTER_DEV_NAME DT_ST_STM32_I2C_V1_40005800_ST_VL53L0X_29_BUS_NAME
|
||||
|
|
|
@ -12,10 +12,6 @@
|
|||
#define DT_LSM6DSL_I2C_ADDR DT_ST_STM32_I2C_V2_40005800_ST_LSM6DSL_6A_BASE_ADDRESS
|
||||
#define DT_LSM6DSL_I2C_MASTER_DEV_NAME DT_ST_STM32_I2C_V2_40005800_ST_LSM6DSL_6A_BUS_NAME
|
||||
|
||||
#define DT_LPS22HB_DEV_NAME DT_ST_STM32_I2C_V2_40005800_ST_LPS22HB_PRESS_5D_LABEL
|
||||
#define DT_LPS22HB_I2C_ADDR DT_ST_STM32_I2C_V2_40005800_ST_LPS22HB_PRESS_5D_BASE_ADDRESS
|
||||
#define DT_LPS22HB_I2C_MASTER_DEV_NAME DT_ST_STM32_I2C_V2_40005800_ST_LPS22HB_PRESS_5D_BUS_NAME
|
||||
|
||||
#define CONFIG_BT_SPI_DEV_NAME DT_ST_STM32_SPI_FIFO_40003C00_ST_SPBTLE_RF_0_BUS_NAME
|
||||
#define CONFIG_BT_SPI_MAX_CLK_FREQ DT_ST_STM32_SPI_FIFO_40003C00_ST_SPBTLE_RF_0_SPI_MAX_FREQUENCY
|
||||
|
||||
|
|
|
@ -5,7 +5,3 @@
|
|||
#define DT_CCS811_NAME DT_NORDIC_NRF_I2C_40003000_AMS_CCS811_5A_LABEL
|
||||
#define DT_CCS811_I2C_MASTER_DEV_NAME DT_NORDIC_NRF_I2C_40003000_AMS_CCS811_5A_BUS_NAME
|
||||
#define DT_CCS811_I2C_ADDR DT_NORDIC_NRF_I2C_40003000_AMS_CCS811_5A_BASE_ADDRESS
|
||||
|
||||
#define DT_LPS22HB_DEV_NAME DT_NORDIC_NRF_I2C_40003000_ST_LPS22HB_PRESS_5C_LABEL
|
||||
#define DT_LPS22HB_I2C_MASTER_DEV_NAME DT_NORDIC_NRF_I2C_40003000_ST_LPS22HB_PRESS_5C_BUS_NAME
|
||||
#define DT_LPS22HB_I2C_ADDR DT_NORDIC_NRF_I2C_40003000_ST_LPS22HB_PRESS_5C_BASE_ADDRESS
|
||||
|
|
|
@ -5,10 +5,6 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define DT_LPS22HB_DEV_NAME ARDUINO_I2C_ST_LPS22HB_PRESS_5D_LABEL
|
||||
#define DT_LPS22HB_I2C_ADDR ARDUINO_I2C_ST_LPS22HB_PRESS_5D_BASE_ADDRESS
|
||||
#define DT_LPS22HB_I2C_MASTER_DEV_NAME ARDUINO_I2C_ST_LPS22HB_PRESS_5D_BUS_NAME
|
||||
|
||||
#define DT_LSM6DSL_DEV_NAME ARDUINO_I2C_ST_LSM6DSL_6B_LABEL
|
||||
#define DT_LSM6DSL_I2C_ADDR ARDUINO_I2C_ST_LSM6DSL_6B_BASE_ADDRESS
|
||||
#define DT_LSM6DSL_I2C_MASTER_DEV_NAME ARDUINO_I2C_ST_LSM6DSL_6B_BUS_NAME
|
||||
|
|
|
@ -152,12 +152,12 @@ static int lps22hb_init(struct device *dev)
|
|||
}
|
||||
|
||||
static const struct lps22hb_config lps22hb_config = {
|
||||
.i2c_master_dev_name = DT_LPS22HB_I2C_MASTER_DEV_NAME,
|
||||
.i2c_slave_addr = DT_LPS22HB_I2C_ADDR,
|
||||
.i2c_master_dev_name = DT_ST_LPS22HB_PRESS_0_BUS_NAME,
|
||||
.i2c_slave_addr = DT_ST_LPS22HB_PRESS_0_BASE_ADDRESS,
|
||||
};
|
||||
|
||||
static struct lps22hb_data lps22hb_data;
|
||||
|
||||
DEVICE_AND_API_INIT(lps22hb, DT_LPS22HB_DEV_NAME, lps22hb_init,
|
||||
DEVICE_AND_API_INIT(lps22hb, DT_ST_LPS22HB_PRESS_0_LABEL, lps22hb_init,
|
||||
&lps22hb_data, &lps22hb_config, POST_KERNEL,
|
||||
CONFIG_SENSOR_INIT_PRIORITY, &lps22hb_api_funcs);
|
||||
|
|
|
@ -149,11 +149,12 @@ void main(void)
|
|||
printk("ArgonKey test!!\n");
|
||||
|
||||
#ifdef CONFIG_LPS22HB
|
||||
struct device *baro_dev = device_get_binding(DT_LPS22HB_DEV_NAME);
|
||||
struct device *baro_dev =
|
||||
device_get_binding(DT_ST_LPS22HB_PRESS_0_LABEL);
|
||||
|
||||
if (!baro_dev) {
|
||||
printk("Could not get pointer to %s sensor\n",
|
||||
DT_LPS22HB_DEV_NAME);
|
||||
DT_ST_LPS22HB_PRESS_0_LABEL);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -115,10 +115,10 @@
|
|||
#define DT_ST_LSM6DSL_BUS_I2C 1
|
||||
#endif
|
||||
|
||||
#ifndef DT_LPS22HB_DEV_NAME
|
||||
#define DT_LPS22HB_DEV_NAME ""
|
||||
#define DT_LPS22HB_I2C_ADDR 0
|
||||
#define DT_LPS22HB_I2C_MASTER_DEV_NAME ""
|
||||
#ifndef DT_ST_LPS22HB_PRESS_0_LABEL
|
||||
#define DT_ST_LPS22HB_PRESS_0_LABEL ""
|
||||
#define DT_ST_LPS22HB_PRESS_0_BASE_ADDRESS 0
|
||||
#define DT_ST_LPS22HB_PRESS_0_BUS_NAME ""
|
||||
#endif
|
||||
|
||||
#ifndef DT_VL53L0X_NAME
|
||||
|
|
Loading…
Reference in a new issue