soc/intel/../thermal: Drop ltt_value
local variable
Using the `GET_LTT_VALUE` macro directly instead of 'ltt_value' local variable. BUG=b:193774296 Change-Id: I791766bf2a78fa30dbba8cf4ad8a50e44f0e73ed Signed-off-by: Subrata Banik <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/59309 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maulik V Vaghela <maulik.v.vaghela@intel.com> Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
#define MAX_TRIP_TEMP 205
|
#define MAX_TRIP_TEMP 205
|
||||||
/* This is the safest default Trip Temp value */
|
/* This is the safest default Trip Temp value */
|
||||||
#define DEFAULT_TRIP_TEMP 50
|
#define DEFAULT_TRIP_TEMP 50
|
||||||
|
/* Trip Point Temp = (LTT / 2 - 50 degree C) */
|
||||||
#define GET_LTT_VALUE(x) (((x) + 50) * (2))
|
#define GET_LTT_VALUE(x) (((x) + 50) * (2))
|
||||||
|
|
||||||
static uint8_t get_thermal_trip_temp(void)
|
static uint8_t get_thermal_trip_temp(void)
|
||||||
@@ -24,7 +25,6 @@ static uint8_t get_thermal_trip_temp(void)
|
|||||||
/* PCH Low Temp Threshold (LTT) */
|
/* PCH Low Temp Threshold (LTT) */
|
||||||
static uint16_t pch_get_ltt_value(struct device *dev)
|
static uint16_t pch_get_ltt_value(struct device *dev)
|
||||||
{
|
{
|
||||||
uint16_t ltt_value;
|
|
||||||
uint8_t thermal_config;
|
uint8_t thermal_config;
|
||||||
|
|
||||||
thermal_config = get_thermal_trip_temp();
|
thermal_config = get_thermal_trip_temp();
|
||||||
@@ -34,10 +34,7 @@ static uint16_t pch_get_ltt_value(struct device *dev)
|
|||||||
if (thermal_config > MAX_TRIP_TEMP)
|
if (thermal_config > MAX_TRIP_TEMP)
|
||||||
die("Input PCH temp trip is higher than allowed range!");
|
die("Input PCH temp trip is higher than allowed range!");
|
||||||
|
|
||||||
/* Trip Point Temp = (LTT / 2 - 50 degree C) */
|
return GET_LTT_VALUE(thermal_config);
|
||||||
ltt_value = GET_LTT_VALUE(thermal_config);
|
|
||||||
|
|
||||||
return ltt_value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable thermal sensor power management */
|
/* Enable thermal sensor power management */
|
||||||
|
Reference in New Issue
Block a user