mirror of
https://gitee.com/open-loongarch/linux-5.10.git
synced 2026-10-25 12:47:11 +08:00
Revert "thermal: 2k300: fix thermal calu code"
This reverts commit 06e1e623e2a1dd6c810ac081ab60b321a8e922ea.
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#define LS2K_TSENSOR_CTRL_LO (0x8)
|
||||
#define LS2K_TSENSOR_STATUS (0x10)
|
||||
#define LS2K_TSENSOR_OUT (0x14)
|
||||
#define LS2K_TSENSOR_CFG (0x18)
|
||||
|
||||
#define LS2K_MIN_TEMP -40
|
||||
#define LS2K_MAX_TEMP 125
|
||||
@@ -84,31 +83,8 @@ static int ls2k_thermal_get_temp(void *__data, int *temp)
|
||||
u32 reg_val;
|
||||
|
||||
reg_val = readl(data->regs + LS2K_TSENSOR_OUT);
|
||||
if (data->cpu_type == ID_2K300) {
|
||||
int version;
|
||||
int val_fix;
|
||||
writel(0xff03, data->regs + LS2K_TSENSOR_CFG); // 0x18
|
||||
reg_val = readl(data->regs + LS2K_TSENSOR_OUT);
|
||||
reg_val &= 0x7ff;
|
||||
|
||||
version = readl(data->regs + 0x2AF0); // 0x16003ff0
|
||||
version >>= 4;
|
||||
version &= 1;
|
||||
|
||||
if(version)
|
||||
val_fix = readl(data->regs + 0x2AF4) & 0xffff; // 0x16003ff4
|
||||
else
|
||||
val_fix = (readl(data->regs + 0x2AF0) >> 20) & 0xffff; // 0x16003ff0
|
||||
|
||||
if (val_fix & 0x8000)
|
||||
val_fix = -(val_fix & 0x7fff);
|
||||
else
|
||||
val_fix = val_fix & 0x7fff;
|
||||
|
||||
reg_val += val_fix;
|
||||
reg_val = reg_val * 570 - 394700;
|
||||
*temp = reg_val;
|
||||
}
|
||||
if (data->cpu_type == ID_2K300)
|
||||
*temp = ((reg_val & 0x7ff) * 569) - 394700;
|
||||
else
|
||||
*temp = ((reg_val & 0xff) - 100) * 1000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user