Browse Source

emul: Migrate all emulation use to use DT_HAS_

Remove all enabling of CONFIG_EMUL_.* in favor of automatically enabling
peripheral emulators based on the compatible string presence in the device
tree and the one true CONFIG_EMUL.

Zephyr has long since moved to a model of enabling drivers based on the
presence of their associated IC's compatible string in the final devicetree
overlay. There is no reason that emulators can't align in just the same
way, and probably ought to to remove superfluous enabling of configs.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
pull/57385/head
Aaron Massey 2 years ago committed by Kumar Gala
parent
commit
07ee466591
  1. 2
      drivers/fuel_gauge/max17048/Kconfig
  2. 2
      drivers/fuel_gauge/sbs_gauge/Kconfig.emul_sbs_gauge
  3. 1
      drivers/sensor/akm09918c/Kconfig
  4. 2
      drivers/sensor/bmi160/Kconfig
  5. 1
      drivers/sensor/icm42688/Kconfig
  6. 7
      subsys/emul/espi/Kconfig
  7. 3
      tests/drivers/fuel_gauge/max17048/boards/native_posix.conf
  8. 3
      tests/drivers/fuel_gauge/sbs_gauge/boards/emulated_board.conf
  9. 1
      tests/drivers/sensor/accel/boards/native_posix.conf
  10. 1
      tests/drivers/sensor/akm09918c/prj.conf
  11. 1
      tests/drivers/sensor/icm42688/prj.conf
  12. 3
      tests/drivers/sensor/sbs_gauge/boards/native_posix.conf
  13. 3
      tests/drivers/sensor/sbs_gauge/boards/qemu_arc_hs.conf
  14. 3
      tests/drivers/sensor/sbs_gauge/boards/qemu_cortex_a9.conf
  15. 1
      tests/subsys/emul/prj.conf

2
drivers/fuel_gauge/max17048/Kconfig

@ -14,7 +14,9 @@ config MAX17048 @@ -14,7 +14,9 @@ config MAX17048
config EMUL_MAX17048
bool "Emulate an MAX17048 fuel gague"
default y
depends on EMUL
depends on MAX17048
help
It provides readings which follow a simple sequence, thus allowing
test code to check that things are working as expected.

2
drivers/fuel_gauge/sbs_gauge/Kconfig.emul_sbs_gauge

@ -6,7 +6,9 @@ @@ -6,7 +6,9 @@
config EMUL_SBS_GAUGE
bool "Emulate an SBS 1.1 compliant smart battery fuel gauge"
default y
depends on EMUL
depends on SBS_GAUGE_NEW_API || SBS_GAUGE
help
It provides readings which follow a simple sequence, thus allowing
test code to check that things are working as expected.

1
drivers/sensor/akm09918c/Kconfig

@ -11,6 +11,7 @@ config AKM09918C @@ -11,6 +11,7 @@ config AKM09918C
config EMUL_AKM09918C
bool "Emulator for AKM09918C"
default y
depends on AKM09918C
depends on EMUL
help

2
drivers/sensor/bmi160/Kconfig

@ -214,7 +214,9 @@ endchoice @@ -214,7 +214,9 @@ endchoice
config EMUL_BMI160
bool "Emulate a Bosch BMI160 accelerometer"
default y
depends on EMUL
depends on BMI160
help
This is an emulator for the Bosch BMI160 accelerometer.

1
drivers/sensor/icm42688/Kconfig

@ -14,6 +14,7 @@ config ICM42688 @@ -14,6 +14,7 @@ config ICM42688
config EMUL_ICM42688
bool "Emulator for the ICM42688"
default y
depends on ICM42688
depends on EMUL
help

7
subsys/emul/espi/Kconfig

@ -6,9 +6,10 @@ @@ -6,9 +6,10 @@
config EMUL_ESPI_HOST
bool "Emulate an eSPI host"
help
This is an emulator of the generic eSPI host. The emulator supports
basic host operations - virtual wires and writing to port 80. It can be
extended.
This is an emulator of the generic eSPI host. The emulator supports basic host operations
- virtual wires and writing to port 80. It can be extended. Note: Because this emulator is
not tied to a particular DT node, it does not make use of the DT_HAS_<compat>_ENABLED
macro.
if EMUL_ESPI_HOST

3
tests/drivers/fuel_gauge/max17048/boards/native_posix.conf

@ -1,6 +1,3 @@ @@ -1,6 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_EMUL=y
CONFIG_EMUL_MAX17048=y
CONFIG_I2C=y
CONFIG_I2C_EMUL=y

3
tests/drivers/fuel_gauge/sbs_gauge/boards/emulated_board.conf

@ -2,6 +2,3 @@ @@ -2,6 +2,3 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_EMUL=y
CONFIG_EMUL_SBS_GAUGE=y
CONFIG_I2C=y
CONFIG_I2C_EMUL=y

1
tests/drivers/sensor/accel/boards/native_posix.conf

@ -4,6 +4,5 @@ @@ -4,6 +4,5 @@
CONFIG_EMUL=y
CONFIG_I2C=y
CONFIG_SPI=y
CONFIG_EMUL_BMI160=y
CONFIG_SENSOR=y
CONFIG_BMI160_TRIGGER_NONE=y

1
tests/drivers/sensor/akm09918c/prj.conf

@ -13,4 +13,3 @@ CONFIG_SENSOR=y @@ -13,4 +13,3 @@ CONFIG_SENSOR=y
# Enable emulation
CONFIG_EMUL=y
CONFIG_EMUL_AKM09918C=y

1
tests/drivers/sensor/icm42688/prj.conf

@ -12,4 +12,3 @@ CONFIG_SENSOR=y @@ -12,4 +12,3 @@ CONFIG_SENSOR=y
# Enable emulation
CONFIG_EMUL=y
CONFIG_EMUL_ICM42688=y

3
tests/drivers/sensor/sbs_gauge/boards/native_posix.conf

@ -2,6 +2,3 @@ @@ -2,6 +2,3 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_EMUL=y
CONFIG_EMUL_SBS_GAUGE=y
CONFIG_I2C=y
CONFIG_I2C_EMUL=y

3
tests/drivers/sensor/sbs_gauge/boards/qemu_arc_hs.conf

@ -2,6 +2,3 @@ @@ -2,6 +2,3 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_EMUL=y
CONFIG_EMUL_SBS_GAUGE=y
CONFIG_I2C=y
CONFIG_I2C_EMUL=y

3
tests/drivers/sensor/sbs_gauge/boards/qemu_cortex_a9.conf

@ -2,6 +2,3 @@ @@ -2,6 +2,3 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_EMUL=y
CONFIG_EMUL_SBS_GAUGE=y
CONFIG_I2C=y
CONFIG_I2C_EMUL=y

1
tests/subsys/emul/prj.conf

@ -5,5 +5,4 @@ @@ -5,5 +5,4 @@
CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y
CONFIG_SENSOR=y
CONFIG_EMUL_BMI160=y
CONFIG_BMI160_TRIGGER_NONE=y

Loading…
Cancel
Save