From f91109844b87f2941fdfe028a13d952789c84ede Mon Sep 17 00:00:00 2001 From: Aaron Massey Date: Wed, 19 Apr 2023 17:11:29 +0000 Subject: Revert "zephyr/tests: emulator and tests for sm5803" This reverts commit fd2415cda6a261b92390aad04829f46f33ffc9e6. Reason for revert: http://b/278890420 - test was flakily blocking CQ Original change's description: > zephyr/tests: emulator and tests for sm5803 > > This implements an emulator and some tests for the SM5803 charger. The > current tests do not exercise the driver as comprehensively as intended, > but those will be added in a later change. > > One discovered bug in the driver is fixed, where some interrupts were > disabled immediately after being enabled. > > BUG=b:242544165 > TEST=twister -ciC -s drivers/drivers.sm5803 > BRANCH=nissa > > Change-Id: I9fc6abd26cd1b2e0cbc05b8e45cf94fc83abd08c > Signed-off-by: Peter Marheine > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290087 > Reviewed-by: Tristan Honscheid Bug: b:242544165 Change-Id: I315d36d1e08035f13d847ea1a21756ee3790216e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4448966 Commit-Queue: Aaron Massey Tested-by: Aaron Massey Reviewed-by: Keith Short --- driver/charger/sm5803.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'driver') diff --git a/driver/charger/sm5803.c b/driver/charger/sm5803.c index ec7132fb35..57b1a0330f 100644 --- a/driver/charger/sm5803.c +++ b/driver/charger/sm5803.c @@ -44,7 +44,7 @@ #define CPRINTS(format, args...) cprints(CC_CHARGER, format, ##args) #define UNKNOWN_DEV_ID -1 -test_export_static int dev_id = UNKNOWN_DEV_ID; +static int dev_id = UNKNOWN_DEV_ID; static const struct charger_info sm5803_charger_info = { .name = CHARGER_NAME, @@ -435,7 +435,7 @@ enum ec_error_list sm5803_vbus_sink_enable(int chgnum, int enable) * Track and store whether we've initialized the charger chips already on this * boot. This should prevent us from re-running inits after sysjumps. */ -test_export_static bool chip_inited[CHARGER_NUM]; +static bool chip_inited[CHARGER_NUM]; #define SM5803_SYSJUMP_TAG 0x534D /* SM */ #define SM5803_HOOK_VERSION 1 @@ -734,13 +734,15 @@ static void sm5803_init(int chgnum) SM5803_TINT_MIN_LEVEL); /* - * Configure VBAT_SNSP high and TINT interrupts to fire after - * thresholds are set. + * Configure VBAT_SNSP high interrupt to fire after thresholds are set. */ rv |= main_read8(chgnum, SM5803_REG_INT2_EN, ®); - reg |= SM5803_INT2_VBATSNSP | SM5803_INT2_TINT; + reg |= SM5803_INT2_VBATSNSP; rv |= main_write8(chgnum, SM5803_REG_INT2_EN, reg); + /* Configure TINT interrupts to fire after thresholds are set */ + rv |= main_write8(chgnum, SM5803_REG_INT2_EN, SM5803_INT2_TINT); + /* * Configure CHG_ENABLE to only be set through I2C by setting * HOST_MODE_EN bit (all other register bits are 0 by default) -- cgit v1.2.1