asoc: update tx frame config for soundwire port

Set correct tx frame config for soundwire port
using wcd9375.

Change-Id: Icbefda65713338908e4d94935296ff30ac4e5f9c
Signed-off-by: Kunlei Zhang <kunleiz@codeaurora.org>
diff --git a/asoc/kona.c b/asoc/kona.c
index 33c24f1..bff29eb 100644
--- a/asoc/kona.c
+++ b/asoc/kona.c
@@ -5371,6 +5371,9 @@
 	struct snd_card *card;
 	struct snd_info_entry *entry;
 	struct snd_soc_component *aux_comp;
+	struct platform_device *pdev = NULL;
+	int i = 0;
+	char *data = NULL;
 	struct msm_asoc_mach_data *pdata =
 				snd_soc_card_get_drvdata(rtd->card);
 
@@ -5447,18 +5450,52 @@
 						WSA_MACRO_GAIN_OFFSET_M1P5_DB);
 			}
 		}
-		if (pdata->lito_v2_enabled) {
-			/*
-			 * Enable tx data line3 for saipan version v2 amd
-			 * write corresponding lpi register.
-			 */
-			bolero_set_port_map(component, ARRAY_SIZE(sm_port_map_v2),
-					sm_port_map_v2);
-		} else {
-			bolero_set_port_map(component, ARRAY_SIZE(sm_port_map),
-					sm_port_map);
+	}
+
+	for (i = 0; i < rtd->card->num_aux_devs; i++)
+	{
+		if (msm_aux_dev[i].name != NULL ) {
+			if (strstr(msm_aux_dev[i].name, "wsa"))
+				continue;
+		}
+
+		if (msm_aux_dev[i].codec_of_node) {
+			pdev = of_find_device_by_node(
+					msm_aux_dev[i].codec_of_node);
+
+			if (pdev)
+				data = (char*) of_device_get_match_data(
+								&pdev->dev);
+			if (data != NULL) {
+				if (!strncmp(data, "wcd937x",
+						sizeof("wcd937x"))) {
+					bolero_set_port_map(component,
+						ARRAY_SIZE(sm_port_map_wcd937x),
+						sm_port_map_wcd937x);
+					break;
+				} else if (!strncmp( data, "wcd938x",
+							sizeof("wcd938x"))) {
+					if (pdata->lito_v2_enabled) {
+						/*
+						 * Enable tx data line3 for
+						 * saipan version v2 and
+						 * write corresponding
+						 * lpi register.
+						 */
+						bolero_set_port_map(component,
+							ARRAY_SIZE(sm_port_map_v2),
+							sm_port_map_v2);
+					} else {
+						bolero_set_port_map(component,
+							ARRAY_SIZE(sm_port_map),
+							sm_port_map);
+					}
+					break;
+				}
+			}
 		}
 	}
+
 	card = rtd->card->snd_card;
 	if (!pdata->codec_root) {
 		entry = snd_info_create_subdir(card->module, "codecs",