Kaynağa Gözat

dsp: afe: add support for VA macro codec DMA interface

VA macro on Kona has three TX codec DMA interface. The
current AFE driver only supports two codec DMA interface.
Add support to enable the third one in AFE driver.

Change-Id: Ie0f6241ef37bc03ad9adb1c4fe82f82468caec25
Signed-off-by: Xiaoyu Ye <[email protected]>
Xiaoyu Ye 6 yıl önce
ebeveyn
işleme
8341eefc48
3 değiştirilmiş dosya ile 20 ekleme ve 7 silme
  1. 7 1
      dsp/q6afe.c
  2. 7 1
      dsp/q6audio-v2.c
  3. 6 5
      include/dsp/q6afe-v2.h

+ 7 - 1
dsp/q6afe.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
  */
 #include <linux/slab.h>
 #include <linux/debugfs.h>
@@ -813,6 +813,7 @@ int afe_sizeof_cfg_cmd(u16 port_id)
 	case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
+	case AFE_PORT_ID_VA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_1:
@@ -4179,6 +4180,7 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config,
 	case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
+	case AFE_PORT_ID_VA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_1:
@@ -4629,6 +4631,8 @@ int afe_get_port_index(u16 port_id)
 		return IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_0;
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
 		return IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_1;
+	case AFE_PORT_ID_VA_CODEC_DMA_TX_2:
+		return IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_2;
 	case AFE_PORT_ID_WSA_CODEC_DMA_RX_0:
 		return IDX_AFE_PORT_ID_WSA_CODEC_DMA_RX_0;
 	case AFE_PORT_ID_WSA_CODEC_DMA_TX_0:
@@ -4827,6 +4831,7 @@ int afe_open(u16 port_id,
 	case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
+	case AFE_PORT_ID_VA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_1:
@@ -6802,6 +6807,7 @@ int afe_validate_port(u16 port_id)
 	case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
+	case AFE_PORT_ID_VA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_1:

+ 7 - 1
dsp/q6audio-v2.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/slab.h>
@@ -317,6 +317,8 @@ int q6audio_get_port_index(u16 port_id)
 		return IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_0;
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
 		return IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_1;
+	case AFE_PORT_ID_VA_CODEC_DMA_TX_2:
+		return IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_2;
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
 		return IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_0;
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
@@ -659,6 +661,8 @@ int q6audio_get_port_id(u16 port_id)
 		return AFE_PORT_ID_VA_CODEC_DMA_TX_0;
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
 		return AFE_PORT_ID_VA_CODEC_DMA_TX_1;
+	case AFE_PORT_ID_VA_CODEC_DMA_TX_2:
+		return AFE_PORT_ID_VA_CODEC_DMA_TX_2;
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
 		return AFE_PORT_ID_RX_CODEC_DMA_RX_0;
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
@@ -850,6 +854,7 @@ int q6audio_is_digital_pcm_interface(u16 port_id)
 	case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
+	case AFE_PORT_ID_VA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_1:
@@ -1062,6 +1067,7 @@ int q6audio_validate_port(u16 port_id)
 	case AFE_PORT_ID_WSA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_VA_CODEC_DMA_TX_1:
+	case AFE_PORT_ID_VA_CODEC_DMA_TX_2:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_0:
 	case AFE_PORT_ID_TX_CODEC_DMA_TX_0:
 	case AFE_PORT_ID_RX_CODEC_DMA_RX_1:

+ 6 - 5
include/dsp/q6afe-v2.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
  */
 #ifndef __Q6AFE_V2_H__
 #define __Q6AFE_V2_H__
@@ -226,7 +226,7 @@ enum {
 	IDX_AFE_PORT_ID_QUINARY_TDM_TX_6,
 	IDX_AFE_PORT_ID_QUINARY_TDM_RX_7,
 	IDX_AFE_PORT_ID_QUINARY_TDM_TX_7,
-	/* IDX 161 to 181 */
+	/* IDX 161 to 182 */
 	IDX_AFE_PORT_ID_WSA_CODEC_DMA_RX_0,
 	IDX_AFE_PORT_ID_WSA_CODEC_DMA_TX_0,
 	IDX_AFE_PORT_ID_WSA_CODEC_DMA_RX_1,
@@ -234,6 +234,7 @@ enum {
 	IDX_AFE_PORT_ID_WSA_CODEC_DMA_TX_2,
 	IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_0,
 	IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_1,
+	IDX_AFE_PORT_ID_VA_CODEC_DMA_TX_2,
 	IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_0,
 	IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_0,
 	IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_1,
@@ -248,14 +249,14 @@ enum {
 	IDX_AFE_PORT_ID_TX_CODEC_DMA_TX_5,
 	IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_6,
 	IDX_AFE_PORT_ID_RX_CODEC_DMA_RX_7,
-	/* IDX 182 to 184 */
+	/* IDX 183 to 185 */
 	IDX_SECONDARY_SPDIF_RX,
 	IDX_PRIMARY_SPDIF_TX,
 	IDX_SECONDARY_SPDIF_TX,
-	/* IDX 185 to 186 */
+	/* IDX 186 to 187 */
 	IDX_SLIMBUS_9_RX,
 	IDX_SLIMBUS_9_TX,
-	/* IDX 187 -> 189 */
+	/* IDX 188 -> 190 */
 	IDX_AFE_PORT_ID_SENARY_PCM_RX,
 	IDX_AFE_PORT_ID_SENARY_PCM_TX,
 	IDX_AFE_LOOPBACK_TX,