google_charger: add new vtier for defender
Factor common stats code to google_bms and add 2 new tiers for
defender stats
Bug: 218802317
Test: checked tier stats
Signed-off-by: Prasanna Prapancham <[email protected]>
Change-Id: I24358399217b09eb0a537f1463be2c29381741c1
(cherry picked from commit 11a0a5c578027b7d722ba30e4ab6923ad598509a)
diff --git a/google_bms.h b/google_bms.h
index 6ce28d3..b5667fc 100644
--- a/google_bms.h
+++ b/google_bms.h
@@ -294,8 +294,10 @@
GBMS_STATS_BD_TI_OVERHEAT_TEMP = 110,
GBMS_STATS_BD_TI_CUSTOM_LEVELS = 111,
GBMS_STATS_BD_TI_TRICKLE = 112,
+ GBMS_STATS_BD_TI_DOCK = 113,
GBMS_STATS_BD_TI_TRICKLE_CLEARED = 122,
+ GBMS_STATS_BD_TI_DOCK_CLEARED = 123,
};
/* health state */
@@ -515,6 +517,26 @@
bool chg_state_is_disconnected(const union gbms_charger_state *chg_state);
+/* Voltage tier stats */
+void gbms_tier_stats_init(struct gbms_ce_tier_stats *stats, int8_t idx);
+
+void gbms_chg_stats_tier(struct gbms_ce_tier_stats *tier,
+ int msc_state, ktime_t elap);
+
+void gbms_stats_update_tier(int temp_idx, int ibatt_ma, int temp, ktime_t elap,
+ int cc, union gbms_charger_state *chg_state,
+ enum gbms_msc_states_t msc_state, int soc_in,
+ struct gbms_ce_tier_stats *tier);
+
+int gbms_tier_stats_cstr(char *buff, int size,
+ const struct gbms_ce_tier_stats *tier_stat,
+ bool verbose);
+
+void gbms_log_cstr_handler(struct logbuffer *log, char *buf, int len);
+
+
+
+
/*
* Charger modes
*