blob: 8bbfa69928bd0543737ece7578746e582c3d94c2 [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
Ajay Dudanibe3335a2013-08-19 18:47:21 -070021endif
22
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080023LOCAL_SRC_FILES := \
24 audio_hw.c \
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070025 voice.c \
Ajay Dudanibe3335a2013-08-19 18:47:21 -070026 $(AUDIO_PLATFORM)/platform.c
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080027
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070028LOCAL_SRC_FILES += audio_extn/audio_extn.c
29
30ifneq ($(strip $(AUDIO_FEATURE_DISABLED_ANC_HEADSET)),true)
31 LOCAL_CFLAGS += -DANC_HEADSET_ENABLED
32endif
33
34ifneq ($(strip $(AUDIO_FEATURE_DISABLED_PROXY_DEVICE)),true)
35 LOCAL_CFLAGS += -DAFE_PROXY_ENABLED
36endif
37
Apoorv Raghuvanshi6e262842013-10-06 14:39:35 -070038ifneq ($(strip $(AUDIO_FEATURE_DISABLED_FM)),true)
39 LOCAL_CFLAGS += -DFM_ENABLED
40 LOCAL_SRC_FILES += audio_extn/fm.c
41endif
42
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070043ifneq ($(strip $(AUDIO_FEATURE_DISABLED_USBAUDIO)),true)
44 LOCAL_CFLAGS += -DUSB_HEADSET_ENABLED
45 LOCAL_SRC_FILES += audio_extn/usb.c
46endif
47
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070048ifneq ($(strip $(AUDIO_FEATURE_DISABLED_SSR)),true)
49 LOCAL_CFLAGS += -DSSR_ENABLED
50 LOCAL_SRC_FILES += audio_extn/ssr.c
51 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/surround_sound/
52endif
53
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070054ifneq ($(strip $(AUDIO_FEATURE_DISABLED_MULTI_VOICE_SESSIONS)),true)
55 LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
56 LOCAL_SRC_FILES += voice_extn/voice_extn.c
57 LOCAL_C_INCLUDES += $(LOCAL_PATH)/voice_extn
58 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
59
60ifneq ($(strip $(AUDIO_FEATURE_DISABLED_INCALL_MUSIC)),true)
61 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
62endif
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070063endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070064
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070065ifneq ($(strip, $(AUDIO_FEATURE_DISABLED_SPKR_PROTECTION)),true)
66ifneq ($(filter msm8974,$(TARGET_BOARD_PLATFORM)),)
67 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
68 LOCAL_SRC_FILES += audio_extn/spkr_protection.c
69 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
70endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070071endif
72
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -070073ifdef MULTIPLE_HW_VARIANTS_ENABLED
74 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
75 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
76endif
77
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080078LOCAL_SHARED_LIBRARIES := \
79 liblog \
80 libcutils \
81 libtinyalsa \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -070082 libtinycompress \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080083 libaudioroute \
84 libdl
85
86LOCAL_C_INCLUDES += \
87 external/tinyalsa/include \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -070088 external/tinycompress/include \
Ravi Kumar Alamandaf70ffb42013-04-16 15:55:53 -070089 $(call include-path-for, audio-route) \
Eric Laurentb23d5282013-05-14 15:27:20 -070090 $(call include-path-for, audio-effects) \
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070091 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
92 $(LOCAL_PATH)/audio_extn
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080093
Kiran Kandi910e1862013-10-29 13:29:42 -070094ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
95 LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
96 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
97 LOCAL_SRC_FILES += audio_extn/listen.c
98endif
99
Damir Didjustof1d46c72013-11-06 17:59:04 -0800100ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
101 LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
102endif
103
Mingming Yin8e5a4f62013-10-07 15:23:41 -0700104LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800105
106LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
107
108LOCAL_MODULE_TAGS := optional
109
110include $(BUILD_SHARED_LIBRARY)
111
112endif