Browse Source

asoc: wcd939x: update port config for pcm path

update port config parameters for hph pcm path.

Change-Id: I2f8fd56a4d562f92c80c8997a98f5f3436411dfa
Signed-off-by: Prasad Kumpatla <[email protected]>
Prasad Kumpatla 2 years ago
parent
commit
d4626706b1

+ 28 - 12
asoc/codecs/wcd939x/wcd939x.c

@@ -1652,14 +1652,22 @@ static int wcd939x_enable_rx1(struct snd_soc_dapm_widget *w,
 
 	switch (event) {
 	case SND_SOC_DAPM_PRE_PMU:
-		wcd939x_rx_connect_port(component, HPH_L, true);
-		if (wcd939x->comp1_enable)
-			wcd939x_rx_connect_port(component, COMP_L, true);
+		if (wcd939x->hph_pcm_enabled[WCD939X_HPHL])
+			wcd939x_rx_connect_port(component, HIFI_PCM_L, true);
+		else {
+			wcd939x_rx_connect_port(component, HPH_L, true);
+			if (wcd939x->comp1_enable)
+				wcd939x_rx_connect_port(component, COMP_L, true);
+		}
 		break;
 	case SND_SOC_DAPM_POST_PMD:
-		wcd939x_rx_connect_port(component, HPH_L, false);
-		if (wcd939x->comp1_enable)
-			wcd939x_rx_connect_port(component, COMP_L, false);
+		if (wcd939x->hph_pcm_enabled[WCD939X_HPHL])
+			wcd939x_rx_connect_port(component, HIFI_PCM_L, false);
+		else {
+			wcd939x_rx_connect_port(component, HPH_L, false);
+			if (wcd939x->comp1_enable)
+				wcd939x_rx_connect_port(component, COMP_L, false);
+		}
 		break;
 	};
 
@@ -1678,14 +1686,22 @@ static int wcd939x_enable_rx2(struct snd_soc_dapm_widget *w,
 
 	switch (event) {
 	case SND_SOC_DAPM_PRE_PMU:
-		wcd939x_rx_connect_port(component, HPH_R, true);
-		if (wcd939x->comp2_enable)
-			wcd939x_rx_connect_port(component, COMP_R, true);
+		if (wcd939x->hph_pcm_enabled[WCD939X_HPHR])
+			wcd939x_rx_connect_port(component, HIFI_PCM_R, true);
+		else {
+			wcd939x_rx_connect_port(component, HPH_R, true);
+			if (wcd939x->comp2_enable)
+				wcd939x_rx_connect_port(component, COMP_R, true);
+		}
 		break;
 	case SND_SOC_DAPM_POST_PMD:
-		wcd939x_rx_connect_port(component, HPH_R, false);
-		if (wcd939x->comp2_enable)
-			wcd939x_rx_connect_port(component, COMP_R, false);
+		if (wcd939x->hph_pcm_enabled[WCD939X_HPHR])
+			wcd939x_rx_connect_port(component, HIFI_PCM_R, false);
+		else {
+			wcd939x_rx_connect_port(component, HPH_R, false);
+			if (wcd939x->comp2_enable)
+				wcd939x_rx_connect_port(component, COMP_R, false);
+		}
 		break;
 	};
 

+ 4 - 4
asoc/pineapple-port-config.h

@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _PINEAPPLE_PORT_CONFIG
@@ -56,7 +56,7 @@ static struct port_params rx_frame_params_dsd[SWR_MSTR_PORT_LEN] = {
 	{3,     1,    0,    0xFF, 0xFF, 0xFF, 0xFF, 3,    0,    0x00, 0x00}, /* DSD */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* GPPO */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* HAPT */
-	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* HIFI */
+	{49,    0,    0,    0,    15,   24,   1,    0,    1,    0x00, 0x01}, /* HIFI */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* HPHT */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* CMPT */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* IPCM */
@@ -72,7 +72,7 @@ static struct port_params rx_frame_params_default[SWR_MSTR_PORT_LEN] = {
 	{0x18F, 0,    0,    0x8,  0x8,  0x0F, 0x00, 0,    0,    0x00, 0x01}, /* PCM_OUT */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* GPPO */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* HAPT */
-	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* HIFI */
+	{49,    0,    0,    0,    15,   24,   1,    0,    1,    0x00, 0x01}, /* HIFI */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* HPHT */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* CMPT */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* IPCM */
@@ -89,7 +89,7 @@ static struct port_params rx_frame_params_44p1KHz[SWR_MSTR_PORT_LEN] = {
 	{0x1FF, 0,    0,    0x8,  0x8,  0x0F, 0,    0,    0,    0x00, 0x01}, /* PCM_OUT */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* GPPO */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* HAPT */
-	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* HIFI */
+	{49,    0,    0,    0,    15,   24,   1,    0,    1,    0x00, 0x01}, /* HIFI */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* HPHT */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* CMPT */
 	{0xFF,  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, /* IPCM */

+ 3 - 1
include/bindings/audio-codec-port-types.h

@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. */
+/* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.*/
 
 #ifndef __AUDIO_CODEC_PORT_TYPES_H
 #define __AUDIO_CODEC_PORT_TYPES_H
@@ -93,5 +94,6 @@
 #define SWRM_TX3_CH3 56
 #define SWRM_TX3_CH4 57
 #define SWRM_TX_PCM_IN 58
-
+#define HIFI_PCM_L 59
+#define HIFI_PCM_R 60
 #endif /* __AUDIO_CODEC_PORT_TYPES_H */