blob: a7e0a026712177b1cd5f5abf4b90516067865feb [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
David Nga5ad5ea2013-10-10 20:36:49 -070011ifneq ($(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
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080026LOCAL_SRC_FILES := \
27 audio_hw.c \
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070028 voice.c \
Ben Romberger61764e32014-01-10 13:49:02 -080029 platform_info.c \
Ajay Dudanibe3335a2013-08-19 18:47:21 -070030 $(AUDIO_PLATFORM)/platform.c
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080031
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070032LOCAL_SRC_FILES += audio_extn/audio_extn.c
33
34ifneq ($(strip $(AUDIO_FEATURE_DISABLED_ANC_HEADSET)),true)
35 LOCAL_CFLAGS += -DANC_HEADSET_ENABLED
36endif
37
38ifneq ($(strip $(AUDIO_FEATURE_DISABLED_PROXY_DEVICE)),true)
39 LOCAL_CFLAGS += -DAFE_PROXY_ENABLED
40endif
41
Apoorv Raghuvanshi6e262842013-10-06 14:39:35 -070042ifneq ($(strip $(AUDIO_FEATURE_DISABLED_FM)),true)
43 LOCAL_CFLAGS += -DFM_ENABLED
44 LOCAL_SRC_FILES += audio_extn/fm.c
45endif
46
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070047ifneq ($(strip $(AUDIO_FEATURE_DISABLED_USBAUDIO)),true)
48 LOCAL_CFLAGS += -DUSB_HEADSET_ENABLED
49 LOCAL_SRC_FILES += audio_extn/usb.c
50endif
Vimal Puthanveed5b4d3f12013-11-05 15:57:39 -080051ifneq ($(strip $(AUDIO_FEATURE_DISABLED_HFP)),true)
52 LOCAL_CFLAGS += -DHFP_ENABLED
53 LOCAL_SRC_FILES += audio_extn/hfp.c
54endif
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070055
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070056ifneq ($(strip $(AUDIO_FEATURE_DISABLED_SSR)),true)
57 LOCAL_CFLAGS += -DSSR_ENABLED
58 LOCAL_SRC_FILES += audio_extn/ssr.c
59 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/surround_sound/
60endif
61
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070062ifneq ($(strip $(AUDIO_FEATURE_DISABLED_MULTI_VOICE_SESSIONS)),true)
63 LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
64 LOCAL_SRC_FILES += voice_extn/voice_extn.c
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070065 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Nagender44733a42013-12-08 00:05:20 -070066 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070067
68ifneq ($(strip $(AUDIO_FEATURE_DISABLED_INCALL_MUSIC)),true)
69 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
70endif
Narsinga Rao Chella05573b72013-11-15 15:21:40 -080071
72ifneq ($(strip $(AUDIO_FEATURE_DISABLED_COMPRESS_VOIP)),true)
73 LOCAL_CFLAGS += -DCOMPRESS_VOIP_ENABLED
74 LOCAL_SRC_FILES += voice_extn/compress_voip.c
75endif
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070076endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070077
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070078ifneq ($(strip, $(AUDIO_FEATURE_DISABLED_SPKR_PROTECTION)),true)
79ifneq ($(filter msm8974,$(TARGET_BOARD_PLATFORM)),)
80 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
81 LOCAL_SRC_FILES += audio_extn/spkr_protection.c
82 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Nagender44733a42013-12-08 00:05:20 -070083 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070084endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070085endif
86
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -070087ifdef MULTIPLE_HW_VARIANTS_ENABLED
88 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
89 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
90endif
91
Mingming Yine62d7842013-10-25 16:26:03 -070092ifneq ($(strip $(AUDIO_FEATURE_DISABLED_COMPRESS_CAPTURE)),true)
93 LOCAL_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED
94 LOCAL_SRC_FILES += audio_extn/compress_capture.c
95endif
96
Mingming Yin90310102013-11-13 16:57:00 -080097ifneq ($(strip $(AUDIO_FEATURE_DISABLED_DS1_DOLBY_DDP)),true)
98 LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
99 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Nagender44733a42013-12-08 00:05:20 -0700100 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800101 LOCAL_SRC_FILES += audio_extn/dolby.c
Mingming Yin90310102013-11-13 16:57:00 -0800102endif
103
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800104ifneq ($(strip $(AUDIO_FEATURE_DISABLED_DS1_DOLBY_DAP)),true)
105 LOCAL_CFLAGS += -DDS1_DOLBY_DAP_ENABLED
106ifeq ($(strip $(AUDIO_FEATURE_DISABLED_DS1_DOLBY_DDP)),true)
107 LOCAL_SRC_FILES += audio_extn/dolby.c
108endif
109endif
110
111
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800112LOCAL_SHARED_LIBRARIES := \
113 liblog \
114 libcutils \
115 libtinyalsa \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700116 libtinycompress \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800117 libaudioroute \
Ben Romberger61764e32014-01-10 13:49:02 -0800118 libdl \
119 libexpat
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800120
121LOCAL_C_INCLUDES += \
122 external/tinyalsa/include \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700123 external/tinycompress/include \
Ben Romberger61764e32014-01-10 13:49:02 -0800124 external/expat/lib \
Ravi Kumar Alamandaf70ffb42013-04-16 15:55:53 -0700125 $(call include-path-for, audio-route) \
Eric Laurentb23d5282013-05-14 15:27:20 -0700126 $(call include-path-for, audio-effects) \
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700127 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800128 $(LOCAL_PATH)/audio_extn \
129 $(LOCAL_PATH)/voice_extn
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800130
Kiran Kandi910e1862013-10-29 13:29:42 -0700131ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
132 LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
133 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
134 LOCAL_SRC_FILES += audio_extn/listen.c
135endif
136
Damir Didjustof1d46c72013-11-06 17:59:04 -0800137ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
138 LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
139endif
140
Mingming Yin8e5a4f62013-10-07 15:23:41 -0700141LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800142
143LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
144
145LOCAL_MODULE_TAGS := optional
146
147include $(BUILD_SHARED_LIBRARY)
148
149endif