Android.mk 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m
  6. endif
  7. ifeq ($(call is-board-platform,$(MSMSTEPPE)),true)
  8. AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m
  9. endif
  10. ifeq ($(call is-board-platform,$(TRINKET)),true)
  11. AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m
  12. endif
  13. ifeq ($(call is-board-platform,kona),true)
  14. AUDIO_SELECT := CONFIG_SND_SOC_KONA=m
  15. endif
  16. ifeq ($(call is-board-platform,lito),true)
  17. AUDIO_SELECT := CONFIG_SND_SOC_LITO=m
  18. endif
  19. AUDIO_CHIPSET := audio
  20. # Build/Package only in case of supported target
  21. ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona lito),true)
  22. LOCAL_PATH := $(call my-dir)
  23. # This makefile is only for DLKM
  24. ifneq ($(findstring vendor,$(LOCAL_PATH)),)
  25. ifneq ($(findstring opensource,$(LOCAL_PATH)),)
  26. AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel
  27. endif # opensource
  28. DLKM_DIR := $(TOP)/device/qcom/common/dlkm
  29. # Build audio.ko as $(AUDIO_CHIPSET)_audio.ko
  30. ###########################################################
  31. # This is set once per LOCAL_PATH, not per (kernel) module
  32. KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR)
  33. # We are actually building audio.ko here, as per the
  34. # requirement we are specifying <chipset>_audio.ko as LOCAL_MODULE.
  35. # This means we need to rename the module to <chipset>_audio.ko
  36. # after audio.ko is built.
  37. KBUILD_OPTIONS += MODNAME=wcd_core_dlkm
  38. KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
  39. KBUILD_OPTIONS += $(AUDIO_SELECT)
  40. ###########################################################
  41. include $(CLEAR_VARS)
  42. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_core.ko
  43. LOCAL_MODULE_KBUILD_NAME := wcd_core_dlkm.ko
  44. LOCAL_MODULE_TAGS := optional
  45. LOCAL_MODULE_DEBUG_ENABLE := true
  46. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  47. include $(DLKM_DIR)/AndroidKernelModule.mk
  48. ###########################################################
  49. include $(CLEAR_VARS)
  50. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9xxx.ko
  51. LOCAL_MODULE_KBUILD_NAME := wcd9xxx_dlkm.ko
  52. LOCAL_MODULE_TAGS := optional
  53. LOCAL_MODULE_DEBUG_ENABLE := true
  54. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  55. include $(DLKM_DIR)/AndroidKernelModule.mk
  56. ###########################################################
  57. ifeq ($(call is-board-platform-in-list, ),true)
  58. include $(CLEAR_VARS)
  59. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_cpe.ko
  60. LOCAL_MODULE_KBUILD_NAME := wcd_cpe_dlkm.ko
  61. LOCAL_MODULE_TAGS := optional
  62. LOCAL_MODULE_DEBUG_ENABLE := true
  63. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  64. include $(DLKM_DIR)/AndroidKernelModule.mk
  65. endif
  66. ###########################################################
  67. ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true)
  68. include $(CLEAR_VARS)
  69. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_spi.ko
  70. LOCAL_MODULE_KBUILD_NAME := wcd_spi_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, ),true)
  78. include $(CLEAR_VARS)
  79. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9335.ko
  80. LOCAL_MODULE_KBUILD_NAME := wcd9335_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. include $(CLEAR_VARS)
  88. LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa881x.ko
  89. LOCAL_MODULE_KBUILD_NAME := wsa881x_dlkm.ko
  90. LOCAL_MODULE_TAGS := optional
  91. LOCAL_MODULE_DEBUG_ENABLE := true
  92. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  93. include $(DLKM_DIR)/AndroidKernelModule.mk
  94. ###########################################################
  95. include $(CLEAR_VARS)
  96. LOCAL_MODULE := $(AUDIO_CHIPSET)_stub.ko
  97. LOCAL_MODULE_KBUILD_NAME := stub_dlkm.ko
  98. LOCAL_MODULE_TAGS := optional
  99. LOCAL_MODULE_DEBUG_ENABLE := true
  100. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  101. include $(DLKM_DIR)/AndroidKernelModule.mk
  102. ###########################################################
  103. include $(CLEAR_VARS)
  104. LOCAL_MODULE := $(AUDIO_CHIPSET)_mbhc.ko
  105. LOCAL_MODULE_KBUILD_NAME := mbhc_dlkm.ko
  106. LOCAL_MODULE_TAGS := optional
  107. LOCAL_MODULE_DEBUG_ENABLE := true
  108. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  109. include $(DLKM_DIR)/AndroidKernelModule.mk
  110. ###########################################################
  111. include $(CLEAR_VARS)
  112. LOCAL_MODULE := $(AUDIO_CHIPSET)_hdmi.ko
  113. LOCAL_MODULE_KBUILD_NAME := hdmi_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. ###########################################################
  119. endif # DLKM check
  120. endif # supported target check