soc: rockchip: ipa: Divide ts by 10

Sometimes ts3 is a floating point value, so convert it to an integer
by multipliying by 10 in devicetree.

Change-Id: I3ac6f879e75927e1e551acbfba18148c993b5d26
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
Finley Xiao
2020-01-02 15:25:10 +08:00
parent d27dca34b7
commit b3038b79f1
3 changed files with 6 additions and 5 deletions

View File

@@ -58,7 +58,7 @@
compatible = "simple-power-model";
ref-leakage = <31>;
static-coefficient = <100000>;
ts = <59740 24105 (-245) 7>;
ts = <597400 241050 (-2450) 70>;
thermal-zone = "soc-thermal";
};
};
@@ -1702,7 +1702,7 @@
ref-leakage = <31>;
static-coefficient = <100000>;
dynamic-coefficient = <3080>;
ts = <8861 30312 (-500) 10>;
ts = <88610 303120 (-5000) 100>;
thermal-zone = "soc-thermal";
};
};

View File

@@ -39,7 +39,7 @@
compatible = "simple-power-model";
ref-leakage = <31>;
static-coefficient = <100000>;
ts = <59740 24105 (-245) 7>;
ts = <597400 241050 (-2450) 70>;
thermal-zone = "soc-thermal";
};
};
@@ -579,7 +579,7 @@
ref-leakage = <31>;
static-coefficient = <100000>;
dynamic-coefficient = <3080>;
ts = <8861 30312 (-500) 10>;
ts = <88610 303120 (-5000) 100>;
thermal-zone = "soc-thermal";
};
};

View File

@@ -106,7 +106,8 @@ static u32 calculate_temp_scaling_factor(s32 ts[4], s64 t)
+ ts[1] * t
+ ts[0] * 1000LL;
s64 res_unclamped = div_s64(res_big, 1000);
/* ts has beed multiplied by 10 in devicetree */
s64 res_unclamped = div_s64(res_big, 10000);
/* Clamp to range of 0x to 10x the static power */
return clamp(res_unclamped, (s64)0, (s64)10000000);