diff options
Diffstat (limited to 'zephyr/test/drivers/isl923x/src/charge_ramp_hw.c')
-rw-r--r-- | zephyr/test/drivers/isl923x/src/charge_ramp_hw.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/zephyr/test/drivers/isl923x/src/charge_ramp_hw.c b/zephyr/test/drivers/isl923x/src/charge_ramp_hw.c index c1ae9ce240..c814b75de9 100644 --- a/zephyr/test/drivers/isl923x/src/charge_ramp_hw.c +++ b/zephyr/test/drivers/isl923x/src/charge_ramp_hw.c @@ -1,10 +1,9 @@ -/* Copyright 2022 The Chromium OS Authors. All rights reserved. +/* Copyright 2022 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ - -#include <ztest.h> +#include <zephyr/ztest.h> #include "driver/charger/isl923x.h" #include "driver/charger/isl923x_public.h" @@ -14,10 +13,10 @@ #include "test/drivers/test_state.h" #define CHARGER_NUM get_charger_num(&isl923x_drv) -#define ISL923X_EMUL emul_get_binding(DT_LABEL(DT_NODELABEL(isl923x_emul))) +#define ISL923X_EMUL EMUL_DT_GET(DT_NODELABEL(isl923x_emul)) -ZTEST_SUITE(charge_ramp_hw, drivers_predicate_post_main, NULL, NULL, - NULL, NULL); +ZTEST_SUITE(charge_ramp_hw, drivers_predicate_post_main, NULL, NULL, NULL, + NULL); ZTEST(charge_ramp_hw, test_charge_ramp_hw_ramp) { @@ -33,20 +32,20 @@ ZTEST(charge_ramp_hw, test_charge_ramp_hw_ramp) ZTEST(charge_ramp_hw, test_charge_ramp_hw_ramp_read_fail_reg0) { - const struct emul *isl923x_emul = ISL923X_EMUL; - struct i2c_emul *i2c_emul = isl923x_emul_get_i2c_emul(isl923x_emul); + struct i2c_common_emul_data *common_data = + emul_isl923x_get_i2c_common_data(ISL923X_EMUL); - i2c_common_emul_set_read_fail_reg(i2c_emul, ISL923X_REG_CONTROL0); + i2c_common_emul_set_read_fail_reg(common_data, ISL923X_REG_CONTROL0); zassert_equal(EC_ERROR_INVAL, isl923x_drv.set_hw_ramp(CHARGER_NUM, 1), NULL); } ZTEST(charge_ramp_hw, test_charge_ramp_hw_ramp_read_fail_acl1) { - const struct emul *isl923x_emul = ISL923X_EMUL; - struct i2c_emul *i2c_emul = isl923x_emul_get_i2c_emul(isl923x_emul); + struct i2c_common_emul_data *common_data = + emul_isl923x_get_i2c_common_data(ISL923X_EMUL); - i2c_common_emul_set_read_fail_reg(i2c_emul, + i2c_common_emul_set_read_fail_reg(common_data, ISL923X_REG_ADAPTER_CURRENT_LIMIT1); zassert_equal(0, isl923x_drv.ramp_get_current_limit(CHARGER_NUM), NULL); } |