blob: 86f92d97983a91f07bdc7c06b1f86903188eff84 [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 \
Ajay Dudanibe3335a2013-08-19 18:47:21 -070029 $(AUDIO_PLATFORM)/platform.c
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080030
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070031LOCAL_SRC_FILES += audio_extn/audio_extn.c
32
33ifneq ($(strip $(AUDIO_FEATURE_DISABLED_ANC_HEADSET)),true)
34 LOCAL_CFLAGS += -DANC_HEADSET_ENABLED
35endif
36
37ifneq ($(strip $(AUDIO_FEATURE_DISABLED_PROXY_DEVICE)),true)
38 LOCAL_CFLAGS += -DAFE_PROXY_ENABLED
39endif
40
Apoorv Raghuvanshi6e262842013-10-06 14:39:35 -070041ifneq ($(strip $(AUDIO_FEATURE_DISABLED_FM)),true)
42 LOCAL_CFLAGS += -DFM_ENABLED
43 LOCAL_SRC_FILES += audio_extn/fm.c
44endif
45
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070046ifneq ($(strip $(AUDIO_FEATURE_DISABLED_USBAUDIO)),true)
47 LOCAL_CFLAGS += -DUSB_HEADSET_ENABLED
48 LOCAL_SRC_FILES += audio_extn/usb.c
49endif
50
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070051ifneq ($(strip $(AUDIO_FEATURE_DISABLED_SSR)),true)
52 LOCAL_CFLAGS += -DSSR_ENABLED
53 LOCAL_SRC_FILES += audio_extn/ssr.c
54 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/surround_sound/
55endif
56
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070057ifneq ($(strip $(AUDIO_FEATURE_DISABLED_MULTI_VOICE_SESSIONS)),true)
58 LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
59 LOCAL_SRC_FILES += voice_extn/voice_extn.c
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070060 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
61
62ifneq ($(strip $(AUDIO_FEATURE_DISABLED_INCALL_MUSIC)),true)
63 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
64endif
Narsinga Rao Chella05573b72013-11-15 15:21:40 -080065
66ifneq ($(strip $(AUDIO_FEATURE_DISABLED_COMPRESS_VOIP)),true)
67 LOCAL_CFLAGS += -DCOMPRESS_VOIP_ENABLED
68 LOCAL_SRC_FILES += voice_extn/compress_voip.c
69endif
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070070endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070071
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070072ifneq ($(strip, $(AUDIO_FEATURE_DISABLED_SPKR_PROTECTION)),true)
73ifneq ($(filter msm8974,$(TARGET_BOARD_PLATFORM)),)
74 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
75 LOCAL_SRC_FILES += audio_extn/spkr_protection.c
76 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
77endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070078endif
79
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -070080ifdef MULTIPLE_HW_VARIANTS_ENABLED
81 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
82 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
83endif
84
Mingming Yine62d7842013-10-25 16:26:03 -070085ifneq ($(strip $(AUDIO_FEATURE_DISABLED_COMPRESS_CAPTURE)),true)
86 LOCAL_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED
87 LOCAL_SRC_FILES += audio_extn/compress_capture.c
88endif
89
Mingming Yin90310102013-11-13 16:57:00 -080090ifneq ($(strip $(AUDIO_FEATURE_DISABLED_DS1_DOLBY_DDP)),true)
91 LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
92 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
93endif
94
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080095LOCAL_SHARED_LIBRARIES := \
96 liblog \
97 libcutils \
98 libtinyalsa \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -070099 libtinycompress \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800100 libaudioroute \
101 libdl
102
103LOCAL_C_INCLUDES += \
104 external/tinyalsa/include \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700105 external/tinycompress/include \
Ravi Kumar Alamandaf70ffb42013-04-16 15:55:53 -0700106 $(call include-path-for, audio-route) \
Eric Laurentb23d5282013-05-14 15:27:20 -0700107 $(call include-path-for, audio-effects) \
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700108 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800109 $(LOCAL_PATH)/audio_extn \
110 $(LOCAL_PATH)/voice_extn
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800111
Kiran Kandi910e1862013-10-29 13:29:42 -0700112ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
113 LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
114 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
115 LOCAL_SRC_FILES += audio_extn/listen.c
116endif
117
Damir Didjustof1d46c72013-11-06 17:59:04 -0800118ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
119 LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
120endif
121
Mingming Yin8e5a4f62013-10-07 15:23:41 -0700122LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800123
124LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
125
126LOCAL_MODULE_TAGS := optional
127
128include $(BUILD_SHARED_LIBRARY)
129
130endif