diff options
Diffstat (limited to 'common/charger_profile_override.c')
-rw-r--r-- | common/charger_profile_override.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/common/charger_profile_override.c b/common/charger_profile_override.c index 2b691b9a5a..00aaa2b5bd 100644 --- a/common/charger_profile_override.c +++ b/common/charger_profile_override.c @@ -1,4 +1,4 @@ -/* Copyright 2016 The Chromium OS Authors. All rights reserved. +/* Copyright 2016 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * @@ -20,17 +20,17 @@ static int test_vtg_mV = -1; static int fast_charging_allowed = 1; -int charger_profile_override_common(struct charge_state_data *curr, - const struct fast_charge_params *fast_chg_params, - const struct fast_charge_profile **prev_chg_prof_info, - int batt_vtg_max) +int charger_profile_override_common( + struct charge_state_data *curr, + const struct fast_charge_params *fast_chg_params, + const struct fast_charge_profile **prev_chg_prof_info, int batt_vtg_max) { int i, voltage_range; /* temp in 0.1 deg C */ int temp_c = curr->batt.temperature - 2731; int temp_ranges = fast_chg_params->total_temp_ranges; const struct fast_charge_profile *chg_profile_info = - fast_chg_params->chg_profile_info; + fast_chg_params->chg_profile_info; #ifdef CONFIG_CMD_CHARGER_PROFILE_OVERRIDE_TEST if (fast_charge_test_on && test_vtg_mV != -1) { @@ -78,9 +78,9 @@ int charger_profile_override_common(struct charge_state_data *curr, if (!(curr->batt.flags & BATT_FLAG_BAD_VOLTAGE)) { for (i = 0; i < CONFIG_CHARGER_PROFILE_VOLTAGE_RANGES - 1; - i++) { + i++) { if (curr->batt.voltage < - fast_chg_params->voltage_mV[i]) { + fast_chg_params->voltage_mV[i]) { voltage_range = i; break; } @@ -98,13 +98,13 @@ int charger_profile_override_common(struct charge_state_data *curr, * Okay, impose our custom will: */ curr->requested_current = - (*prev_chg_prof_info)->current_mA[voltage_range]; + (*prev_chg_prof_info)->current_mA[voltage_range]; curr->requested_voltage = curr->requested_current ? batt_vtg_max : 0; #ifdef CONFIG_CMD_CHARGER_PROFILE_OVERRIDE_TEST if (fast_charge_test_on) ccprintf("Fast charge profile i=%dmA, v=%dmV\n", - curr->requested_current, curr->requested_voltage); + curr->requested_current, curr->requested_voltage); #endif return 0; @@ -134,7 +134,7 @@ enum ec_status charger_profile_override_set_param(uint32_t param, } #ifdef CONFIG_CMD_CHARGER_PROFILE_OVERRIDE -static int command_fastcharge(int argc, char **argv) +static int command_fastcharge(int argc, const char **argv) { if (argc > 1 && !parse_bool(argv[1], &fast_charging_allowed)) return EC_ERROR_PARAM1; @@ -143,8 +143,7 @@ static int command_fastcharge(int argc, char **argv) return EC_SUCCESS; } -DECLARE_CONSOLE_COMMAND(fastcharge, command_fastcharge, - "[on|off]", +DECLARE_CONSOLE_COMMAND(fastcharge, command_fastcharge, "[on|off]", "Get or set fast charging profile"); #endif @@ -153,7 +152,7 @@ DECLARE_CONSOLE_COMMAND(fastcharge, command_fastcharge, * fast charging profile is selected. */ #ifdef CONFIG_CMD_CHARGER_PROFILE_OVERRIDE_TEST -static int command_fastcharge_test(int argc, char **argv) +static int command_fastcharge_test(int argc, const char **argv) { char *e; int test_on; |