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> |
||
|---|---|---|
| .. | ||
| hts221 | ||
| i3g4250d | ||
| iis2dh | ||
| iis2dlpc | ||
| iis2iclx | ||
| iis2mdc | ||
| iis3dhhc | ||
| iis328dq | ||
| ism330dhcx | ||
| lis2de12 | ||
| lis2dh | ||
| lis2ds12 | ||
| lis2du12 | ||
| lis2dux12 | ||
| lis2dw12 | ||
| lis2mdl | ||
| lis3mdl | ||
| lps2xdf | ||
| lps22hb | ||
| lps22hh | ||
| lps25hb | ||
| lsm6ds0 | ||
| lsm6dsl | ||
| lsm6dso | ||
| lsm6dso16is | ||
| lsm6dsv16x | ||
| lsm9ds0_gyro | ||
| lsm9ds0_mfd | ||
| lsm303dlhc_magn | ||
| qdec_stm32 | ||
| stm32_temp | ||
| stm32_vbat | ||
| stm32_vref | ||
| stmemsc | ||
| stts22h | ||
| stts751 | ||
| vl53l0x | ||
| vl53l1x | ||
| CMakeLists.txt | ||
| Kconfig | ||