Android.mk 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. AUDIO_CHIPSET := audio
  17. # Build/Package only in case of supported target
  18. ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona),true)
  19. LOCAL_PATH := $(call my-dir)
  20. # This makefile is only for DLKM
  21. ifneq ($(findstring vendor,$(LOCAL_PATH)),)
  22. ifneq ($(findstring opensource,$(LOCAL_PATH)),)
  23. AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel
  24. endif # opensource
  25. DLKM_DIR := $(TOP)/device/qcom/common/dlkm
  26. # Build audio.ko as $(AUDIO_CHIPSET)_audio.ko
  27. ###########################################################
  28. # This is set once per LOCAL_PATH, not per (kernel) module
  29. KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR)
  30. # We are actually building audio.ko here, as per the
  31. # requirement we are specifying <chipset>_audio.ko as LOCAL_MODULE.
  32. # This means we need to rename the module to <chipset>_audio.ko
  33. # after audio.ko is built.
  34. KBUILD_OPTIONS += MODNAME=wcd_core_dlkm
  35. KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
  36. KBUILD_OPTIONS += $(AUDIO_SELECT)
  37. ###########################################################
  38. include $(CLEAR_VARS)
  39. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_core.ko
  40. LOCAL_MODULE_KBUILD_NAME := wcd_core_dlkm.ko
  41. LOCAL_MODULE_TAGS := optional
  42. LOCAL_MODULE_DEBUG_ENABLE := true
  43. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  44. include $(DLKM_DIR)/AndroidKernelModule.mk
  45. ###########################################################
  46. include $(CLEAR_VARS)
  47. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9xxx.ko
  48. LOCAL_MODULE_KBUILD_NAME := wcd9xxx_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. ifeq ($(call is-board-platform-in-list, ),true)
  55. include $(CLEAR_VARS)
  56. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_cpe.ko
  57. LOCAL_MODULE_KBUILD_NAME := wcd_cpe_dlkm.ko
  58. LOCAL_MODULE_TAGS := optional
  59. LOCAL_MODULE_DEBUG_ENABLE := true
  60. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  61. include $(DLKM_DIR)/AndroidKernelModule.mk
  62. endif
  63. ###########################################################
  64. ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true)
  65. include $(CLEAR_VARS)
  66. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd_spi.ko
  67. LOCAL_MODULE_KBUILD_NAME := wcd_spi_dlkm.ko
  68. LOCAL_MODULE_TAGS := optional
  69. LOCAL_MODULE_DEBUG_ENABLE := true
  70. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  71. include $(DLKM_DIR)/AndroidKernelModule.mk
  72. endif
  73. ###########################################################
  74. ifeq ($(call is-board-platform-in-list, ),true)
  75. include $(CLEAR_VARS)
  76. LOCAL_MODULE := $(AUDIO_CHIPSET)_wcd9335.ko
  77. LOCAL_MODULE_KBUILD_NAME := wcd9335_dlkm.ko
  78. LOCAL_MODULE_TAGS := optional
  79. LOCAL_MODULE_DEBUG_ENABLE := true
  80. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  81. include $(DLKM_DIR)/AndroidKernelModule.mk
  82. endif
  83. ###########################################################
  84. include $(CLEAR_VARS)
  85. LOCAL_MODULE := $(AUDIO_CHIPSET)_wsa881x.ko
  86. LOCAL_MODULE_KBUILD_NAME := wsa881x_dlkm.ko
  87. LOCAL_MODULE_TAGS := optional
  88. LOCAL_MODULE_DEBUG_ENABLE := true
  89. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  90. include $(DLKM_DIR)/AndroidKernelModule.mk
  91. ###########################################################
  92. include $(CLEAR_VARS)
  93. LOCAL_MODULE := $(AUDIO_CHIPSET)_stub.ko
  94. LOCAL_MODULE_KBUILD_NAME := stub_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. ###########################################################
  108. include $(CLEAR_VARS)
  109. LOCAL_MODULE := $(AUDIO_CHIPSET)_hdmi.ko
  110. LOCAL_MODULE_KBUILD_NAME := hdmi_dlkm.ko
  111. LOCAL_MODULE_TAGS := optional
  112. LOCAL_MODULE_DEBUG_ENABLE := true
  113. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  114. include $(DLKM_DIR)/AndroidKernelModule.mk
  115. ###########################################################
  116. endif # DLKM check
  117. endif # supported target check