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

CRs-Fixed: 1089771
Change-Id: I4bf8bcf1913f16ad6298ff1f3fa5dd649c889b2a
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 09c5a96..e2386a8 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -472,6 +472,27 @@
     return 0;
 }
 
+__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)
 {
     if (format == AUDIO_FORMAT_MP3 ||