summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--power-660.c13
-rw-r--r--power-8916.c13
-rw-r--r--power-8974.c13
3 files changed, 18 insertions, 21 deletions
diff --git a/power-660.c b/power-660.c
index ac1137e..0bec132 100644
--- a/power-660.c
+++ b/power-660.c
@@ -140,19 +140,18 @@ static int set_power_profile(int profile)
}
/**
- * If target is SDM630:
- * return true
- * else:
- * return false
+ * Returns true if the target is SDM630.
*/
static bool is_target_SDM630(void)
{
- static bool is_SDM630 = false;
+ static int is_SDM630 = -1;
int soc_id;
+ if (is_SDM630 >= 0)
+ return is_SDM630;
+
soc_id = get_soc_id();
- if (soc_id == 318 || soc_id == 327)
- is_SDM630 = true;
+ is_SDM630 = soc_id == 318 || soc_id == 327;
return is_SDM630;
}
diff --git a/power-8916.c b/power-8916.c
index 190b336..66b57e7 100644
--- a/power-8916.c
+++ b/power-8916.c
@@ -60,19 +60,18 @@ const char *scaling_min_freq[4] = {
};
/**
- * If target is 8916:
- * return true
- * else:
- * return false
+ * Returns true if the target is MSM8916.
*/
static bool is_target_8916(void)
{
- static bool is_8916 = false;
+ static int is_8916 = -1;
int soc_id;
+ if (is_8916 >= 0)
+ return is_8916;
+
soc_id = get_soc_id();
- if (soc_id == 206 || (soc_id >= 247 && soc_id <= 250))
- is_8916 = true;
+ is_8916 = soc_id == 206 || (soc_id >= 247 && soc_id <= 250);
return is_8916;
}
diff --git a/power-8974.c b/power-8974.c
index adad79e..94d4125 100644
--- a/power-8974.c
+++ b/power-8974.c
@@ -53,19 +53,18 @@
static int first_display_off_hint;
/**
- * If target is 8974pro:
- * return true
- * else:
- * return false
+ * Returns true if the target is MSM8974AB or MSM8974AC.
*/
static bool is_target_8974pro(void)
{
- static bool is_8974pro = false;
+ static int is_8974pro = -1;
int soc_id;
+ if (is_8974pro >= 0)
+ return is_8974pro;
+
soc_id = get_soc_id();
- if (soc_id == 194 || (soc_id >= 208 && soc_id <= 218))
- is_8974pro = true;
+ is_8974pro = soc_id == 194 || (soc_id >= 208 && soc_id <= 218);
return is_8974pro;
}