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/Android.mk b/Android.mk
index 76813c1..c10d1ca 100644
--- a/Android.mk
+++ b/Android.mk
@@ -3,7 +3,7 @@
 
 UAPI_OUT := $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/include
 
-ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true)
+ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET) kona),true)
 $(shell mkdir -p $(UAPI_OUT)/linux;)
 $(shell mkdir -p $(UAPI_OUT)/sound;)
 $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers)
@@ -12,7 +12,6 @@
 $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers)
 $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers)
 $(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers)
-$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers)
 
 include $(MY_LOCAL_PATH)/include/uapi/Android.mk
 include $(MY_LOCAL_PATH)/ipc/Android.mk
@@ -21,6 +20,10 @@
 include $(MY_LOCAL_PATH)/soc/Android.mk
 include $(MY_LOCAL_PATH)/asoc/Android.mk
 include $(MY_LOCAL_PATH)/asoc/codecs/Android.mk
+endif
+
+ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true)
+$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers)
 include $(MY_LOCAL_PATH)/asoc/codecs/wcd934x/Android.mk
 endif
 
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
 
diff --git a/config/konaauto.conf b/config/konaauto.conf
new file mode 100644
index 0000000..328b67f
--- /dev/null
+++ b/config/konaauto.conf
@@ -0,0 +1,36 @@
+CONFIG_PINCTRL_WCD=m
+CONFIG_AUDIO_EXT_CLK=m
+CONFIG_SND_SOC_WCD9XXX_V2=m
+CONFIG_SND_SOC_WCD_MBHC=m
+CONFIG_SND_SOC_WSA881X=m
+CONFIG_WCD9XXX_CODEC_CORE_V2=m
+CONFIG_MSM_CDC_PINCTRL=m
+CONFIG_MSM_QDSP6V2_CODECS=m
+CONFIG_MSM_ULTRASOUND=m
+CONFIG_MSM_QDSP6_APRV2_RPMSG=m
+CONFIG_MSM_ADSP_LOADER=m
+CONFIG_REGMAP_SWR=m
+CONFIG_MSM_QDSP6_SSR=m
+CONFIG_MSM_QDSP6_PDR=m
+CONFIG_MSM_QDSP6_NOTIFIER=m
+CONFIG_SND_SOC_MSM_HOSTLESS_PCM=m
+CONFIG_SND_SOC_MSM_QDSP6V2_INTF=m
+CONFIG_SOUNDWIRE=m
+CONFIG_SOUNDWIRE_MSTR_CTRL=m
+CONFIG_SND_SOC_QDSP6V2=m
+CONFIG_SND_SOC_WCD_MBHC_ADC=m
+CONFIG_SND_SOC_MSM_HDMI_CODEC_RX=m
+CONFIG_QTI_PP=m
+CONFIG_SND_HWDEP_ROUTING=m
+CONFIG_SND_SOC_MSM_STUB=m
+CONFIG_MSM_AVTIMER=m
+CONFIG_SND_SOC_BOLERO=m
+CONFIG_WSA_MACRO=m
+CONFIG_VA_MACRO=m
+CONFIG_RX_MACRO=m
+CONFIG_TX_MACRO=m
+CONFIG_SND_SOC_WCD_IRQ=m
+CONFIG_SND_SOC_WCD938X=m
+CONFIG_SND_SOC_WCD938X_SLAVE=m
+CONFIG_SND_SOC_KONA=m
+CONFIG_SND_EVENT=m
diff --git a/config/konaautoconf.h b/config/konaautoconf.h
new file mode 100644
index 0000000..4e6da4a
--- /dev/null
+++ b/config/konaautoconf.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ */
+
+#define CONFIG_PINCTRL_WCD 1
+#define CONFIG_AUDIO_EXT_CLK 1
+#define CONFIG_SND_SOC_WCD9XXX_V2 1
+#define CONFIG_SND_SOC_WCD_MBHC 1
+#define CONFIG_SND_SOC_WSA881X 1
+#define CONFIG_WCD9XXX_CODEC_CORE_V2 1
+#define CONFIG_MSM_CDC_PINCTRL 1
+#define CONFIG_MSM_QDSP6V2_CODECS 1
+#define CONFIG_MSM_ULTRASOUND 1
+#define CONFIG_MSM_QDSP6_APRV2_RPMSG 1
+#define CONFIG_SND_SOC_MSM_QDSP6V2_INTF 1
+#define CONFIG_MSM_ADSP_LOADER 1
+#define CONFIG_REGMAP_SWR 1
+#define CONFIG_MSM_QDSP6_SSR 1
+#define CONFIG_MSM_QDSP6_PDR 1
+#define CONFIG_MSM_QDSP6_NOTIFIER 1
+#define CONFIG_SND_SOC_MSM_HOSTLESS_PCM 1
+#define CONFIG_SOUNDWIRE 1
+#define CONFIG_SOUNDWIRE_MSTR_CTRL 1
+#define CONFIG_SND_SOC_WCD_MBHC_ADC 1
+#define CONFIG_SND_SOC_QDSP6V2 1
+#define CONFIG_SND_SOC_MSM_HDMI_CODEC_RX 1
+#define CONFIG_QTI_PP 1
+#define CONFIG_SND_HWDEP_ROUTING 1
+#define CONFIG_SND_SOC_MSM_STUB 1
+#define CONFIG_MSM_AVTIMER 1
+#define CONFIG_SND_SOC_BOLERO 1
+#define CONFIG_WSA_MACRO 1
+#define CONFIG_VA_MACRO 1
+#define CONFIG_RX_MACRO 1
+#define CONFIG_TX_MACRO 1
+#define CONFIG_SND_SOC_WCD_IRQ 1
+#define CONFIG_SND_SOC_WCD938X 1
+#define CONFIG_SND_SOC_WCD938X_SLAVE 1
+#define CONFIG_SND_SOC_KONA 1
+#define CONFIG_SND_EVENT 1
diff --git a/dsp/Android.mk b/dsp/Android.mk
index c81a1bd..ddaebe2 100644
--- a/dsp/Android.mk
+++ b/dsp/Android.mk
@@ -11,9 +11,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)
 
