Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 1 | # We can build either as part of a standalone Kernel build or as |
| 2 | # an external module. Determine which mechanism is being used |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 3 | ifeq ($(MODNAME),) |
| 4 | KERNEL_BUILD := 1 |
| 5 | else |
| 6 | KERNEL_BUILD := 0 |
| 7 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 8 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 9 | ifeq ($(KERNEL_BUILD), 1) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 10 | # These are configurable via Kconfig for kernel-based builds |
| 11 | # Need to explicitly configure for Android-based builds |
Meng Wang | 19fa6de | 2018-12-20 11:25:47 +0800 | [diff] [blame] | 12 | AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19 |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 13 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 14 | endif |
| 15 | |
| 16 | ifeq ($(KERNEL_BUILD), 0) |
Banajit Goswami | f58e5fc | 2018-04-11 14:10:09 -0700 | [diff] [blame] | 17 | ifeq ($(CONFIG_ARCH_SM8150), y) |
Cong Tang | 1fa4e04 | 2018-12-17 19:45:55 +0800 | [diff] [blame] | 18 | ifdef CONFIG_SND_SOC_SA8155 |
| 19 | include $(AUDIO_ROOT)/config/sa8155auto.conf |
Cong Tang | 1fa4e04 | 2018-12-17 19:45:55 +0800 | [diff] [blame] | 20 | INCS += -include $(AUDIO_ROOT)/config/sa8155autoconf.h |
| 21 | else |
| 22 | include $(AUDIO_ROOT)/config/sm8150auto.conf |
Cong Tang | 1fa4e04 | 2018-12-17 19:45:55 +0800 | [diff] [blame] | 23 | INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h |
| 24 | endif |
Meng Wang | 5fddb8d | 2018-01-23 16:56:56 +0800 | [diff] [blame] | 25 | endif |
Salendarsingh Gaud | ad97889 | 2018-05-14 16:53:09 +0530 | [diff] [blame] | 26 | ifeq ($(CONFIG_ARCH_SM6150), y) |
Rahul Sharma | f53de7f | 2019-03-03 22:30:47 +0530 | [diff] [blame] | 27 | ifdef CONFIG_SND_SOC_SA6155 |
| 28 | include $(AUDIO_ROOT)/config/sa6155auto.conf |
Rahul Sharma | f53de7f | 2019-03-03 22:30:47 +0530 | [diff] [blame] | 29 | INCS += -include $(AUDIO_ROOT)/config/sa6155autoconf.h |
| 30 | else |
| 31 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
Rahul Sharma | f53de7f | 2019-03-03 22:30:47 +0530 | [diff] [blame] | 32 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
| 33 | endif |
Abhishek Arpure | 6d74b70 | 2018-04-05 13:50:25 +0530 | [diff] [blame] | 34 | endif |
Hari Veerubhotla | dcab67c | 2018-10-14 17:08:35 +0530 | [diff] [blame] | 35 | ifeq ($(CONFIG_ARCH_TRINKET), y) |
| 36 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
Hari Veerubhotla | dcab67c | 2018-10-14 17:08:35 +0530 | [diff] [blame] | 37 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
| 38 | endif |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 39 | ifeq ($(CONFIG_ARCH_KONA), y) |
| 40 | include $(AUDIO_ROOT)/config/konaauto.conf |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 41 | INCS += -include $(AUDIO_ROOT)/config/konaautoconf.h |
| 42 | endif |
Vatsal Bucha | d284ff1 | 2019-04-01 15:34:50 +0530 | [diff] [blame] | 43 | ifeq ($(CONFIG_ARCH_LITO), y) |
| 44 | include $(AUDIO_ROOT)/config/litoauto.conf |
Vatsal Bucha | d284ff1 | 2019-04-01 15:34:50 +0530 | [diff] [blame] | 45 | INCS += -include $(AUDIO_ROOT)/config/litoautoconf.h |
| 46 | endif |
Laxminath Kasam | fdda2d8 | 2019-07-31 21:26:30 +0530 | [diff] [blame] | 47 | ifeq ($(CONFIG_ARCH_BENGAL), y) |
Laxminath Kasam | 00f60ba | 2019-10-04 09:37:07 +0530 | [diff] [blame] | 48 | include $(AUDIO_ROOT)/config/bengalauto.conf |
Laxminath Kasam | 00f60ba | 2019-10-04 09:37:07 +0530 | [diff] [blame] | 49 | INCS += -include $(AUDIO_ROOT)/config/bengalautoconf.h |
Laxminath Kasam | fdda2d8 | 2019-07-31 21:26:30 +0530 | [diff] [blame] | 50 | endif |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 51 | ifeq ($(CONFIG_ARCH_SDMSHRIKE), y) |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 52 | include $(AUDIO_ROOT)/config/sm8150auto.conf |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 53 | INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 54 | endif |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 55 | ifeq ($(CONFIG_ARCH_QCS405), y) |
| 56 | include $(AUDIO_ROOT)/config/qcs405auto.conf |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 57 | INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h |
| 58 | endif |
Timothy Sham | 4a6979f | 2019-02-19 12:36:06 -0500 | [diff] [blame] | 59 | ifeq ($(CONFIG_QTI_GVM), y) |
| 60 | include $(AUDIO_ROOT)/config/gvmauto.conf |
Timothy Sham | 4a6979f | 2019-02-19 12:36:06 -0500 | [diff] [blame] | 61 | INCS += -include $(AUDIO_ROOT)/config/gvmautoconf.h |
| 62 | endif |
Soumya Managoli | d11d6f0 | 2020-05-27 17:25:12 +0530 | [diff] [blame] | 63 | ifeq ($(CONFIG_ARCH_SDM660), y) |
| 64 | include $(AUDIO_ROOT)/config/sdm660auto.conf |
Soumya Managoli | d11d6f0 | 2020-05-27 17:25:12 +0530 | [diff] [blame] | 65 | INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h |
| 66 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 67 | endif |
| 68 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 69 | # As per target team, build is done as follows: |
| 70 | # Defconfig : build with default flags |
| 71 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 72 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 73 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 74 | # |
| 75 | # Shipment builds (user variants) should not have any debug feature |
| 76 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 77 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 78 | # there is no other way to identify defconfig builds, QTI internal |
| 79 | # representation of perf builds (identified using the string 'perf'), |
| 80 | # is used to identify if the build is a slub or defconfig one. This |
| 81 | # way no critical debug feature will be enabled for perf and shipment |
| 82 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 83 | # config. |
| 84 | |
| 85 | ############ UAPI ############ |
| 86 | UAPI_DIR := uapi |
| 87 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 88 | |
| 89 | ############ COMMON ############ |
| 90 | COMMON_DIR := include |
| 91 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 92 | |
| 93 | ############ ASoC Codecs ############ |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 94 | ifdef CONFIG_WCD9XXX_CODEC_CORE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 95 | CORE_OBJS += wcd9xxx-rst.o |
| 96 | CORE_OBJS += wcd9xxx-core-init.o |
| 97 | CORE_OBJS += wcd9xxx-core.o |
| 98 | CORE_OBJS += wcd9xxx-irq.o |
| 99 | CORE_OBJS += wcd9xxx-slimslave.o |
| 100 | CORE_OBJS += wcd9xxx-utils.o |
| 101 | CORE_OBJS += wcd9335-regmap.o |
| 102 | CORE_OBJS += wcd9335-tables.o |
| 103 | CORE_OBJS += msm-cdc-pinctrl.o |
| 104 | CORE_OBJS += msm-cdc-supply.o |
| 105 | CORE_OBJS += wcd934x/wcd934x-regmap.o |
| 106 | CORE_OBJS += wcd934x/wcd934x-tables.o |
| 107 | endif |
| 108 | |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 109 | ifdef CONFIG_WCD9XXX_CODEC_CORE_V2 |
Karthikeyan Mani | 1efdee5 | 2019-02-08 11:11:47 -0800 | [diff] [blame] | 110 | CORE_OBJS += wcd9xxx-core-init.o |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 111 | CORE_OBJS += msm-cdc-pinctrl.o |
| 112 | CORE_OBJS += msm-cdc-supply.o |
| 113 | endif |
| 114 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 115 | ifdef CONFIG_SND_SOC_WCD9XXX_V2 |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 116 | ifdef CONFIG_WCD9XXX_CODEC_CORE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 117 | WCD9XXX_OBJS += wcd9xxx-common-v2.o |
| 118 | WCD9XXX_OBJS += wcd9xxx-resmgr-v2.o |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 119 | else |
| 120 | WCD9XXX_OBJS += wcd-clsh.o |
| 121 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 122 | WCD9XXX_OBJS += wcdcal-hwdep.o |
| 123 | WCD9XXX_OBJS += wcd9xxx-soc-init.o |
| 124 | WCD9XXX_OBJS += wcd-dsp-utils.o |
| 125 | WCD9XXX_OBJS += wcd-dsp-mgr.o |
| 126 | WCD9XXX_OBJS += audio-ext-clk-up.o |
| 127 | endif |
| 128 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 129 | ifdef CONFIG_SND_SOC_WCD9335 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 130 | WCD9335_OBJS += wcd9335.o |
| 131 | endif |
| 132 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 133 | ifdef CONFIG_SND_SOC_WSA881X |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 134 | WSA881X_OBJS += wsa881x.o |
| 135 | WSA881X_OBJS += wsa881x-tables.o |
| 136 | WSA881X_OBJS += wsa881x-regmap.o |
| 137 | WSA881X_OBJS += wsa881x-temp-sensor.o |
| 138 | endif |
| 139 | |
Laxminath Kasam | 00f60ba | 2019-10-04 09:37:07 +0530 | [diff] [blame] | 140 | ifdef CONFIG_SND_SOC_WSA881X_ANALOG |
| 141 | WSA881X_ANALOG_OBJS += wsa881x-analog.o |
| 142 | WSA881X_ANALOG_OBJS += wsa881x-tables-analog.o |
| 143 | WSA881X_ANALOG_OBJS += wsa881x-regmap-analog.o |
| 144 | WSA881X_ANALOG_OBJS += wsa881x-temp-sensor.o |
| 145 | endif |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 146 | ifdef CONFIG_SND_SOC_MSM_STUB |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 147 | STUB_OBJS += msm_stub.o |
| 148 | endif |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 149 | ifdef CONFIG_SND_SOC_WCD_SPI |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 150 | SPI_OBJS += wcd-spi.o |
| 151 | endif |
| 152 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 153 | ifdef CONFIG_SND_SOC_WCD_CPE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 154 | WCD_CPE_OBJS += wcd_cpe_core.o |
| 155 | WCD_CPE_OBJS += wcd_cpe_services.o |
| 156 | endif |
| 157 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 158 | ifdef CONFIG_SND_SOC_WCD_MBHC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 159 | MBHC_OBJS += wcd-mbhc-v2.o |
| 160 | endif |
| 161 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 162 | ifdef CONFIG_SND_SOC_WCD_MBHC_ADC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 163 | MBHC_OBJS += wcd-mbhc-adc.o |
| 164 | endif |
| 165 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 166 | ifdef CONFIG_SND_SOC_WCD_MBHC_LEGACY |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 167 | MBHC_OBJS += wcd-mbhc-legacy.o |
| 168 | endif |
| 169 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 170 | ifdef CONFIG_SND_SOC_MSM_HDMI_CODEC_RX |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 171 | HDMICODEC_OBJS += msm_hdmi_codec_rx.o |
| 172 | endif |
| 173 | |
Vatsal Bucha | ec5eab5 | 2018-07-24 11:28:04 +0530 | [diff] [blame] | 174 | ifdef CONFIG_SND_SOC_WCD_IRQ |
| 175 | CORE_OBJS += wcd-irq.o |
| 176 | endif |
| 177 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 178 | LINUX_INC += -Iinclude/linux |
| 179 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 180 | INCS += $(COMMON_INC) \ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 181 | $(UAPI_INC) |
| 182 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 183 | |
| 184 | EXTRA_CFLAGS += $(INCS) |
| 185 | |
| 186 | |
| 187 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 188 | -DANI_LITTLE_BIT_ENDIAN \ |
| 189 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 190 | -DANI_COMPILER_TYPE_GCC \ |
| 191 | -DANI_OS_TYPE_ANDROID=6 \ |
| 192 | -DPTT_SOCK_SVC_ENABLE \ |
| 193 | -Wall\ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 194 | -D__linux__ |
| 195 | |
| 196 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 197 | |
| 198 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 199 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 200 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 201 | # will override the kernel settings. |
| 202 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 203 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 204 | endif |
| 205 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 206 | |
| 207 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 208 | EXTRA_CFLAGS += -Wheader-guard |
| 209 | endif |
| 210 | |
| 211 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 212 | ifeq ($(KERNEL_BUILD), 0) |
Meng Wang | e61ddb0 | 2018-03-07 11:18:35 +0800 | [diff] [blame] | 213 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 214 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 215 | endif |
| 216 | |
| 217 | ifeq ($(KERNEL_BUILD), 1) |
| 218 | obj-y += wcd934x/ |
Rohit kumar | 759426e | 2018-05-14 18:21:52 +0530 | [diff] [blame] | 219 | obj-y += wcd937x/ |
Karthikeyan Mani | 8e14752 | 2019-05-13 15:14:46 -0700 | [diff] [blame] | 220 | obj-y += wcd938x/ |
| 221 | obj-y += bolero/ |
Aditya Bavanari | d6f7f84 | 2020-03-12 11:23:50 +0530 | [diff] [blame] | 222 | obj-y += rouleur/ |
Ramlal Karra | 6ce71ff | 2020-01-30 14:03:18 +0530 | [diff] [blame] | 223 | obj-y += wsa883x/ |
Soumya Managoli | d11d6f0 | 2020-05-27 17:25:12 +0530 | [diff] [blame] | 224 | obj-y += sdm660_cdc/ |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 225 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 226 | # Module information used by KBuild framework |
| 227 | obj-$(CONFIG_WCD9XXX_CODEC_CORE) += wcd_core_dlkm.o |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 228 | obj-$(CONFIG_WCD9XXX_CODEC_CORE_V2) += wcd_core_dlkm.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 229 | wcd_core_dlkm-y := $(CORE_OBJS) |
| 230 | |
| 231 | obj-$(CONFIG_SND_SOC_WCD9XXX_V2) += wcd9xxx_dlkm.o |
| 232 | wcd9xxx_dlkm-y := $(WCD9XXX_OBJS) |
| 233 | |
| 234 | obj-$(CONFIG_SND_SOC_WCD9335) += wcd9335_dlkm.o |
| 235 | wcd9335_dlkm-y := $(WCD9335_OBJS) |
| 236 | |
| 237 | obj-$(CONFIG_SND_SOC_WSA881X) += wsa881x_dlkm.o |
| 238 | wsa881x_dlkm-y := $(WSA881X_OBJS) |
| 239 | |
Laxminath Kasam | 00f60ba | 2019-10-04 09:37:07 +0530 | [diff] [blame] | 240 | obj-$(CONFIG_SND_SOC_WSA881X_ANALOG) += wsa881x_analog_dlkm.o |
| 241 | wsa881x_analog_dlkm-y := $(WSA881X_ANALOG_OBJS) |
| 242 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 243 | obj-$(CONFIG_SND_SOC_MSM_STUB) += stub_dlkm.o |
| 244 | stub_dlkm-y := $(STUB_OBJS) |
| 245 | |
| 246 | obj-$(CONFIG_SND_SOC_WCD_CPE) += wcd_cpe_dlkm.o |
| 247 | wcd_cpe_dlkm-y := $(WCD_CPE_OBJS) |
| 248 | |
| 249 | obj-$(CONFIG_SND_SOC_WCD_SPI) += wcd_spi_dlkm.o |
| 250 | wcd_spi_dlkm-y := $(SPI_OBJS) |
| 251 | |
| 252 | obj-$(CONFIG_SND_SOC_WCD_MBHC) += mbhc_dlkm.o |
| 253 | mbhc_dlkm-y := $(MBHC_OBJS) |
| 254 | |
| 255 | obj-$(CONFIG_SND_SOC_MSM_HDMI_CODEC_RX) += hdmi_dlkm.o |
| 256 | hdmi_dlkm-y := $(HDMICODEC_OBJS) |