-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: sensor: Update drivers to use devicetree Kconfig symbol #48048
drivers: sensor: Update drivers to use devicetree Kconfig symbol #48048
Conversation
Update sensor drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol to expose the driver and enable it by default based on devicetree. Signed-off-by: Kumar Gala <galak@kernel.org>
Kconfig will default to enable the drivers based on devicetree so we don't need to explicitly set the Kconfig symbols. Signed-off-by: Kumar Gala <galak@kernel.org>
95fb83c
to
c47589d
Compare
@galak Are you gonna also remove the unnecessary Kconfig symbols from samples? For example https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/sensor/ina219/prj.conf#L5= |
Not in this PR. Happy to have help from others on that. |
CONFIG_ADT7420=y | ||
CONFIG_ADXL345=y | ||
CONFIG_ADXL362=y | ||
CONFIG_ADXL372=y | ||
CONFIG_AK8975=y | ||
CONFIG_AMG88XX=y | ||
CONFIG_AMS_IAQ_CORE=y | ||
CONFIG_APDS9960=y | ||
CONFIG_BMA280=y | ||
CONFIG_BMC150_MAGN=y | ||
CONFIG_BME280=y | ||
CONFIG_BME680=y | ||
CONFIG_BMG160=y | ||
CONFIG_BMI160=y | ||
CONFIG_BMI270=y | ||
CONFIG_BMM150=y | ||
CONFIG_BMP388=y | ||
CONFIG_BQ274XX=y | ||
CONFIG_CCS811=y | ||
CONFIG_DHT=y | ||
CONFIG_DPS310=y | ||
CONFIG_DS18B20=y | ||
CONFIG_ENS210=y | ||
CONFIG_FDC2X1X=y | ||
CONFIG_FXAS21002=y | ||
CONFIG_FXOS8700=y | ||
CONFIG_HMC5883L=y | ||
CONFIG_HP206C=y | ||
CONFIG_HTS221=y | ||
CONFIG_I3G4250D=y | ||
CONFIG_ICM42605=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hooray!
drivers/sensor/adxl345/Kconfig
Outdated
depends on (I2C && $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL345),i2c)) || \ | ||
(SPI && $(dt_compat_on_bus,$(DT_COMPAT_ADI_ADXL345),spi)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand this logic. The sensor has to be on one type of bus or the other, so isn't it redundant to qualify with dt_compat_on_bus
now that it depends on DT_HAS_ADI_ADXL345_ENABLED
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there was a case that the sensor was on I2C and enabled, but CONFIG_I2C=n and CONFIG_SPI=y. So DT_HAS_ADI_ADXL345_ENABLED
will be 'y', so we need to qualify such a case (which is why that mess of logic).
If a test or sample enables CONFIG_SENSOR=y than any sensor on the I2C or SPI bus should be available. We already handle this for SPI on the board, add I2C as well. Signed-off-by: Kumar Gala <galak@kernel.org>
c47589d
to
cd531d1
Compare
Similar to the changes made in #48048, compile in the appropriate lora modem driver when `CONFIG_LORA=y`. The `LORA_SX12XX` symbol has no use now so remove. LoRa and LoRaWAN subsystems are still marked as unstable so no additional deprecation cycle is needed. Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Similar to the changes made in zephyrproject-rtos#48048, compile in the appropriate lora modem driver when `CONFIG_LORA=y`. The `LORA_SX12XX` symbol has no use now so remove. LoRa and LoRaWAN subsystems are still marked as unstable so no additional deprecation cycle is needed. Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Similar to the changes made in zephyrproject-rtos#48048, compile in the appropriate lora modem driver when `CONFIG_LORA=y`. The `LORA_SX12XX` symbol has no use now so remove. LoRa and LoRaWAN subsystems are still marked as unstable so no additional deprecation cycle is needed. Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
No description provided.