audio: limit sampling rates to 192Khz for WCD9380 varient.
-WCD9380 supports sampling rates upto 192Khz, hence limit
SR > 192Khz to 192Khz.
Change-Id: I1435919320d784bedf4147a9e467867d777b594b
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index d66b368..0ea7d94 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -1772,6 +1772,27 @@
return 0;
}
+int audio_extn_utils_get_codec_variant(int card_num,
+ char *codec_variant)
+{
+ char procfs_path[50];
+ FILE *fp;
+ snprintf(procfs_path, sizeof(procfs_path),
+ "/proc/asound/card%d/codecs/wcd938x/variant", card_num);
+ if ((fp = fopen(procfs_path, "r")) == NULL) {
+ snprintf(procfs_path, sizeof(procfs_path),
+ "/proc/asound/card%d/codecs/wcd937x/variant", card_num);
+ if ((fp = fopen(procfs_path, "r")) == NULL) {
+ ALOGE("%s: ERROR. cannot open %s", __func__, procfs_path);
+ return -ENOENT;
+ }
+ }
+ fgets(codec_variant, CODEC_VARIANT_MAX_LENGTH, fp);
+ fclose(fp);
+ ALOGD("%s: codec variant is %s", __func__, codec_variant);
+ return 0;
+}
+
#ifdef AUDIO_EXTERNAL_HDMI_ENABLED