Merge "configs: MSM8909: HAL compatibility for P upgrade"
diff --git a/configs/msmsteppe/msmsteppe.mk b/configs/msmsteppe/msmsteppe.mk
index aea148f..dc4df7a 100644
--- a/configs/msmsteppe/msmsteppe.mk
+++ b/configs/msmsteppe/msmsteppe.mk
@@ -66,6 +66,7 @@
 AUDIO_FEATURE_ENABLED_RAS := true
 AUDIO_FEATURE_ENABLED_SND_MONITOR := true
 AUDIO_FEATURE_ENABLED_SVA_MULTI_STAGE := true
+AUDIO_FEATURE_ENABLED_BATTERY_LISTENER := true
 ##AUDIO_FEATURE_FLAGS
 
 #Audio Specific device overlays
diff --git a/configs/msmsteppe/sound_trigger_platform_info.xml b/configs/msmsteppe/sound_trigger_platform_info.xml
index 5f14bb8..ed9c08d 100644
--- a/configs/msmsteppe/sound_trigger_platform_info.xml
+++ b/configs/msmsteppe/sound_trigger_platform_info.xml
@@ -41,6 +41,7 @@
         <param support_device_switch="false" />
         <!-- Transition will only occur if execution_type="DYNAMIC" -->
         <param transit_to_adsp_on_playback="false" />
+        <param transit_to_adsp_on_battery_charging="false" />
         <!-- Below backend params must match with port used in mixer path file -->
         <!-- param used to configure backend sample rate, format and channels -->
         <param backend_port_name="SLIM_0_TX" />
@@ -153,6 +154,64 @@
         <param client_capture_read_delay="2000" />
     </sound_model_config>
 
+    <!-- QTI Music Detection !-->
+    <sound_model_config>
+        <param vendor_uuid="876c1b46-9d4d-40cc-a4fd-4d5ec7a80e47" />
+        <param execution_type="ADSP" /> <!-- value: "WDSP" "ADSP" "DYNAMIC" -->
+        <param library="libsmwrapper.so" />
+        <param max_cpe_phrases="1" />
+        <param max_cpe_users="1" />
+        <param max_ape_phrases="1" />
+        <param max_ape_users="1" />
+        <!-- Profile specific data which the algorithm can support -->
+        <param sample_rate="16000" />
+        <param bit_width="16" />
+        <param out_channels="1"/> <!-- Module output channels -->
+        <!-- adm_cfg_profile should match with the one defined under adm_config -->
+        <!-- Set it to NONE if LSM directly connects to AFE -->
+        <param adm_cfg_profile="NONE" />
+        <!-- fluence_type: "FLUENCE", "FLUENCE_DMIC", "FLUENCE_TMIC"   -->
+        <!-- "FLUENCE_QMIC". Param value is valid when adm_cfg_profile -->
+        <!-- is one of FLUENCE, FLUENCE_STEREO, FFECNS values          -->
+        <param fluence_type="FLUENCE_DMIC" />
+        <!-- wdsp_fluence_type: fluence disabled: "NONE" -->
+        <!-- fluence enabled: "FLUENCE_DMIC", "FLUENCE_TMIC", "FLUENCE_QMIC" -->
+        <param wdsp_fluence_type="NONE" />
+        <gcs_usecase>
+            <param uid="0x5" />
+            <param acdb_devices="DEVICE_HANDSET_MIC_CPE, DEVICE_HANDSET_TMIC_CPE, DEVICE_HEADSET_MIC_CPE" />
+            <!-- module_id, instance_id, param_id -->
+            <param load_sound_model_ids="0x00012C2E, 0x6, 0x00012C14" />
+            <param confidence_levels_ids="0x00012C2E, 0x6, 0x00012C28" />
+            <param detection_event_ids="0x00012C2E, 0x6, 0x00012B05" />
+            <param read_cmd_ids="0x00020013, 0x6, 0x00020015" />
+            <param read_rsp_ids="0x00020013, 0x6, 0x00020016" />
+            <param custom_config_ids="0x00012C2E, 0x6, 0x00012C2D" />
+            <param det_event_type_ids="0x00012C2E, 0x6, 0x00012C2C" />
+        </gcs_usecase>
+        <!-- Module and param ids with which the algorithm is integrated
+            in non-graphite firmware (note these must come after gcs params)
+            Extends flexibility to have different ids based on execution type.
+            valid execution_type values: only "ADSP" -->
+        <lsm_usecase>
+            <param execution_mode="ADSP" />
+            <param app_type="4" /> <!-- app type for MD used in ACDB -->
+            <param in_channels="1"/> <!-- Module input channels -->
+            <param load_sound_model_ids="0x00012C22, 0x00012C14" />
+            <param unload_sound_model_ids="0x00012C22, 0x00012C15" />
+            <param confidence_levels_ids="0x00012C22, 0x00012C07" />
+            <param det_event_type_ids="0x00012C22, 0x00012C2C" />
+            <param custom_config_ids="0x00012C22, 0x00012C30" />
+        </lsm_usecase>
+
+        <!-- format: "ADPCM_packet" or "PCM_packet" !-->
+        <!-- transfer_mode: "FTRT" or "RT" -->
+        <!--  kw_duration is in milli seconds. It is valid only for FTRT
+            transfer mode -->
+        <param capture_keyword="PCM_packet, FTRT, 1500" />
+        <param client_capture_read_delay="2000" />
+    </sound_model_config>
+
 <!-- Sound model config for Hotword !-->
     <sound_model_config>
         <param vendor_uuid="7038ddc8-30f2-11e6-b0ac-40a8f03d3f15" />
diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h
index 7231955..365b03e 100644
--- a/hal/audio_extn/audio_extn.h
+++ b/hal/audio_extn/audio_extn.h
@@ -217,7 +217,8 @@
 #define audio_extn_usb_deinit()                                        (0)
 #define audio_extn_usb_add_device(device, card)                        (0)
 #define audio_extn_usb_remove_device(device, card)                     (0)
-#define audio_extn_usb_is_config_supported(bit_width, sample_rate, ch, pb) (0)
+#define audio_extn_usb_is_config_supported(bit_width, sample_rate, ch, pb) \
+                        (*bit_width=0, *sample_rate=0, *ch=0, 0)
 #define audio_extn_usb_enable_sidetone(device, enable)                 (0)
 #define audio_extn_usb_set_sidetone_gain(parms, value, len)            (0)
 #define audio_extn_usb_is_capture_supported()                          (0)