summaryrefslogtreecommitdiffstats
path: root/hardware.c
diff options
context:
space:
mode:
Diffstat (limited to 'hardware.c')
-rw-r--r--hardware.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hardware.c b/hardware.c
index 1f831cb..ce14fe3 100644
--- a/hardware.c
+++ b/hardware.c
@@ -89,11 +89,13 @@ static int load(const char *id,
}
/* Check that the id matches */
+#ifndef DISABLE_HW_ID_MATCH_CHECK
if (strcmp(id, hmi->id) != 0) {
ALOGE("load: id=%s != hmi->id=%s", id, hmi->id);
status = -EINVAL;
goto done;
}
+#endif /* DISABLE_HW_ID_MATCH_CHECK */
hmi->dso = handle;
@@ -126,6 +128,10 @@ int hw_get_module_by_class(const char *class_id, const char *inst,
char prop[PATH_MAX];
char path[PATH_MAX];
char name[PATH_MAX];
+#ifdef QCOM_HARDWARE
+ int is_mpq;
+ IS_TARGET_MPQ(is_mpq);
+#endif
if (inst)
snprintf(name, PATH_MAX, "%s.%s", class_id, inst);
@@ -149,6 +155,16 @@ int hw_get_module_by_class(const char *class_id, const char *inst,
HAL_LIBRARY_PATH2, name, prop);
if (access(path, R_OK) == 0) break;
+#ifdef QCOM_HARDWARE
+ if ((!strncmp(name, "audio.primary", 13) ||
+ !strncmp(name, "audio_policy", 12)) &&
+ (is_mpq) && (!strncmp(prop, "msm8960", 7)))
+ {
+ strlcpy(prop, "mpq8064", 8);
+ ALOGE("setting prop to mpq8064");
+ }
+#endif
+
snprintf(path, sizeof(path), "%s/%s.%s.so",
HAL_LIBRARY_PATH1, name, prop);
if (access(path, R_OK) == 0) break;