summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorAaron Massey <aaronmassey@google.com>2023-04-19 17:11:29 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-19 18:22:54 +0000
commitf91109844b87f2941fdfe028a13d952789c84ede (patch)
tree16828edc29c7c966eeada483a41a9010bfb1a2be /driver
parent296a16ab4d9b80168b1a09f63c27b12a13c03180 (diff)
downloadchrome-ec-f91109844b87f2941fdfe028a13d952789c84ede.tar.gz
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 <pmarheine@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290087 > Reviewed-by: Tristan Honscheid <honscheid@google.com> Bug: b:242544165 Change-Id: I315d36d1e08035f13d847ea1a21756ee3790216e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4448966 Commit-Queue: Aaron Massey <aaronmassey@google.com> Tested-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/charger/sm5803.c12
1 files changed, 7 insertions, 5 deletions
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);
- 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)