sensor: convert ADC depends on to select

When a sensor that depends on an ADC is enabled in devicetree, enable
the ADC subsystem. ADC is roughly equivalent to a bus for these sensors
(the mechanism through which data is transferred), which had the same
conversion applied in #48707.

The same benefits apply here, namely removing the need for the following
pattern in board `.kconfig` files:
```
configdefault ADC
    default y if SENSOR
```

Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit is contained in:
Jordan Yates 2024-05-14 20:40:01 +10:00 committed by Carles Cufí
parent 83cd4d36ab
commit d725666b2c
7 changed files with 12 additions and 8 deletions

View file

@ -5,8 +5,8 @@ config INPUT_ANALOG_AXIS
bool "ADC based analog axis input driver" bool "ADC based analog axis input driver"
default y default y
depends on DT_HAS_ANALOG_AXIS_ENABLED depends on DT_HAS_ANALOG_AXIS_ENABLED
depends on ADC
depends on MULTITHREADING depends on MULTITHREADING
select ADC
help help
ADC based analog axis input driver ADC based analog axis input driver

View file

@ -8,6 +8,6 @@ config CURRENT_AMP
bool "Current sense amplifier driver" bool "Current sense amplifier driver"
default y default y
depends on DT_HAS_CURRENT_SENSE_AMPLIFIER_ENABLED depends on DT_HAS_CURRENT_SENSE_AMPLIFIER_ENABLED
depends on ADC select ADC
help help
Enable current sense amplifier driver. Enable current sense amplifier driver.

View file

@ -7,7 +7,7 @@ config RPI_PICO_TEMP
bool "Raspberry Pi Pico CPU Temperature Sensor" bool "Raspberry Pi Pico CPU Temperature Sensor"
default y default y
depends on DT_HAS_RASPBERRYPI_PICO_TEMP_ENABLED depends on DT_HAS_RASPBERRYPI_PICO_TEMP_ENABLED
depends on ADC select ADC
help help
Enable driver for Raspberry Pi Pico CPU temperature sensor. Enable driver for Raspberry Pi Pico CPU temperature sensor.

View file

@ -16,7 +16,8 @@ config GROVE_LIGHT_SENSOR
bool "The Seeed Grove Light Sensor" bool "The Seeed Grove Light Sensor"
default y default y
depends on DT_HAS_SEEED_GROVE_LIGHT_ENABLED depends on DT_HAS_SEEED_GROVE_LIGHT_ENABLED
depends on ADC && !MINIMAL_LIBC depends on !MINIMAL_LIBC
select ADC
help help
Setting this value will enable driver support for the Grove Light Setting this value will enable driver support for the Grove Light
Sensor. Sensor.
@ -25,7 +26,8 @@ config GROVE_TEMPERATURE_SENSOR
bool "The Seeed Grove Temperature Sensor" bool "The Seeed Grove Temperature Sensor"
default y default y
depends on DT_HAS_SEEED_GROVE_TEMPERATURE_ENABLED depends on DT_HAS_SEEED_GROVE_TEMPERATURE_ENABLED
depends on ADC && !MINIMAL_LIBC depends on !MINIMAL_LIBC
select ADC
help help
Setting this value will enable driver support for the Grove Setting this value will enable driver support for the Grove
Temperature Sensor. Temperature Sensor.

View file

@ -7,6 +7,7 @@ config STM32_VBAT
bool "STM32 Vbat Sensor" bool "STM32 Vbat Sensor"
default y default y
depends on DT_HAS_ST_STM32_VBAT_ENABLED depends on DT_HAS_ST_STM32_VBAT_ENABLED
depends on ADC && (SOC_FAMILY_STM32 && !SOC_SERIES_STM32F1X) depends on SOC_FAMILY_STM32 && !SOC_SERIES_STM32F1X
select ADC
help help
Enable driver for STM32 Vbat sensor and then also ADC Enable driver for STM32 Vbat sensor and then also ADC

View file

@ -7,6 +7,7 @@ config STM32_VREF
bool "STM32 VREF Sensor" bool "STM32 VREF Sensor"
default y default y
depends on DT_HAS_ST_STM32_VREF_ENABLED depends on DT_HAS_ST_STM32_VREF_ENABLED
depends on ADC && (SOC_FAMILY_STM32 && !SOC_SERIES_STM32F1X) depends on SOC_FAMILY_STM32 && !SOC_SERIES_STM32F1X
select ADC
help help
Enable driver for STM32 Vref sensor. Enable driver for STM32 Vref sensor.

View file

@ -8,6 +8,6 @@ config VOLTAGE_DIVIDER
bool "Voltage sensor driver" bool "Voltage sensor driver"
default y default y
depends on DT_HAS_VOLTAGE_DIVIDER_ENABLED depends on DT_HAS_VOLTAGE_DIVIDER_ENABLED
depends on ADC select ADC
help help
Enable voltage sensor driver. Enable voltage sensor driver.