zephyr/drivers/sensor/st
Yong Cong Sin b0394425e1 drivers: sensor: st: vbat: check for ADC nodes
The vbat driver requires the adc node to be enabled:

```c
.adc = DEVICE_DT_GET(DT_INST_IO_CHANNELS_CTLR(inst))
```

Update its Kconfig to depend on `DT_HAS_ST_STM32_ADC_ENABLED`,
which is the `"st,stm32-adc"` compat that all ST ADC bindings
include, this will guarantee that at least one ADC node is
enabled, but not necessarily the ADC used by the vbat node.

To make sure that it at least compiles, we init the `adc`
pointer only if the specified ADC node is enabled, otherwise
it will points to `NULL`.

Finally, check if the `adc` points to `NULL` in
`stm32_vbat_init`. We are not relying on the existing
`device_is_ready` check because `DEVICE_DT_GET` will not
return `NULL` if the ADC is enabled. `adc == NULL` means
that the ADC node is not enabled in the devicetree.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-17 11:39:19 +02:00
..
hts221
i3g4250d
iis2dh
iis2dlpc
iis2iclx
iis2mdc
iis3dhhc
iis328dq
ism330dhcx
lis2de12
lis2dh drivers: allow lis2dh anymotion triggers if no anymotion latching is active 2024-05-06 14:54:46 +01:00
lis2ds12
lis2du12
lis2dux12
lis2dw12
lis2mdl
lis3mdl
lps2xdf drivers: use DT_INST_NODE_HAS_COMPAT 2024-04-26 20:04:38 +01:00
lps22hb
lps22hh
lps25hb drivers/sensor: lps25hb: Fix int32 overflow in the val2 part 2024-05-15 15:01:15 +02:00
lsm6ds0
lsm6dsl drivers/sensor: lsm6dsl: use sensor APIs to convert to units 2024-05-08 09:23:50 -04:00
lsm6dso drivers: use DT_INST_NODE_HAS_COMPAT 2024-04-26 20:04:38 +01:00
lsm6dso16is
lsm6dsv16x
lsm9ds0_gyro
lsm9ds0_mfd
lsm303dlhc_magn
qdec_stm32
stm32_temp
stm32_vbat drivers: sensor: st: vbat: check for ADC nodes 2024-05-17 11:39:19 +02:00
stm32_vref sensor: convert ADC depends on to select 2024-05-16 13:31:32 +02:00
stmemsc
stts22h
stts751
vl53l0x
vl53l1x
CMakeLists.txt
Kconfig