sensors: dts: cleanup usage of HAS_DTS_I2C_DEVICE
Move to new Kconfig pattern in which we use an if !HAS_DTS_I2C_DEVICE block for the Kconfig symbols that can now come from DT generation. This pattern is useful to allow us to define default values for the generated symbols for build-all testing. Fixes: #5877 Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
7361d3d74d
commit
b51cfeae60
4 changed files with 28 additions and 12 deletions
|
@ -12,18 +12,20 @@ menuconfig LIS3MDL
|
||||||
help
|
help
|
||||||
Enable driver for LIS3MDL I2C-based magnetometer.
|
Enable driver for LIS3MDL I2C-based magnetometer.
|
||||||
|
|
||||||
|
if !HAS_DTS_I2C_DEVICE
|
||||||
|
|
||||||
config LIS3MDL_NAME
|
config LIS3MDL_NAME
|
||||||
string
|
string
|
||||||
prompt "Driver name"
|
prompt "Driver name"
|
||||||
default "LIS3MDL"
|
default "LIS3MDL"
|
||||||
depends on LIS3MDL && !HAS_DTS_I2C_DEVICE
|
depends on LIS3MDL
|
||||||
help
|
help
|
||||||
Device name with which the LIS3MDL sensor is identified.
|
Device name with which the LIS3MDL sensor is identified.
|
||||||
|
|
||||||
config LIS3MDL_I2C_ADDR
|
config LIS3MDL_I2C_ADDR
|
||||||
hex
|
hex
|
||||||
prompt "I2C address"
|
prompt "I2C address"
|
||||||
depends on LIS3MDL && !HAS_DTS_I2C_DEVICE
|
depends on LIS3MDL
|
||||||
default 0x1C
|
default 0x1C
|
||||||
help
|
help
|
||||||
I2C address of the LIS3MDL sensor.
|
I2C address of the LIS3MDL sensor.
|
||||||
|
@ -33,12 +35,14 @@ config LIS3MDL_I2C_ADDR
|
||||||
config LIS3MDL_I2C_MASTER_DEV_NAME
|
config LIS3MDL_I2C_MASTER_DEV_NAME
|
||||||
string
|
string
|
||||||
prompt "I2C master where LIS3MDL is connected"
|
prompt "I2C master where LIS3MDL is connected"
|
||||||
depends on LIS3MDL && !HAS_DTS_I2C_DEVICE
|
depends on LIS3MDL
|
||||||
default "I2C_0"
|
default "I2C_0"
|
||||||
help
|
help
|
||||||
Specify the device name of the I2C master device to which LIS3MDL is
|
Specify the device name of the I2C master device to which LIS3MDL is
|
||||||
connected.
|
connected.
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Trigger mode"
|
prompt "Trigger mode"
|
||||||
depends on LIS3MDL
|
depends on LIS3MDL
|
||||||
|
|
|
@ -13,18 +13,20 @@ menuconfig LPS22HB
|
||||||
Enable driver for LPS22HB I2C-based pressure and temperature
|
Enable driver for LPS22HB I2C-based pressure and temperature
|
||||||
sensor.
|
sensor.
|
||||||
|
|
||||||
|
if !HAS_DTS_I2C_DEVICE
|
||||||
|
|
||||||
config LPS22HB_DEV_NAME
|
config LPS22HB_DEV_NAME
|
||||||
string
|
string
|
||||||
prompt "Device name"
|
prompt "Device name"
|
||||||
default "LPS22HB"
|
default "LPS22HB"
|
||||||
depends on LPS22HB && !HAS_DTS_I2C_DEVICE
|
depends on LPS22HB
|
||||||
help
|
help
|
||||||
Device name used for LPS22HB sensor identification.
|
Device name used for LPS22HB sensor identification.
|
||||||
|
|
||||||
config LPS22HB_I2C_ADDR
|
config LPS22HB_I2C_ADDR
|
||||||
hex
|
hex
|
||||||
prompt "I2C address"
|
prompt "I2C address"
|
||||||
depends on LPS22HB && !HAS_DTS_I2C_DEVICE
|
depends on LPS22HB
|
||||||
default 0x5D
|
default 0x5D
|
||||||
range 0x5C 0x5D
|
range 0x5C 0x5D
|
||||||
help
|
help
|
||||||
|
@ -35,12 +37,14 @@ config LPS22HB_I2C_ADDR
|
||||||
config LPS22HB_I2C_MASTER_DEV_NAME
|
config LPS22HB_I2C_MASTER_DEV_NAME
|
||||||
string
|
string
|
||||||
prompt "I2C master where LPS22HB is connected"
|
prompt "I2C master where LPS22HB is connected"
|
||||||
depends on LPS22HB && !HAS_DTS_I2C_DEVICE
|
depends on LPS22HB
|
||||||
default I2C_0_NAME
|
default I2C_0_NAME
|
||||||
help
|
help
|
||||||
Specify the device name of the I2C master device to which
|
Specify the device name of the I2C master device to which
|
||||||
LPS22HB is connected.
|
LPS22HB is connected.
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
menu "Attributes"
|
menu "Attributes"
|
||||||
depends on LPS22HB
|
depends on LPS22HB
|
||||||
|
|
||||||
|
|
|
@ -15,15 +15,17 @@ menuconfig LSM6DSL
|
||||||
Enable driver for LSM6DSL I2C-based accelerometer and gyroscope
|
Enable driver for LSM6DSL I2C-based accelerometer and gyroscope
|
||||||
sensor.
|
sensor.
|
||||||
|
|
||||||
|
if !HAS_DTS_I2C_DEVICE
|
||||||
|
|
||||||
config LSM6DSL_DEV_NAME
|
config LSM6DSL_DEV_NAME
|
||||||
string "LSM6DSL device name"
|
string "LSM6DSL device name"
|
||||||
depends on LSM6DSL && !HAS_DTS_I2C_DEVICE
|
depends on LSM6DSL
|
||||||
default "LSM6DSL"
|
default "LSM6DSL"
|
||||||
|
|
||||||
config LSM6DSL_I2C_ADDR
|
config LSM6DSL_I2C_ADDR
|
||||||
hex
|
hex
|
||||||
prompt "LSM6DSL I2C address"
|
prompt "LSM6DSL I2C address"
|
||||||
depends on LSM6DSL && !HAS_DTS_I2C_DEVICE
|
depends on LSM6DSL
|
||||||
default 0x6A
|
default 0x6A
|
||||||
range 0x6A 0x6B
|
range 0x6A 0x6B
|
||||||
help
|
help
|
||||||
|
@ -33,12 +35,14 @@ config LSM6DSL_I2C_ADDR
|
||||||
|
|
||||||
config LSM6DSL_I2C_MASTER_DEV_NAME
|
config LSM6DSL_I2C_MASTER_DEV_NAME
|
||||||
string "I2C master where LSM6DSL chip is connected"
|
string "I2C master where LSM6DSL chip is connected"
|
||||||
depends on LSM6DSL && !HAS_DTS_I2C_DEVICE
|
depends on LSM6DSL
|
||||||
default I2C_0_NAME
|
default I2C_0_NAME
|
||||||
help
|
help
|
||||||
Specify the device name of the I2C master device to which LSM6DSL is
|
Specify the device name of the I2C master device to which LSM6DSL is
|
||||||
connected.
|
connected.
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
config LSM6DSL_ENABLE_TEMP
|
config LSM6DSL_ENABLE_TEMP
|
||||||
bool "Enable temperature"
|
bool "Enable temperature"
|
||||||
depends on LSM6DSL
|
depends on LSM6DSL
|
||||||
|
|
|
@ -15,11 +15,13 @@ menuconfig VL53L0X
|
||||||
help
|
help
|
||||||
Enable driver for VL53L0X I2C-based time of flight sensor.
|
Enable driver for VL53L0X I2C-based time of flight sensor.
|
||||||
|
|
||||||
|
if !HAS_DTS_I2C_DEVICE
|
||||||
|
|
||||||
config VL53L0X_NAME
|
config VL53L0X_NAME
|
||||||
string
|
string
|
||||||
prompt "Driver name"
|
prompt "Driver name"
|
||||||
default "VL53L0X"
|
default "VL53L0X"
|
||||||
depends on VL53L0X && !HAS_DTS_I2C_DEVICE
|
depends on VL53L0X
|
||||||
help
|
help
|
||||||
Device name with which the VL53L0X sensor is identified.
|
Device name with which the VL53L0X sensor is identified.
|
||||||
|
|
||||||
|
@ -27,19 +29,21 @@ config VL53L0X_I2C_ADDR
|
||||||
int
|
int
|
||||||
prompt "Vl53l0x I2C address"
|
prompt "Vl53l0x I2C address"
|
||||||
default 0x29
|
default 0x29
|
||||||
depends on VL53L0X && !HAS_DTS_I2C_DEVICE
|
depends on VL53L0X
|
||||||
help
|
help
|
||||||
address of the i2c used for the vl53l0x sensor
|
address of the i2c used for the vl53l0x sensor
|
||||||
|
|
||||||
config VL53L0X_I2C_MASTER_DEV_NAME
|
config VL53L0X_I2C_MASTER_DEV_NAME
|
||||||
string
|
string
|
||||||
prompt "I2C master where VL53L0X is connected"
|
prompt "I2C master where VL53L0X is connected"
|
||||||
depends on VL53L0X && !HAS_DTS_I2C_DEVICE
|
depends on VL53L0X
|
||||||
default "I2C_0"
|
default "I2C_0"
|
||||||
help
|
help
|
||||||
Specify the device name of the I2C master device to which VL53L0X is
|
Specify the device name of the I2C master device to which VL53L0X is
|
||||||
connected.
|
connected.
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
config VL53L0X_XSHUT_GPIO_DEV_NAME
|
config VL53L0X_XSHUT_GPIO_DEV_NAME
|
||||||
string
|
string
|
||||||
prompt "GPIO device"
|
prompt "GPIO device"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue