Android.mk 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # Android makefile for audio kernel modules
  2. # Assume no targets will be supported
  3. # Check if this driver needs be built for current target
  4. ifeq ($(call is-board-platform-in-list,msmnile sdmshrike),true)
  5. ifeq ($(TARGET_BOARD_AUTO),true)
  6. AUDIO_SELECT := CONFIG_SND_SOC_SA8155=m
  7. else
  8. AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m
  9. endif
  10. endif
  11. ifeq ($(call is-board-platform,$(MSMSTEPPE)),true)
  12. ifeq ($(TARGET_BOARD_AUTO),true)
  13. AUDIO_SELECT := CONFIG_SND_SOC_SA6155=m
  14. else
  15. AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m
  16. endif
  17. endif
  18. ifeq ($(call is-board-platform,$(TRINKET)),true)
  19. AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m
  20. endif
  21. ifeq ($(call is-board-platform,kona),true)
  22. AUDIO_SELECT := CONFIG_SND_SOC_KONA=m
  23. endif
  24. ifeq ($(call is-board-platform,lito),true)
  25. AUDIO_SELECT := CONFIG_SND_SOC_LITO=m
  26. endif
  27. ifeq ($(call is-board-platform,bengal),true)
  28. AUDIO_SELECT := CONFIG_SND_SOC_BENGAL=m
  29. endif
  30. AUDIO_CHIPSET := audio
  31. # Build/Package only in case of supported target
  32. ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal sdmshrike),true)
  33. LOCAL_PATH := $(call my-dir)
  34. # This makefile is only for DLKM
  35. ifneq ($(findstring vendor,$(LOCAL_PATH)),)
  36. ifneq ($(findstring opensource,$(LOCAL_PATH)),)
  37. AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel
  38. endif # opensource
  39. DLKM_DIR := $(TOP)/device/qcom/common/dlkm
  40. # Build audio.ko as $(AUDIO_CHIPSET)_audio.ko
  41. ###########################################################
  42. # This is set once per LOCAL_PATH, not per (kernel) module
  43. KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR)
  44. # We are actually building audio.ko here, as per the
  45. # requirement we are specifying <chipset>_audio.ko as LOCAL_MODULE.
  46. # This means we need to rename the module to <chipset>_audio.ko
  47. # after audio.ko is built.
  48. KBUILD_OPTIONS += MODNAME=wcd_core_dlkm
  49. KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
  50. KBUILD_OPTIONS += $(AUDIO_SELECT)
  51. # Target specific build
  52. ###########################################################
  53. ifneq ($(TARGET_BOARD_AUTO),true)
  54. include $(CLEAR_VARS)
  55. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_core.ko
  56. LOCAL_MODULE_KBUILD_NAME := wcd_core_dlkm.ko
  57. LOCAL_MODULE_TAGS := optional
  58. LOCAL_MODULE_DEBUG_ENABLE := true
  59. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  60. include $(DLKM_DIR)/AndroidKernelModule.mk
  61. ###########################################################
  62. include $(CLEAR_VARS)
  63. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9xxx.ko
  64. LOCAL_MODULE_KBUILD_NAME := wcd9xxx_dlkm.ko
  65. LOCAL_MODULE_TAGS := optional
  66. LOCAL_MODULE_DEBUG_ENABLE := true
  67. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  68. include $(DLKM_DIR)/AndroidKernelModule.mk
  69. ###########################################################
  70. ifeq ($(call is-board-platform-in-list, ),true)
  71. include $(CLEAR_VARS)
  72. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_cpe.ko
  73. LOCAL_MODULE_KBUILD_NAME := wcd_cpe_dlkm.ko
  74. LOCAL_MODULE_TAGS := optional
  75. LOCAL_MODULE_DEBUG_ENABLE := true
  76. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  77. include $(DLKM_DIR)/AndroidKernelModule.mk
  78. endif
  79. ###########################################################
  80. ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) sdmshrike),true)
  81. include $(CLEAR_VARS)
  82. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_spi.ko
  83. LOCAL_MODULE_KBUILD_NAME := wcd_spi_dlkm.ko
  84. LOCAL_MODULE_TAGS := optional
  85. LOCAL_MODULE_DEBUG_ENABLE := true
  86. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  87. include $(DLKM_DIR)/AndroidKernelModule.mk
  88. endif
  89. ###########################################################
  90. ifeq ($(call is-board-platform-in-list, ),true)
  91. include $(CLEAR_VARS)
  92. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9335.ko
  93. LOCAL_MODULE_KBUILD_NAME := wcd9335_dlkm.ko
  94. LOCAL_MODULE_TAGS := optional
  95. LOCAL_MODULE_DEBUG_ENABLE := true
  96. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  97. include $(DLKM_DIR)/AndroidKernelModule.mk
  98. endif
  99. ###########################################################
  100. ifneq ($(TARGET_PRODUCT), $(filter $(TARGET_PRODUCT), bengal))
  101. include $(CLEAR_VARS)
  102. LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa881x.ko
  103. LOCAL_MODULE_KBUILD_NAME := wsa881x_dlkm.ko
  104. LOCAL_MODULE_TAGS := optional
  105. LOCAL_MODULE_DEBUG_ENABLE := true
  106. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  107. include $(DLKM_DIR)/AndroidKernelModule.mk
  108. endif
  109. ###########################################################
  110. ifeq ($(call is-board-platform-in-list, bengal),true)
  111. include $(CLEAR_VARS)
  112. LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa881x_analog.ko
  113. LOCAL_MODULE_KBUILD_NAME := wsa881x_analog_dlkm.ko
  114. LOCAL_MODULE_TAGS := optional
  115. LOCAL_MODULE_DEBUG_ENABLE := true
  116. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  117. include $(DLKM_DIR)/AndroidKernelModule.mk
  118. endif
  119. ###########################################################
  120. include $(CLEAR_VARS)
  121. LOCAL_MODULE := $(AUDIO_CHIPSET)_mbhc.ko
  122. LOCAL_MODULE_KBUILD_NAME := mbhc_dlkm.ko
  123. LOCAL_MODULE_TAGS := optional
  124. LOCAL_MODULE_DEBUG_ENABLE := true
  125. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  126. include $(DLKM_DIR)/AndroidKernelModule.mk
  127. endif # target specific build
  128. ###########################################################
  129. include $(CLEAR_VARS)
  130. LOCAL_MODULE := $(AUDIO_CHIPSET)_stub.ko
  131. LOCAL_MODULE_KBUILD_NAME := stub_dlkm.ko
  132. LOCAL_MODULE_TAGS := optional
  133. LOCAL_MODULE_DEBUG_ENABLE := true
  134. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  135. include $(DLKM_DIR)/AndroidKernelModule.mk
  136. ###########################################################
  137. ifneq ($(TARGET_PRODUCT), $(filter $(TARGET_PRODUCT), bengal))
  138. include $(CLEAR_VARS)
  139. LOCAL_MODULE := $(AUDIO_CHIPSET)_hdmi.ko
  140. LOCAL_MODULE_KBUILD_NAME := hdmi_dlkm.ko
  141. LOCAL_MODULE_TAGS := optional
  142. LOCAL_MODULE_DEBUG_ENABLE := true
  143. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  144. include $(DLKM_DIR)/AndroidKernelModule.mk
  145. endif
  146. ###########################################################
  147. endif # DLKM check
  148. endif # supported target check