Android.mk 5.1 KB

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