.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Intel Skylake I2S Machine Driver for NAU88L25+SSM4567 |
---|
3 | 4 | * |
---|
.. | .. |
---|
7 | 8 | * Intel Skylake I2S Machine Driver for NAU88L25 and SSM4567 |
---|
8 | 9 | * |
---|
9 | 10 | * Copyright (C) 2015, Intel Corporation. All rights reserved. |
---|
10 | | - * |
---|
11 | | - * This program is free software; you can redistribute it and/or |
---|
12 | | - * modify it under the terms of the GNU General Public License version |
---|
13 | | - * 2 as published by the Free Software Foundation. |
---|
14 | | - * |
---|
15 | | - * This program is distributed in the hope that it will be useful, |
---|
16 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 | | - * GNU General Public License for more details. |
---|
19 | 11 | */ |
---|
20 | 12 | |
---|
21 | 13 | #include <linux/module.h> |
---|
.. | .. |
---|
23 | 15 | #include <sound/core.h> |
---|
24 | 16 | #include <sound/pcm.h> |
---|
25 | 17 | #include <sound/soc.h> |
---|
| 18 | +#include <sound/soc-acpi.h> |
---|
26 | 19 | #include <sound/jack.h> |
---|
27 | 20 | #include <sound/pcm_params.h> |
---|
28 | 21 | #include "../../codecs/nau8825.h" |
---|
29 | 22 | #include "../../codecs/hdac_hdmi.h" |
---|
30 | | -#include "../skylake/skl.h" |
---|
31 | 23 | |
---|
32 | 24 | #define SKL_NUVOTON_CODEC_DAI "nau8825-hifi" |
---|
33 | 25 | #define SKL_SSM_CODEC_DAI "ssm4567-hifi" |
---|
.. | .. |
---|
155 | 147 | |
---|
156 | 148 | static struct snd_soc_codec_conf ssm4567_codec_conf[] = { |
---|
157 | 149 | { |
---|
158 | | - .dev_name = "i2c-INT343B:00", |
---|
| 150 | + .dlc = COMP_CODEC_CONF("i2c-INT343B:00"), |
---|
159 | 151 | .name_prefix = "Left", |
---|
160 | 152 | }, |
---|
161 | 153 | { |
---|
162 | | - .dev_name = "i2c-INT343B:01", |
---|
| 154 | + .dlc = COMP_CODEC_CONF("i2c-INT343B:01"), |
---|
163 | 155 | .name_prefix = "Right", |
---|
164 | | - }, |
---|
165 | | -}; |
---|
166 | | - |
---|
167 | | -static struct snd_soc_dai_link_component ssm4567_codec_components[] = { |
---|
168 | | - { /* Left */ |
---|
169 | | - .name = "i2c-INT343B:00", |
---|
170 | | - .dai_name = SKL_SSM_CODEC_DAI, |
---|
171 | | - }, |
---|
172 | | - { /* Right */ |
---|
173 | | - .name = "i2c-INT343B:01", |
---|
174 | | - .dai_name = SKL_SSM_CODEC_DAI, |
---|
175 | 156 | }, |
---|
176 | 157 | }; |
---|
177 | 158 | |
---|
.. | .. |
---|
180 | 161 | int ret; |
---|
181 | 162 | |
---|
182 | 163 | /* Slot 1 for left */ |
---|
183 | | - ret = snd_soc_dai_set_tdm_slot(rtd->codec_dais[0], 0x01, 0x01, 2, 48); |
---|
| 164 | + ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_codec(rtd, 0), 0x01, 0x01, 2, 48); |
---|
184 | 165 | if (ret < 0) |
---|
185 | 166 | return ret; |
---|
186 | 167 | |
---|
187 | 168 | /* Slot 2 for right */ |
---|
188 | | - ret = snd_soc_dai_set_tdm_slot(rtd->codec_dais[1], 0x02, 0x02, 2, 48); |
---|
| 169 | + ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_codec(rtd, 1), 0x02, 0x02, 2, 48); |
---|
189 | 170 | if (ret < 0) |
---|
190 | 171 | return ret; |
---|
191 | 172 | |
---|
.. | .. |
---|
195 | 176 | static int skylake_nau8825_codec_init(struct snd_soc_pcm_runtime *rtd) |
---|
196 | 177 | { |
---|
197 | 178 | int ret; |
---|
198 | | - struct snd_soc_component *component = rtd->codec_dai->component; |
---|
| 179 | + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; |
---|
199 | 180 | |
---|
200 | 181 | /* |
---|
201 | 182 | * 4 buttons here map to the google Reference headset |
---|
.. | .. |
---|
220 | 201 | static int skylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd) |
---|
221 | 202 | { |
---|
222 | 203 | struct skl_nau88125_private *ctx = snd_soc_card_get_drvdata(rtd->card); |
---|
223 | | - struct snd_soc_dai *dai = rtd->codec_dai; |
---|
| 204 | + struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0); |
---|
224 | 205 | struct skl_hdmi_pcm *pcm; |
---|
225 | 206 | |
---|
226 | 207 | pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); |
---|
.. | .. |
---|
238 | 219 | static int skylake_hdmi2_init(struct snd_soc_pcm_runtime *rtd) |
---|
239 | 220 | { |
---|
240 | 221 | struct skl_nau88125_private *ctx = snd_soc_card_get_drvdata(rtd->card); |
---|
241 | | - struct snd_soc_dai *dai = rtd->codec_dai; |
---|
| 222 | + struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0); |
---|
242 | 223 | struct skl_hdmi_pcm *pcm; |
---|
243 | 224 | |
---|
244 | 225 | pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); |
---|
.. | .. |
---|
257 | 238 | static int skylake_hdmi3_init(struct snd_soc_pcm_runtime *rtd) |
---|
258 | 239 | { |
---|
259 | 240 | struct skl_nau88125_private *ctx = snd_soc_card_get_drvdata(rtd->card); |
---|
260 | | - struct snd_soc_dai *dai = rtd->codec_dai; |
---|
| 241 | + struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0); |
---|
261 | 242 | struct skl_hdmi_pcm *pcm; |
---|
262 | 243 | |
---|
263 | 244 | pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); |
---|
.. | .. |
---|
275 | 256 | static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd) |
---|
276 | 257 | { |
---|
277 | 258 | struct snd_soc_dapm_context *dapm; |
---|
278 | | - struct snd_soc_component *component = rtd->cpu_dai->component; |
---|
| 259 | + struct snd_soc_component *component = asoc_rtd_to_cpu(rtd, 0)->component; |
---|
279 | 260 | |
---|
280 | 261 | dapm = snd_soc_component_get_dapm(component); |
---|
281 | 262 | snd_soc_dapm_ignore_suspend(dapm, "Reference Capture"); |
---|
.. | .. |
---|
336 | 317 | { |
---|
337 | 318 | struct snd_interval *rate = hw_param_interval(params, |
---|
338 | 319 | SNDRV_PCM_HW_PARAM_RATE); |
---|
339 | | - struct snd_interval *channels = hw_param_interval(params, |
---|
| 320 | + struct snd_interval *chan = hw_param_interval(params, |
---|
340 | 321 | SNDRV_PCM_HW_PARAM_CHANNELS); |
---|
341 | 322 | struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); |
---|
342 | 323 | |
---|
343 | 324 | /* The ADSP will covert the FE rate to 48k, stereo */ |
---|
344 | 325 | rate->min = rate->max = 48000; |
---|
345 | | - channels->min = channels->max = 2; |
---|
| 326 | + chan->min = chan->max = 2; |
---|
346 | 327 | |
---|
347 | 328 | /* set SSP0 to 24 bit */ |
---|
348 | 329 | snd_mask_none(fmt); |
---|
.. | .. |
---|
353 | 334 | static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd, |
---|
354 | 335 | struct snd_pcm_hw_params *params) |
---|
355 | 336 | { |
---|
356 | | - struct snd_interval *channels = hw_param_interval(params, |
---|
| 337 | + struct snd_interval *chan = hw_param_interval(params, |
---|
357 | 338 | SNDRV_PCM_HW_PARAM_CHANNELS); |
---|
358 | 339 | if (params_channels(params) == 2 || DMIC_CH(dmic_constraints) == 2) |
---|
359 | | - channels->min = channels->max = 2; |
---|
| 340 | + chan->min = chan->max = 2; |
---|
360 | 341 | else |
---|
361 | | - channels->min = channels->max = 4; |
---|
| 342 | + chan->min = chan->max = 4; |
---|
362 | 343 | |
---|
363 | 344 | return 0; |
---|
364 | 345 | } |
---|
.. | .. |
---|
366 | 347 | static int skylake_nau8825_hw_params(struct snd_pcm_substream *substream, |
---|
367 | 348 | struct snd_pcm_hw_params *params) |
---|
368 | 349 | { |
---|
369 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
370 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
---|
| 350 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
| 351 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
---|
371 | 352 | int ret; |
---|
372 | 353 | |
---|
373 | 354 | ret = snd_soc_dai_set_sysclk(codec_dai, |
---|
.. | .. |
---|
449 | 430 | &constraints_16000); |
---|
450 | 431 | } |
---|
451 | 432 | |
---|
452 | | -static const struct snd_soc_ops skylaye_refcap_ops = { |
---|
| 433 | +static const struct snd_soc_ops skylake_refcap_ops = { |
---|
453 | 434 | .startup = skylake_refcap_startup, |
---|
454 | 435 | }; |
---|
| 436 | + |
---|
| 437 | +SND_SOC_DAILINK_DEF(dummy, |
---|
| 438 | + DAILINK_COMP_ARRAY(COMP_DUMMY())); |
---|
| 439 | + |
---|
| 440 | +SND_SOC_DAILINK_DEF(system, |
---|
| 441 | + DAILINK_COMP_ARRAY(COMP_CPU("System Pin"))); |
---|
| 442 | + |
---|
| 443 | +SND_SOC_DAILINK_DEF(reference, |
---|
| 444 | + DAILINK_COMP_ARRAY(COMP_CPU("Reference Pin"))); |
---|
| 445 | + |
---|
| 446 | +SND_SOC_DAILINK_DEF(dmic, |
---|
| 447 | + DAILINK_COMP_ARRAY(COMP_CPU("DMIC Pin"))); |
---|
| 448 | + |
---|
| 449 | +SND_SOC_DAILINK_DEF(hdmi1, |
---|
| 450 | + DAILINK_COMP_ARRAY(COMP_CPU("HDMI1 Pin"))); |
---|
| 451 | + |
---|
| 452 | +SND_SOC_DAILINK_DEF(hdmi2, |
---|
| 453 | + DAILINK_COMP_ARRAY(COMP_CPU("HDMI2 Pin"))); |
---|
| 454 | + |
---|
| 455 | +SND_SOC_DAILINK_DEF(hdmi3, |
---|
| 456 | + DAILINK_COMP_ARRAY(COMP_CPU("HDMI3 Pin"))); |
---|
| 457 | + |
---|
| 458 | +SND_SOC_DAILINK_DEF(ssp0_pin, |
---|
| 459 | + DAILINK_COMP_ARRAY(COMP_CPU("SSP0 Pin"))); |
---|
| 460 | +SND_SOC_DAILINK_DEF(ssp0_codec, |
---|
| 461 | + DAILINK_COMP_ARRAY( |
---|
| 462 | + /* Left */ COMP_CODEC("i2c-INT343B:00", SKL_SSM_CODEC_DAI), |
---|
| 463 | + /* Right */ COMP_CODEC("i2c-INT343B:01", SKL_SSM_CODEC_DAI))); |
---|
| 464 | + |
---|
| 465 | +SND_SOC_DAILINK_DEF(ssp1_pin, |
---|
| 466 | + DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin"))); |
---|
| 467 | +SND_SOC_DAILINK_DEF(ssp1_codec, |
---|
| 468 | + DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10508825:00", SKL_NUVOTON_CODEC_DAI))); |
---|
| 469 | + |
---|
| 470 | +SND_SOC_DAILINK_DEF(dmic01_pin, |
---|
| 471 | + DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin"))); |
---|
| 472 | +SND_SOC_DAILINK_DEF(dmic_codec, |
---|
| 473 | + DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi"))); |
---|
| 474 | + |
---|
| 475 | +SND_SOC_DAILINK_DEF(idisp1_pin, |
---|
| 476 | + DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin"))); |
---|
| 477 | +SND_SOC_DAILINK_DEF(idisp1_codec, |
---|
| 478 | + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1"))); |
---|
| 479 | + |
---|
| 480 | +SND_SOC_DAILINK_DEF(idisp2_pin, |
---|
| 481 | + DAILINK_COMP_ARRAY(COMP_CPU("iDisp2 Pin"))); |
---|
| 482 | +SND_SOC_DAILINK_DEF(idisp2_codec, |
---|
| 483 | + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2"))); |
---|
| 484 | + |
---|
| 485 | +SND_SOC_DAILINK_DEF(idisp3_pin, |
---|
| 486 | + DAILINK_COMP_ARRAY(COMP_CPU("iDisp3 Pin"))); |
---|
| 487 | +SND_SOC_DAILINK_DEF(idisp3_codec, |
---|
| 488 | + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3"))); |
---|
| 489 | + |
---|
| 490 | +SND_SOC_DAILINK_DEF(platform, |
---|
| 491 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:1f.3"))); |
---|
455 | 492 | |
---|
456 | 493 | /* skylake digital audio interface glue - connects codec <--> CPU */ |
---|
457 | 494 | static struct snd_soc_dai_link skylake_dais[] = { |
---|
.. | .. |
---|
459 | 496 | [SKL_DPCM_AUDIO_PB] = { |
---|
460 | 497 | .name = "Skl Audio Port", |
---|
461 | 498 | .stream_name = "Audio", |
---|
462 | | - .cpu_dai_name = "System Pin", |
---|
463 | | - .platform_name = "0000:00:1f.3", |
---|
464 | 499 | .dynamic = 1, |
---|
465 | | - .codec_name = "snd-soc-dummy", |
---|
466 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
467 | 500 | .nonatomic = 1, |
---|
468 | 501 | .init = skylake_nau8825_fe_init, |
---|
469 | 502 | .trigger = { |
---|
470 | 503 | SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, |
---|
471 | 504 | .dpcm_playback = 1, |
---|
472 | 505 | .ops = &skylake_nau8825_fe_ops, |
---|
| 506 | + SND_SOC_DAILINK_REG(system, dummy, platform), |
---|
473 | 507 | }, |
---|
474 | 508 | [SKL_DPCM_AUDIO_CP] = { |
---|
475 | 509 | .name = "Skl Audio Capture Port", |
---|
476 | 510 | .stream_name = "Audio Record", |
---|
477 | | - .cpu_dai_name = "System Pin", |
---|
478 | | - .platform_name = "0000:00:1f.3", |
---|
479 | 511 | .dynamic = 1, |
---|
480 | | - .codec_name = "snd-soc-dummy", |
---|
481 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
482 | 512 | .nonatomic = 1, |
---|
483 | 513 | .trigger = { |
---|
484 | 514 | SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, |
---|
485 | 515 | .dpcm_capture = 1, |
---|
486 | 516 | .ops = &skylake_nau8825_fe_ops, |
---|
| 517 | + SND_SOC_DAILINK_REG(system, dummy, platform), |
---|
487 | 518 | }, |
---|
488 | 519 | [SKL_DPCM_AUDIO_REF_CP] = { |
---|
489 | 520 | .name = "Skl Audio Reference cap", |
---|
490 | 521 | .stream_name = "Wake on Voice", |
---|
491 | | - .cpu_dai_name = "Reference Pin", |
---|
492 | | - .codec_name = "snd-soc-dummy", |
---|
493 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
494 | | - .platform_name = "0000:00:1f.3", |
---|
495 | 522 | .init = NULL, |
---|
496 | 523 | .dpcm_capture = 1, |
---|
497 | 524 | .nonatomic = 1, |
---|
498 | 525 | .dynamic = 1, |
---|
499 | | - .ops = &skylaye_refcap_ops, |
---|
| 526 | + .ops = &skylake_refcap_ops, |
---|
| 527 | + SND_SOC_DAILINK_REG(reference, dummy, platform), |
---|
500 | 528 | }, |
---|
501 | 529 | [SKL_DPCM_AUDIO_DMIC_CP] = { |
---|
502 | 530 | .name = "Skl Audio DMIC cap", |
---|
503 | 531 | .stream_name = "dmiccap", |
---|
504 | | - .cpu_dai_name = "DMIC Pin", |
---|
505 | | - .codec_name = "snd-soc-dummy", |
---|
506 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
507 | | - .platform_name = "0000:00:1f.3", |
---|
508 | 532 | .init = NULL, |
---|
509 | 533 | .dpcm_capture = 1, |
---|
510 | 534 | .nonatomic = 1, |
---|
511 | 535 | .dynamic = 1, |
---|
512 | 536 | .ops = &skylake_dmic_ops, |
---|
| 537 | + SND_SOC_DAILINK_REG(dmic, dummy, platform), |
---|
513 | 538 | }, |
---|
514 | 539 | [SKL_DPCM_AUDIO_HDMI1_PB] = { |
---|
515 | 540 | .name = "Skl HDMI Port1", |
---|
516 | 541 | .stream_name = "Hdmi1", |
---|
517 | | - .cpu_dai_name = "HDMI1 Pin", |
---|
518 | | - .codec_name = "snd-soc-dummy", |
---|
519 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
520 | | - .platform_name = "0000:00:1f.3", |
---|
521 | 542 | .dpcm_playback = 1, |
---|
522 | 543 | .init = NULL, |
---|
523 | 544 | .trigger = { |
---|
524 | 545 | SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, |
---|
525 | 546 | .nonatomic = 1, |
---|
526 | 547 | .dynamic = 1, |
---|
| 548 | + SND_SOC_DAILINK_REG(hdmi1, dummy, platform), |
---|
527 | 549 | }, |
---|
528 | 550 | [SKL_DPCM_AUDIO_HDMI2_PB] = { |
---|
529 | 551 | .name = "Skl HDMI Port2", |
---|
530 | 552 | .stream_name = "Hdmi2", |
---|
531 | | - .cpu_dai_name = "HDMI2 Pin", |
---|
532 | | - .codec_name = "snd-soc-dummy", |
---|
533 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
534 | | - .platform_name = "0000:00:1f.3", |
---|
535 | 553 | .dpcm_playback = 1, |
---|
536 | 554 | .init = NULL, |
---|
537 | 555 | .trigger = { |
---|
538 | 556 | SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, |
---|
539 | 557 | .nonatomic = 1, |
---|
540 | 558 | .dynamic = 1, |
---|
| 559 | + SND_SOC_DAILINK_REG(hdmi2, dummy, platform), |
---|
541 | 560 | }, |
---|
542 | 561 | [SKL_DPCM_AUDIO_HDMI3_PB] = { |
---|
543 | 562 | .name = "Skl HDMI Port3", |
---|
544 | 563 | .stream_name = "Hdmi3", |
---|
545 | | - .cpu_dai_name = "HDMI3 Pin", |
---|
546 | | - .codec_name = "snd-soc-dummy", |
---|
547 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
548 | | - .platform_name = "0000:00:1f.3", |
---|
549 | 564 | .trigger = { |
---|
550 | 565 | SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, |
---|
551 | 566 | .dpcm_playback = 1, |
---|
552 | 567 | .init = NULL, |
---|
553 | 568 | .nonatomic = 1, |
---|
554 | 569 | .dynamic = 1, |
---|
| 570 | + SND_SOC_DAILINK_REG(hdmi3, dummy, platform), |
---|
555 | 571 | }, |
---|
556 | 572 | |
---|
557 | 573 | /* Back End DAI links */ |
---|
.. | .. |
---|
559 | 575 | /* SSP0 - Codec */ |
---|
560 | 576 | .name = "SSP0-Codec", |
---|
561 | 577 | .id = 0, |
---|
562 | | - .cpu_dai_name = "SSP0 Pin", |
---|
563 | | - .platform_name = "0000:00:1f.3", |
---|
564 | 578 | .no_pcm = 1, |
---|
565 | | - .codecs = ssm4567_codec_components, |
---|
566 | | - .num_codecs = ARRAY_SIZE(ssm4567_codec_components), |
---|
567 | 579 | .dai_fmt = SND_SOC_DAIFMT_DSP_A | |
---|
568 | 580 | SND_SOC_DAIFMT_IB_NF | |
---|
569 | 581 | SND_SOC_DAIFMT_CBS_CFS, |
---|
.. | .. |
---|
572 | 584 | .be_hw_params_fixup = skylake_ssp_fixup, |
---|
573 | 585 | .dpcm_playback = 1, |
---|
574 | 586 | .dpcm_capture = 1, |
---|
| 587 | + SND_SOC_DAILINK_REG(ssp0_pin, ssp0_codec, platform), |
---|
575 | 588 | }, |
---|
576 | 589 | { |
---|
577 | 590 | /* SSP1 - Codec */ |
---|
578 | 591 | .name = "SSP1-Codec", |
---|
579 | 592 | .id = 1, |
---|
580 | | - .cpu_dai_name = "SSP1 Pin", |
---|
581 | | - .platform_name = "0000:00:1f.3", |
---|
582 | 593 | .no_pcm = 1, |
---|
583 | | - .codec_name = "i2c-10508825:00", |
---|
584 | | - .codec_dai_name = SKL_NUVOTON_CODEC_DAI, |
---|
585 | 594 | .init = skylake_nau8825_codec_init, |
---|
586 | 595 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
587 | 596 | SND_SOC_DAIFMT_CBS_CFS, |
---|
.. | .. |
---|
590 | 599 | .ops = &skylake_nau8825_ops, |
---|
591 | 600 | .dpcm_playback = 1, |
---|
592 | 601 | .dpcm_capture = 1, |
---|
| 602 | + SND_SOC_DAILINK_REG(ssp1_pin, ssp1_codec, platform), |
---|
593 | 603 | }, |
---|
594 | 604 | { |
---|
595 | 605 | .name = "dmic01", |
---|
596 | 606 | .id = 2, |
---|
597 | | - .cpu_dai_name = "DMIC01 Pin", |
---|
598 | | - .codec_name = "dmic-codec", |
---|
599 | | - .codec_dai_name = "dmic-hifi", |
---|
600 | | - .platform_name = "0000:00:1f.3", |
---|
601 | 607 | .ignore_suspend = 1, |
---|
602 | 608 | .be_hw_params_fixup = skylake_dmic_fixup, |
---|
603 | 609 | .dpcm_capture = 1, |
---|
604 | 610 | .no_pcm = 1, |
---|
| 611 | + SND_SOC_DAILINK_REG(dmic01_pin, dmic_codec, platform), |
---|
605 | 612 | }, |
---|
606 | 613 | { |
---|
607 | 614 | .name = "iDisp1", |
---|
608 | 615 | .id = 3, |
---|
609 | | - .cpu_dai_name = "iDisp1 Pin", |
---|
610 | | - .codec_name = "ehdaudio0D2", |
---|
611 | | - .codec_dai_name = "intel-hdmi-hifi1", |
---|
612 | | - .platform_name = "0000:00:1f.3", |
---|
613 | 616 | .dpcm_playback = 1, |
---|
614 | 617 | .init = skylake_hdmi1_init, |
---|
615 | 618 | .no_pcm = 1, |
---|
| 619 | + SND_SOC_DAILINK_REG(idisp1_pin, idisp1_codec, platform), |
---|
616 | 620 | }, |
---|
617 | 621 | { |
---|
618 | 622 | .name = "iDisp2", |
---|
619 | 623 | .id = 4, |
---|
620 | | - .cpu_dai_name = "iDisp2 Pin", |
---|
621 | | - .codec_name = "ehdaudio0D2", |
---|
622 | | - .codec_dai_name = "intel-hdmi-hifi2", |
---|
623 | | - .platform_name = "0000:00:1f.3", |
---|
624 | 624 | .init = skylake_hdmi2_init, |
---|
625 | 625 | .dpcm_playback = 1, |
---|
626 | 626 | .no_pcm = 1, |
---|
| 627 | + SND_SOC_DAILINK_REG(idisp2_pin, idisp2_codec, platform), |
---|
627 | 628 | }, |
---|
628 | 629 | { |
---|
629 | 630 | .name = "iDisp3", |
---|
630 | 631 | .id = 5, |
---|
631 | | - .cpu_dai_name = "iDisp3 Pin", |
---|
632 | | - .codec_name = "ehdaudio0D2", |
---|
633 | | - .codec_dai_name = "intel-hdmi-hifi3", |
---|
634 | | - .platform_name = "0000:00:1f.3", |
---|
635 | 632 | .init = skylake_hdmi3_init, |
---|
636 | 633 | .dpcm_playback = 1, |
---|
637 | 634 | .no_pcm = 1, |
---|
| 635 | + SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform), |
---|
638 | 636 | }, |
---|
639 | 637 | }; |
---|
640 | 638 | |
---|
.. | .. |
---|
688 | 686 | .codec_conf = ssm4567_codec_conf, |
---|
689 | 687 | .num_configs = ARRAY_SIZE(ssm4567_codec_conf), |
---|
690 | 688 | .fully_routed = true, |
---|
| 689 | + .disable_route_checks = true, |
---|
691 | 690 | .late_probe = skylake_card_late_probe, |
---|
692 | 691 | }; |
---|
693 | 692 | |
---|
694 | 693 | static int skylake_audio_probe(struct platform_device *pdev) |
---|
695 | 694 | { |
---|
696 | 695 | struct skl_nau88125_private *ctx; |
---|
697 | | - struct skl_machine_pdata *pdata; |
---|
| 696 | + struct snd_soc_acpi_mach *mach; |
---|
698 | 697 | |
---|
699 | 698 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); |
---|
700 | 699 | if (!ctx) |
---|
.. | .. |
---|
705 | 704 | skylake_audio_card.dev = &pdev->dev; |
---|
706 | 705 | snd_soc_card_set_drvdata(&skylake_audio_card, ctx); |
---|
707 | 706 | |
---|
708 | | - pdata = dev_get_drvdata(&pdev->dev); |
---|
709 | | - if (pdata) |
---|
710 | | - dmic_constraints = pdata->dmic_num == 2 ? |
---|
| 707 | + mach = pdev->dev.platform_data; |
---|
| 708 | + if (mach) |
---|
| 709 | + dmic_constraints = mach->mach_params.dmic_num == 2 ? |
---|
711 | 710 | &constraints_dmic_2ch : &constraints_dmic_channels; |
---|
712 | 711 | |
---|
713 | 712 | return devm_snd_soc_register_card(&pdev->dev, &skylake_audio_card); |
---|