1ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
2
3LOCAL_PATH := $(call my-dir)
4
5include $(CLEAR_VARS)
6
7LOCAL_ARM_MODE := arm
8
9AUDIO_PLATFORM := $(TARGET_BOARD_PLATFORM)
10ifneq ($(filter msm8960,$(TARGET_BOARD_PLATFORM)),)
11  LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
12endif
13ifneq ($(filter msm8974 msm8226 msm8084 msm8992 msm8994 msm8996,$(TARGET_BOARD_PLATFORM)),)
14  # B-family platform uses msm8974 code base
15  AUDIO_PLATFORM = msm8974
16ifneq ($(filter msm8974,$(TARGET_BOARD_PLATFORM)),)
17  LOCAL_CFLAGS := -DPLATFORM_MSM8974
18  LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
19endif
20ifneq ($(filter msm8226,$(TARGET_BOARD_PLATFORM)),)
21  LOCAL_CFLAGS := -DPLATFORM_MSM8x26
22  LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
23endif
24ifneq ($(filter msm8084,$(TARGET_BOARD_PLATFORM)),)
25  LOCAL_CFLAGS := -DPLATFORM_MSM8084
26  LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
27endif
28ifneq ($(filter msm8992,$(TARGET_BOARD_PLATFORM)),)
29  LOCAL_CFLAGS := -DPLATFORM_MSM8994
30  LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
31  LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
32endif
33ifneq ($(filter msm8994,$(TARGET_BOARD_PLATFORM)),)
34  LOCAL_CFLAGS := -DPLATFORM_MSM8994
35  LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
36  LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
37endif
38ifneq ($(filter msm8996,$(TARGET_BOARD_PLATFORM)),)
39  LOCAL_CFLAGS := -DPLATFORM_MSM8996
40  LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
41  LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
42  MULTIPLE_HW_VARIANTS_ENABLED := true
43endif
44endif
45
46LOCAL_SRC_FILES := \
47	audio_hw.c \
48	voice.c \
49	platform_info.c \
50	audio_extn/ext_speaker.c \
51	audio_extn/audio_extn.c \
52	$(AUDIO_PLATFORM)/platform.c
53
54ifdef MULTIPLE_HW_VARIANTS_ENABLED
55  LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
56  LOCAL_SRC_FILES +=  $(AUDIO_PLATFORM)/hw_info.c
57endif
58
59LOCAL_SHARED_LIBRARIES := \
60	liblog \
61	libcutils \
62	libtinyalsa \
63	libtinycompress \
64	libaudioroute \
65	libdl \
66	libexpat
67
68LOCAL_C_INCLUDES += \
69	external/tinyalsa/include \
70	external/tinycompress/include \
71	$(call include-path-for, audio-route) \
72	$(call include-path-for, audio-effects) \
73	$(LOCAL_PATH)/$(AUDIO_PLATFORM) \
74	$(LOCAL_PATH)/audio_extn \
75	$(LOCAL_PATH)/voice_extn \
76	external/expat/lib
77
78ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS)),true)
79    LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
80    LOCAL_SRC_FILES += voice_extn/voice_extn.c
81endif
82
83ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HFP)),true)
84    LOCAL_CFLAGS += -DHFP_ENABLED
85    LOCAL_SRC_FILES += audio_extn/hfp.c
86endif
87
88ifeq ($(strip $(AUDIO_FEATURE_SUPPORTED_EXTERNAL_BT)),true)
89    LOCAL_CFLAGS += -DEXTERNAL_BT_SUPPORTED
90endif
91
92ifeq ($(strip $(AUDIO_FEATURE_NO_AUDIO_OUT)),true)
93    LOCAL_CFLAGS += -DNO_AUDIO_OUT
94endif
95
96ifeq ($(strip $(BOARD_SUPPORTS_SOUND_TRIGGER)),true)
97    LOCAL_CFLAGS += -DSOUND_TRIGGER_ENABLED
98    LOCAL_CFLAGS += -DSOUND_TRIGGER_PLATFORM_NAME=$(TARGET_BOARD_PLATFORM)
99    LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/sound_trigger
100    LOCAL_SRC_FILES += audio_extn/soundtrigger.c
101endif
102
103ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true)
104    LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
105    LOCAL_SRC_FILES += audio_extn/spkr_protection.c
106endif
107
108ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DSM_FEEDBACK)),true)
109    LOCAL_CFLAGS += -DDSM_FEEDBACK_ENABLED
110    LOCAL_SRC_FILES += audio_extn/dsm_feedback.c
111endif
112
113ifneq ($(filter msm8992 msm8994 msm8996,$(TARGET_BOARD_PLATFORM)),)
114  # push codec/mad calibration to HW dep node
115  # applicable to msm8992/8994 or newer platforms
116  LOCAL_CFLAGS += -DHWDEP_CAL_ENABLED
117  LOCAL_SRC_FILES += audio_extn/hwdep_cal.c
118endif
119
120LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
121
122LOCAL_MODULE_RELATIVE_PATH := hw
123
124LOCAL_MODULE_TAGS := optional
125
126include $(BUILD_SHARED_LIBRARY)
127
128endif
129