hal: add support to override volume gain to step mapping table
- if customer mapping is added in platform info file, use that
- in absence of customer table use default mapping
BUG 28897755
Change-Id: I4bf8bcf1913f16ad6298ff1f3fa5dd649c889b2a
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 911a49c..2a95ab8 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -369,6 +369,27 @@
return ret_val;
}
+__attribute__ ((visibility ("default")))
+int audio_hw_get_gain_level_mapping(struct amp_db_and_gain_table *mapping_tbl,
+ int table_size) {
+ int ret_val = 0;
+ ALOGV("%s: enter ... ", __func__);
+
+ pthread_mutex_lock(&adev_init_lock);
+ if (adev == NULL) {
+ ALOGW("%s: adev is NULL .... ", __func__);
+ goto done;
+ }
+
+ pthread_mutex_lock(&adev->lock);
+ ret_val = platform_get_gain_level_mapping(mapping_tbl, table_size);
+ pthread_mutex_unlock(&adev->lock);
+done:
+ pthread_mutex_unlock(&adev_init_lock);
+ ALOGV("%s: exit ... ", __func__);
+ return ret_val;
+}
+
static bool is_supported_format(audio_format_t format)
{
switch (format) {