Prechádzať zdrojové kódy

asoc: add tambora support in machine driver

Add tambora support in machine driver.

Change-Id: Ie0fc4f1e8c8fb00cd784924671aec014f7cfe07d
Signed-off-by: Yuhui Zhao <[email protected]>
Yuhui Zhao 1 rok pred
rodič
commit
ef192ce2b7
2 zmenil súbory, kde vykonal 32 pridanie a 5 odobranie
  1. 7 0
      asoc/msm_dailink.h
  2. 25 5
      asoc/pineapple.c

+ 7 - 0
asoc/msm_dailink.h

@@ -151,6 +151,7 @@ SND_SOC_DAILINK_DEFS(rx_dma_rx0,
 	DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
 	DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "rx_macro_rx1"),
 			   COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
+			   COMP_CODEC("wcd9378_codec", "wcd9378_cdc"),
 			   COMP_CODEC("wcd939x_codec", "wcd939x_cdc"),
 			   COMP_CODEC("wsa-codec0", "wsa_rx0")),
 	DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
@@ -159,6 +160,7 @@ SND_SOC_DAILINK_DEFS(rx_dma_rx1,
 	DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
 	DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "rx_macro_rx2"),
 			   COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
+			   COMP_CODEC("wcd9378_codec", "wcd9378_cdc"),
 			   COMP_CODEC("wcd939x_codec", "wcd939x_cdc"),
 			   COMP_CODEC("wsa-codec0", "wsa_rx0")),
 	DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
@@ -167,6 +169,7 @@ SND_SOC_DAILINK_DEFS(rx_dma_rx2,
 	DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
 	DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "rx_macro_rx3"),
 			   COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
+			   COMP_CODEC("wcd9378_codec", "wcd9378_cdc"),
 			   COMP_CODEC("wcd939x_codec", "wcd939x_cdc")),
 	DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
 
@@ -174,6 +177,7 @@ SND_SOC_DAILINK_DEFS(rx_dma_rx3,
 	DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
 	DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "rx_macro_rx4"),
 			   COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
+			   COMP_CODEC("wcd9378_codec", "wcd9378_cdc"),
 			   COMP_CODEC("wcd939x_codec", "wcd939x_cdc")),
 	DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
 
@@ -181,6 +185,7 @@ SND_SOC_DAILINK_DEFS(rx_dma_rx5,
 	DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
 	DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "rx_macro_rx5"),
 			   COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
+			   COMP_CODEC("wcd9378_codec", "wcd9378_cdc"),
 			   COMP_CODEC("wcd939x_codec", "wcd939x_cdc")),
 	DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
 
@@ -194,6 +199,7 @@ SND_SOC_DAILINK_DEFS(tx_dma_tx3,
 	DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
 	DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "tx_macro_tx1"),
 			   COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
+			   COMP_CODEC("wcd9378_codec", "wcd9378_cdc"),
 			   COMP_CODEC("wcd939x_codec", "wcd939x_cdc")),
 	DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
 
