audio HAL: Add retry to get mixer in adev_open

If the sound card is not created in kernel before audio hal initialized
by audio flinger, the mixer open would be failed.
This is timing issue. So retry routine is need.

Change-Id: Icff3cd53763bfc483725849874fe27ff4de28890
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index 7052d68..0c6871a 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -37,6 +37,7 @@
  * This is the sysfs path for the HDMI audio data block
  */
 #define AUDIO_DATA_BLOCK_PATH "/sys/class/graphics/fb1/audio_data_block"
+#define MIXER_XML_PATH "/system/etc/mixer_paths.xml"
 
 /*
  * This file will have a maximum of 38 bytes:
@@ -248,6 +249,19 @@
     char value[PROPERTY_VALUE_MAX];
     struct platform_data *my_data;
 
+    adev->mixer = mixer_open(MIXER_CARD);
+
+    if (!adev->mixer) {
+        ALOGE("Unable to open the mixer, aborting.");
+        return NULL;
+    }
+
+    adev->audio_route = audio_route_init(MIXER_CARD, MIXER_XML_PATH);
+    if (!adev->audio_route) {
+        ALOGE("%s: Failed to init audio route controls, aborting.", __func__);
+        return NULL;
+    }
+
     my_data = calloc(1, sizeof(struct platform_data));
 
     my_data->adev = adev;