power: Use declared enums where possible

Change-Id: I079490f8ff61bf278dd69eb89b9dae5ce42e6052
diff --git a/power-660.c b/power-660.c
index e246f3b..e1b74de 100644
--- a/power-660.c
+++ b/power-660.c
@@ -100,8 +100,10 @@
                     2. BusDCVS V2 params
                         - Sample_ms of 10ms
                  */
-                int resource_values[] = {0x41414000, 0x459, 0x41410000, 0x5F, 0x41400000, 0x4,
-                                         0x41420000, 0x5F,  0x40C2C000, 0X5,  0x41820000, 0xA};
+                int resource_values[] = {
+                        HISPEED_FREQ_BIG,        0x459, GO_HISPEED_LOAD_BIG,   0x5F,
+                        ABOVE_HISPEED_DELAY_BIG, 0x4,   TARGET_LOADS_BIG,      0x5F,
+                        SCHED_SPILL_NR_RUN,      0X5,   CPUBW_HWMON_SAMPLE_MS, 0xA};
                 if (!video_encode_hint_sent) {
                     perform_hint_action(video_encode_metadata.hint_id, resource_values,
                                         ARRAY_SIZE(resource_values));
@@ -117,8 +119,9 @@
                     2. BusDCVS V2 params
                         - Sample_ms of 10ms
                  */
-                int resource_values[] = {0x41414100, 0x386, 0x41410100, 0x5F,
-                                         0x41400100, 0x4,   0x41820000, 0xA};
+                int resource_values[] = {
+                        HISPEED_FREQ_LITTLE,        0x386, GO_HISPEED_LOAD_LITTLE, 0x5F,
+                        ABOVE_HISPEED_DELAY_LITTLE, 0x4,   CPUBW_HWMON_SAMPLE_MS,  0xA};
                 if (!video_encode_hint_sent) {
                     perform_hint_action(video_encode_metadata.hint_id, resource_values,
                                         ARRAY_SIZE(resource_values));
@@ -169,8 +172,9 @@
                     2. BusDCVS V2 params
                        - Sample_ms of 10ms
                  */
-                int resource_values[] = {0x41414000, 0x459, 0x41410000, 0x5F,
-                                         0x41400000, 0x4,   0x41820000, 0xA};
+                int resource_values[] = {
+                        HISPEED_FREQ_BIG,        0x459, GO_HISPEED_LOAD_BIG,   0x5F,
+                        ABOVE_HISPEED_DELAY_BIG, 0x4,   CPUBW_HWMON_SAMPLE_MS, 0xA};
                 perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values,
                                     ARRAY_SIZE(resource_values));
             } else {
@@ -183,8 +187,10 @@
                         - Sample_ms of 10ms
                     3. Sched group upmigrate - 500
                  */
-                int resource_values[] = {0x41414100, 0x386,      0x41410100, 0x5F,       0x41400100,
-                                         0x4,        0x41820000, 0xA,        0x40C54000, 0x1F4};
+                int resource_values[] = {
+                        HISPEED_FREQ_LITTLE,        0x386, GO_HISPEED_LOAD_LITTLE, 0x5F,
+                        ABOVE_HISPEED_DELAY_LITTLE, 0x4,   CPUBW_HWMON_SAMPLE_MS,  0xA,
+                        SCHED_GROUP_UP_MIGRATE,     0x1F4};
                 perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values,
                                     ARRAY_SIZE(resource_values));
             }
