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) |
Derek Chen | c894029 | 2019-03-14 10:26:41 -0700 | [diff] [blame] | 18 | ifdef CONFIG_SND_SOC_SA8155 |
| 19 | include $(AUDIO_ROOT)/config/sa8155auto.conf |
Derek Chen | c894029 | 2019-03-14 10:26:41 -0700 | [diff] [blame] | 20 | INCS += -include $(AUDIO_ROOT)/config/sa8155autoconf.h |
| 21 | else |
| 22 | include $(AUDIO_ROOT)/config/sm8150auto.conf |
Derek Chen | c894029 | 2019-03-14 10:26:41 -0700 | [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 |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 26 | ifeq ($(CONFIG_ARCH_KONA), y) |
| 27 | include $(AUDIO_ROOT)/config/konaauto.conf |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 28 | INCS += -include $(AUDIO_ROOT)/config/konaautoconf.h |
| 29 | endif |
Vatsal Bucha | d284ff1 | 2019-04-01 15:34:50 +0530 | [diff] [blame] | 30 | ifeq ($(CONFIG_ARCH_LITO), y) |
| 31 | include $(AUDIO_ROOT)/config/litoauto.conf |
Vatsal Bucha | d284ff1 | 2019-04-01 15:34:50 +0530 | [diff] [blame] | 32 | INCS += -include $(AUDIO_ROOT)/config/litoautoconf.h |
| 33 | endif |
Laxminath Kasam | fdda2d8 | 2019-07-31 21:26:30 +0530 | [diff] [blame] | 34 | ifeq ($(CONFIG_ARCH_BENGAL), y) |
Laxminath Kasam | 00f60ba | 2019-10-04 09:37:07 +0530 | [diff] [blame] | 35 | include $(AUDIO_ROOT)/config/bengalauto.conf |
Laxminath Kasam | 00f60ba | 2019-10-04 09:37:07 +0530 | [diff] [blame] | 36 | INCS += -include $(AUDIO_ROOT)/config/bengalautoconf.h |
Laxminath Kasam | fdda2d8 | 2019-07-31 21:26:30 +0530 | [diff] [blame] | 37 | endif |
Salendarsingh Gaud | ad97889 | 2018-05-14 16:53:09 +0530 | [diff] [blame] | 38 | ifeq ($(CONFIG_ARCH_SM6150), y) |
Erin Yan | 300664f | 2019-05-14 10:42:31 +0800 | [diff] [blame] | 39 | ifdef CONFIG_SND_SOC_SA6155 |
| 40 | include $(AUDIO_ROOT)/config/sa6155auto.conf |
Erin Yan | 300664f | 2019-05-14 10:42:31 +0800 | [diff] [blame] | 41 | INCS += -include $(AUDIO_ROOT)/config/sa6155autoconf.h |
| 42 | else |
| 43 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
Erin Yan | 300664f | 2019-05-14 10:42:31 +0800 | [diff] [blame] | 44 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
| 45 | endif |
Abhishek Arpure | 6d74b70 | 2018-04-05 13:50:25 +0530 | [diff] [blame] | 46 | endif |
Hari Veerubhotla | dcab67c | 2018-10-14 17:08:35 +0530 | [diff] [blame] | 47 | ifeq ($(CONFIG_ARCH_TRINKET), y) |
| 48 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
Hari Veerubhotla | dcab67c | 2018-10-14 17:08:35 +0530 | [diff] [blame] | 49 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
| 50 | endif |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 51 | ifeq ($(CONFIG_ARCH_SDMSHRIKE), y) |
Derek Chen | 583e3bf | 2019-04-15 18:01:45 -0700 | [diff] [blame] | 52 | ifdef CONFIG_SND_SOC_SA8155 |
| 53 | include $(AUDIO_ROOT)/config/sa8155auto.conf |
Derek Chen | 583e3bf | 2019-04-15 18:01:45 -0700 | [diff] [blame] | 54 | INCS += -include $(AUDIO_ROOT)/config/sa8155autoconf.h |
| 55 | else |
| 56 | include $(AUDIO_ROOT)/config/sm8150auto.conf |
Derek Chen | 583e3bf | 2019-04-15 18:01:45 -0700 | [diff] [blame] | 57 | INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h |
| 58 | endif |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 59 | endif |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 60 | ifeq ($(CONFIG_ARCH_QCS405), y) |
| 61 | include $(AUDIO_ROOT)/config/qcs405auto.conf |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 62 | INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h |
| 63 | endif |
Derek Chen | c894029 | 2019-03-14 10:26:41 -0700 | [diff] [blame] | 64 | ifeq ($(CONFIG_QTI_GVM), y) |
| 65 | include $(AUDIO_ROOT)/config/gvmauto.conf |
Derek Chen | c894029 | 2019-03-14 10:26:41 -0700 | [diff] [blame] | 66 | INCS += -include $(AUDIO_ROOT)/config/gvmautoconf.h |
| 67 | endif |
Soumya Managoli | a620a95 | 2020-06-11 12:14:46 +0530 | [diff] [blame] | 68 | ifeq ($(CONFIG_ARCH_SDM660), y) |
| 69 | include $(AUDIO_ROOT)/config/sdm660auto.conf |
Soumya Managoli | a620a95 | 2020-06-11 12:14:46 +0530 | [diff] [blame] | 70 | INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h |
| 71 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 72 | endif |
| 73 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 74 | # As per target team, build is done as follows: |
| 75 | # Defconfig : build with default flags |
| 76 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 77 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 78 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 79 | # |
| 80 | # Shipment builds (user variants) should not have any debug feature |
| 81 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 82 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 83 | # there is no other way to identify defconfig builds, QTI internal |
| 84 | # representation of perf builds (identified using the string 'perf'), |
| 85 | # is used to identify if the build is a slub or defconfig one. This |
| 86 | # way no critical debug feature will be enabled for perf and shipment |
| 87 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 88 | # config. |
| 89 | |
| 90 | ############ UAPI ############ |
| 91 | UAPI_DIR := uapi |
| 92 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 93 | |
| 94 | ############ COMMON ############ |
| 95 | COMMON_DIR := include |
| 96 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 97 | |
| 98 | ############ SoC Modules ############ |
| 99 | |
| 100 | # for pinctrl WCD driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 101 | ifdef CONFIG_PINCTRL_WCD |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 102 | PINCTRL_WCD_OBJS += pinctrl-wcd.o |
| 103 | endif |
| 104 | |
| 105 | # for pinctrl LPI driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 106 | ifdef CONFIG_PINCTRL_LPI |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 107 | PINCTRL_LPI_OBJS += pinctrl-lpi.o |
| 108 | endif |
| 109 | |
Soumya Managoli | 8d4f94c | 2020-07-01 17:05:03 +0530 | [diff] [blame] | 110 | # for pinctrl LPI legacy driver |
| 111 | ifdef CONFIG_PINCTRL_LPI_LEGACY |
| 112 | PINCTRL_LPI_OBJS += pinctrl-lpi-legacy.o |
| 113 | endif |
| 114 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 115 | # for soundwire driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 116 | ifdef CONFIG_SOUNDWIRE_WCD_CTRL |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 117 | SWR_CTRL_OBJS += swr-wcd-ctrl.o |
| 118 | endif |
| 119 | |
Ramprasad Katkam | e80ab29 | 2018-06-13 07:00:59 +0530 | [diff] [blame] | 120 | # for new soundwire driver |
| 121 | ifdef CONFIG_SOUNDWIRE_MSTR_CTRL |
| 122 | SWR_CTRL_OBJS += swr-mstr-ctrl.o |
| 123 | endif |
| 124 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 125 | ifdef CONFIG_SOUNDWIRE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 126 | SWR_OBJS += regmap-swr.o |
| 127 | SWR_OBJS += soundwire.o |
| 128 | endif |
| 129 | |
Banajit Goswami | 0618368 | 2018-07-31 00:31:14 -0700 | [diff] [blame] | 130 | ifdef CONFIG_SND_EVENT |
| 131 | SND_EVENT_OBJS += snd_event.o |
| 132 | endif |
| 133 | |
Bhalchandra Gajare | c77b19f | 2018-03-09 17:22:33 -0800 | [diff] [blame] | 134 | ifdef CONFIG_WCD_SPI_AC |
| 135 | WCD_SPI_ACC_CTL_OBJS += wcd-spi-ac.o |
| 136 | WCD_SPI_ACC_CTL_OBJS += wcd_spi_ctl_v01.o |
| 137 | endif |
| 138 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 139 | LINUX_INC += -Iinclude/linux |
| 140 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 141 | INCS += $(COMMON_INC) \ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 142 | $(UAPI_INC) |
| 143 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 144 | EXTRA_CFLAGS += $(INCS) |
| 145 | |
| 146 | |
| 147 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 148 | -DANI_LITTLE_BIT_ENDIAN \ |
| 149 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 150 | -DANI_COMPILER_TYPE_GCC \ |
| 151 | -DANI_OS_TYPE_ANDROID=6 \ |
| 152 | -DPTT_SOCK_SVC_ENABLE \ |
| 153 | -Wall\ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 154 | -D__linux__ |
| 155 | |
| 156 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 157 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 158 | ifeq ($(KERNEL_BUILD), 0) |
Meng Wang | e61ddb0 | 2018-03-07 11:18:35 +0800 | [diff] [blame] | 159 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 160 | endif |
| 161 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 162 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 163 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 164 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 165 | # will override the kernel settings. |
| 166 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 167 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 168 | endif |
| 169 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 170 | |
| 171 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 172 | EXTRA_CFLAGS += -Wheader-guard |
| 173 | endif |
| 174 | |
Vatsal Bucha | d4b85ec | 2018-08-23 12:50:46 +0530 | [diff] [blame] | 175 | ifeq ($(CONFIG_SND_SOC_GCOV), y) |
| 176 | GCOV_PROFILE := y |
| 177 | endif |
| 178 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 179 | # Module information used by KBuild framework |
| 180 | obj-$(CONFIG_PINCTRL_WCD) += pinctrl_wcd_dlkm.o |
| 181 | pinctrl_wcd_dlkm-y := $(PINCTRL_WCD_OBJS) |
| 182 | |
| 183 | obj-$(CONFIG_PINCTRL_LPI) += pinctrl_lpi_dlkm.o |
| 184 | pinctrl_lpi_dlkm-y := $(PINCTRL_LPI_OBJS) |
| 185 | |
Soumya Managoli | 8d4f94c | 2020-07-01 17:05:03 +0530 | [diff] [blame] | 186 | obj-$(CONFIG_PINCTRL_LPI_LEGACY) += pinctrl_lpi_dlkm.o |
| 187 | pinctrl_lpi_dlkm-y := $(PINCTRL_LPI_OBJS) |
| 188 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 189 | obj-$(CONFIG_SOUNDWIRE) += swr_dlkm.o |
| 190 | swr_dlkm-y := $(SWR_OBJS) |
| 191 | |
Banajit Goswami | 0618368 | 2018-07-31 00:31:14 -0700 | [diff] [blame] | 192 | obj-$(CONFIG_SND_EVENT) += snd_event_dlkm.o |
| 193 | snd_event_dlkm-y := $(SND_EVENT_OBJS) |
| 194 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 195 | obj-$(CONFIG_SOUNDWIRE_WCD_CTRL) += swr_ctrl_dlkm.o |
Laxminath Kasam | fbcaf32 | 2018-07-18 00:38:14 +0530 | [diff] [blame] | 196 | obj-$(CONFIG_SOUNDWIRE_MSTR_CTRL) += swr_ctrl_dlkm.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 197 | swr_ctrl_dlkm-y := $(SWR_CTRL_OBJS) |
| 198 | |
Bhalchandra Gajare | c77b19f | 2018-03-09 17:22:33 -0800 | [diff] [blame] | 199 | obj-$(CONFIG_WCD_SPI_AC) += wcd_spi_acc_ctl_dlkm.o |
| 200 | wcd_spi_acc_ctl_dlkm-y := $(WCD_SPI_ACC_CTL_OBJS) |