Merge pull request #67 from mengdonglin/topic/yorp

topology: Add 3 HDMI/DP PCMs and backends for GLK
diff --git a/topology/sof-glk-da7219.m4 b/topology/sof-glk-da7219.m4
index 121f4ed..a2ac09f 100644
--- a/topology/sof-glk-da7219.m4
+++ b/topology/sof-glk-da7219.m4
@@ -7,6 +7,7 @@
 include(`dai.m4')
 include(`pipeline.m4')
 include(`ssp.m4')
+include(`hda.m4')
 
 # Include TLV library
 include(`common/tlv.m4')
@@ -21,9 +22,12 @@
 #
 # Define the pipelines
 #
-# PCM0 ----> volume -----> SSP1 (speaker - maxim98357a)
-# PCM1 <---> volume <----> SSP2 (headset - da7219)
-# PCM99 <---- volume <----- DMIC0 (dmic capture)
+# PCM0  ----> volume (pipe 1)   -----> SSP1 (speaker - maxim98357a, BE link 0)
+# PCM1  <---> volume (pipe 2,3) <----> SSP2 (headset - da7219, BE link 1)
+# PCM99 <---- volume (pipe 4)   <----- DMIC0 (dmic capture, BE link 2)
+# PCM5  ----> volume (pipe 5)   -----> iDisp1 (HDMI/DP playback, BE link 3)
+# PCM6  ----> Volume (pipe 6)   -----> iDisp2 (HDMI/DP playback, BE link 4)
+# PCM7  ----> volume (pipe 7)   -----> iDisp3 (HDMI/DP playback, BE link 5)
 #
 
 # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le.
@@ -44,13 +48,34 @@
 	3, 1, 2, s32le,
 	48, 1000, 0, 0)
 
-# Low Latency capture pipeline 4 on PCM 0 using max 4 channels of s32le.
+# Low Latency capture pipeline 4 on PCM 99 using max 4 channels of s32le.
 # Schedule 48 frames per 1000us deadline on core 0 with priority 0
 #PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4,
 PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4,
 	4, 99, 4, s32le,
 	48, 1000, 0, 0)
 
+# Low Latency playback pipeline 5 on PCM 5 using max 2 channels of s16le.
+# Schedule 48 frames per 1000us deadline on core 0 with priority 0
+# PIPELINE_PCM_ADD(sof/pipe-passthrough-playback.m4,
+PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
+        5, 5, 2, s16le,
+        48, 1000, 0, 0)
+
+# Low Latency playback pipeline 6 on PCM 6 using max 2 channels of s16le.
+# Schedule 48 frames per 1000us deadline on core 0 with priority 0
+# PIPELINE_PCM_ADD(sof/pipe-passthrough-playback.m4,
+PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
+        6, 6, 2, s16le,
+        48, 1000, 0, 0)
+
+# Low Latency playback pipeline 7 on PCM 7 using max 2 channels of s16le.
+# Schedule 48 frames per 1000us deadline on core 0 with priority 0
+# PIPELINE_PCM_ADD(sof/pipe-passthrough-playback.m4,
+PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
+        7, 7, 2, s16le,
+        48, 1000, 0, 0)
+
 #
 # DAIs configuration
 #
@@ -83,9 +108,33 @@
 	PIPELINE_SINK_4, 2, s32le,
 	48, 1000, 0, 0)
 
+# playback DAI is iDisp1 using 2 periods
+# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0
+DAI_ADD(sof/pipe-dai-playback.m4,
+        5, HDA, 3, iDisp1,
+        PIPELINE_SOURCE_5, 2, s16le,
+        48, 1000, 0, 0)
+
+# playback DAI is iDisp2 using 2 periods
+# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0
+DAI_ADD(sof/pipe-dai-playback.m4,
+        6, HDA, 4, iDisp2,
+        PIPELINE_SOURCE_6, 2, s16le,
+        48, 1000, 0, 0)
+
+# playback DAI is iDisp3 using 2 periods
+# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0
+DAI_ADD(sof/pipe-dai-playback.m4,
+        7, HDA, 5, iDisp3,
+        PIPELINE_SOURCE_7, 2, s16le,
+        48, 1000, 0, 0)
+
 PCM_PLAYBACK_ADD(Speakers, 0, PIPELINE_PCM_1)
 PCM_DUPLEX_ADD(Headset, 1, PIPELINE_PCM_2, PIPELINE_PCM_3)
 PCM_CAPTURE_ADD(DMIC01, 99, PIPELINE_PCM_4)
+PCM_PLAYBACK_ADD(HDMI1, 5, PIPELINE_PCM_5)
+PCM_PLAYBACK_ADD(HDMI2, 6, PIPELINE_PCM_6)
+PCM_PLAYBACK_ADD(HDMI3, 7, PIPELINE_PCM_7)
 
 #
 # BE configurations - overrides config in ACPI if present
@@ -115,6 +164,11 @@
 		# PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))
 		PDM_CONFIG(DMIC, 0, STEREO_PDM0)))
 
+# 3 HDMI/DP outputs (ID: 3,4,5)
+HDA_DAI_CONFIG(3, 3, iDisp1)
+HDA_DAI_CONFIG(4, 4, iDisp2)
+HDA_DAI_CONFIG(5, 5, iDisp3)
+
 ## remove warnings with SST hard-coded routes (FIXME)
 
 VIRTUAL_WIDGET(ssp5 Tx, 0)
@@ -126,9 +180,6 @@
 VIRTUAL_WIDGET(hif5-0 Output, 6)
 VIRTUAL_WIDGET(hif6-0 Output, 7)
 VIRTUAL_WIDGET(hif7-0 Output, 8)
-VIRTUAL_WIDGET(hifi1, 9)
-VIRTUAL_WIDGET(hifi2, 10)
-VIRTUAL_WIDGET(hifi3, 11)
 
 VIRTUAL_DAPM_ROUTE_OUT(codec0_out, SSP, 0, OUT, 12)
 VIRTUAL_DAPM_ROUTE_OUT(codec1_out, SSP, 0, OUT, 13)