diff --git a/dsp/Kbuild b/dsp/Kbuild
index 724dc12..11e87c2 100644
--- a/dsp/Kbuild
+++ b/dsp/Kbuild
@@ -24,6 +24,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_SM8150), y)
 		include $(AUDIO_ROOT)/config/sm8150auto.conf
 		export
@@ -82,13 +87,15 @@
 	Q6_OBJS += q6common.o
 	Q6_OBJS += rtac.o
 	Q6_OBJS += q6lsm.o
-	Q6_OBJS += audio_slimslave.o
 	Q6_OBJS += adsp_err.o
 	Q6_OBJS += msm_audio_ion.o
 	Q6_OBJS += avtimer.o
 	Q6_OBJS += q6_init.o
 
 endif
+ifdef CONFIG_WCD9XXX_CODEC_CORE
+	Q6_OBJS += audio_slimslave.o
+endif
 ifdef CONFIG_DTS_SRS_TM
 	Q6_OBJS += msm-dts-srs-tm-config.o
 endif
diff --git a/dsp/codecs/Android.mk b/dsp/codecs/Android.mk
index 62f6db8..25726ac 100644
--- a/dsp/codecs/Android.mk
+++ b/dsp/codecs/Android.mk
@@ -11,9 +11,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)
 
diff --git a/dsp/codecs/Kbuild b/dsp/codecs/Kbuild
index 54d64f2..c80cace 100644
--- a/dsp/codecs/Kbuild
+++ b/dsp/codecs/Kbuild
@@ -24,6 +24,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_SM8150), y)
 		include $(AUDIO_ROOT)/config/sm8150auto.conf
 		export
diff --git a/dsp/q6_init.h b/dsp/q6_init.h
index 71af2da..21be524 100644
--- a/dsp/q6_init.h
+++ b/dsp/q6_init.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 */
 
 #ifndef __Q6_INIT_H__
@@ -15,7 +15,6 @@
 int core_init(void);
 int rtac_init(void);
 int msm_audio_ion_init(void);
-int audio_slimslave_init(void);
 int avtimer_init(void);
 #ifdef CONFIG_MSM_MDF
 int msm_mdf_init(void);
@@ -33,7 +32,6 @@
 #endif
 
 void avtimer_exit(void);
-void audio_slimslave_exit(void);
 void msm_audio_ion_exit(void);
 void rtac_exit(void);
 void core_exit(void);
@@ -44,5 +42,17 @@
 void afe_exit(void);
 void adm_exit(void);
 void adsp_err_exit(void);
+#if IS_ENABLED(CONFIG_WCD9XXX_CODEC_CORE)
+int audio_slimslave_init(void);
+void audio_slimslave_exit(void);
+#else
+static inline int audio_slimslave_init(void)
+{
+	return 0;
+};
+static inline void audio_slimslave_exit(void)
+{
+};
+#endif
 #endif
 
