Electro: Add battery hint message
Showing which battery is useful when debug.
BRANCH=master
TEST=power on EC can see prompt
Commit-Ready: Ryan Zhang
Tested-by: Ryan Zhang
#include "i2c.h"
#include "util.h"
+#define CPRINTS(format, args...) cprints(CC_CHARGER, format, ## args)
+
enum battery_type {
BATTERY_SONY_CORP,
BATTERY_SMP_COS4870,
@@ -306,7 +308,10 @@ static int board_get_battery_type(void)
*/
static void board_init_battery_type(void)
{
- board_get_battery_type();
+ if (board_get_battery_type() != BATTERY_TYPE_COUNT)
+ CPRINTS("found batt:%s", info[board_battery_type].manuf_name);
+ else
+ CPRINTS("battery not found");
}
DECLARE_HOOK(HOOK_INIT, board_init_battery_type, HOOK_PRIO_INIT_I2C + 1);
