qcom-common: Add thermal profiles

 * Add thermal profiles for 8064/8960

Change-Id: I92b04a4a4d0be552ef18108cd5f2c9fc95d6c288
diff --git a/qcom-common.mk b/qcom-common.mk
index 1ce5357..6c9064e 100644
--- a/qcom-common.mk
+++ b/qcom-common.mk
@@ -66,6 +66,17 @@
     system/extras/bugmailer/bugmailer.sh:system/bin/bugmailer.sh \
     system/extras/bugmailer/send_bug:system/bin/send_bug
 
+# Thermal profiles
+PRODUCT_PACKAGES += \
+    thermald-8064ab.conf \
+    thermald-8064.conf \
+    thermald-8930.conf \
+    thermald-8960.conf \
+    thermal-engine-8064ab.conf \
+    thermal-engine-8064.conf \
+    thermal-engine-8930.conf \
+    thermal-engine-8960.conf
+
 # Init scripts
 PRODUCT_PACKAGES += \
     init.qcom.post_boot.sh \
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index 1a9c947..b064e7f 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -100,3 +100,62 @@
 LOCAL_MODULE_CLASS := ETC
 LOCAL_SRC_FILES    := etc/init.qcom.ril.sh
 include $(BUILD_PREBUILT)
+
+
+# Thermal profiles
+include $(CLEAR_VARS)
+LOCAL_MODULE       := thermald-8064ab.conf
+LOCAL_MODULE_TAGS  := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES    := etc/thermald-8064ab.conf
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE       := thermald-8064.conf
+LOCAL_MODULE_TAGS  := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES    := etc/thermald-8064.conf
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE       := thermald-8930.conf
+LOCAL_MODULE_TAGS  := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES    := etc/thermald-8930.conf
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE       := thermald-8960.conf
+LOCAL_MODULE_TAGS  := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES    := etc/thermald-8960.conf
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE       := thermal-engine-8064ab.conf
+LOCAL_MODULE_TAGS  := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES    := etc/thermal-engine-8064ab.conf
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE       := thermal-engine-8064.conf
+LOCAL_MODULE_TAGS  := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES    := etc/thermal-engine-8064.conf
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE       := thermal-engine-8930.conf
+LOCAL_MODULE_TAGS  := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES    := etc/thermal-engine-8930.conf
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE       := thermal-engine-8960.conf
+LOCAL_MODULE_TAGS  := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES    := etc/thermal-engine-8960.conf
+include $(BUILD_PREBUILT)
+
diff --git a/rootdir/etc/thermal-engine-8064.conf b/rootdir/etc/thermal-engine-8064.conf
new file mode 100644
index 0000000..77e2d72
--- /dev/null
+++ b/rootdir/etc/thermal-engine-8064.conf
@@ -0,0 +1,38 @@
+sampling         5000
+
+[CPU0_MONITOR]
+algo_type        monitor
+sensor           cpu0
+sampling         1000
+thresholds       90000   100000  110000  115000  120000
+thresholds_clr   85000   95000   105000  110000  115000
+actions          battery battery battery battery shutdown
+action_info      0       1       2       3       5000
+
+[CPU1_MONITOR]
+algo_type        monitor
+sensor           cpu1
+sampling         1000
+thresholds       120000
+thresholds_clr   115000
+actions          shutdown
+action_info      5000
+
+[CPU2_MONITOR]
+algo_type        monitor
+sensor           cpu2
+sampling         1000
+thresholds       120000
+thresholds_clr   115000
+actions          shutdown
+action_info      5000
+
+[CPU3_MONITOR]
+algo_type        monitor
+sensor           cpu3
+sampling         1000
+thresholds       120000
+thresholds_clr   115000
+actions          shutdown
+action_info      5000
+
diff --git a/rootdir/etc/thermal-engine-8064ab.conf b/rootdir/etc/thermal-engine-8064ab.conf
new file mode 100644
index 0000000..42c224c
--- /dev/null
+++ b/rootdir/etc/thermal-engine-8064ab.conf
@@ -0,0 +1,47 @@
+sampling         5000
+
+[HYBRID-THRESH]
+algo_type	monitor
+sensor		 tsens_tz_sensor0
+sampling         1000
+thresholds       70000
+thresholds_clr   67000
+actions          none
+action_info      0
+
+[CPU0_MONITOR]
+algo_type        monitor
+sensor           cpu0
+sampling         250
+thresholds       70000    85000    90000    95000    100000  105000  110000  120000
+thresholds_clr   67000    80000    85000    90000    95000   100000  105000  115000
+actions          cpu+battery  cpu+battery  cpu+battery  cpu+battery  cpu+battery  cpu+battery  cpu+battery  shutdown
+action_info      1890000+0    1674000+0    1350000+1    1026000+1    810000+2     594000+2     384000+3     5000
+
+[CPU1_MONITOR]
+algo_type        monitor
+sensor           cpu1
+sampling         250
+thresholds       70000    85000    90000    95000    100000  105000  110000  120000
+thresholds_clr   67000    80000    85000    90000    95000   100000  105000  115000
+actions          cpu      cpu      cpu      cpu      cpu     cpu     cpu     shutdown
+action_info      1890000  1674000  1350000  1026000  810000  594000  384000  5000
+
+[CPU2_MONITOR]
+algo_type        monitor
+sensor           cpu2
+sampling         250
+thresholds       70000    85000    90000    95000    100000  105000  110000  120000
+thresholds_clr   67000    80000    85000    90000    95000   100000  105000  115000
+actions          cpu      cpu      cpu      cpu      cpu     cpu     cpu     shutdown
+action_info      1890000  1674000  1350000  1026000  810000  594000  384000  5000
+
+[CPU3_MONITOR]
+algo_type        monitor
+sensor           cpu3
+sampling         250
+thresholds       70000    85000    90000    95000    100000  105000  110000  120000
+thresholds_clr   67000    80000    85000    90000    95000   100000  105000  115000
+actions          cpu      cpu      cpu      cpu      cpu     cpu     cpu     shutdown
+action_info      1890000  1674000  1350000  1026000  810000  594000  384000  5000
+
diff --git a/rootdir/etc/thermal-engine-8930.conf b/rootdir/etc/thermal-engine-8930.conf
new file mode 100644
index 0000000..ed86677
--- /dev/null
+++ b/rootdir/etc/thermal-engine-8930.conf
@@ -0,0 +1,20 @@
+sampling         5000
+
+[PA0_MONITOR]
+algo_type        monitor
+sensor           pa_therm0
+sampling         100000
+thresholds       65000   70000   75000   80000   85000   90000
+thresholds_clr   60000   65000   70000   75000   80000   85000
+actions          none    none    none    none    none    none
+action_info      0       0       0       0       0       0
+
+[CPU0_MONITOR]
+algo_type        monitor
+sensor           cpu0
+sampling         1000
+thresholds       120000
+thresholds_clr   115000
+actions          shutdown
+action_info      5000
+
diff --git a/rootdir/etc/thermal-engine-8960.conf b/rootdir/etc/thermal-engine-8960.conf
new file mode 100644
index 0000000..1472553
--- /dev/null
+++ b/rootdir/etc/thermal-engine-8960.conf
@@ -0,0 +1,29 @@
+sampling         5000
+
+[PA0_MONITOR]
+algo_type        monitor
+sensor           pa_therm0
+sampling         100000
+thresholds       65000   70000   75000   80000   85000   90000
+thresholds_clr   60000   65000   70000   75000   80000   85000
+actions          none    none    none    none    none    none
+action_info      0       0       0       0       0       0
+
+[CPU0_MONITOR]
+algo_type        monitor
+sensor           cpu0
+sampling         1000
+thresholds       105000
+thresholds_clr   102000
+actions          shutdown
+action_info      5000
+
+[POPMEM_MONITOR]
+algo_type        monitor
+sensor           pop_mem
+sampling         1000
+thresholds       90000
+thresholds_clr   87000
+actions          shutdown
+action_info      5000
+
diff --git a/rootdir/etc/thermald-8064.conf b/rootdir/etc/thermald-8064.conf
new file mode 100644
index 0000000..cdc15bb
--- /dev/null
+++ b/rootdir/etc/thermald-8064.conf
@@ -0,0 +1,86 @@
+sampling         5000
+
+[pa_therm0]
+sampling         5000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor0]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor1]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor2]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor3]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor4]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor5]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor6]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor7]
+sampling         1000
+thresholds       70      90      95      100     105     110     115     120
+thresholds_clr   67      85      90      95      100     105     110     115
+actions          cpu+battery  cpu+battery  cpu+battery  cpu+battery  cpu+battery  cpu+battery  cpu+battery  shutdown
+action_info      1512000+0    1188000+0    810000+1     648000+1     540000+2     487000+2     384000+3     5000
+
+[tsens_tz_sensor8]
+sampling         1000
+thresholds       70      90      95      100     105     110     115     120
+thresholds_clr   67      85      90      95      100     105     110     115
+actions          cpu     cpu     cpu     cpu     cpu     cpu     cpu     shutdown
+action_info      1512000 1188000 810000  648000  540000  487000  384000  5000
+
+[tsens_tz_sensor9]
+sampling         1000
+thresholds       70      90      95      100     105     110     115     120
+thresholds_clr   67      85      90      95      100     105     110     115
+actions          cpu     cpu     cpu     cpu     cpu     cpu     cpu     shutdown
+action_info      1512000 1188000 810000  648000  540000  487000  384000  5000
+
+[tsens_tz_sensor10]
+sampling         1000
+thresholds       70      90     95     100     105     110     115   120
+thresholds_clr   67      85     90     95      100     105     110   115
+actions          cpu    cpu     cpu     cpu     cpu     cpu     cpu   shutdown
+action_info      1512000   1188000  810000 648000  540000  487000  384000  5000
+
diff --git a/rootdir/etc/thermald-8064ab.conf b/rootdir/etc/thermald-8064ab.conf
new file mode 100644
index 0000000..6eeb0c4
--- /dev/null
+++ b/rootdir/etc/thermald-8064ab.conf
@@ -0,0 +1,92 @@
+sampling         5000
+
+[pa_therm0]
+sampling         5000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor0]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor1]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor2]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor3]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor4]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor5]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor6]
+sampling         1000
+thresholds       70
+thresholds_clr   67
+actions          none
+action_info      0
+
+[tsens_tz_sensor7]
+sampling         1000
+thresholds       70       85       90       95       100     105     110     120
+thresholds_clr   67       80       85       90       95      100     105     115
+actions          cpu+battery  cpu+battery  cpu+battery  cpu+battery  cpu+battery  cpu+battery  cpu+battery  shutdown
+action_info      1890000+0    1674000+0    1350000+1    1026000+1    810000+2     594000+2     384000+3     5000
+
+[tsens_tz_sensor8]
+sampling         1000
+thresholds       70       85       90       95       100     105     110     120
+thresholds_clr   67       80       85       90       95      100     105     115
+actions          cpu      cpu      cpu      cpu      cpu     cpu     cpu     shutdown
+action_info      1890000  1674000  1350000  1026000  810000  594000  384000  5000
+
+[tsens_tz_sensor9]
+sampling         1000
+thresholds       70       85       90       95       100     105     110     120
+thresholds_clr   67       80       85       90       95      100     105     115
+actions          cpu      cpu      cpu      cpu      cpu     cpu     cpu     shutdown
+action_info      1890000  1674000  1350000  1026000  810000  594000  384000  5000
+
+[tsens_tz_sensor10]
+sampling         1000
+thresholds       70       85       90       95       100     105     110     120
+thresholds_clr   67       80       85       90       95      100     105     115
+actions          cpu      cpu      cpu      cpu      cpu     cpu     cpu     shutdown
+action_info      1890000  1674000  1350000  1026000  810000  594000  384000  5000
+
+[pm8821_tz]
+thresholds       107
+thresholds_clr   103
+actions          cpu
+action_info      918000
+
diff --git a/rootdir/etc/thermald-8930.conf b/rootdir/etc/thermald-8930.conf
new file mode 100644
index 0000000..f1c144c
--- /dev/null
+++ b/rootdir/etc/thermald-8930.conf
@@ -0,0 +1,79 @@
+sampling         5000
+
+[pa_therm0]
+sampling         100000
+thresholds       65      70      75      80      85      90
+thresholds_clr   60      65      70      75      80      85
+actions          none    none    none    none    none    none
+action_info      0       0       0       0       0       0
+
+[tsens_tz_sensor0]
+sampling         1000
+thresholds       60
+thresholds_clr   57
+actions          none
+action_info      0
+
+[tsens_tz_sensor1]
+sampling         1000
+thresholds       60
+thresholds_clr   57
+actions          none
+action_info      0
+
+[tsens_tz_sensor2]
+sampling         1000
+thresholds       60
+thresholds_clr   57
+actions          none
+action_info      0
+
+[tsens_tz_sensor3]
+sampling         1000
+thresholds       60
+thresholds_clr   57
+actions          none
+action_info      0
+
+[tsens_tz_sensor4]
+sampling         1000
+thresholds       60
+thresholds_clr   57
+actions          none
+action_info      0
+
+[tsens_tz_sensor5]
+sampling         1000
+thresholds       60
+thresholds_clr   57
+actions          none
+action_info      0
+
+[tsens_tz_sensor6]
+sampling         1000
+thresholds       60
+thresholds_clr   57
+actions          none
+action_info      0
+
+[tsens_tz_sensor7]
+sampling         1000
+thresholds       60
+thresholds_clr   57
+actions          none
+action_info      0
+
+[tsens_tz_sensor8]
+sampling         1000
+thresholds       60
+thresholds_clr   57
+actions          none
+action_info      0
+
+[tsens_tz_sensor9]
+sampling         1000
+thresholds       60      90      95      100     105     110     115     120
+thresholds_clr   57      85      90      95      100     105     110     115
+actions          cpu     cpu     cpu     cpu     cpu     cpu     cpu     shutdown
+action_info      1404000 1296000 1188000 918000  756000  648000  384000  5000
+
diff --git a/rootdir/etc/thermald-8960.conf b/rootdir/etc/thermald-8960.conf
new file mode 100644
index 0000000..7fd19b5
--- /dev/null
+++ b/rootdir/etc/thermald-8960.conf
@@ -0,0 +1,44 @@
+sampling         5000
+
+[pa_therm0]
+sampling         100000
+thresholds       65      70      75      80      85      90
+thresholds_clr   60      65      70      75      80      85
+actions          none    none    none    none    none    none
+action_info      0       0       0       0       0       0
+
+[tsens_tz_sensor0]
+sampling         1000
+thresholds       65      90      93      96      99      102     105
+thresholds_clr   62      87      90      93      96      99      102
+actions          cpu     cpu     cpu     cpu     cpu     cpu     shutdown
+action_info      1512000 1296000 1188000 918000  756000  648000  5000
+
+[tsens_tz_sensor1]
+sampling         1000
+thresholds       75
+thresholds_clr   72
+actions          none
+action_info      0
+
+[tsens_tz_sensor2]
+sampling         1000
+thresholds       75
+thresholds_clr   72
+actions          none
+action_info      0
+
+[tsens_tz_sensor3]
+sampling         1000
+thresholds       75      78      81      84      87      90
+thresholds_clr   72      75      78      81      84      87
+actions          cpu     cpu     cpu     cpu     cpu     shutdown
+action_info      1296000 1188000 918000  756000  648000  5000
+
+[tsens_tz_sensor4]
+sampling         1000
+thresholds       75
+thresholds_clr   72
+actions          none
+action_info      0
+