aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/skl_nau88l25_max98357a.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/intel/boards/skl_nau88l25_max98357a.c')
-rw-r--r--sound/soc/intel/boards/skl_nau88l25_max98357a.c122
1 files changed, 105 insertions, 17 deletions
diff --git a/sound/soc/intel/boards/skl_nau88l25_max98357a.c b/sound/soc/intel/boards/skl_nau88l25_max98357a.c
index ab7da9c304b2..72176b79a18d 100644
--- a/sound/soc/intel/boards/skl_nau88l25_max98357a.c
+++ b/sound/soc/intel/boards/skl_nau88l25_max98357a.c
@@ -22,6 +22,7 @@
22#include <sound/pcm_params.h> 22#include <sound/pcm_params.h>
23#include <sound/soc.h> 23#include <sound/soc.h>
24#include "../../codecs/nau8825.h" 24#include "../../codecs/nau8825.h"
25#include "../../codecs/hdac_hdmi.h"
25 26
26#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi" 27#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"
27#define SKL_MAXIM_CODEC_DAI "HiFi" 28#define SKL_MAXIM_CODEC_DAI "HiFi"
@@ -29,6 +30,16 @@
29static struct snd_soc_jack skylake_headset; 30static struct snd_soc_jack skylake_headset;
30static struct snd_soc_card skylake_audio_card; 31static struct snd_soc_card skylake_audio_card;
31 32
33enum {
34 SKL_DPCM_AUDIO_PB = 0,
35 SKL_DPCM_AUDIO_CP,
36 SKL_DPCM_AUDIO_REF_CP,
37 SKL_DPCM_AUDIO_DMIC_CP,
38 SKL_DPCM_AUDIO_HDMI1_PB,
39 SKL_DPCM_AUDIO_HDMI2_PB,
40 SKL_DPCM_AUDIO_HDMI3_PB,
41};
42
32static inline struct snd_soc_dai *skl_get_codec_dai(struct snd_soc_card *card) 43static inline struct snd_soc_dai *skl_get_codec_dai(struct snd_soc_card *card)
33{ 44{
34 struct snd_soc_pcm_runtime *rtd; 45 struct snd_soc_pcm_runtime *rtd;
@@ -87,7 +98,6 @@ static const struct snd_soc_dapm_widget skylake_widgets[] = {
87 SND_SOC_DAPM_MIC("Headset Mic", NULL), 98 SND_SOC_DAPM_MIC("Headset Mic", NULL),
88 SND_SOC_DAPM_SPK("Spk", NULL), 99 SND_SOC_DAPM_SPK("Spk", NULL),
89 SND_SOC_DAPM_MIC("SoC DMIC", NULL), 100 SND_SOC_DAPM_MIC("SoC DMIC", NULL),
90 SND_SOC_DAPM_SINK("WoV Sink"),
91 SND_SOC_DAPM_SPK("DP", NULL), 101 SND_SOC_DAPM_SPK("DP", NULL),
92 SND_SOC_DAPM_SPK("HDMI", NULL), 102 SND_SOC_DAPM_SPK("HDMI", NULL),
93 SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0, 103 SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
@@ -107,7 +117,6 @@ static const struct snd_soc_dapm_route skylake_map[] = {
107 { "MIC", NULL, "Headset Mic" }, 117 { "MIC", NULL, "Headset Mic" },
108 { "DMic", NULL, "SoC DMIC" }, 118 { "DMic", NULL, "SoC DMIC" },
109 119
110 {"WoV Sink", NULL, "hwd_in sink"},
111 {"HDMI", NULL, "hif5 Output"}, 120 {"HDMI", NULL, "hif5 Output"},
112 {"DP", NULL, "hif6 Output"}, 121 {"DP", NULL, "hif6 Output"},
113 122
@@ -124,8 +133,14 @@ static const struct snd_soc_dapm_route skylake_map[] = {
124 /* DMIC */ 133 /* DMIC */
125 { "dmic01_hifi", NULL, "DMIC01 Rx" }, 134 { "dmic01_hifi", NULL, "DMIC01 Rx" },
126 { "DMIC01 Rx", NULL, "DMIC AIF" }, 135 { "DMIC01 Rx", NULL, "DMIC AIF" },
127 { "hifi1", NULL, "iDisp Tx"}, 136
128 { "iDisp Tx", NULL, "iDisp_out"}, 137 { "hifi3", NULL, "iDisp3 Tx"},
138 { "iDisp3 Tx", NULL, "iDisp3_out"},
139 { "hifi2", NULL, "iDisp2 Tx"},
140 { "iDisp2 Tx", NULL, "iDisp2_out"},
141 { "hifi1", NULL, "iDisp1 Tx"},
142 { "iDisp1 Tx", NULL, "iDisp1_out"},
143
129 { "Headphone Jack", NULL, "Platform Clock" }, 144 { "Headphone Jack", NULL, "Platform Clock" },
130 { "Headset Mic", NULL, "Platform Clock" }, 145 { "Headset Mic", NULL, "Platform Clock" },
131}; 146};
@@ -171,11 +186,31 @@ static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd)
171 nau8825_enable_jack_detect(codec, &skylake_headset); 186 nau8825_enable_jack_detect(codec, &skylake_headset);
172 187
173 snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC"); 188 snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
174 snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "WoV Sink");
175 189
176 return ret; 190 return ret;
177} 191}
178 192
193static int skylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
194{
195 struct snd_soc_dai *dai = rtd->codec_dai;
196
197 return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI1_PB);
198}
199
200static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd)
201{
202 struct snd_soc_dai *dai = rtd->codec_dai;
203
204 return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI2_PB);
205}
206
207static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd)
208{
209 struct snd_soc_dai *dai = rtd->codec_dai;
210
211 return hdac_hdmi_jack_init(dai, SKL_DPCM_AUDIO_HDMI3_PB);
212}
213
179static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd) 214static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd)
180{ 215{
181 struct snd_soc_dapm_context *dapm; 216 struct snd_soc_dapm_context *dapm;
@@ -318,7 +353,7 @@ static struct snd_soc_ops skylaye_refcap_ops = {
318/* skylake digital audio interface glue - connects codec <--> CPU */ 353/* skylake digital audio interface glue - connects codec <--> CPU */
319static struct snd_soc_dai_link skylake_dais[] = { 354static struct snd_soc_dai_link skylake_dais[] = {
320 /* Front End DAI links */ 355 /* Front End DAI links */
321 { 356 [SKL_DPCM_AUDIO_PB] = {
322 .name = "Skl Audio Port", 357 .name = "Skl Audio Port",
323 .stream_name = "Audio", 358 .stream_name = "Audio",
324 .cpu_dai_name = "System Pin", 359 .cpu_dai_name = "System Pin",
@@ -333,7 +368,7 @@ static struct snd_soc_dai_link skylake_dais[] = {
333 .dpcm_playback = 1, 368 .dpcm_playback = 1,
334 .ops = &skylake_nau8825_fe_ops, 369 .ops = &skylake_nau8825_fe_ops,
335 }, 370 },
336 { 371 [SKL_DPCM_AUDIO_CP] = {
337 .name = "Skl Audio Capture Port", 372 .name = "Skl Audio Capture Port",
338 .stream_name = "Audio Record", 373 .stream_name = "Audio Record",
339 .cpu_dai_name = "System Pin", 374 .cpu_dai_name = "System Pin",
@@ -347,7 +382,7 @@ static struct snd_soc_dai_link skylake_dais[] = {
347 .dpcm_capture = 1, 382 .dpcm_capture = 1,
348 .ops = &skylake_nau8825_fe_ops, 383 .ops = &skylake_nau8825_fe_ops,
349 }, 384 },
350 { 385 [SKL_DPCM_AUDIO_REF_CP] = {
351 .name = "Skl Audio Reference cap", 386 .name = "Skl Audio Reference cap",
352 .stream_name = "Wake on Voice", 387 .stream_name = "Wake on Voice",
353 .cpu_dai_name = "Reference Pin", 388 .cpu_dai_name = "Reference Pin",
@@ -361,7 +396,7 @@ static struct snd_soc_dai_link skylake_dais[] = {
361 .dynamic = 1, 396 .dynamic = 1,
362 .ops = &skylaye_refcap_ops, 397 .ops = &skylaye_refcap_ops,
363 }, 398 },
364 { 399 [SKL_DPCM_AUDIO_DMIC_CP] = {
365 .name = "Skl Audio DMIC cap", 400 .name = "Skl Audio DMIC cap",
366 .stream_name = "dmiccap", 401 .stream_name = "dmiccap",
367 .cpu_dai_name = "DMIC Pin", 402 .cpu_dai_name = "DMIC Pin",
@@ -374,15 +409,45 @@ static struct snd_soc_dai_link skylake_dais[] = {
374 .dynamic = 1, 409 .dynamic = 1,
375 .ops = &skylake_dmic_ops, 410 .ops = &skylake_dmic_ops,
376 }, 411 },
377 { 412 [SKL_DPCM_AUDIO_HDMI1_PB] = {
378 .name = "Skl HDMI Port", 413 .name = "Skl HDMI Port1",
379 .stream_name = "Hdmi", 414 .stream_name = "Hdmi1",
380 .cpu_dai_name = "HDMI Pin", 415 .cpu_dai_name = "HDMI1 Pin",
416 .codec_name = "snd-soc-dummy",
417 .codec_dai_name = "snd-soc-dummy-dai",
418 .platform_name = "0000:00:1f.3",
419 .dpcm_playback = 1,
420 .init = NULL,
421 .trigger = {
422 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
423 .nonatomic = 1,
424 .dynamic = 1,
425 },
426 [SKL_DPCM_AUDIO_HDMI2_PB] = {
427 .name = "Skl HDMI Port2",
428 .stream_name = "Hdmi2",
429 .cpu_dai_name = "HDMI2 Pin",
381 .codec_name = "snd-soc-dummy", 430 .codec_name = "snd-soc-dummy",
382 .codec_dai_name = "snd-soc-dummy-dai", 431 .codec_dai_name = "snd-soc-dummy-dai",
383 .platform_name = "0000:00:1f.3", 432 .platform_name = "0000:00:1f.3",
384 .dpcm_playback = 1, 433 .dpcm_playback = 1,
385 .init = NULL, 434 .init = NULL,
435 .trigger = {
436 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
437 .nonatomic = 1,
438 .dynamic = 1,
439 },
440 [SKL_DPCM_AUDIO_HDMI3_PB] = {
441 .name = "Skl HDMI Port3",
442 .stream_name = "Hdmi3",
443 .cpu_dai_name = "HDMI3 Pin",
444 .codec_name = "snd-soc-dummy",
445 .codec_dai_name = "snd-soc-dummy-dai",
446 .platform_name = "0000:00:1f.3",
447 .trigger = {
448 SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
449 .dpcm_playback = 1,
450 .init = NULL,
386 .nonatomic = 1, 451 .nonatomic = 1,
387 .dynamic = 1, 452 .dynamic = 1,
388 }, 453 },
@@ -407,7 +472,7 @@ static struct snd_soc_dai_link skylake_dais[] = {
407 { 472 {
408 /* SSP1 - Codec */ 473 /* SSP1 - Codec */
409 .name = "SSP1-Codec", 474 .name = "SSP1-Codec",
410 .be_id = 0, 475 .be_id = 1,
411 .cpu_dai_name = "SSP1 Pin", 476 .cpu_dai_name = "SSP1 Pin",
412 .platform_name = "0000:00:1f.3", 477 .platform_name = "0000:00:1f.3",
413 .no_pcm = 1, 478 .no_pcm = 1,
@@ -424,7 +489,7 @@ static struct snd_soc_dai_link skylake_dais[] = {
424 }, 489 },
425 { 490 {
426 .name = "dmic01", 491 .name = "dmic01",
427 .be_id = 1, 492 .be_id = 2,
428 .cpu_dai_name = "DMIC01 Pin", 493 .cpu_dai_name = "DMIC01 Pin",
429 .codec_name = "dmic-codec", 494 .codec_name = "dmic-codec",
430 .codec_dai_name = "dmic-hifi", 495 .codec_dai_name = "dmic-hifi",
@@ -435,13 +500,36 @@ static struct snd_soc_dai_link skylake_dais[] = {
435 .no_pcm = 1, 500 .no_pcm = 1,
436 }, 501 },
437 { 502 {
438 .name = "iDisp", 503 .name = "iDisp1",
439 .be_id = 3, 504 .be_id = 3,
440 .cpu_dai_name = "iDisp Pin", 505 .cpu_dai_name = "iDisp1 Pin",
441 .codec_name = "ehdaudio0D2", 506 .codec_name = "ehdaudio0D2",
442 .codec_dai_name = "intel-hdmi-hifi1", 507 .codec_dai_name = "intel-hdmi-hifi1",
443 .platform_name = "0000:00:1f.3", 508 .platform_name = "0000:00:1f.3",
444 .dpcm_playback = 1, 509 .dpcm_playback = 1,
510 .init = skylake_hdmi1_init,
511 .no_pcm = 1,
512 },
513 {
514 .name = "iDisp2",
515 .be_id = 4,
516 .cpu_dai_name = "iDisp2 Pin",
517 .codec_name = "ehdaudio0D2",
518 .codec_dai_name = "intel-hdmi-hifi2",
519 .platform_name = "0000:00:1f.3",
520 .init = skylake_hdmi2_init,
521 .dpcm_playback = 1,
522 .no_pcm = 1,
523 },
524 {
525 .name = "iDisp3",
526 .be_id = 5,
527 .cpu_dai_name = "iDisp3 Pin",
528 .codec_name = "ehdaudio0D2",
529 .codec_dai_name = "intel-hdmi-hifi3",
530 .platform_name = "0000:00:1f.3",
531 .init = skylake_hdmi3_init,
532 .dpcm_playback = 1,
445 .no_pcm = 1, 533 .no_pcm = 1,
446 }, 534 },
447}; 535};