hal: Add API to support device configuration
Add new API to set device configuration from Client.
Currently the device config is set from edid.
New API overwrites the default device config with
client provided values.
CRs-fixed: 2071954
Change-Id: I1f0918acf0a420f9c9d8a17bc070637199cb7105
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 9e7b1ce..662032f 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -5538,6 +5538,10 @@
audio_extn_adsp_hdlr_deinit();
audio_extn_snd_mon_deinit();
audio_extn_loopback_deinit(adev);
+ if (adev->device_cfg_params) {
+ free(adev->device_cfg_params);
+ adev->device_cfg_params = NULL;
+ }
free(device);
adev = NULL;
}
@@ -5838,6 +5842,12 @@
adev->card_status = CARD_STATUS_ONLINE;
pthread_mutex_unlock(&adev->lock);
audio_extn_sound_trigger_init(adev); /* dependent on snd_mon_init() */
+ /* Allocate memory for Device config params */
+ adev->device_cfg_params = (struct audio_device_config_param*)
+ calloc(platform_get_max_codec_backend(),
+ sizeof(struct audio_device_config_param));
+ if (adev->device_cfg_params == NULL)
+ ALOGE("%s: Memory allocation failed for Device config params", __func__);
ALOGV("%s: exit", __func__);
return 0;