ASoC: config: add config to compile audio drivers for kona

Add config to compile audio drivers for kona.

Change-Id: I3367a68d0109c80de8525fd74ebaef2959684865
Signed-off-by: Meng Wang <mengw@codeaurora.org>
diff --git a/asoc/Android.mk b/asoc/Android.mk
index 7937120..db01167 100644
--- a/asoc/Android.mk
+++ b/asoc/Android.mk
@@ -18,9 +18,14 @@
 AUDIO_SELECT  := CONFIG_SND_SOC_SM6150=m
 endif
 
+ifeq ($(call is-board-platform,kona),true)
+TARGET := kona
+AUDIO_SELECT  := CONFIG_SND_SOC_KONA=m
+endif
+
 AUDIO_CHIPSET := audio
 # Build/Package only in case of supported target
-ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true)
+ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona),true)
 
 LOCAL_PATH := $(call my-dir)
 
diff --git a/asoc/Kbuild b/asoc/Kbuild
index ee290b2..945d554 100644
--- a/asoc/Kbuild
+++ b/asoc/Kbuild
@@ -29,6 +29,11 @@
 		export
 		INCS    +=  -include $(AUDIO_ROOT)/config/sm6150autoconf.h
 	endif
+	ifeq ($(CONFIG_ARCH_KONA), y)
+		include $(AUDIO_ROOT)/config/konaauto.conf
+		export
+		INCS    +=  -include $(AUDIO_ROOT)/config/konaautoconf.h
+	endif
 	ifeq ($(CONFIG_ARCH_SDMSHRIKE), y)
 		include $(AUDIO_ROOT)/config/sm8150auto.conf
 		export
@@ -99,7 +104,6 @@
 	PLATFORM_OBJS += msm-dai-fe.o
 	PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o
 	PLATFORM_OBJS += msm-dai-q6-v2.o
-	PLATFORM_OBJS += msm-dai-slim.o
 	PLATFORM_OBJS += msm-dai-stub-v2.o
 	PLATFORM_OBJS += msm-lsm-client.o
 	PLATFORM_OBJS += msm-pcm-afe-v2.o
@@ -115,6 +119,9 @@
 	PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o
 	PLATFORM_OBJS += platform_init.o
 endif
+ifdef CONFIG_WCD9XXX_CODEC_CORE
+	PLATFORM_OBJS += msm-dai-slim.o
+endif
 ifdef CONFIG_DOLBY_DS2
 	PLATFORM_OBJS += msm-ds2-dap-config.o
 endif
diff --git a/asoc/codecs/Android.mk b/asoc/codecs/Android.mk
index 8eb61c1..b73b983 100644
--- a/asoc/codecs/Android.mk
+++ b/asoc/codecs/Android.mk
@@ -15,9 +15,13 @@
 AUDIO_SELECT  := CONFIG_SND_SOC_SM6150=m
 endif
 
+ifeq ($(call is-board-platform,kona),true)
+AUDIO_SELECT  := CONFIG_SND_SOC_KONA=m
+endif
+
 AUDIO_CHIPSET := audio
 # Build/Package only in case of supported target
-ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true)
+ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona),true)
 
 LOCAL_PATH := $(call my-dir)
 
@@ -70,6 +74,7 @@
 include $(DLKM_DIR)/AndroidKernelModule.mk
 endif
 ###########################################################
+ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true)
 include $(CLEAR_VARS)
 LOCAL_MODULE              := $(AUDIO_CHIPSET)_wcd_spi.ko
 LOCAL_MODULE_KBUILD_NAME  := wcd_spi_dlkm.ko
@@ -77,6 +82,7 @@
 LOCAL_MODULE_DEBUG_ENABLE := true
 LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
 include $(DLKM_DIR)/AndroidKernelModule.mk
+endif
 ###########################################################
 ifeq ($(call is-board-platform-in-list, ),true)
 include $(CLEAR_VARS)
diff --git a/asoc/codecs/Kbuild b/asoc/codecs/Kbuild
index ee4c61f..a4cbc45 100644
--- a/asoc/codecs/Kbuild
+++ b/asoc/codecs/Kbuild
@@ -29,6 +29,11 @@
 		export
 		INCS    +=  -include $(AUDIO_ROOT)/config/sm6150autoconf.h
 	endif
+	ifeq ($(CONFIG_ARCH_KONA), y)
+		include $(AUDIO_ROOT)/config/konaauto.conf
+		export
+		INCS    +=  -include $(AUDIO_ROOT)/config/konaautoconf.h
+	endif
 	ifeq ($(CONFIG_ARCH_SDMSHRIKE), y)
 		include $(AUDIO_ROOT)/config/sm8150auto.conf
 		export
@@ -81,10 +86,18 @@
 	CORE_OBJS += wcd934x/wcd934x-tables.o
 endif
 
+ifdef CONFIG_WCD9XXX_CODEC_CORE_V2
+	CORE_OBJS += msm-cdc-pinctrl.o
+	CORE_OBJS += msm-cdc-supply.o
+endif
+
 ifdef CONFIG_SND_SOC_WCD9XXX_V2
-	WCD9XXX_OBJS += wcd-clsh.o
+ifdef CONFIG_WCD9XXX_CODEC_CORE
 	WCD9XXX_OBJS += wcd9xxx-common-v2.o
 	WCD9XXX_OBJS += wcd9xxx-resmgr-v2.o
+else
+	WCD9XXX_OBJS += wcd-clsh.o
+endif
 	WCD9XXX_OBJS += wcdcal-hwdep.o
 	WCD9XXX_OBJS += wcd9xxx-soc-init.o
 	WCD9XXX_OBJS += wcd-dsp-utils.o