diff --git a/power-845.c b/power-845.c
index 8739d54..0044bf6 100644
--- a/power-845.c
+++ b/power-845.c
@@ -190,7 +190,7 @@
             ret_val = process_perf_hint(data, VR_MODE);
             break;
         case POWER_HINT_INTERACTION: {
-            int resources[] = {0x40800100, 0x514};
+            int resources[] = {MIN_FREQ_LITTLE_CORE_0, 0x514};
             int duration = 100;
             interaction(duration, ARRAY_SIZE(resources), resources);
             ret_val = HINT_HANDLED;
diff --git a/power-8937.c b/power-8937.c
index fc59a22..a32354b 100644
--- a/power-8937.c
+++ b/power-8937.c
@@ -97,11 +97,20 @@
                  * SLB for Core3 = -6
                  * hispeed load = 95
                  * hispeed freq = 998Mhz */
-                int resource_values[] = {
-                        0x41820000, 0xa,        0x40c68100, 0xfffffffa, 0x40c68110,
-                        0xfffffffa, 0x40c68120, 0xfffffffa, 0x40c68130, 0xfffffffa,
-                        0x41440100, 0x5f,       0x4143c100, 0x3e6,
-                };
+                int resource_values[] = {CPUBW_HWMON_SAMPLE_MS,
+                                         0xa,
+                                         0x40c68100,
+                                         0xfffffffa,
+                                         0x40c68110,
+                                         0xfffffffa,
+                                         0x40c68120,
+                                         0xfffffffa,
+                                         0x40c68130,
+                                         0xfffffffa,
+                                         0x41440100,
+                                         0x5f,
+                                         0x4143c100,
+                                         0x3e6};
                 if (!video_encode_hint_sent) {
                     perform_hint_action(video_encode_metadata.hint_id, resource_values,
                                         ARRAY_SIZE(resource_values));
@@ -110,10 +119,7 @@
                 }
             } else {
                 /* sample_ms = 10mS */
-                int resource_values[] = {
-                        0x41820000,
-                        0xa,
-                };
+                int resource_values[] = {CPUBW_HWMON_SAMPLE_MS, 0xa};
                 if (!video_encode_hint_sent) {
                     perform_hint_action(video_encode_metadata.hint_id, resource_values,
                                         ARRAY_SIZE(resource_values));
diff --git a/power-8953.c b/power-8953.c
index cc1f000..775b6ce 100644
--- a/power-8953.c
+++ b/power-8953.c
@@ -97,11 +97,20 @@
                  * SLB for Core3 = -6
                  * hispeed load = 95
                  * hispeed freq = 1036 */
-                int resource_values[] = {
-                        0x41820000, 0xa,        0x40c68100, 0xfffffffa, 0x40c68110,
-                        0xfffffffa, 0x40c68120, 0xfffffffa, 0x40c68130, 0xfffffffa,
-                        0x41440100, 0x5f,       0x4143c100, 0x40c,
-                };
+                int resource_values[] = {CPUBW_HWMON_SAMPLE_MS,
+                                         0xa,
+                                         0x40c68100,
+                                         0xfffffffa,
+                                         0x40c68110,
+                                         0xfffffffa,
+                                         0x40c68120,
+                                         0xfffffffa,
+                                         0x40c68130,
+                                         0xfffffffa,
+                                         0x41440100,
+                                         0x5f,
+                                         0x4143c100,
+                                         0x40c};
                 if (!video_encode_hint_sent) {
                     perform_hint_action(video_encode_metadata.hint_id, resource_values,
                                         ARRAY_SIZE(resource_values));
@@ -110,10 +119,7 @@
                 }
             } else {
                 /* sample_ms = 10mS */
-                int resource_values[] = {
-                        0x41820000,
-                        0xa,
-                };
+                int resource_values[] = {CPUBW_HWMON_SAMPLE_MS, 0xa};
                 if (!video_encode_hint_sent) {
                     perform_hint_action(video_encode_metadata.hint_id, resource_values,
                                         ARRAY_SIZE(resource_values));
@@ -124,9 +130,9 @@
         } else if (is_interactive_governor(governor)) {
             /* Sched_load and migration_notification disable
              * timer rate - 40mS*/
-            int resource_values[] = {
-                    0x41430000, 0x1, 0x41434000, 0x1, 0x41424000, 0x28,
-            };
+            int resource_values[] = {INT_OP_CLUSTER0_USE_SCHED_LOAD,      0x1,
+                                     INT_OP_CLUSTER0_USE_MIGRATION_NOTIF, 0x1,
+                                     INT_OP_CLUSTER0_TIMER_RATE,          BIG_LITTLE_TR_MS_40};
             if (!video_encode_hint_sent) {
                 perform_hint_action(video_encode_metadata.hint_id, resource_values,
                                     ARRAY_SIZE(resource_values));
@@ -167,11 +173,7 @@
     if (!on) {
         /* Display off */
         if (is_interactive_governor(governor)) {
-            /* timer rate - 40mS*/
-            int resource_values[] = {
-                    0x41424000,
-                    0x28,
-            };
+            int resource_values[] = {INT_OP_CLUSTER0_TIMER_RATE, BIG_LITTLE_TR_MS_40};
             perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values,
                                 ARRAY_SIZE(resource_values));
         }
diff --git a/power-8996.c b/power-8996.c
index a378652..8202942 100644
--- a/power-8996.c
+++ b/power-8996.c
@@ -180,12 +180,14 @@
              * 3. hysteresis optimization
              *    -bus dcvs hysteresis tuning
              *    -sample_ms of 10 ms
-             *    -sLVT hispeed freq to 806MHz
              */
-            int resource_values[] = {0x41400000, 0x4,   0x41410000, 0x5F, 0x41414000, 0x326,
-                                     0x41420000, 0x5A,  0x41400100, 0x4,  0x41410100, 0x5F,
-                                     0x41414100, 0x22C, 0x41420100, 0x5A, 0x41810000, 0x9C4,
-                                     0x41814000, 0x32,  0x4180C000, 0x0,  0x41820000, 0xA};
+            int resource_values[] = {
+                    ABOVE_HISPEED_DELAY_BIG,    0x4,   GO_HISPEED_LOAD_BIG,    0x5F,
+                    HISPEED_FREQ_BIG,           0x326, TARGET_LOADS_BIG,       0x5A,
+                    ABOVE_HISPEED_DELAY_LITTLE, 0x4,   GO_HISPEED_LOAD_LITTLE, 0x5F,
+                    HISPEED_FREQ_LITTLE,        0x22C, TARGET_LOADS_LITTLE,    0x5A,
+                    LOW_POWER_CEIL_MBPS,        0x9C4, LOW_POWER_IO_PERCENT,   0x32,
+                    CPUBW_HWMON_HYST_OPT,       0x0,   CPUBW_HWMON_SAMPLE_MS,  0xA};
             if (!video_encode_hint_sent) {
                 perform_hint_action(video_encode_metadata.hint_id, resource_values,
                                     ARRAY_SIZE(resource_values));
diff --git a/power-msmnile.c b/power-msmnile.c
index 5e91030..d92a5ff 100644
--- a/power-msmnile.c
+++ b/power-msmnile.c
@@ -42,6 +42,7 @@
 #include <hardware/power.h>
 #include <log/log.h>
 
+#include "performance.h"
 #include "power-common.h"
 #include "utils.h"
 
@@ -49,7 +50,7 @@
     int ret_val = HINT_NONE;
     switch (hint) {
         case POWER_HINT_INTERACTION: {
-            int resources[] = {0x40800100, 0x514};
+            int resources[] = {MIN_FREQ_LITTLE_CORE_0, 0x514};
             int duration = 100;
             interaction(duration, ARRAY_SIZE(resources), resources);
             ret_val = HINT_HANDLED;