hal: Add provision to select hpx backend based on the codec type
- SLIMBUS_0 is the backend on 8952 external codec PLs.
Whereas PRIMARY_MI2S is the backend on 8952 internal codec PLs.
- Since both these PLs are supported on same code base,
provision is required to select backend based on codec type.
Change-Id: I716dc16abe920dad4b3d18281624a7d85967ea0b
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index a15d73d..2bea17d 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -1192,6 +1192,8 @@
const char *snd_card_name;
char mixer_xml_path[100],ffspEnable[PROPERTY_VALUE_MAX];
char *cvd_version = NULL;
+ const char *mixer_ctl_name = "Set HPX ActiveBe";
+ struct mixer_ctl *ctl = NULL;
my_data = calloc(1, sizeof(struct platform_data));
if (!my_data) {
@@ -1399,6 +1401,13 @@
closedir(dir);
}
+ /* Configure active back end for HPX*/
+ ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
+ if (ctl) {
+ ALOGE(" sending HPX Active BE information ");
+ mixer_ctl_set_value(ctl, 0, is_external_codec);
+ }
+
acdb_init_fail:
set_platform_defaults();
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index bbfa042..925095e 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -230,6 +230,8 @@
char value[PROPERTY_VALUE_MAX];
struct platform_data *my_data;
const char *snd_card_name;
+ const char *mixer_ctl_name = "Set HPX ActiveBe";
+ struct mixer_ctl *ctl = NULL;
adev->mixer = mixer_open(MIXER_CARD);
@@ -340,6 +342,13 @@
}
}
+ /* Configure active back end for HPX*/
+ ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
+ if (ctl) {
+ ALOGI(" sending HPX Active BE information ");
+ mixer_ctl_set_value(ctl, 0, false);
+ }
+
return my_data;
}
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 24e23e6..5ae53ad 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -1028,6 +1028,8 @@
char *snd_internal_name = NULL;
char *tmp = NULL;
char mixer_xml_file[MIXER_PATH_MAX_LENGTH]= {0};
+ const char *mixer_ctl_name = "Set HPX ActiveBe";
+ struct mixer_ctl *ctl = NULL;
my_data = calloc(1, sizeof(struct platform_data));
@@ -1250,6 +1252,13 @@
free(cvd_version);
}
+ /* Configure active back end for HPX*/
+ ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
+ if (ctl) {
+ ALOGI(" sending HPX Active BE information ");
+ mixer_ctl_set_value(ctl, 0, true);
+ }
+
acdb_init_fail:
set_platform_defaults();