aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/intel/boards/skl_nau88l25_ssm4567.c')
-rw-r--r--sound/soc/intel/boards/skl_nau88l25_ssm4567.c130
1 files changed, 112 insertions, 18 deletions
diff --git a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
index c071812f31e5..5f1ca99ae9b0 100644
--- a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
+++ b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c
@@ -26,6 +26,7 @@
26#include <sound/jack.h> 26#include <sound/jack.h>
27#include <sound/pcm_params.h> 27#include <sound/pcm_params.h>
28#include "../../codecs/nau8825.h" 28#include "../../codecs/nau8825.h"
29#include "../../codecs/hdac_hdmi.h"
29 30
30#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi" 31#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"
31#define SKL_SSM_CODEC_DAI "ssm4567-hifi" 32#define SKL_SSM_CODEC_DAI "ssm4567-hifi"
@@ -33,6 +34,16 @@
33static struct snd_soc_jack skylake_headset; 34static struct snd_soc_jack skylake_headset;
34static struct snd_soc_card skylake_audio_card; 35static struct snd_soc_card skylake_audio_card;
35 36
37enum {
38 SKL_DPCM_AUDIO_PB = 0,
39 SKL_DPCM_AUDIO_CP,
40 SKL_DPCM_AUDIO_REF_CP,
41 SKL_DPCM_AUDIO_DMIC_CP,
42 SKL_DPCM_AUDIO_HDMI1_PB,
43 SKL_DPCM_AUDIO_HDMI2_PB,
44 SKL_DPCM_AUDIO_HDMI3_PB,
45};
46
36static inline struct snd_soc_dai *skl_get_codec_dai(struct snd_soc_card *card) 47static inline struct snd_soc_dai *skl_get_codec_dai(struct snd_soc_card *card)
37{ 48{
38 struct snd_soc_pcm_runtime *rtd; 49 struct snd_soc_pcm_runtime *rtd;
@@ -92,7 +103,6 @@ static const struct snd_soc_dapm_widget skylake_widgets[] = {
92 SND_SOC_DAPM_SPK("Left Speaker", NULL), 103 SND_SOC_DAPM_SPK("Left Speaker", NULL),
93 SND_SOC_DAPM_SPK("Right Speaker", NULL), 104 SND_SOC_DAPM_SPK("Right Speaker", NULL),
94 SND_SOC_DAPM_MIC("SoC DMIC", NULL), 105 SND_SOC_DAPM_MIC("SoC DMIC", NULL),
95 SND_SOC_DAPM_SINK("WoV Sink"),
96 SND_SOC_DAPM_SPK("DP", NULL), 106 SND_SOC_DAPM_SPK("DP", NULL),
97 SND_SOC_DAPM_SPK("HDMI", NULL), 107 SND_SOC_DAPM_SPK("HDMI", NULL),
98 SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0, 108 SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
@@ -113,8 +123,6 @@ static const struct snd_soc_dapm_route skylake_map[] = {
113 {"MIC", NULL, "Headset Mic"}, 123 {"MIC", NULL, "Headset Mic"},
114 {"DMic", NULL, "SoC DMIC"}, 124 {"DMic", NULL, "SoC DMIC"},
115 125
116 {"WoV Sink", NULL, "hwd_in sink"},
117
118 {"HDMI", NULL, "hif5 Output"}, 126 {"HDMI", NULL, "hif5 Output"},
119 {"DP", NULL, "hif6 Output"}, 127 {"DP", NULL, "hif6 Output"},
120 /* CODEC BE connections */ 128 /* CODEC BE connections */
@@ -122,6 +130,11 @@ static const struct snd_soc_dapm_route skylake_map[] = {
122 { "Right Playback", NULL, "ssp0 Tx"}, 130 { "Right Playback", NULL, "ssp0 Tx"},
123 { "ssp0 Tx", NULL, "codec0_out"}, 131 { "ssp0 Tx", NULL, "codec0_out"},
124 132
133 /* IV feedback path */
134 { "codec0_lp_in", NULL, "ssp0 Rx"},
135 { "ssp0 Rx", NULL, "Left Capture Sense" },
136 { "ssp0 Rx", NULL, "Right Capture Sense" },
137
125 { "Playback", NULL, "ssp1 Tx"}, 138 { "Playback", NULL, "ssp1 Tx"},
126 { "ssp1 Tx", NULL, "codec1_out"}, 139 { "ssp1 Tx", NULL, "codec1_out"},
127 140
@@ -131,8 +144,14 @@ static const struct snd_soc_dapm_route skylake_map[] = {
131 /* DMIC */ 144 /* DMIC */
132 { "dmic01_hifi", NULL, "DMIC01 Rx" }, 145 { "dmic01_hifi", NULL, "DMIC01 Rx" },
133 { "DMIC01 Rx", NULL, "DMIC AIF" }, 146 { "DMIC01 Rx", NULL, "DMIC AIF" },
134 { "hifi1", NULL, "iDisp Tx"}, 147
135 { "iDisp Tx", NULL, "iDisp_out"}, 148 { "hifi3", NULL, "iDisp3 Tx"},
149 { "iDisp3 Tx", NULL, "iDisp3_out"},
150 { "hifi2", NULL, "iDisp2 Tx"},
151 { "iDisp2 Tx", NULL, "iDisp2_out"},
152 { "hifi1", NULL, "iDisp1 Tx"},
153 { "iDisp1 Tx", NULL, "iDisp1_out"},
154
136 { "Headphone Jack", NULL, "Platform Clock" }, 155 { "Headphone Jack", NULL, "Platform Clock" },
137 { "Headset Mic", NULL, "Platform Clock" }, 156 { "Headset Mic", NULL, "Platform Clock" },
138}; 157};
@@ -197,11 +216,32 @@ static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
197 nau8825_enable_jack_detect(codec, &skylake_headset); 216 nau8825_enable_jack_detect(codec, &skylake_headset);
198 217
199 snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC"); 218 snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
200 snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "WoV Sink");
201 219
202 return ret; 220 return ret;
203} 221}
204 222
223static int skylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
224{
225 struct snd_soc_dai *dai = rtd->codec_dai;
226
227 return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI1_PB);
228}
229
230static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd)
231{
232 struct snd_soc_dai *dai = rtd->codec_dai;
233
234 return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI2_PB);
235}
236
237
238static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd)
239{
240 struct snd_soc_dai *dai = rtd->codec_dai;
241
242 return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI3_PB);
243}
244
205static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd) 245static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd)
206{ 246{
207 struct snd_soc_dapm_context *dapm; 247 struct snd_soc_dapm_context *dapm;
@@ -362,7 +402,7 @@ static struct snd_soc_ops skylaye_refcap_ops = {
362/* skylake digital audio interface glue - connects codec <--> CPU */ 402/* skylake digital audio interface glue - connects codec <--> CPU */
363static struct snd_soc_dai_link skylake_dais[] = { 403static struct snd_soc_dai_link skylake_dais[] = {
364 /* Front End DAI links */ 404 /* Front End DAI links */
365 { 405 [SKL_DPCM_AUDIO_PB] = {
366 .name = "Skl Audio Port", 406 .name = "Skl Audio Port",
367 .stream_name = "Audio", 407 .stream_name = "Audio",
368 .cpu_dai_name = "System Pin", 408 .cpu_dai_name = "System Pin",
@@ -377,7 +417,7 @@ static struct snd_soc_dai_link skylake_dais[] = {
377 .dpcm_playback = 1, 417 .dpcm_playback = 1,
378 .ops = &skylake_nau8825_fe_ops, 418 .ops = &skylake_nau8825_fe_ops,
379 }, 419 },
380 { 420 [SKL_DPCM_AUDIO_CP] = {
381 .name = "Skl Audio Capture Port", 421 .name = "Skl Audio Capture Port",
382 .stream_name = "Audio Record", 422 .stream_name = "Audio Record",
383 .cpu_dai_name = "System Pin", 423 .cpu_dai_name = "System Pin",
@@ -391,7 +431,7 @@ static struct snd_soc_dai_link skylake_dais[] = {
391 .dpcm_capture = 1, 431 .dpcm_capture = 1,
392 .ops = &skylake_nau8825_fe_ops, 432 .ops = &skylake_nau8825_fe_ops,
393 }, 433 },
394 { 434 [SKL_DPCM_AUDIO_REF_CP] = {
395 .name = "Skl Audio Reference cap", 435 .name = "Skl Audio Reference cap",
396 .stream_name = "Wake on Voice", 436 .stream_name = "Wake on Voice",
397 .cpu_dai_name = "Reference Pin", 437 .cpu_dai_name = "Reference Pin",
@@ -405,7 +445,7 @@ static struct snd_soc_dai_link skylake_dais[] = {
405 .dynamic = 1, 445 .dynamic = 1,
406 .ops = &skylaye_refcap_ops, 446 .ops = &skylaye_refcap_ops,
407 }, 447 },
408 { 448 [SKL_DPCM_AUDIO_DMIC_CP] = {
409 .name = "Skl Audio DMIC cap", 449 .name = "Skl Audio DMIC cap",
410 .stream_name = "dmiccap", 450 .stream_name = "dmiccap",
411 .cpu_dai_name = "DMIC Pin", 451 .cpu_dai_name = "DMIC Pin",
@@ -418,13 +458,43 @@ static struct snd_soc_dai_link skylake_dais[] = {
418 .dynamic = 1, 458 .dynamic = 1,
419 .ops = &skylake_dmic_ops, 459 .ops = &skylake_dmic_ops,
420 }, 460 },
421 { 461 [SKL_DPCM_AUDIO_HDMI1_PB] = {
422 .name = "Skl HDMI Port", 462 .name = "Skl HDMI Port1",
423 .stream_name = "Hdmi", 463 .stream_name = "Hdmi1",
424 .cpu_dai_name = "HDMI Pin", 464 .cpu_dai_name = "HDMI1 Pin",
465 .codec_name = "snd-soc-dummy",
466 .codec_dai_name = "snd-soc-dummy-dai",
467 .platform_name = "0000:00:1f.3",
468 .dpcm_playback = 1,
469 .init = NULL,
470 .trigger = {
471 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
472 .nonatomic = 1,
473 .dynamic = 1,
474 },
475 [SKL_DPCM_AUDIO_HDMI2_PB] = {
476 .name = "Skl HDMI Port2",
477 .stream_name = "Hdmi2",
478 .cpu_dai_name = "HDMI2 Pin",
479 .codec_name = "snd-soc-dummy",
480 .codec_dai_name = "snd-soc-dummy-dai",
481 .platform_name = "0000:00:1f.3",
482 .dpcm_playback = 1,
483 .init = NULL,
484 .trigger = {
485 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
486 .nonatomic = 1,
487 .dynamic = 1,
488 },
489 [SKL_DPCM_AUDIO_HDMI3_PB] = {
490 .name = "Skl HDMI Port3",
491 .stream_name = "Hdmi3",
492 .cpu_dai_name = "HDMI3 Pin",
425 .codec_name = "snd-soc-dummy", 493 .codec_name = "snd-soc-dummy",
426 .codec_dai_name = "snd-soc-dummy-dai", 494 .codec_dai_name = "snd-soc-dummy-dai",
427 .platform_name = "0000:00:1f.3", 495 .platform_name = "0000:00:1f.3",
496 .trigger = {
497 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
428 .dpcm_playback = 1, 498 .dpcm_playback = 1,
429 .init = NULL, 499 .init = NULL,
430 .nonatomic = 1, 500 .nonatomic = 1,
@@ -448,11 +518,12 @@ static struct snd_soc_dai_link skylake_dais[] = {
448 .ignore_pmdown_time = 1, 518 .ignore_pmdown_time = 1,
449 .be_hw_params_fixup = skylake_ssp_fixup, 519 .be_hw_params_fixup = skylake_ssp_fixup,
450 .dpcm_playback = 1, 520 .dpcm_playback = 1,
521 .dpcm_capture = 1,
451 }, 522 },
452 { 523 {
453 /* SSP1 - Codec */ 524 /* SSP1 - Codec */
454 .name = "SSP1-Codec", 525 .name = "SSP1-Codec",
455 .be_id = 0, 526 .be_id = 1,
456 .cpu_dai_name = "SSP1 Pin", 527 .cpu_dai_name = "SSP1 Pin",
457 .platform_name = "0000:00:1f.3", 528 .platform_name = "0000:00:1f.3",
458 .no_pcm = 1, 529 .no_pcm = 1,
@@ -469,7 +540,7 @@ static struct snd_soc_dai_link skylake_dais[] = {
469 }, 540 },
470 { 541 {
471 .name = "dmic01", 542 .name = "dmic01",
472 .be_id = 1, 543 .be_id = 2,
473 .cpu_dai_name = "DMIC01 Pin", 544 .cpu_dai_name = "DMIC01 Pin",
474 .codec_name = "dmic-codec", 545 .codec_name = "dmic-codec",
475 .codec_dai_name = "dmic-hifi", 546 .codec_dai_name = "dmic-hifi",
@@ -480,13 +551,36 @@ static struct snd_soc_dai_link skylake_dais[] = {
480 .no_pcm = 1, 551 .no_pcm = 1,
481 }, 552 },
482 { 553 {
483 .name = "iDisp", 554 .name = "iDisp1",
484 .be_id = 3, 555 .be_id = 3,
485 .cpu_dai_name = "iDisp Pin", 556 .cpu_dai_name = "iDisp1 Pin",
486 .codec_name = "ehdaudio0D2", 557 .codec_name = "ehdaudio0D2",
487 .codec_dai_name = "intel-hdmi-hifi1", 558 .codec_dai_name = "intel-hdmi-hifi1",
488 .platform_name = "0000:00:1f.3", 559 .platform_name = "0000:00:1f.3",
489 .dpcm_playback = 1, 560 .dpcm_playback = 1,
561 .init = skylake_hdmi1_init,
562 .no_pcm = 1,
563 },
564 {
565 .name = "iDisp2",
566 .be_id = 4,
567 .cpu_dai_name = "iDisp2 Pin",
568 .codec_name = "ehdaudio0D2",
569 .codec_dai_name = "intel-hdmi-hifi2",
570 .platform_name = "0000:00:1f.3",
571 .init = skylake_hdmi2_init,
572 .dpcm_playback = 1,
573 .no_pcm = 1,
574 },
575 {
576 .name = "iDisp3",
577 .be_id = 5,
578 .cpu_dai_name = "iDisp3 Pin",
579 .codec_name = "ehdaudio0D2",
580 .codec_dai_name = "intel-hdmi-hifi3",
581 .platform_name = "0000:00:1f.3",
582 .init = skylake_hdmi3_init,
583 .dpcm_playback = 1,
490 .no_pcm = 1, 584 .no_pcm = 1,
491 }, 585 },
492}; 586};