blob: e2b781a7f73ce507114a4a4f239a6b73b025ebec [file] [log] [blame]
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -08001ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
2
3LOCAL_PATH := $(call my-dir)
4
5include $(CLEAR_VARS)
6
7LOCAL_ARM_MODE := arm
8
Ajay Dudanibe3335a2013-08-19 18:47:21 -07009AUDIO_PLATFORM := $(TARGET_BOARD_PLATFORM)
Jean-Michel Trivic0750692015-10-12 12:12:32 -070010ifneq ($(filter msm8960,$(TARGET_BOARD_PLATFORM)),)
11 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
12endif
Thierry Strudel8a8deaa2016-12-15 13:34:42 -080013ifneq ($(filter msm8974 msm8226 msm8084 msm8992 msm8994 msm8996 msm8998,$(TARGET_BOARD_PLATFORM)),)
Ajay Dudanibe3335a2013-08-19 18:47:21 -070014 # B-family platform uses msm8974 code base
15 AUDIO_PLATFORM = msm8974
Jean-Michel Trivi7246fb62015-10-08 20:20:48 -070016ifneq ($(filter msm8974,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070017 LOCAL_CFLAGS := -DPLATFORM_MSM8974
Jean-Michel Trivi7246fb62015-10-08 20:20:48 -070018 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
19endif
Ravi Kumar Alamanda8e6e98f2013-11-05 15:57:39 -080020ifneq ($(filter msm8226,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070021 LOCAL_CFLAGS := -DPLATFORM_MSM8x26
Prashant Malanic92c5962015-08-11 15:10:18 -070022 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
Ravi Kumar Alamanda8e6e98f2013-11-05 15:57:39 -080023endif
Ravi Kumar Alamanda83281a92014-05-19 18:14:57 -070024ifneq ($(filter msm8084,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070025 LOCAL_CFLAGS := -DPLATFORM_MSM8084
Prashant Malanic92c5962015-08-11 15:10:18 -070026 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
Ravi Kumar Alamanda83281a92014-05-19 18:14:57 -070027endif
Patrick Tjin11c2e2d2015-03-12 11:44:18 -070028ifneq ($(filter msm8992,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070029 LOCAL_CFLAGS := -DPLATFORM_MSM8994
Prashant Malanic92c5962015-08-11 15:10:18 -070030 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
Ravi Kumar Alamanda533bb722015-09-23 13:47:03 -070031 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
Patrick Tjin11c2e2d2015-03-12 11:44:18 -070032endif
33ifneq ($(filter msm8994,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070034 LOCAL_CFLAGS := -DPLATFORM_MSM8994
Prashant Malanic92c5962015-08-11 15:10:18 -070035 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
Ravi Kumar Alamanda533bb722015-09-23 13:47:03 -070036 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
Patrick Tjin11c2e2d2015-03-12 11:44:18 -070037endif
vivek mehta295916b2016-02-04 14:47:22 -080038ifneq ($(filter msm8996,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070039 LOCAL_CFLAGS := -DPLATFORM_MSM8996
vivek mehta295916b2016-02-04 14:47:22 -080040 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
41 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
vivek mehtade4849c2016-03-03 17:23:38 -080042 MULTIPLE_HW_VARIANTS_ENABLED := true
vivek mehta295916b2016-02-04 14:47:22 -080043endif
Thierry Strudel8a8deaa2016-12-15 13:34:42 -080044ifneq ($(filter msm8998,$(TARGET_BOARD_PLATFORM)),)
45 LOCAL_CFLAGS := -DPLATFORM_MSM8998
Thierry Strudel0cfc50a2016-10-26 23:58:53 -070046 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
47 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
48 MULTIPLE_HW_VARIANTS_ENABLED := true
49endif
Ajay Dudanibe3335a2013-08-19 18:47:21 -070050endif
51
Yamit Mehta6b4b1272016-06-10 15:12:50 +053052ifneq ($(filter msm8916 msm8909 msm8952,$(TARGET_BOARD_PLATFORM)),)
53 AUDIO_PLATFORM = msm8916
54 LOCAL_CFLAGS := -DPLATFORM_MSM8916
55ifneq ($(filter msm8909,$(TARGET_BOARD_PLATFORM)),)
56 LOCAL_CFLAGS := -DPLATFORM_MSM8909
57endif
58 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
59 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
60 MULTIPLE_HW_VARIANTS_ENABLED := true
61endif
62
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080063LOCAL_SRC_FILES := \
64 audio_hw.c \
Vineeta Srivastava4b89e372014-06-19 14:21:42 -070065 voice.c \
Haynes Mathew George5bc18842014-06-16 16:36:20 -070066 platform_info.c \
Eric Laurent0499d4f2014-08-25 22:39:29 -050067 audio_extn/ext_speaker.c \
Ravi Kumar Alamanda533bb722015-09-23 13:47:03 -070068 audio_extn/audio_extn.c \
Yamit Mehtae3b99562016-09-16 22:44:00 +053069 audio_extn/utils.c \
Ed Tam70b5c142016-03-21 19:14:29 -070070 $(AUDIO_PLATFORM)/platform.c
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080071
vivek mehtade4849c2016-03-03 17:23:38 -080072ifdef MULTIPLE_HW_VARIANTS_ENABLED
73 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
74 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
75endif
76
David Linee3fe402017-03-13 10:00:42 -070077ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_TUNNEL)),true)
78 LOCAL_CFLAGS += -DUSB_TUNNEL_ENABLED
79 LOCAL_SRC_FILES += audio_extn/usb.c
80endif
81
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080082LOCAL_SHARED_LIBRARIES := \
Andy Hungfc044e12017-03-20 09:24:22 -070083 libaudioutils \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080084 liblog \
85 libcutils \
86 libtinyalsa \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -070087 libtinycompress \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080088 libaudioroute \
Haynes Mathew George5bc18842014-06-16 16:36:20 -070089 libdl \
90 libexpat
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080091
92LOCAL_C_INCLUDES += \
93 external/tinyalsa/include \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -070094 external/tinycompress/include \
Ravi Kumar Alamandaf70ffb42013-04-16 15:55:53 -070095 $(call include-path-for, audio-route) \
Eric Laurentb23d5282013-05-14 15:27:20 -070096 $(call include-path-for, audio-effects) \
Ravi Kumar Alamanda8e6e98f2013-11-05 15:57:39 -080097 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
Vineeta Srivastava4b89e372014-06-19 14:21:42 -070098 $(LOCAL_PATH)/audio_extn \
Haynes Mathew George5bc18842014-06-16 16:36:20 -070099 $(LOCAL_PATH)/voice_extn \
100 external/expat/lib
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800101
Alain Vongsouvanh13f26e82016-11-18 14:39:11 -0800102ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SMART_PA_TFA_98XX)),true)
103 LOCAL_SHARED_LIBRARIES += libexTfa98xx
104 LOCAL_CFLAGS += -DSMART_PA_TFA_98XX_SUPPORTED
105 LOCAL_SRC_FILES += audio_extn/tfa_98xx.c
106endif
107
Chirayu Desaia996aa32014-11-13 09:08:13 +0530108LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
109LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
110
Vineeta Srivastava4b89e372014-06-19 14:21:42 -0700111ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS)),true)
112 LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
113 LOCAL_SRC_FILES += voice_extn/voice_extn.c
114endif
115
Ravi Kumar Alamanda8e6e98f2013-11-05 15:57:39 -0800116ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HFP)),true)
117 LOCAL_CFLAGS += -DHFP_ENABLED
118 LOCAL_SRC_FILES += audio_extn/hfp.c
119endif
120
Uday Kishore Pasupuleti075842f2015-07-28 15:18:31 -0700121ifeq ($(strip $(AUDIO_FEATURE_SUPPORTED_EXTERNAL_BT)),true)
122 LOCAL_CFLAGS += -DEXTERNAL_BT_SUPPORTED
123endif
124
Uday Kishore Pasupuleticec8ad82015-04-15 10:34:06 -0700125ifeq ($(strip $(AUDIO_FEATURE_NO_AUDIO_OUT)),true)
126 LOCAL_CFLAGS += -DNO_AUDIO_OUT
127endif
128
Ravi Kumar Alamandaa417cc52015-05-01 16:41:56 -0700129ifeq ($(strip $(BOARD_SUPPORTS_SOUND_TRIGGER)),true)
130 LOCAL_CFLAGS += -DSOUND_TRIGGER_ENABLED
131 LOCAL_CFLAGS += -DSOUND_TRIGGER_PLATFORM_NAME=$(TARGET_BOARD_PLATFORM)
132 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/sound_trigger
133 LOCAL_SRC_FILES += audio_extn/soundtrigger.c
Vijay Venkatraman49543ea2017-02-28 17:29:29 -0800134ifneq ($(filter msm8996,$(TARGET_BOARD_PLATFORM)),)
135LOCAL_HEADER_LIBRARIES := sound_trigger.primary_headers
136endif
137
Ravi Kumar Alamandaa417cc52015-05-01 16:41:56 -0700138endif
139
Ravi Kumar Alamanda63863002015-04-22 11:15:25 -0700140ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true)
141 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
142 LOCAL_SRC_FILES += audio_extn/spkr_protection.c
143endif
144
zhaoyang yin4211fad2015-06-04 21:13:25 +0800145ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DSM_FEEDBACK)),true)
146 LOCAL_CFLAGS += -DDSM_FEEDBACK_ENABLED
147 LOCAL_SRC_FILES += audio_extn/dsm_feedback.c
148endif
149
Thierry Strudel8a8deaa2016-12-15 13:34:42 -0800150ifneq ($(filter msm8992 msm8994 msm8996 msm8998,$(TARGET_BOARD_PLATFORM)),)
Ravi Kumar Alamanda76315572015-04-23 13:13:56 -0700151 # push codec/mad calibration to HW dep node
152 # applicable to msm8992/8994 or newer platforms
153 LOCAL_CFLAGS += -DHWDEP_CAL_ENABLED
154 LOCAL_SRC_FILES += audio_extn/hwdep_cal.c
155endif
156
Haynes Mathew Georgec735fb02016-06-30 18:00:28 -0700157ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SND_MONITOR)), true)
158 LOCAL_CFLAGS += -DSND_MONITOR_ENABLED
159 LOCAL_SRC_FILES += audio_extn/sndmonitor.c
160endif
161
Ravi Kumar Alamanda80e2d862014-05-05 16:00:33 -0700162LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800163
Isaac Chen7c4fca22017-02-24 20:47:31 +0800164LOCAL_MODULE_RELATIVE_PATH := hw
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800165
166LOCAL_MODULE_TAGS := optional
167
Diego Wilson8c83e0a2017-03-17 15:29:43 -0700168LOCAL_MODULE_OWNER := qcom
169
170LOCAL_PROPRIETARY_MODULE := true
171
Glenn Kastencf4cddf2016-11-09 10:49:03 -0800172LOCAL_CFLAGS += -Werror
173
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800174include $(BUILD_SHARED_LIBRARY)
175
176endif