Android.mk 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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,msmnile),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. AUDIO_CHIPSET := audio
  28. # Build/Package only in case of supported target
  29. ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito bengal),true)
  30. LOCAL_PATH := $(call my-dir)
  31. # This makefile is only for DLKM
  32. ifneq ($(findstring vendor,$(LOCAL_PATH)),)
  33. ifneq ($(findstring opensource,$(LOCAL_PATH)),)
  34. AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel
  35. endif # opensource
  36. DLKM_DIR := $(TOP)/device/qcom/common/dlkm
  37. # Build audio.ko as $(AUDIO_CHIPSET)_audio.ko
  38. ###########################################################
  39. # This is set once per LOCAL_PATH, not per (kernel) module
  40. KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR)
  41. # We are actually building audio.ko here, as per the
  42. # requirement we are specifying <chipset>_audio.ko as LOCAL_MODULE.
  43. # This means we need to rename the module to <chipset>_audio.ko
  44. # after audio.ko is built.
  45. KBUILD_OPTIONS += MODNAME=wcd_core_dlkm
  46. KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
  47. KBUILD_OPTIONS += $(AUDIO_SELECT)
  48. # Target specific build
  49. ###########################################################
  50. ifneq ($(TARGET_BOARD_AUTO),true)
  51. include $(CLEAR_VARS)
  52. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_core.ko
  53. LOCAL_MODULE_KBUILD_NAME := wcd_core_dlkm.ko
  54. LOCAL_MODULE_TAGS := optional
  55. LOCAL_MODULE_DEBUG_ENABLE := true
  56. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  57. include $(DLKM_DIR)/AndroidKernelModule.mk
  58. ###########################################################
  59. include $(CLEAR_VARS)
  60. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9xxx.ko
  61. LOCAL_MODULE_KBUILD_NAME := wcd9xxx_dlkm.ko
  62. LOCAL_MODULE_TAGS := optional
  63. LOCAL_MODULE_DEBUG_ENABLE := true
  64. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  65. include $(DLKM_DIR)/AndroidKernelModule.mk
  66. ###########################################################
  67. ifeq ($(call is-board-platform-in-list, ),true)
  68. include $(CLEAR_VARS)
  69. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_cpe.ko
  70. LOCAL_MODULE_KBUILD_NAME := wcd_cpe_dlkm.ko
  71. LOCAL_MODULE_TAGS := optional
  72. LOCAL_MODULE_DEBUG_ENABLE := true
  73. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  74. include $(DLKM_DIR)/AndroidKernelModule.mk
  75. endif
  76. ###########################################################
  77. ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true)
  78. include $(CLEAR_VARS)
  79. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_spi.ko
  80. LOCAL_MODULE_KBUILD_NAME := wcd_spi_dlkm.ko
  81. LOCAL_MODULE_TAGS := optional
  82. LOCAL_MODULE_DEBUG_ENABLE := true
  83. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  84. include $(DLKM_DIR)/AndroidKernelModule.mk
  85. endif
  86. ###########################################################
  87. ifeq ($(call is-board-platform-in-list, ),true)
  88. include $(CLEAR_VARS)
  89. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9335.ko
  90. LOCAL_MODULE_KBUILD_NAME := wcd9335_dlkm.ko
  91. LOCAL_MODULE_TAGS := optional
  92. LOCAL_MODULE_DEBUG_ENABLE := true
  93. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  94. include $(DLKM_DIR)/AndroidKernelModule.mk
  95. endif
  96. ###########################################################
  97. include $(CLEAR_VARS)
  98. LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa881x.ko
  99. LOCAL_MODULE_KBUILD_NAME := wsa881x_dlkm.ko
  100. LOCAL_MODULE_TAGS := optional
  101. LOCAL_MODULE_DEBUG_ENABLE := true
  102. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  103. include $(DLKM_DIR)/AndroidKernelModule.mk
  104. ###########################################################
  105. include $(CLEAR_VARS)
  106. LOCAL_MODULE := $(AUDIO_CHIPSET)_mbhc.ko
  107. LOCAL_MODULE_KBUILD_NAME := mbhc_dlkm.ko
  108. LOCAL_MODULE_TAGS := optional
  109. LOCAL_MODULE_DEBUG_ENABLE := true
  110. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  111. include $(DLKM_DIR)/AndroidKernelModule.mk
  112. endif # target specific build
  113. ###########################################################
  114. include $(CLEAR_VARS)
  115. LOCAL_MODULE := $(AUDIO_CHIPSET)_stub.ko
  116. LOCAL_MODULE_KBUILD_NAME := stub_dlkm.ko
  117. LOCAL_MODULE_TAGS := optional
  118. LOCAL_MODULE_DEBUG_ENABLE := true
  119. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  120. include $(DLKM_DIR)/AndroidKernelModule.mk
  121. ###########################################################
  122. include $(CLEAR_VARS)
  123. LOCAL_MODULE := $(AUDIO_CHIPSET)_hdmi.ko
  124. LOCAL_MODULE_KBUILD_NAME := hdmi_dlkm.ko
  125. LOCAL_MODULE_TAGS := optional
  126. LOCAL_MODULE_DEBUG_ENABLE := true
  127. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  128. include $(DLKM_DIR)/AndroidKernelModule.mk
  129. ###########################################################
  130. endif # DLKM check
  131. endif # supported target check