mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
Hide battery vendor params override behind config option
Only link actually used this function, but all batteries were required to provide an (empty) implementation. Use CONFIG_BATTERY_VENDOR_PARAMS to gate this functionality, so non-link battery code can be simpler. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms and pass unit tests Change-Id: Ic2c6dd1163a981e48873d798f77891cc7de1f8cf Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65257 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Rong Chang <rongchang@chromium.org>
This commit is contained in:
committed by
ChromeBot
parent
2b2f78d929
commit
d8be5316e6
@@ -11,6 +11,7 @@
|
||||
/* Optional features */
|
||||
#define CONFIG_BACKLIGHT_X86
|
||||
#define CONFIG_BATTERY_SMART
|
||||
#define CONFIG_BATTERY_VENDOR_PARAMS
|
||||
#define CONFIG_BOARD_VERSION
|
||||
#define CONFIG_CHARGER
|
||||
#define CONFIG_CHARGER_BQ24725
|
||||
|
||||
@@ -36,12 +36,6 @@ const struct battery_info *battery_get_info(void)
|
||||
return &info;
|
||||
}
|
||||
|
||||
/* FIXME: The smart battery should do the right thing - that's why it's
|
||||
* called "smart". Do we really want to second-guess it? For now, let's not. */
|
||||
void battery_vendor_params(struct batt_params *batt)
|
||||
{
|
||||
}
|
||||
|
||||
int battery_command_cut_off(struct host_cmd_handler_args *args)
|
||||
{
|
||||
int rv;
|
||||
|
||||
@@ -38,12 +38,6 @@ const struct battery_info *battery_get_info(void)
|
||||
return &info;
|
||||
}
|
||||
|
||||
/* FIXME: The smart battery should do the right thing - that's why it's
|
||||
* called "smart". Do we really want to second-guess it? For now, let's not. */
|
||||
void battery_vendor_params(struct batt_params *batt)
|
||||
{
|
||||
}
|
||||
|
||||
int battery_command_cut_off(struct host_cmd_handler_args *args)
|
||||
{
|
||||
return sb_write(SB_SHIP_MODE_ADDR, SB_SHIP_MODE_DATA);
|
||||
|
||||
@@ -33,12 +33,6 @@ const struct battery_info *battery_get_info(void)
|
||||
return &info;
|
||||
}
|
||||
|
||||
/* FIXME: The smart battery should do the right thing - that's why it's
|
||||
* called "smart". Do we really want to second-guess it? For now, let's not. */
|
||||
void battery_vendor_params(struct batt_params *batt)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Physical detection of battery connection.
|
||||
*/
|
||||
|
||||
@@ -284,8 +284,10 @@ static int state_common(struct power_state_context *ctx)
|
||||
*ctx->memmap_batt_flags &= ~EC_BATT_FLAG_LEVEL_CRITICAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BATTERY_VENDOR_PARAMS
|
||||
/* Apply battery pack vendor charging method */
|
||||
battery_vendor_params(batt);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CHARGER_CURRENT_LIMIT
|
||||
if (batt->desired_current > CONFIG_CHARGER_CURRENT_LIMIT)
|
||||
|
||||
@@ -118,7 +118,3 @@ const struct battery_info *battery_get_info(void)
|
||||
{
|
||||
return &bat_info;
|
||||
}
|
||||
|
||||
void battery_vendor_params(struct batt_params *batt)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -45,12 +45,14 @@ struct battery_info {
|
||||
*/
|
||||
const struct battery_info *battery_get_info(void);
|
||||
|
||||
#ifdef CONFIG_BATTERY_VENDOR_PARAMS
|
||||
/**
|
||||
* Modify battery parameters to match vendor charging profile.
|
||||
*
|
||||
* @param batt Battery parameters to modify
|
||||
*/
|
||||
void battery_vendor_params(struct batt_params *batt);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BATTERY_CHECK_CONNECTED
|
||||
/**
|
||||
|
||||
@@ -69,6 +69,12 @@
|
||||
*/
|
||||
#undef CONFIG_BATTERY_SMART
|
||||
|
||||
/*
|
||||
* Charger should call battery_vendor_params() to limit/correct the voltage and
|
||||
* current requested by the battery pack before acting on the request.
|
||||
*/
|
||||
#undef CONFIG_BATTERY_VENDOR_PARAMS
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user