summaryrefslogtreecommitdiff
authorweitao.qiao <weitao.qiao@amlogic.com>2020-11-23 09:14:43 (GMT)
committer Weitao Qiao <weitao.qiao@amlogic.com>2020-11-23 09:40:07 (GMT)
commit972637c0a198b907a070c6774f81ad87de782ebb (patch)
treec0afde3bdf5ec2d7ab1474e1f5991b21c1c0b541
parent6bd9f796708fd9e4561d3862b02399e7ad402a57 (diff)
downloadcommon-972637c0a198b907a070c6774f81ad87de782ebb.zip
common-972637c0a198b907a070c6774f81ad87de782ebb.tar.gz
common-972637c0a198b907a070c6774f81ad87de782ebb.tar.bz2
common: sync code from openlinux in P [1/3]
OTT-12574 Problem: 1、Rapid temperature rise, try to close or optimize the module after analysis Solution: 1、try to close or optimize the module after analysis Verify: anning Changes to be committed: modified: arch/arm64/boot/dts/amlogic/gxl_p244_1g.dts modified: drivers/thermal/cpu_cooling.c Change-Id: Ie08de6378db2aae8646b15aee1723928f0b8ca38
Diffstat
-rwxr-xr-x[-rw-r--r--]arch/arm64/boot/dts/amlogic/gxl_p244_1g.dts21
-rwxr-xr-x[-rw-r--r--]drivers/thermal/cpu_cooling.c13
2 files changed, 24 insertions, 10 deletions
diff --git a/arch/arm64/boot/dts/amlogic/gxl_p244_1g.dts b/arch/arm64/boot/dts/amlogic/gxl_p244_1g.dts
index 6190af5..8616bd4 100644..100755
--- a/arch/arm64/boot/dts/amlogic/gxl_p244_1g.dts
+++ b/arch/arm64/boot/dts/amlogic/gxl_p244_1g.dts
@@ -397,6 +397,7 @@
ethmac: ethernet@0xc9410000 {
compatible = "amlogic, gxbb-eth-dwmac";
+ status = "disabled";
reg = <0x0 0xc9410000 0x0 0x10000
0x0 0xc8834540 0x0 0x8
0x0 0xc8834558 0x0 0xc>;
@@ -421,14 +422,14 @@
#thermal-sensor-cells = <1>;
cooling_devices {
cpufreq_cool_cluster0 {
- min_state = <1200000>;
+ min_state = <1000000>;
dyn_coeff = <140>;
cluster_id = <0>;
node_name = "cpufreq_cool0";
device_type = "cpufreq";
};
cpucore_cool_cluster0 {
- min_state = <1>;
+ min_state = <3>;
dyn_coeff = <0>;
cluster_id = <0>;
node_name = "cpucore_cool0";
@@ -472,22 +473,22 @@
trips {
switch_on: trip-point@0 {
- temperature = <80000>;
+ temperature = <90000>;
hysteresis = <1000>;
type = "passive";
};
control: trip-point@1 {
- temperature = <90000>;
+ temperature = <95000>;
hysteresis = <1000>;
type = "passive";
};
hot: trip-point@2 {
- temperature = <100000>;
+ temperature = <105000>;
hysteresis = <5000>;
type = "hot";
};
critical: trip-point@3 {
- temperature = <260000>;
+ temperature = <120000>;
hysteresis = <1000>;
type = "critical";
};
@@ -585,7 +586,7 @@
cvbsout {
compatible = "amlogic, cvbsout-gxl";
dev_name = "cvbsout";
- status = "okay";
+ status = "disabled";
clocks = <&clkc CLKID_VCLK2_ENCI
&clkc CLKID_VCLK2_VENCI0
&clkc CLKID_VCLK2_VENCI1
@@ -882,13 +883,13 @@
dummy_codec:dummy{
#sound-dai-cells = <0>;
compatible = "amlogic, aml_dummy_codec";
- status = "disable";
+ status = "okay";
};
amlogic_codec:t9015{
#sound-dai-cells = <0>;
compatible = "amlogic, aml_codec_T9015";
reg = <0x0 0xc8832000 0x0 0x14>;
- status = "okay";
+ status = "disable";
};
aml_sound_meson {
compatible = "aml, meson-snd-card";
@@ -918,7 +919,7 @@
sound-dai = <&pcm_dai>;
};
codec0: codec0 {
- sound-dai = <&amlogic_codec>;
+ sound-dai = <&dummy_codec>;
};
codec1: codec1 {
sound-dai = <&spdif_codec>;
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index f49d298..99c7c82 100644..100755
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -33,6 +33,10 @@
#include <trace/events/thermal.h>
+#define CON_TEMP 100000
+int TEMP = -1;
+int RET = -1;
+
/*
* Cooling state <-> CPUFreq frequency
*
@@ -428,6 +432,10 @@ static int get_static_power(struct cpufreq_cooling_device *cpufreq_device,
unsigned long voltage;
struct cpumask *cpumask = &cpufreq_device->allowed_cpus;
unsigned long freq_hz = freq * 1000;
+ int temp;
+
+ RET = tz->ops->get_temp(tz, &temp);
+ TEMP = temp;
if (!cpufreq_device->plat_get_static_power ||
!cpufreq_device->cpu_dev) {
@@ -533,6 +541,11 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
if (WARN_ON(state > cpufreq_device->max_level))
return -EINVAL;
+ if (cpufreq_device->freq_table[state] == 1000000) {
+ if (TEMP <= CON_TEMP)
+ state = state - 1;
+ }
+
/* Check if the old cooling action is same as new cooling action */
if (cpufreq_device->cpufreq_state == state)
return 0;