diff --git a/include/asoc/pdata.h b/include/asoc/pdata.h
index 1182ef7..d24d56a 100644
--- a/include/asoc/pdata.h
+++ b/include/asoc/pdata.h
@@ -6,7 +6,10 @@
 
 #define __MFD_WCD9XXX_PDATA_H__
 
+#if IS_ENABLED(CONFIG_WCD9XXX_CODEC_CORE)
 #include <linux/slimbus/slimbus.h>
+#endif
+
 #include "msm-cdc-supply.h"
 
 #define MICBIAS_EXT_BYP_CAP 0x00
@@ -177,7 +180,9 @@
 	struct device_node *micb_en_ctl;
 	struct device_node *wcd_rst_np;
 	struct wcd9xxx_amic amic_settings;
+#if IS_ENABLED(CONFIG_WCD9XXX_CODEC_CORE)
 	struct slim_device slimbus_slave_device;
+#endif
 	struct wcd9xxx_micbias_setting micbias;
 	struct wcd9xxx_ocp_setting ocp;
 	struct cdc_regulator *regulator;
diff --git a/include/asoc/wcd-irq.h b/include/asoc/wcd-irq.h
index 1388cfc..5460e18 100644
--- a/include/asoc/wcd-irq.h
+++ b/include/asoc/wcd-irq.h
@@ -18,7 +18,8 @@
 	struct device *dev;
 };
 
-#if IS_ENABLED(CONFIG_WCD9XXX_CODEC_CORE)
+#if (IS_ENABLED(CONFIG_WCD9XXX_CODEC_CORE) | \
+	IS_ENABLED(CONFIG_WCD9XXX_CODEC_CORE_V2))
 int wcd_irq_init(struct wcd_irq_info *irq_info, struct irq_domain **virq);
 int wcd_irq_exit(struct wcd_irq_info *irq_info, struct irq_domain *virq);
 int wcd_request_irq(struct wcd_irq_info *irq_info, int irq, const char *name,
diff --git a/ipc/Android.mk b/ipc/Android.mk
index b54e522..066c5b8 100644
--- a/ipc/Android.mk
+++ b/ipc/Android.mk
@@ -11,9 +11,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)
 
@@ -48,6 +52,7 @@
 LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
 include $(DLKM_DIR)/AndroidKernelModule.mk
 ###########################################################
+ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true)
 include $(CLEAR_VARS)
 LOCAL_MODULE              := $(AUDIO_CHIPSET)_wglink.ko
 LOCAL_MODULE_KBUILD_NAME  := wglink_dlkm.ko
@@ -55,6 +60,7 @@
 LOCAL_MODULE_DEBUG_ENABLE := true
 LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
 include $(DLKM_DIR)/AndroidKernelModule.mk
+endif
 ###########################################################
 
 endif # DLKM check
diff --git a/ipc/Kbuild b/ipc/Kbuild
index 484d79a..3577623 100644
--- a/ipc/Kbuild
+++ b/ipc/Kbuild
@@ -25,6 +25,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_SM8150), y)
 		include $(AUDIO_ROOT)/config/sm8150auto.conf
 		export
diff --git a/soc/Android.mk b/soc/Android.mk
index 7a8bd0e..8ce2c75 100644
--- a/soc/Android.mk
+++ b/soc/Android.mk
@@ -11,9 +11,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)
 
@@ -74,7 +78,7 @@
 LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
 include $(DLKM_DIR)/AndroidKernelModule.mk
 ###########################################################
-ifeq ($(call is-board-platform-in-list, $(MSMSTEPPE)),true)
+ifeq ($(call is-board-platform-in-list, $(MSMSTEPPE) kona),true)
 include $(CLEAR_VARS)
 LOCAL_MODULE              := $(AUDIO_CHIPSET)_snd_event.ko
 LOCAL_MODULE_KBUILD_NAME  := snd_event_dlkm.ko
diff --git a/soc/Kbuild b/soc/Kbuild
index 4e54577..12d99c3 100644
--- a/soc/Kbuild
+++ b/soc/Kbuild
@@ -19,6 +19,11 @@
 		export
 		INCS    +=  -include $(AUDIO_ROOT)/config/sm8150autoconf.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_SM6150), y)
 		include $(AUDIO_ROOT)/config/sm6150auto.conf
 		export