blob: 58cf1c6594d155b83fb081baf6f88ca6c095e9ce [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
60 LOCAL_C_INCLUDES += $(LOCAL_PATH)/voice_extn
61 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
62
63ifneq ($(strip $(AUDIO_FEATURE_DISABLED_INCALL_MUSIC)),true)
64 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
65endif
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070066endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070067
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070068ifneq ($(strip, $(AUDIO_FEATURE_DISABLED_SPKR_PROTECTION)),true)
69ifneq ($(filter msm8974,$(TARGET_BOARD_PLATFORM)),)
70 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
71 LOCAL_SRC_FILES += audio_extn/spkr_protection.c
72 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
73endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070074endif
75
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -070076ifdef MULTIPLE_HW_VARIANTS_ENABLED
77 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
78 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
79endif
80
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080081LOCAL_SHARED_LIBRARIES := \
82 liblog \
83 libcutils \
84 libtinyalsa \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -070085 libtinycompress \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080086 libaudioroute \
87 libdl
88
89LOCAL_C_INCLUDES += \
90 external/tinyalsa/include \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -070091 external/tinycompress/include \
Ravi Kumar Alamandaf70ffb42013-04-16 15:55:53 -070092 $(call include-path-for, audio-route) \
Eric Laurentb23d5282013-05-14 15:27:20 -070093 $(call include-path-for, audio-effects) \
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070094 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
95 $(LOCAL_PATH)/audio_extn
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080096
Kiran Kandi910e1862013-10-29 13:29:42 -070097ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
98 LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
99 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
100 LOCAL_SRC_FILES += audio_extn/listen.c
101endif
102
Damir Didjustof1d46c72013-11-06 17:59:04 -0800103ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
104 LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
105endif
106
Mingming Yin8e5a4f62013-10-07 15:23:41 -0700107LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800108
109LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
110
111LOCAL_MODULE_TAGS := optional
112
113include $(BUILD_SHARED_LIBRARY)
114
115endif