hal: send correct acdb_id for app_type cfg

Send speaker protection device acdb_id when speaker protection
is enabled. This fixes RTAC failure with RAS feature.

CRs-Fixed: 1088468
Change-Id: I6def5adba5e40e17f86f773990d9a49fca21bbbe
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 446e205..81dfbd1 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -805,13 +805,6 @@
             "Audio Stream Capture %d App Type Cfg", pcm_device_id);
     }
 
-    acdb_dev_id = platform_get_snd_device_acdb_id(snd_device);
-    if (acdb_dev_id <= 0) {
-        ALOGE("%s: Couldn't get the acdb dev id", __func__);
-        rc = -EINVAL;
-        goto exit_send_app_type_cfg;
-    }
-
     ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
     if (!ctl) {
         ALOGE("%s: Could not get ctl for mixer cmd - %s", __func__,
@@ -822,6 +815,13 @@
     snd_device = (snd_device == SND_DEVICE_OUT_SPEAKER) ?
                  platform_get_spkr_prot_snd_device(snd_device) : snd_device;
 
+    acdb_dev_id = platform_get_snd_device_acdb_id(snd_device);
+    if (acdb_dev_id <= 0) {
+        ALOGE("%s: Couldn't get the acdb dev id", __func__);
+        rc = -EINVAL;
+        goto exit_send_app_type_cfg;
+    }
+
     snd_device_be_idx = platform_get_snd_device_backend_index(snd_device);
     if (snd_device_be_idx < 0) {
         ALOGE("%s: Couldn't get the backend index for snd device %s ret=%d",