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>
This commit is contained in:
Aaron Massey 2023-04-14 15:38:56 -06:00 committed by Kumar Gala
parent 5893606187
commit 07ee466591
15 changed files with 12 additions and 22 deletions

View file

@ -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.

View file

@ -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.

View file

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

View file

@ -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.

View file

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

View file

@ -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

View file

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

View file

@ -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

View file

@ -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

View file

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

View file

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

View file

@ -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

View file

@ -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

View file

@ -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

View file

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