@@ -201,6 +207,7 @@ SND_SOC_DAILINK_DEFS(tx_dma_tx4,
 	DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
 	DAILINK_COMP_ARRAY(COMP_CODEC("lpass-cdc", "tx_macro_tx2"),
 			   COMP_CODEC("wcd937x_codec", "wcd937x_cdc"),
+			   COMP_CODEC("wcd9378_codec", "wcd9378_cdc"),
 			   COMP_CODEC("wcd939x_codec", "wcd939x_cdc"),
 			   COMP_CODEC("swr-dmic.01", "swr_dmic_tx0"),
 			   COMP_CODEC("swr-dmic.02", "swr_dmic_tx1"),

+ 25 - 5
asoc/pineapple.c

@@ -34,10 +34,12 @@
 #include "asoc/msm-cdc-pinctrl.h"
 #include "asoc/wcd-mbhc-v2.h"
 #include "codecs/wcd937x/wcd937x-mbhc.h"
+#include "codecs/wcd9378/wcd9378-mbhc.h"
 #include "codecs/wcd939x/wcd939x-mbhc.h"
 #include "codecs/wsa884x/wsa884x.h"
 #include "codecs/wsa883x/wsa883x.h"
 #include "codecs/wcd937x/wcd937x.h"
+#include "codecs/wcd9378/wcd9378.h"
 #include "codecs/wcd939x/wcd939x.h"
 #include "codecs/lpass-cdc/lpass-cdc.h"
 #include <bindings/audio-codec-port-types.h>
@@ -69,6 +71,7 @@
 enum {
 	WCD937X_DEV_INDEX,
 	WCD939X_DEV_INDEX,
+	WCD9378_DEV_INDEX,
 };
 
 struct msm_asoc_mach_data {
@@ -239,6 +242,8 @@ static void msm_set_upd_config(struct snd_soc_pcm_runtime *rtd)
 	} else {
 		if (pdata->wcd_used == WCD937X_DEV_INDEX)
 			strscpy(wcd_name, WCD937X_DRV_NAME, sizeof(WCD937X_DRV_NAME));
+		else if (pdata->wcd_used == WCD9378_DEV_INDEX)
+			strscpy(wcd_name, WCD9378_DRV_NAME, sizeof(WCD9378_DRV_NAME));
 		else
 			strscpy(wcd_name, WCD939X_DRV_NAME, sizeof(WCD939X_DRV_NAME));
 
@@ -257,7 +262,9 @@ static void msm_set_upd_config(struct snd_soc_pcm_runtime *rtd)
 	} else {
 		if (pdata->wcd_used == WCD937X_DEV_INDEX) {
 			pdata->get_dev_num = wcd937x_codec_get_dev_num;
-		} else if (pdata->wcd_used == WCD939X_DEV_INDEX) {
+		} else if (pdata->wcd_used == WCD9378_DEV_INDEX) {
+			pdata->get_dev_num = wcd9378_codec_get_dev_num;
+		} else {
 			pdata->get_dev_num = wcd939x_codec_get_dev_num;
 		}
 	}
@@ -1495,6 +1502,8 @@ static int msm_snd_card_late_probe(struct snd_soc_card *card)
 
 	if (pdata->wcd_used == WCD937X_DEV_INDEX)
 		strscpy(wcd_name, WCD937X_DRV_NAME, sizeof(WCD937X_DRV_NAME));
+	else if (pdata->wcd_used == WCD9378_DEV_INDEX)
+		strscpy(wcd_name, WCD9378_DRV_NAME, sizeof(WCD9378_DRV_NAME));
 	else
 		strscpy(wcd_name, WCD939X_DRV_NAME, sizeof(WCD939X_DRV_NAME));
 
@@ -1519,6 +1528,9 @@ static int msm_snd_card_late_probe(struct snd_soc_card *card)
 	case WCD937X_DEV_INDEX:
 		ret = wcd937x_mbhc_hs_detect(component, &wcd_mbhc_cfg);
 		break;
+	case WCD9378_DEV_INDEX:
+		ret = wcd9378_mbhc_hs_detect(component, &wcd_mbhc_cfg);
+		break;
 	case WCD939X_DEV_INDEX:
 		ret = wcd939x_mbhc_hs_detect(component, &wcd_mbhc_cfg);
 		break;
@@ -2051,11 +2063,17 @@ static int msm_rx_tx_codec_init(struct snd_soc_pcm_runtime *rtd)
 	if (!component) {
 		component = snd_soc_rtdcom_lookup(rtd, WCD937X_DRV_NAME);
 		if (!component) {
-			pr_err("%s component is NULL\n", __func__);
-			ret = -EINVAL;
-			goto exit;
+			component = snd_soc_rtdcom_lookup(rtd, WCD9378_DRV_NAME);
+			if (!component) {
+				pr_err("%s component is NULL\n", __func__);
+				ret = -EINVAL;
+				goto exit;
+			} else {
+				pdata->wcd_used = WCD9378_DEV_INDEX;
+			}
+		} else {
+			pdata->wcd_used = WCD937X_DEV_INDEX;
 		}
-		pdata->wcd_used = WCD937X_DEV_INDEX;
 	} else {
 		pdata->wcd_used = WCD939X_DEV_INDEX;
 	}
@@ -2089,6 +2107,8 @@ static int msm_rx_tx_codec_init(struct snd_soc_pcm_runtime *rtd)
 		wcd937x_info_create_codec_entry(pdata->codec_root, component);
 		codec_variant = wcd937x_get_codec_variant(component);
 		dev_dbg(component->dev, "%s: variant %d\n", __func__, codec_variant);
+	} else if (pdata->wcd_used == WCD9378_DEV_INDEX) {
+		wcd9378_info_create_codec_entry(pdata->codec_root, component);
 	} else {
 		wcd939x_info_create_codec_entry(pdata->codec_root, component);
 		codec_variant = wcd939x_get_codec_variant(component);