Skip to content

Commit 8ac822e

Browse files
yperesscarlescufi
authored andcommitted
emul: Cleanup emul directory
Avoid implementations in the subsys emul directory to keep the directory focused on emulator subsystem instead of consumers. Consumers should be implemented side-by-side to their drivers Signed-off-by: Yuval Peress <peress@google.com>
1 parent a6326f1 commit 8ac822e

File tree

13 files changed

+39
-30
lines changed

13 files changed

+39
-30
lines changed

drivers/eeprom/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ zephyr_library_sources_ifdef(CONFIG_EEPROM_EMULATOR eeprom_emulator.c)
1313
zephyr_library_sources_ifdef(CONFIG_EEPROM_TMP116 eeprom_tmp116.c)
1414
zephyr_library_sources_ifdef(CONFIG_EEPROM_XEC eeprom_mchp_xec.c)
1515
zephyr_library_sources_ifdef(CONFIG_EEPROM_FAKE eeprom_fake.c)
16+
17+
zephyr_library_sources_ifdef(CONFIG_EEPROM_AT2X_EMUL eeprom_at2x_emul.c)

drivers/eeprom/Kconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,27 @@ config EEPROM_AT2X
4141
Enable support for Atmel AT2x (and compatible) I2C/SPI
4242
EEPROMs.
4343

44+
config EEPROM_AT2X_EMUL
45+
bool "Emulate an Atmel AT24 I2C chip"
46+
depends on EMUL
47+
help
48+
This is an emulator for the Atmel AT24 series of I2C-attached EEPROMs.
49+
50+
At present it only supports 8-bit addressing. The size of the EEPROM
51+
is given by the 'size' property. See the binding for further details.
52+
53+
config EMUL_EEPROM_AT2X
54+
bool "[DEPRECATED] Emulate an Atmel AT24 I2C chip"
55+
select EEPROM_AT2X_EMUL
56+
select DEPRECATED
57+
help
58+
This is an emulator for the Atmel AT24 series of I2C-attached EEPROMs.
59+
60+
At present it only supports 8-bit addressing. The size of the EEPROM
61+
is given by the 'size' property. See the binding for further details.
62+
63+
[DEPRECATED] Select EEPROM_AT2X_EMUL instead.
64+
4465
config EEPROM_AT24
4566
bool "Atmel AT24 (and compatible) I2C EEPROM support"
4667
default y
File renamed without changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
zephyr_library()
22

33
zephyr_library_sources(sbs_gauge.c)
4+
5+
zephyr_include_directories_ifdef(CONFIG_EMUL_SBS_GAUGE .)
6+
zephyr_library_sources_ifdef(CONFIG_EMUL_SBS_GAUGE ../../sensor/sbs_gauge/emul_sbs_gauge.c)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
zephyr_library()
22

33
zephyr_library_sources(sbs_gauge.c)
4+
5+
zephyr_include_directories_ifdef(CONFIG_EMUL_SBS_GAUGE .)
6+
zephyr_library_sources_ifdef(CONFIG_EMUL_SBS_GAUGE emul_sbs_gauge.c)

drivers/sensor/sbs_gauge/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ config SBS_GAUGE
88
select I2C
99
help
1010
Enable I2C-based/SMBus-based driver for a Smart Battery Fuel Gauge.
11+
12+
config EMUL_SBS_GAUGE
13+
bool "Emulate an SBS 1.1 compliant smart battery fuel gauge"
14+
depends on EMUL
15+
help
16+
It provides readings which follow a simple sequence, thus allowing
17+
test code to check that things are working as expected.

subsys/emul/i2c/emul_sbs_gauge.c renamed to drivers/sensor/sbs_gauge/emul_sbs_gauge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LOG_MODULE_REGISTER(sbs_sbs_gauge);
2121
#include <zephyr/drivers/i2c_emul.h>
2222
#include <zephyr/sys/byteorder.h>
2323

24-
#include <sbs_gauge.h>
24+
#include "sbs_gauge.h"
2525

2626
/** Run-time data used by the emulator */
2727
struct sbs_gauge_emul_data {

subsys/emul/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ zephyr_library()
44

55
zephyr_library_sources_ifdef(CONFIG_EMUL emul.c)
66

7-
add_subdirectory(i2c)
87
add_subdirectory(espi)

subsys/emul/Kconfig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ module = EMUL
3434
module-str = emul
3535
source "subsys/logging/Kconfig.template.log_config"
3636

37-
config EMUL_SBS_GAUGE
38-
bool "Emulate an SBS 1.1 compliant smart battery fuel gauge"
39-
help
40-
It provides readings which follow a simple sequence, thus allowing
41-
test code to check that things are working as expected.
42-
43-
source "subsys/emul/i2c/Kconfig"
4437
source "subsys/emul/espi/Kconfig"
4538

4639
endif

subsys/emul/i2c/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)