mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-03 13:39:53 +00:00
charger: Add CONFIG_CHARGE_STATE_DEBUG
Servo / Suzy-Q related debugging methods is a big challenge in factory especially after servo debug header is removed. Expose some information to OS from EC will do a great help for massive production. + expose charge/battery related state to ectool 1. chg_ctl_mode 2. manual_mode 3. battery_seems_to_be_dead 4. battery_seems_to_be_disconnected 5. battery_was_removed 6. disch_on_ac (learn mode state) BUG=b:65265543 BRANCH=master TEST=`ectool chargestate param 0x20000~0x20006 get correct state` Change-Id: Ic2ed38e2eb9def01be29729fa1fe1959eb73fe43 Signed-off-by: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/646412 Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
@@ -50,5 +50,16 @@ struct charge_state_data {
|
||||
*/
|
||||
int charge_set_input_current_limit(int ma, int mv);
|
||||
|
||||
/*
|
||||
* Expose charge/battery related state
|
||||
*
|
||||
* @param param command to get corresponding data
|
||||
* @param value the corresponding data
|
||||
* @return EC_SUCCESS or error
|
||||
*/
|
||||
#ifdef CONFIG_CHARGE_STATE_DEBUG
|
||||
int charge_get_charge_state_debug(int param, uint32_t *value);
|
||||
#endif /* CONFIG_CHARGE_STATE_DEBUG */
|
||||
|
||||
#endif /* __CROS_EC_CHARGE_STATE_V2_H */
|
||||
|
||||
|
||||
@@ -318,6 +318,12 @@
|
||||
*/
|
||||
#undef CONFIG_BATTERY_LEVEL_NEAR_FULL
|
||||
|
||||
/*
|
||||
* Expose some data when it is needed.
|
||||
* For example, battery disconnect state
|
||||
*/
|
||||
#undef CONFIG_CHARGE_STATE_DEBUG
|
||||
|
||||
/* Include support for Bluetooth LE */
|
||||
#undef CONFIG_BLUETOOTH_LE
|
||||
|
||||
|
||||
@@ -3473,6 +3473,15 @@ enum charge_state_params {
|
||||
CS_PARAM_CUSTOM_PROFILE_MIN = 0x10000,
|
||||
CS_PARAM_CUSTOM_PROFILE_MAX = 0x1ffff,
|
||||
|
||||
/* Range for CONFIG_CHARGE_STATE_DEBUG params */
|
||||
CS_PARAM_DEBUG_MIN = 0x20000,
|
||||
CS_PARAM_DEBUG_CTL_MODE = 0x20000,
|
||||
CS_PARAM_DEBUG_MANUAL_MODE,
|
||||
CS_PARAM_DEBUG_SEEMS_DEAD,
|
||||
CS_PARAM_DEBUG_SEEMS_DISCONNECTED,
|
||||
CS_PARAM_DEBUG_BATT_REMOVED,
|
||||
CS_PARAM_DEBUG_MAX = 0x2ffff,
|
||||
|
||||
/* Other custom param ranges go here... */
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user