mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
cleanup: Rename charge_temp_sensor_get_val() to charge_get_battery_temp()
charge_temp_sensor_get_val() is used to get the battery temperature value hence renamed it to charge_get_battery_temp(). BUG=none BRANCH=none TEST=make buildall -j Change-Id: I2b52cac57dcde12a6b7405e7d712240e278954e2 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/397962 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
26cacee37f
commit
6f5489e18e
@@ -224,7 +224,7 @@ const struct temp_sensor_t temp_sensors[] = {
|
||||
G78X_IDX_EXTERNAL1, 4},
|
||||
{"G782_Sensor_2", TEMP_SENSOR_TYPE_BOARD, g78x_get_val,
|
||||
G78X_IDX_EXTERNAL2, 4},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val,
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp,
|
||||
0, 4},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
|
||||
|
||||
@@ -209,7 +209,7 @@ void board_rtc_reset(void)
|
||||
}
|
||||
|
||||
const struct temp_sensor_t temp_sensors[] = {
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0, 4},
|
||||
|
||||
/* These BD99992GW temp sensors are only readable in S0 */
|
||||
{"Ambient", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
|
||||
|
||||
@@ -150,7 +150,7 @@ const struct temp_sensor_t temp_sensors[] = {
|
||||
{"TMP432_Sensor_2", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
|
||||
TMP432_IDX_REMOTE2, 4},
|
||||
#endif
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val,
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp,
|
||||
0, 4},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
|
||||
|
||||
@@ -182,7 +182,7 @@ void board_reset_pd_mcu(void)
|
||||
}
|
||||
|
||||
const struct temp_sensor_t temp_sensors[] = {
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0, 4},
|
||||
|
||||
/* These BD99992GW temp sensors are only readable in S0 */
|
||||
{"Ambient", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
|
||||
|
||||
@@ -144,7 +144,7 @@ const struct i2c_port_t i2c_ports[] = {
|
||||
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
|
||||
|
||||
const struct temp_sensor_t temp_sensors[] = {
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0, 4},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ const struct temp_sensor_t temp_sensors[] = {
|
||||
TMP432_IDX_REMOTE1, 4},
|
||||
{"TMP432_Sensor_2", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
|
||||
TMP432_IDX_REMOTE2, 4},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val,
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp,
|
||||
0, 4},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
|
||||
|
||||
@@ -414,7 +414,7 @@ int board_get_ambient_temp(int idx, int *temp_ptr)
|
||||
|
||||
const struct temp_sensor_t temp_sensors[] = {
|
||||
/* FIXME(dhendrix): tweak action_delay_sec */
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 1},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0, 1},
|
||||
{"Ambient", TEMP_SENSOR_TYPE_BOARD, board_get_ambient_temp, 0, 5},
|
||||
{"Charger", TEMP_SENSOR_TYPE_BOARD, board_get_charger_temp, 1, 1},
|
||||
};
|
||||
|
||||
@@ -100,6 +100,6 @@ const struct temp_sensor_t temp_sensors[] = {
|
||||
TMP432_IDX_REMOTE1, 4},
|
||||
{"TMP432_CPU_bottom", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
|
||||
TMP432_IDX_REMOTE2, 4},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0, 4},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
|
||||
|
||||
@@ -398,7 +398,7 @@ int board_get_ambient_temp(int idx, int *temp_ptr)
|
||||
|
||||
const struct temp_sensor_t temp_sensors[] = {
|
||||
/* FIXME(dhendrix): tweak action_delay_sec */
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 1},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0, 1},
|
||||
{"Ambient", TEMP_SENSOR_TYPE_BOARD, board_get_ambient_temp, 0, 5},
|
||||
{"Charger", TEMP_SENSOR_TYPE_BOARD, board_get_charger_temp, 1, 1},
|
||||
};
|
||||
|
||||
@@ -164,7 +164,7 @@ const struct temp_sensor_t temp_sensors[] = {
|
||||
{"I2C-Right D-Object", TEMP_SENSOR_TYPE_CASE, tmp006_get_val, 9, 7},
|
||||
{"I2C-Left D-Die", TEMP_SENSOR_TYPE_BOARD, tmp006_get_val, 10, 7},
|
||||
{"I2C-Left D-Object", TEMP_SENSOR_TYPE_CASE, tmp006_get_val, 11, 7},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0, 4},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ const struct temp_sensor_t temp_sensors[] = {
|
||||
TMP432_IDX_REMOTE1, 4},
|
||||
{"TMP432_Sensor_2", TEMP_SENSOR_TYPE_BOARD, tmp432_get_val,
|
||||
TMP432_IDX_REMOTE2, 4},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val,
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp,
|
||||
0, 4},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
|
||||
|
||||
@@ -182,7 +182,7 @@ void board_reset_pd_mcu(void)
|
||||
}
|
||||
|
||||
const struct temp_sensor_t temp_sensors[] = {
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_temp_sensor_get_val, 0, 4},
|
||||
{"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0, 4},
|
||||
|
||||
/* These BD99992GW temp sensors are only readable in S0 */
|
||||
{"Ambient", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
|
||||
|
||||
@@ -665,7 +665,7 @@ int charge_get_percent(void)
|
||||
return task_ctx.curr.batt.state_of_charge;
|
||||
}
|
||||
|
||||
int charge_temp_sensor_get_val(int idx, int *temp_ptr)
|
||||
int charge_get_battery_temp(int idx, int *temp_ptr)
|
||||
{
|
||||
const struct batt_params *batt = &task_ctx.curr.batt;
|
||||
|
||||
|
||||
@@ -1090,7 +1090,7 @@ int charge_get_percent(void)
|
||||
return is_full ? 100 : curr.batt.state_of_charge;
|
||||
}
|
||||
|
||||
int charge_temp_sensor_get_val(int idx, int *temp_ptr)
|
||||
int charge_get_battery_temp(int idx, int *temp_ptr)
|
||||
{
|
||||
if (curr.batt.flags & BATT_FLAG_BAD_TEMPERATURE)
|
||||
return EC_ERROR_UNKNOWN;
|
||||
|
||||
@@ -110,7 +110,7 @@ int charge_prevent_power_on(int power_button_pressed);
|
||||
*
|
||||
* @return EC_SUCCESS if successful, non-zero if error.
|
||||
*/
|
||||
int charge_temp_sensor_get_val(int idx, int *temp_ptr);
|
||||
int charge_get_battery_temp(int idx, int *temp_ptr);
|
||||
|
||||
/**
|
||||
* Get the pointer to the battery parameters we saved in charge state.
|
||||
|
||||
@@ -408,7 +408,7 @@ static int test_external_funcs(void)
|
||||
TEST_ASSERT(!charge_want_shutdown());
|
||||
TEST_ASSERT(charge_get_percent() == 50);
|
||||
temp = 0;
|
||||
rv = charge_temp_sensor_get_val(0, &temp);
|
||||
rv = charge_get_battery_temp(0, &temp);
|
||||
TEST_ASSERT(rv == EC_SUCCESS);
|
||||
TEST_ASSERT(K_TO_C(temp) == 25);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user