@@ -181,6 +194,7 @@
 endif
 # Module information used by KBuild framework
 obj-$(CONFIG_WCD9XXX_CODEC_CORE) += wcd_core_dlkm.o
+obj-$(CONFIG_WCD9XXX_CODEC_CORE_V2) += wcd_core_dlkm.o
 wcd_core_dlkm-y := $(CORE_OBJS)
 
 obj-$(CONFIG_SND_SOC_WCD9XXX_V2) += wcd9xxx_dlkm.o
diff --git a/asoc/codecs/bolero/Android.mk b/asoc/codecs/bolero/Android.mk
index e858207..d96d616 100644
--- a/asoc/codecs/bolero/Android.mk
+++ b/asoc/codecs/bolero/Android.mk
@@ -7,9 +7,13 @@
 AUDIO_SELECT  := CONFIG_SND_SOC_SM6150=m
 endif
 
+ifeq ($(call is-board-platform,kona),true)
+AUDIO_SELECT  := CONFIG_SND_SOC_KONA=m
+endif
+
 AUDIO_CHIPSET := audio
 # Build/Package only in case of supported target
-ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) $(TRINKET)),true)
+ifeq ($(call is-board-platform-in-list,$(MSMSTEPPE) $(TRINKET) kona),true)
 
 LOCAL_PATH := $(call my-dir)
 
@@ -17,7 +21,7 @@
 ifneq ($(findstring vendor,$(LOCAL_PATH)),)
 
 ifneq ($(findstring opensource,$(LOCAL_PATH)),)
-	AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/audio-kernel
+	AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel
 endif # opensource
 
 DLKM_DIR := $(TOP)/device/qcom/common/dlkm
diff --git a/asoc/codecs/bolero/Kbuild b/asoc/codecs/bolero/Kbuild
index 1c60ec6..f01f523 100644
--- a/asoc/codecs/bolero/Kbuild
+++ b/asoc/codecs/bolero/Kbuild
@@ -26,6 +26,11 @@
 		export
 		INCS    +=  -include $(AUDIO_ROOT)/config/sm6150autoconf.h
 	endif
+	ifeq ($(CONFIG_ARCH_KONA), y)
+		include $(AUDIO_ROOT)/config/konaauto.conf
+		export
+		INCS    +=  -include $(AUDIO_ROOT)/config/konaautoconf.h
+	endif
 	ifeq ($(CONFIG_ARCH_QCS405), y)
 		include $(AUDIO_ROOT)/config/qcs405auto.conf
 		export
diff --git a/asoc/codecs/ep92/Android.mk b/asoc/codecs/ep92/Android.mk
index c2ac059..e50f8eb 100644
--- a/asoc/codecs/ep92/Android.mk
+++ b/asoc/codecs/ep92/Android.mk
@@ -17,7 +17,7 @@
 ifneq ($(findstring vendor,$(LOCAL_PATH)),)
 
 ifneq ($(findstring opensource,$(LOCAL_PATH)),)
-	AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/audio-kernel
+	AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel
 endif # opensource
 
 DLKM_DIR := $(TOP)/device/qcom/common/dlkm
diff --git a/asoc/codecs/ep92/Kbuild b/asoc/codecs/ep92/Kbuild
index 1b38aad..fc46a72 100644
--- a/asoc/codecs/ep92/Kbuild
+++ b/asoc/codecs/ep92/Kbuild
@@ -11,7 +11,7 @@
 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.19
+	AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19
 	AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio
 endif
 
diff --git a/asoc/codecs/wcd937x/Android.mk b/asoc/codecs/wcd937x/Android.mk
index 95d8058..cbd0877 100644
--- a/asoc/codecs/wcd937x/Android.mk
+++ b/asoc/codecs/wcd937x/Android.mk
@@ -17,7 +17,7 @@
 ifneq ($(findstring vendor,$(LOCAL_PATH)),)
 
 ifneq ($(findstring opensource,$(LOCAL_PATH)),)
-	AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/audio-kernel
+	AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel
 endif # opensource
 
 DLKM_DIR := $(TOP)/device/qcom/common/dlkm
diff --git a/asoc/platform_init.h b/asoc/platform_init.h
index 17f0784..caa5404 100644
--- a/asoc/platform_init.h
+++ b/asoc/platform_init.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
  */
 
 #ifndef __PLATFORM_INIT_H__
@@ -9,7 +9,6 @@
 int msm_fe_dai_init(void);
 int msm_dai_q6_hdmi_init(void);
 int msm_dai_q6_init(void);
-int msm_dai_slim_init(void);
 int msm_dai_stub_init(void);
 int msm_lsm_client_init(void);
 int msm_pcm_afe_init(void);
@@ -39,11 +38,22 @@
 void msm_pcm_afe_exit(void);
 void msm_lsm_client_exit(void);
 void msm_dai_stub_exit(void);
-void msm_dai_slim_exit(void);
 void msm_dai_q6_exit(void);
 void msm_dai_q6_hdmi_exit(void);
 void msm_fe_dai_exit(void);
 void msm_compress_dsp_exit(void);
 
+#if IS_ENABLED(CONFIG_WCD9XXX_CODEC_CORE)
+int msm_dai_slim_init(void);
+void msm_dai_slim_exit(void);
+#else
+static inline int msm_dai_slim_init(void)
+{
+	return 0;
+};
+static inline void msm_dai_slim_exit(void)
+{
+};
+#endif
 #endif