ASoC: allow drivers to compile both static and dynamic
Based on where the code is synced the driver should allow both static and dynamic linked compilation. Also remove __exit for modules loaded from another common init/exit functions. Change-Id: Ib58f152002aba3af4446f9bbd9b82c279212bd0a Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
此提交包含在:
@@ -1,22 +1,32 @@
|
||||
# We can build either as part of a standalone Kernel build or as
|
||||
# an external module. Determine which mechanism is being used
|
||||
KERNEL_BUILD := 0
|
||||
ifeq ($(MODNAME), )
|
||||
KERNEL_BUILD := 1
|
||||
else
|
||||
KERNEL_BUILD := 0
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(KERNEL_BUILD), 0)
|
||||
ifeq ($(KERNEL_BUILD), 1)
|
||||
# These are configurable via Kconfig for kernel-based builds
|
||||
# Need to explicitly configure for Android-based builds
|
||||
AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/kernel/msm-4.9
|
||||
AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio
|
||||
endif
|
||||
|
||||
ifeq ($(KERNEL_BUILD), 0)
|
||||
ifeq ($(CONFIG_ARCH_SDM845), y)
|
||||
include $(AUDIO_ROOT)/config/sdm845auto.conf
|
||||
export
|
||||
INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h
|
||||
|
||||
endif
|
||||
ifeq ($(CONFIG_ARCH_SDM670), y)
|
||||
include $(AUDIO_ROOT)/config/sdm670auto.conf
|
||||
export
|
||||
INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
# As per target team, build is done as follows:
|
||||
# Defconfig : build with default flags
|
||||
# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
|
||||
@@ -43,7 +53,7 @@ COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
|
||||
|
||||
############ Native Enc/Dec ############
|
||||
|
||||
ifeq ($(CONFIG_MSM_QDSP6V2_CODECS), m)
|
||||
ifdef CONFIG_MSM_QDSP6V2_CODECS
|
||||
NATIVE_OBJS += q6audio_v2.o q6audio_v2_aio.o
|
||||
NATIVE_OBJS += audio_utils_aio.o
|
||||
NATIVE_OBJS += audio_utils.o
|
||||
@@ -74,16 +84,9 @@ endif
|
||||
|
||||
LINUX_INC += -Iinclude/linux
|
||||
|
||||
INCS := $(COMMON_INC) \
|
||||
INCS += $(COMMON_INC) \
|
||||
$(UAPI_INC)
|
||||
|
||||
ifeq ($(CONFIG_ARCH_SDM845), y)
|
||||
INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h
|
||||
endif
|
||||
ifeq ($(CONFIG_ARCH_SDM670), y)
|
||||
INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h
|
||||
endif
|
||||
|
||||
EXTRA_CFLAGS += $(INCS)
|
||||
|
||||
|
||||
@@ -112,17 +115,9 @@ ifeq ($(call cc-option-yn, -Wheader-guard),y)
|
||||
EXTRA_CFLAGS += -Wheader-guard
|
||||
endif
|
||||
|
||||
ifeq ($(KERNEL_BUILD), 0)
|
||||
KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
|
||||
KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
|
||||
# If the module name is not "wlan", then the define MULTI_IF_NAME to be the
|
||||
# same a the QCA CHIP name. The host driver will then append MULTI_IF_NAME to
|
||||
# any string that must be unique for all instances of the driver on the system.
|
||||
# This allows multiple instances of the driver with different module names.
|
||||
# If the module name is wlan, leave MULTI_IF_NAME undefined and the code will
|
||||
# treat the driver as the primary driver.
|
||||
ifneq ($(MODNAME), qdsp6v2)
|
||||
CHIP_NAME ?= $(MODNAME)
|
||||
CDEFINES += -DMULTI_IF_NAME=\"$(CHIP_NAME)\"
|
||||
endif
|
||||
|
||||
# Module information used by KBuild framework
|
||||
|
@@ -1,5 +0,0 @@
|
||||
obj-$(CONFIG_MSM_QDSP6V2_CODECS) += aac_in.o qcelp_in.o evrc_in.o amrnb_in.o g711mlaw_in.o g711alaw_in.o audio_utils.o
|
||||
obj-$(CONFIG_MSM_QDSP6V2_CODECS) += audio_wma.o audio_wmapro.o audio_aac.o audio_multi_aac.o audio_alac.o audio_ape.o audio_utils_aio.o
|
||||
obj-$(CONFIG_MSM_QDSP6V2_CODECS) += q6audio_v2.o q6audio_v2_aio.o
|
||||
obj-$(CONFIG_MSM_QDSP6V2_CODECS) += audio_g711mlaw.o audio_g711alaw.o
|
||||
obj-$(CONFIG_MSM_QDSP6V2_CODECS) += audio_mp3.o audio_amrnb.o audio_amrwb.o audio_amrwbplus.o audio_evrc.o audio_qcelp.o amrwb_in.o audio_hwacc_effects.o
|
@@ -707,7 +707,7 @@ int __init aac_in_init(void)
|
||||
return misc_register(&audio_aac_in_misc);
|
||||
}
|
||||
|
||||
void __exit aac_in_exit(void)
|
||||
void aac_in_exit(void)
|
||||
{
|
||||
misc_deregister(&audio_aac_in_misc);
|
||||
}
|
||||
|
@@ -399,7 +399,7 @@ int __init amrnb_in_init(void)
|
||||
return misc_register(&audio_amrnb_in_misc);
|
||||
}
|
||||
|
||||
void __exit amrnb_in_exit(void)
|
||||
void amrnb_in_exit(void)
|
||||
{
|
||||
misc_deregister(&audio_amrnb_in_misc);
|
||||
}
|
||||
|
@@ -397,7 +397,7 @@ int __init amrwb_in_init(void)
|
||||
return misc_register(&audio_amrwb_in_misc);
|
||||
}
|
||||
|
||||
void __exit amrwb_in_exit(void)
|
||||
void amrwb_in_exit(void)
|
||||
{
|
||||
misc_deregister(&audio_amrwb_in_misc);
|
||||
}
|
||||
|
@@ -473,7 +473,7 @@ int __init audio_aac_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_aac_exit(void)
|
||||
void audio_aac_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_aac_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_aac_misc);
|
||||
|
@@ -432,7 +432,7 @@ int __init audio_alac_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_alac_exit(void)
|
||||
void audio_alac_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_alac_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_alac_misc);
|
||||
|
@@ -223,7 +223,7 @@ int __init audio_amrnb_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_amrnb_exit(void)
|
||||
void audio_amrnb_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_amrnb_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_amrnb_misc);
|
||||
|
@@ -228,7 +228,7 @@ int __init audio_amrwb_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_amrwb_exit(void)
|
||||
void audio_amrwb_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_amrwb_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_amrwb_misc);
|
||||
|
@@ -394,7 +394,7 @@ int __init audio_amrwbplus_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_amrwbplus_exit(void)
|
||||
void audio_amrwbplus_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_amrwbplus_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_amrwbplus_misc);
|
||||
|
@@ -356,7 +356,7 @@ int __init audio_ape_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_ape_exit(void)
|
||||
void audio_ape_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_ape_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_ape_misc);
|
||||
|
@@ -181,7 +181,7 @@ int __init audio_evrc_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_evrc_exit(void)
|
||||
void audio_evrc_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_evrc_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_evrc_misc);
|
||||
|
@@ -387,7 +387,7 @@ int __init audio_g711alaw_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_g711alaw_exit(void)
|
||||
void audio_g711alaw_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_g711_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_g711alaw_misc);
|
||||
|
@@ -386,7 +386,7 @@ int __init audio_g711mlaw_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_g711mlaw_exit(void)
|
||||
void audio_g711mlaw_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_g711_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_g711mlaw_misc);
|
||||
|
@@ -772,7 +772,7 @@ int __init audio_effects_init(void)
|
||||
return misc_register(&audio_effects_misc);
|
||||
}
|
||||
|
||||
void __exit audio_effects_exit(void)
|
||||
void audio_effects_exit(void)
|
||||
{
|
||||
misc_deregister(&audio_effects_misc);
|
||||
}
|
||||
|
@@ -185,7 +185,7 @@ int __init audio_mp3_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_mp3_exit(void)
|
||||
void audio_mp3_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_mp3_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_mp3_misc);
|
||||
|
@@ -520,7 +520,7 @@ int __init audio_multiaac_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_multiaac_exit(void)
|
||||
void audio_multiaac_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_multiaac_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_multiaac_misc);
|
||||
|
@@ -188,7 +188,7 @@ int audio_qcelp_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_qcelp_exit(void)
|
||||
void audio_qcelp_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_qcelp_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_qcelp_misc);
|
||||
|
@@ -342,7 +342,7 @@ int __init audio_wma_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_wma_exit(void)
|
||||
void audio_wma_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_wma_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_wma_misc);
|
||||
|
@@ -415,7 +415,7 @@ int __init audio_wmapro_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __exit audio_wmapro_exit(void)
|
||||
void audio_wmapro_exit(void)
|
||||
{
|
||||
mutex_destroy(&audio_wmapro_ws_mgr.ws_lock);
|
||||
misc_deregister(&audio_wmapro_misc);
|
||||
|
@@ -407,7 +407,7 @@ int __init evrc_in_init(void)
|
||||
return misc_register(&audio_evrc_in_misc);
|
||||
}
|
||||
|
||||
void __exit evrc_in_exit(void)
|
||||
void evrc_in_exit(void)
|
||||
{
|
||||
misc_deregister(&audio_evrc_in_misc);
|
||||
}
|
||||
|
@@ -379,7 +379,7 @@ int __init g711alaw_in_init(void)
|
||||
return misc_register(&audio_g711alaw_in_misc);
|
||||
}
|
||||
|
||||
void __exit g711alaw_in_exit(void)
|
||||
void g711alaw_in_exit(void)
|
||||
{
|
||||
misc_deregister(&audio_g711alaw_in_misc);
|
||||
}
|
||||
|
@@ -382,7 +382,7 @@ int __init g711mlaw_in_init(void)
|
||||
return misc_register(&audio_g711mlaw_in_misc);
|
||||
}
|
||||
|
||||
void __exit g711mlaw_in_exit(void)
|
||||
void g711mlaw_in_exit(void)
|
||||
{
|
||||
misc_deregister(&audio_g711mlaw_in_misc);
|
||||
}
|
||||
|
@@ -407,7 +407,7 @@ int __init qcelp_in_init(void)
|
||||
return misc_register(&audio_qcelp_in_misc);
|
||||
}
|
||||
|
||||
void __exit qcelp_in_exit(void)
|
||||
void qcelp_in_exit(void)
|
||||
{
|
||||
misc_deregister(&audio_qcelp_in_misc);
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者