hal: Add support for speaker protection

- Speaker protection feature protects the speaker from
  overheating.

Change-Id: Ida4899534124eba203025915beba662e88a0f403
diff --git a/hal/Android.mk b/hal/Android.mk
index f20105c..8bbfa69 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -60,7 +60,14 @@
 ifneq ($(strip $(AUDIO_FEATURE_DISABLED_INCALL_MUSIC)),true)
     LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
 endif
+endif
 
+ifneq ($(strip, $(AUDIO_FEATURE_DISABLED_SPKR_PROTECTION)),true)
+ifneq ($(filter msm8974,$(TARGET_BOARD_PLATFORM)),)
+    LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
+    LOCAL_SRC_FILES += audio_extn/spkr_protection.c
+    LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
+endif
 endif
 
 ifdef MULTIPLE_HW_VARIANTS_ENABLED