Android.mk 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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,sdm845),true)
  5. AUDIO_SELECT := CONFIG_SND_SOC_SDM845=m
  6. endif
  7. ifeq ($(call is-board-platform-in-list,msm8953 sdm670 qcs605),true)
  8. AUDIO_SELECT := CONFIG_SND_SOC_SDM670=m
  9. endif
  10. ifeq ($(call is-board-platform,msmnile),true)
  11. AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m
  12. endif
  13. ifeq ($(call is-board-platform,$(MSMSTEPPE)),true)
  14. AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m
  15. endif
  16. AUDIO_CHIPSET := audio
  17. # Build/Package only in case of supported target
  18. ifeq ($(call is-board-platform-in-list,msm8953 sdm845 sdm670 qcs605 msmnile $(MSMSTEPPE)),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 := $(ANDROID_BUILD_TOP)/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=soc_dlkm
  35. KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
  36. KBUILD_OPTIONS += $(AUDIO_SELECT)
  37. ###########################################################
  38. ifeq ($(call is-board-platform-in-list,msm8953 sdm670 qcs605 $(MSMSTEPPE)),true)
  39. include $(CLEAR_VARS)
  40. LOCAL_MODULE := $(AUDIO_CHIPSET)_pinctrl_lpi.ko
  41. LOCAL_MODULE_KBUILD_NAME := pinctrl_lpi_dlkm.ko
  42. LOCAL_MODULE_TAGS := optional
  43. LOCAL_MODULE_DEBUG_ENABLE := true
  44. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  45. include $(DLKM_DIR)/AndroidKernelModule.mk
  46. endif
  47. ###########################################################
  48. include $(CLEAR_VARS)
  49. LOCAL_MODULE := $(AUDIO_CHIPSET)_pinctrl_wcd.ko
  50. LOCAL_MODULE_KBUILD_NAME := pinctrl_wcd_dlkm.ko
  51. LOCAL_MODULE_TAGS := optional
  52. LOCAL_MODULE_DEBUG_ENABLE := true
  53. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  54. include $(DLKM_DIR)/AndroidKernelModule.mk
  55. ###########################################################
  56. include $(CLEAR_VARS)
  57. LOCAL_MODULE := $(AUDIO_CHIPSET)_swr.ko
  58. LOCAL_MODULE_KBUILD_NAME := swr_dlkm.ko
  59. LOCAL_MODULE_TAGS := optional
  60. LOCAL_MODULE_DEBUG_ENABLE := true
  61. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  62. include $(DLKM_DIR)/AndroidKernelModule.mk
  63. ###########################################################
  64. include $(CLEAR_VARS)
  65. LOCAL_MODULE := $(AUDIO_CHIPSET)_swr_ctrl.ko
  66. LOCAL_MODULE_KBUILD_NAME := swr_ctrl_dlkm.ko
  67. LOCAL_MODULE_TAGS := optional
  68. LOCAL_MODULE_DEBUG_ENABLE := true
  69. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  70. include $(DLKM_DIR)/AndroidKernelModule.mk
  71. ###########################################################
  72. ifeq ($(call is-board-platform-in-list, ),true)
  73. include $(CLEAR_VARS)
  74. LOCAL_MODULE := $(AUDIO_CHIPSET)_snd_event.ko
  75. LOCAL_MODULE_KBUILD_NAME := snd_event_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. endif # DLKM check
  83. endif # supported target check