summaryrefslogtreecommitdiff
path: root/zephyr/emul/emul_bb_retimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/emul/emul_bb_retimer.c')
-rw-r--r--zephyr/emul/emul_bb_retimer.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/zephyr/emul/emul_bb_retimer.c b/zephyr/emul/emul_bb_retimer.c
index 8028c53c0f..266fd1a340 100644
--- a/zephyr/emul/emul_bb_retimer.c
+++ b/zephyr/emul/emul_bb_retimer.c
@@ -3,21 +3,22 @@
* found in the LICENSE file.
*/
-#include "driver/retimer/bb_retimer.h"
-#include "emul/emul_bb_retimer.h"
-#include "emul/emul_common_i2c.h"
-#include "emul/emul_stub_device.h"
+#define DT_DRV_COMPAT cros_bb_retimer_emul
+
+#define LOG_LEVEL CONFIG_I2C_LOG_LEVEL
+#include <zephyr/logging/log.h>
+LOG_MODULE_REGISTER(emul_bb_retimer);
#include <zephyr/device.h>
#include <zephyr/drivers/emul.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/drivers/i2c_emul.h>
-#include <zephyr/logging/log.h>
-#define DT_DRV_COMPAT intel_jhl8040r
+#include "emul/emul_common_i2c.h"
+#include "emul/emul_bb_retimer.h"
+#include "emul/emul_stub_device.h"
-#define LOG_LEVEL CONFIG_I2C_LOG_LEVEL
-LOG_MODULE_REGISTER(emul_bb_retimer);
+#include "driver/retimer/bb_retimer.h"
/** Run-time data used by the emulator */
struct bb_emul_data {
@@ -308,9 +309,10 @@ static int bb_emul_init(const struct emul *emul, const struct device *parent)
#define BB_RETIMER_EMUL(n) \
static struct bb_emul_data bb_emul_data_##n = { \
- .vendor_id = BB_RETIMER_VENDOR_ID_1, \
- .error_on_ro_write = true, \
- .error_on_rsvd_write = true, \
+ .vendor_id = DT_STRING_TOKEN(DT_DRV_INST(n), vendor), \
+ .error_on_ro_write = DT_INST_PROP(n, error_on_ro_write),\
+ .error_on_rsvd_write = DT_INST_PROP(n, \
+ error_on_reserved_bit_write), \
.common = { \
.start_write = NULL, \
.write_byte = bb_emul_write_byte, \