blob: 0ec3e3d69eba62c0e1690e1fe5ae1392e05bf3f7 [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)
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -070010
Naresh Tannirudb72d1e2014-03-05 17:33:47 +053011ifneq ($(filter msm8974 msm8226 msm8610 apq8084,$(TARGET_BOARD_PLATFORM)),)
Ajay Dudanibe3335a2013-08-19 18:47:21 -070012 # B-family platform uses msm8974 code base
13 AUDIO_PLATFORM = msm8974
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -070014 MULTIPLE_HW_VARIANTS_ENABLED := true
Mingming Yin8e5a4f62013-10-07 15:23:41 -070015ifneq ($(filter msm8610,$(TARGET_BOARD_PLATFORM)),)
16 LOCAL_CFLAGS := -DPLATFORM_MSM8610
17endif
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070018ifneq ($(filter msm8226,$(TARGET_BOARD_PLATFORM)),)
19 LOCAL_CFLAGS := -DPLATFORM_MSM8x26
20endif
Vidyakumar Athotad9d9ff32013-11-13 11:46:52 -080021ifneq ($(filter apq8084,$(TARGET_BOARD_PLATFORM)),)
22 LOCAL_CFLAGS := -DPLATFORM_APQ8084
23endif
Ajay Dudanibe3335a2013-08-19 18:47:21 -070024endif
25
Naresh Tannirudb72d1e2014-03-05 17:33:47 +053026ifneq ($(filter msm8916,$(TARGET_BOARD_PLATFORM)),)
27 AUDIO_PLATFORM = msm8916
28 MULTIPLE_HW_VARIANTS_ENABLED := true
29 LOCAL_CFLAGS := -DPLATFORM_MSM8916
30endif
Naresh Tanniru8b919ac2014-01-30 19:12:53 +053031
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080032LOCAL_SRC_FILES := \
33 audio_hw.c \
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070034 voice.c \
Ben Romberger61764e32014-01-10 13:49:02 -080035 platform_info.c \
Ajay Dudanibe3335a2013-08-19 18:47:21 -070036 $(AUDIO_PLATFORM)/platform.c
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080037
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070038LOCAL_SRC_FILES += audio_extn/audio_extn.c
39
Mingming Yin67e34512014-04-03 17:47:22 -070040ifneq ($(strip $(AUDIO_FEATURE_DISABLED_PCM_OFFLOAD)),true)
41 LOCAL_CFLAGS += -DPCM_OFFLOAD_ENABLED
42endif
43
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070044ifneq ($(strip $(AUDIO_FEATURE_DISABLED_ANC_HEADSET)),true)
45 LOCAL_CFLAGS += -DANC_HEADSET_ENABLED
46endif
47
Venkata Narendra Kumar Gutta88fd0bc2014-03-27 19:47:56 +053048ifneq ($(strip $(AUDIO_FEATURE_DISABLED_FLUENCE)),true)
49 LOCAL_CFLAGS += -DFLUENCE_ENABLED
50endif
51
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070052ifneq ($(strip $(AUDIO_FEATURE_DISABLED_PROXY_DEVICE)),true)
53 LOCAL_CFLAGS += -DAFE_PROXY_ENABLED
54endif
55
Apoorv Raghuvanshi6e262842013-10-06 14:39:35 -070056ifneq ($(strip $(AUDIO_FEATURE_DISABLED_FM)),true)
57 LOCAL_CFLAGS += -DFM_ENABLED
58 LOCAL_SRC_FILES += audio_extn/fm.c
59endif
60
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070061ifneq ($(strip $(AUDIO_FEATURE_DISABLED_USBAUDIO)),true)
62 LOCAL_CFLAGS += -DUSB_HEADSET_ENABLED
63 LOCAL_SRC_FILES += audio_extn/usb.c
64endif
Vimal Puthanveed5b4d3f12013-11-05 15:57:39 -080065ifneq ($(strip $(AUDIO_FEATURE_DISABLED_HFP)),true)
66 LOCAL_CFLAGS += -DHFP_ENABLED
67 LOCAL_SRC_FILES += audio_extn/hfp.c
68endif
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070069
Jitendra Singh Naruka9a6a8d42014-02-10 20:07:12 -080070ifneq ($(strip $(AUDIO_FEATURE_DISABLED_CUSTOMSTEREO)),true)
71 LOCAL_CFLAGS += -DCUSTOM_STEREO_ENABLED
72endif
73
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070074ifneq ($(strip $(AUDIO_FEATURE_DISABLED_SSR)),true)
75 LOCAL_CFLAGS += -DSSR_ENABLED
76 LOCAL_SRC_FILES += audio_extn/ssr.c
77 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/surround_sound/
78endif
79
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070080ifneq ($(strip $(AUDIO_FEATURE_DISABLED_MULTI_VOICE_SESSIONS)),true)
81 LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
82 LOCAL_SRC_FILES += voice_extn/voice_extn.c
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070083 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Nagender44733a42013-12-08 00:05:20 -070084 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070085
86ifneq ($(strip $(AUDIO_FEATURE_DISABLED_INCALL_MUSIC)),true)
87 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
88endif
Narsinga Rao Chella05573b72013-11-15 15:21:40 -080089
90ifneq ($(strip $(AUDIO_FEATURE_DISABLED_COMPRESS_VOIP)),true)
91 LOCAL_CFLAGS += -DCOMPRESS_VOIP_ENABLED
92 LOCAL_SRC_FILES += voice_extn/compress_voip.c
93endif
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070094endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070095
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070096ifneq ($(strip, $(AUDIO_FEATURE_DISABLED_SPKR_PROTECTION)),true)
Vidyakumar Athota1c6419a2014-01-10 14:47:34 -080097ifneq ($(filter msm8974 apq8084,$(TARGET_BOARD_PLATFORM)),)
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070098 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
99 LOCAL_SRC_FILES += audio_extn/spkr_protection.c
100 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Nagender44733a42013-12-08 00:05:20 -0700101 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -0700102endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700103endif
104
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -0700105ifdef MULTIPLE_HW_VARIANTS_ENABLED
106 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
107 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
108endif
109
Mingming Yine62d7842013-10-25 16:26:03 -0700110ifneq ($(strip $(AUDIO_FEATURE_DISABLED_COMPRESS_CAPTURE)),true)
111 LOCAL_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED
112 LOCAL_SRC_FILES += audio_extn/compress_capture.c
113endif
114
Mingming Yin90310102013-11-13 16:57:00 -0800115ifneq ($(strip $(AUDIO_FEATURE_DISABLED_DS1_DOLBY_DDP)),true)
116 LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
117 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Nagender44733a42013-12-08 00:05:20 -0700118 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800119 LOCAL_SRC_FILES += audio_extn/dolby.c
Mingming Yin90310102013-11-13 16:57:00 -0800120endif
121
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800122ifneq ($(strip $(AUDIO_FEATURE_DISABLED_DS1_DOLBY_DAP)),true)
123 LOCAL_CFLAGS += -DDS1_DOLBY_DAP_ENABLED
124ifeq ($(strip $(AUDIO_FEATURE_DISABLED_DS1_DOLBY_DDP)),true)
125 LOCAL_SRC_FILES += audio_extn/dolby.c
126endif
127endif
128
Subhash Chandra Bose Naripeddy16ff4f82014-04-01 21:03:10 -0700129ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTIPLE_TUNNEL)), true)
130 LOCAL_CFLAGS += -DMULTIPLE_OFFLOAD_ENABLED
131endif
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800132
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800133LOCAL_SHARED_LIBRARIES := \
134 liblog \
135 libcutils \
136 libtinyalsa \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700137 libtinycompress \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800138 libaudioroute \
Ben Romberger61764e32014-01-10 13:49:02 -0800139 libdl \
Helen Zeng008aebd2014-02-23 19:13:12 -0800140 libexpat \
141 libmdmdetect
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800142
143LOCAL_C_INCLUDES += \
144 external/tinyalsa/include \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700145 external/tinycompress/include \
Ben Romberger61764e32014-01-10 13:49:02 -0800146 external/expat/lib \
Ravi Kumar Alamandaf70ffb42013-04-16 15:55:53 -0700147 $(call include-path-for, audio-route) \
Eric Laurentb23d5282013-05-14 15:27:20 -0700148 $(call include-path-for, audio-effects) \
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700149 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800150 $(LOCAL_PATH)/audio_extn \
Helen Zeng008aebd2014-02-23 19:13:12 -0800151 $(LOCAL_PATH)/voice_extn \
152 $(TARGET_OUT_HEADERS)/libmdmdetect/inc
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800153
Kiran Kandi910e1862013-10-29 13:29:42 -0700154ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
155 LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
156 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
157 LOCAL_SRC_FILES += audio_extn/listen.c
158endif
159
Damir Didjustof1d46c72013-11-06 17:59:04 -0800160ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
161 LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
162endif
163
Mingming Yin8e5a4f62013-10-07 15:23:41 -0700164LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800165
166LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
167
168LOCAL_MODULE_TAGS := optional
169
170include $(BUILD_SHARED_LIBRARY)
171
172endif