diff options
author | Dave Parker <dparker@chromium.org> | 2014-04-19 14:09:42 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-04-29 03:11:05 +0000 |
commit | 6f21e3f5c1c61caac1535ec433210aac213c1c1c (patch) | |
tree | fd60f927ff58ce1e24a19a1d14f0116e8e923183 | |
parent | 4e1472e3037602beec0eb5849ab76fb055d5a657 (diff) | |
download | chrome-ec-6f21e3f5c1c61caac1535ec433210aac213c1c1c.tar.gz |
Rename battery_vendor_params() to battery_override_params()
Charger V1 only. This is a clearer name for the intent of
the function to override the charging parameters requested
by the battery. This also disabmiguates this function with
a new host command to get and set arbitrary vendor
parameters in the battery.
BUG=chrome-os-partner:25145
BRANCH=ToT
TEST=`make buildall -j`.
Change-Id: I1e8762d359c0e91c5b2a539553d22c12c9850c03
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/195823
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/197164
Reviewed-by: Yung-chieh Lo <yjlou@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r-- | board/big/battery.c | 6 | ||||
-rw-r--r-- | board/blaze/battery.c | 6 | ||||
-rw-r--r-- | board/link/board.h | 2 | ||||
-rw-r--r-- | board/nyan/battery.c | 6 | ||||
-rw-r--r-- | common/charge_state_v1.c | 4 | ||||
-rw-r--r-- | driver/battery/link.c | 6 | ||||
-rw-r--r-- | include/battery.h | 2 | ||||
-rw-r--r-- | include/config.h | 21 |
8 files changed, 28 insertions, 25 deletions
diff --git a/board/big/battery.c b/board/big/battery.c index b795206bfc..aa6191f2c0 100644 --- a/board/big/battery.c +++ b/board/big/battery.c @@ -169,7 +169,7 @@ static struct battery_device support_batteries[] = { }, }; -#ifdef CONFIG_BATTERY_VENDOR_PARAMS +#ifdef CONFIG_BATTERY_OVERRIDE_PARAMS /* * The following parameters are for 2S battery. * There is no corresponding params for 3S battery. @@ -213,7 +213,7 @@ static inline void limit_value(int *val, int limit) *val = limit; } -void battery_vendor_params(struct batt_params *batt) +void battery_override_params(struct batt_params *batt) { int *desired_current = &batt->desired_current; int temp_range, volt_range; @@ -264,7 +264,7 @@ void battery_vendor_params(struct batt_params *batt) *desired_current < battery_info->precharge_current) *desired_current = battery_info->precharge_current; } -#endif /* CONFIG_BATTERY_VENDOR_PARAMS */ +#endif /* CONFIG_BATTERY_OVERRIDE_PARAMS */ const struct battery_info *battery_get_info(void) { diff --git a/board/blaze/battery.c b/board/blaze/battery.c index 2944f97119..f024445f44 100644 --- a/board/blaze/battery.c +++ b/board/blaze/battery.c @@ -94,7 +94,7 @@ static struct battery_device support_batteries[] = { } }; -#ifdef CONFIG_BATTERY_VENDOR_PARAMS +#ifdef CONFIG_BATTERY_OVERRIDE_PARAMS /* * The following parameters are for 2S battery. * There is no corresponding params for 3S battery. @@ -138,7 +138,7 @@ static inline void limit_value(int *val, int limit) *val = limit; } -void battery_vendor_params(struct batt_params *batt) +void battery_override_params(struct batt_params *batt) { int *desired_current = &batt->desired_current; int temp_range, volt_range; @@ -189,7 +189,7 @@ void battery_vendor_params(struct batt_params *batt) *desired_current < battery_info->precharge_current) *desired_current = battery_info->precharge_current; } -#endif /* CONFIG_BATTERY_VENDOR_PARAMS */ +#endif /* CONFIG_BATTERY_OVERRIDE_PARAMS */ const struct battery_info *battery_get_info(void) { diff --git a/board/link/board.h b/board/link/board.h index c52b6561a2..88e363b9a7 100644 --- a/board/link/board.h +++ b/board/link/board.h @@ -14,7 +14,7 @@ #define CONFIG_BACKLIGHT_REQ_GPIO GPIO_PCH_BKLTEN #define CONFIG_BATTERY_LINK #define CONFIG_BATTERY_SMART -#define CONFIG_BATTERY_VENDOR_PARAMS +#define CONFIG_BATTERY_OVERRIDE_PARAMS #define CONFIG_BOARD_VERSION #define CONFIG_CHARGER #define CONFIG_CHARGER_V1 diff --git a/board/nyan/battery.c b/board/nyan/battery.c index fa8ff5792b..381ff09290 100644 --- a/board/nyan/battery.c +++ b/board/nyan/battery.c @@ -131,7 +131,7 @@ static struct battery_device support_batteries[] = { } }; -#ifdef CONFIG_BATTERY_VENDOR_PARAMS +#ifdef CONFIG_BATTERY_OVERRIDE_PARAMS /* * The following parameters are for 2S battery. * There is no corresponding params for 3S battery. @@ -175,7 +175,7 @@ static inline void limit_value(int *val, int limit) *val = limit; } -void battery_vendor_params(struct batt_params *batt) +void battery_override_params(struct batt_params *batt) { int *desired_current = &batt->desired_current; int temp_range, volt_range; @@ -226,7 +226,7 @@ void battery_vendor_params(struct batt_params *batt) *desired_current < battery_info->precharge_current) *desired_current = battery_info->precharge_current; } -#endif /* CONFIG_BATTERY_VENDOR_PARAMS */ +#endif /* CONFIG_BATTERY_OVERRIDE_PARAMS */ const struct battery_info *battery_get_info(void) { diff --git a/common/charge_state_v1.c b/common/charge_state_v1.c index fc1fe28da3..3ddb513996 100644 --- a/common/charge_state_v1.c +++ b/common/charge_state_v1.c @@ -349,9 +349,9 @@ static int state_common(struct charge_state_context *ctx) *ctx->memmap_batt_flags &= ~EC_BATT_FLAG_LEVEL_CRITICAL; } -#ifdef CONFIG_BATTERY_VENDOR_PARAMS +#ifdef CONFIG_BATTERY_OVERRIDE_PARAMS /* Apply battery pack vendor charging method */ - battery_vendor_params(batt); + battery_override_params(batt); #endif #ifdef CONFIG_CHARGER_CURRENT_LIMIT diff --git a/driver/battery/link.c b/driver/battery/link.c index f870342f9a..37a4ffb150 100644 --- a/driver/battery/link.c +++ b/driver/battery/link.c @@ -39,7 +39,7 @@ const struct battery_info *battery_get_info(void) return &info; } -#ifdef CONFIG_BATTERY_VENDOR_PARAMS +#ifdef CONFIG_BATTERY_OVERRIDE_PARAMS /* * Design capacity @@ -93,7 +93,7 @@ static inline void limit_value(int *val, int limit) * desired_voltage and desired_current will be passed to the charger. To use * the smart battery's profile, simply do nothing. */ -void battery_vendor_params(struct batt_params *batt) +void battery_override_params(struct batt_params *batt) { int *desired_current = &batt->desired_current; int temp_range, volt_range; @@ -137,4 +137,4 @@ void battery_vendor_params(struct batt_params *batt) *desired_current = info.precharge_current; } -#endif /* CONFIG_BATTERY_VENDOR_PARAMS */ +#endif /* CONFIG_BATTERY_OVERRIDE_PARAMS */ diff --git a/include/battery.h b/include/battery.h index ee110d6684..cfc358bf4e 100644 --- a/include/battery.h +++ b/include/battery.h @@ -113,7 +113,7 @@ void battery_get_params(struct batt_params *batt); * * @param batt Battery parameters to modify */ -void battery_vendor_params(struct batt_params *batt); +void battery_override_params(struct batt_params *batt); /** * Check for presence of battery. diff --git a/include/config.h b/include/config.h index 1f2ce70946..56d18d26bb 100644 --- a/include/config.h +++ b/include/config.h @@ -95,6 +95,14 @@ #undef CONFIG_BATTERY_MOCK /* + * Charger should call battery_override_params() to limit/correct the voltage + * and current requested by the battery pack before acting on the request. + * + * This is valid with CONFIG_CHARGER_V1 only. + */ +#undef CONFIG_BATTERY_OVERRIDE_PARAMS + +/* * If defined, the charger will check for battery presence before attempting * to communicate with it. This avoids the 30 second delay when booting * without a battery present. Do not use with CONFIG_BATTERY_PRESENT_GPIO. @@ -121,14 +129,6 @@ #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. - * - * This is valid with CONFIG_CHARGER_V1 only. - */ -#undef CONFIG_BATTERY_VENDOR_PARAMS - -/* * Support battery cut-off as host command and console command. * * Once defined, you have to implement a board_cut_off_battery() function @@ -212,7 +212,10 @@ */ #undef CONFIG_CHARGER_INPUT_CURRENT -/* Equivalent of CONFIG_BATTERY_VENDOR_PARAMS for use with CONFIG_CHARGER_V2 */ +/* + * Equivalent of CONFIG_BATTERY_OVERRIDE_PARAMS for use with + * CONFIG_CHARGER_V2 + */ #undef CONFIG_CHARGER_PROFILE_OVERRIDE /* Value of the charge sense resistor, in mOhms */ |