.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Intel Broxton-P I2S Machine Driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Modified from: |
---|
7 | 8 | * Intel Skylake I2S Machine driver |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or |
---|
10 | | - * modify it under the terms of the GNU General Public License version |
---|
11 | | - * 2 as published by the Free Software Foundation. |
---|
12 | | - * |
---|
13 | | - * This program is distributed in the hope that it will be useful, |
---|
14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | | - * GNU General Public License for more details. |
---|
17 | 9 | */ |
---|
18 | 10 | |
---|
19 | 11 | #include <linux/module.h> |
---|
.. | .. |
---|
21 | 13 | #include <sound/core.h> |
---|
22 | 14 | #include <sound/pcm.h> |
---|
23 | 15 | #include <sound/soc.h> |
---|
| 16 | +#include <sound/soc-acpi.h> |
---|
24 | 17 | #include <sound/jack.h> |
---|
25 | 18 | #include <sound/pcm_params.h> |
---|
26 | 19 | #include "../../codecs/hdac_hdmi.h" |
---|
27 | 20 | #include "../../codecs/rt298.h" |
---|
| 21 | +#include "hda_dsp_common.h" |
---|
28 | 22 | |
---|
29 | 23 | /* Headset jack detection DAPM pins */ |
---|
30 | 24 | static struct snd_soc_jack broxton_headset; |
---|
.. | .. |
---|
38 | 32 | |
---|
39 | 33 | struct bxt_rt286_private { |
---|
40 | 34 | struct list_head hdmi_pcm_list; |
---|
| 35 | + bool common_hdmi_codec_drv; |
---|
41 | 36 | }; |
---|
42 | 37 | |
---|
43 | 38 | enum { |
---|
.. | .. |
---|
160 | 155 | static int broxton_rt298_fe_init(struct snd_soc_pcm_runtime *rtd) |
---|
161 | 156 | { |
---|
162 | 157 | struct snd_soc_dapm_context *dapm; |
---|
163 | | - struct snd_soc_component *component = rtd->cpu_dai->component; |
---|
| 158 | + struct snd_soc_component *component = asoc_rtd_to_cpu(rtd, 0)->component; |
---|
164 | 159 | |
---|
165 | 160 | dapm = snd_soc_component_get_dapm(component); |
---|
166 | 161 | snd_soc_dapm_ignore_suspend(dapm, "Reference Capture"); |
---|
.. | .. |
---|
170 | 165 | |
---|
171 | 166 | static int broxton_rt298_codec_init(struct snd_soc_pcm_runtime *rtd) |
---|
172 | 167 | { |
---|
173 | | - struct snd_soc_component *component = rtd->codec_dai->component; |
---|
| 168 | + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; |
---|
174 | 169 | int ret = 0; |
---|
175 | 170 | |
---|
176 | 171 | ret = snd_soc_card_jack_new(rtd->card, "Headset", |
---|
.. | .. |
---|
191 | 186 | static int broxton_hdmi_init(struct snd_soc_pcm_runtime *rtd) |
---|
192 | 187 | { |
---|
193 | 188 | struct bxt_rt286_private *ctx = snd_soc_card_get_drvdata(rtd->card); |
---|
194 | | - struct snd_soc_dai *dai = rtd->codec_dai; |
---|
| 189 | + struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0); |
---|
195 | 190 | struct bxt_hdmi_pcm *pcm; |
---|
196 | 191 | |
---|
197 | 192 | pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); |
---|
.. | .. |
---|
211 | 206 | { |
---|
212 | 207 | struct snd_interval *rate = hw_param_interval(params, |
---|
213 | 208 | SNDRV_PCM_HW_PARAM_RATE); |
---|
214 | | - struct snd_interval *channels = hw_param_interval(params, |
---|
| 209 | + struct snd_interval *chan = hw_param_interval(params, |
---|
215 | 210 | SNDRV_PCM_HW_PARAM_CHANNELS); |
---|
216 | 211 | struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); |
---|
217 | 212 | |
---|
218 | 213 | /* The ADSP will covert the FE rate to 48k, stereo */ |
---|
219 | 214 | rate->min = rate->max = 48000; |
---|
220 | | - channels->min = channels->max = 2; |
---|
| 215 | + chan->min = chan->max = 2; |
---|
221 | 216 | |
---|
222 | 217 | /* set SSP5 to 24 bit */ |
---|
223 | 218 | snd_mask_none(fmt); |
---|
.. | .. |
---|
229 | 224 | static int broxton_rt298_hw_params(struct snd_pcm_substream *substream, |
---|
230 | 225 | struct snd_pcm_hw_params *params) |
---|
231 | 226 | { |
---|
232 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
---|
233 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
---|
| 227 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
---|
| 228 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
---|
234 | 229 | int ret; |
---|
235 | 230 | |
---|
236 | 231 | ret = snd_soc_dai_set_sysclk(codec_dai, RT298_SCLK_S_PLL, |
---|
.. | .. |
---|
260 | 255 | static int broxton_dmic_fixup(struct snd_soc_pcm_runtime *rtd, |
---|
261 | 256 | struct snd_pcm_hw_params *params) |
---|
262 | 257 | { |
---|
263 | | - struct snd_interval *channels = hw_param_interval(params, |
---|
| 258 | + struct snd_interval *chan = hw_param_interval(params, |
---|
264 | 259 | SNDRV_PCM_HW_PARAM_CHANNELS); |
---|
265 | | - channels->min = channels->max = 4; |
---|
| 260 | + chan->min = chan->max = 4; |
---|
266 | 261 | |
---|
267 | 262 | return 0; |
---|
268 | 263 | } |
---|
.. | .. |
---|
330 | 325 | .startup = bxt_fe_startup, |
---|
331 | 326 | }; |
---|
332 | 327 | |
---|
| 328 | +SND_SOC_DAILINK_DEF(dummy, |
---|
| 329 | + DAILINK_COMP_ARRAY(COMP_DUMMY())); |
---|
| 330 | + |
---|
| 331 | +SND_SOC_DAILINK_DEF(system, |
---|
| 332 | + DAILINK_COMP_ARRAY(COMP_CPU("System Pin"))); |
---|
| 333 | + |
---|
| 334 | +SND_SOC_DAILINK_DEF(reference, |
---|
| 335 | + DAILINK_COMP_ARRAY(COMP_CPU("Reference Pin"))); |
---|
| 336 | + |
---|
| 337 | +SND_SOC_DAILINK_DEF(dmic, |
---|
| 338 | + DAILINK_COMP_ARRAY(COMP_CPU("DMIC Pin"))); |
---|
| 339 | + |
---|
| 340 | +SND_SOC_DAILINK_DEF(hdmi1, |
---|
| 341 | + DAILINK_COMP_ARRAY(COMP_CPU("HDMI1 Pin"))); |
---|
| 342 | + |
---|
| 343 | +SND_SOC_DAILINK_DEF(hdmi2, |
---|
| 344 | + DAILINK_COMP_ARRAY(COMP_CPU("HDMI2 Pin"))); |
---|
| 345 | + |
---|
| 346 | +SND_SOC_DAILINK_DEF(hdmi3, |
---|
| 347 | + DAILINK_COMP_ARRAY(COMP_CPU("HDMI3 Pin"))); |
---|
| 348 | + |
---|
| 349 | +SND_SOC_DAILINK_DEF(ssp5_pin, |
---|
| 350 | + DAILINK_COMP_ARRAY(COMP_CPU("SSP5 Pin"))); |
---|
| 351 | +SND_SOC_DAILINK_DEF(ssp5_codec, |
---|
| 352 | + DAILINK_COMP_ARRAY(COMP_CODEC("i2c-INT343A:00", |
---|
| 353 | + "rt298-aif1"))); |
---|
| 354 | + |
---|
| 355 | +SND_SOC_DAILINK_DEF(dmic_pin, |
---|
| 356 | + DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin"))); |
---|
| 357 | + |
---|
| 358 | +SND_SOC_DAILINK_DEF(dmic_codec, |
---|
| 359 | + DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", |
---|
| 360 | + "dmic-hifi"))); |
---|
| 361 | + |
---|
| 362 | +SND_SOC_DAILINK_DEF(dmic16k, |
---|
| 363 | + DAILINK_COMP_ARRAY(COMP_CPU("DMIC16k Pin"))); |
---|
| 364 | + |
---|
| 365 | +SND_SOC_DAILINK_DEF(idisp1_pin, |
---|
| 366 | + DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin"))); |
---|
| 367 | +SND_SOC_DAILINK_DEF(idisp1_codec, |
---|
| 368 | + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", |
---|
| 369 | + "intel-hdmi-hifi1"))); |
---|
| 370 | + |
---|
| 371 | +SND_SOC_DAILINK_DEF(idisp2_pin, |
---|
| 372 | + DAILINK_COMP_ARRAY(COMP_CPU("iDisp2 Pin"))); |
---|
| 373 | +SND_SOC_DAILINK_DEF(idisp2_codec, |
---|
| 374 | + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", |
---|
| 375 | + "intel-hdmi-hifi2"))); |
---|
| 376 | + |
---|
| 377 | +SND_SOC_DAILINK_DEF(idisp3_pin, |
---|
| 378 | + DAILINK_COMP_ARRAY(COMP_CPU("iDisp3 Pin"))); |
---|
| 379 | +SND_SOC_DAILINK_DEF(idisp3_codec, |
---|
| 380 | + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", |
---|
| 381 | + "intel-hdmi-hifi3"))); |
---|
| 382 | + |
---|
| 383 | +SND_SOC_DAILINK_DEF(platform, |
---|
| 384 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:0e.0"))); |
---|
| 385 | + |
---|
333 | 386 | /* broxton digital audio interface glue - connects codec <--> CPU */ |
---|
334 | 387 | static struct snd_soc_dai_link broxton_rt298_dais[] = { |
---|
335 | 388 | /* Front End DAI links */ |
---|
.. | .. |
---|
337 | 390 | { |
---|
338 | 391 | .name = "Bxt Audio Port", |
---|
339 | 392 | .stream_name = "Audio", |
---|
340 | | - .cpu_dai_name = "System Pin", |
---|
341 | | - .platform_name = "0000:00:0e.0", |
---|
342 | 393 | .nonatomic = 1, |
---|
343 | 394 | .dynamic = 1, |
---|
344 | | - .codec_name = "snd-soc-dummy", |
---|
345 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
346 | 395 | .init = broxton_rt298_fe_init, |
---|
347 | 396 | .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, |
---|
348 | 397 | .dpcm_playback = 1, |
---|
349 | 398 | .ops = &broxton_rt286_fe_ops, |
---|
| 399 | + SND_SOC_DAILINK_REG(system, dummy, platform), |
---|
350 | 400 | }, |
---|
351 | 401 | [BXT_DPCM_AUDIO_CP] = |
---|
352 | 402 | { |
---|
353 | 403 | .name = "Bxt Audio Capture Port", |
---|
354 | 404 | .stream_name = "Audio Record", |
---|
355 | | - .cpu_dai_name = "System Pin", |
---|
356 | | - .platform_name = "0000:00:0e.0", |
---|
357 | 405 | .nonatomic = 1, |
---|
358 | 406 | .dynamic = 1, |
---|
359 | | - .codec_name = "snd-soc-dummy", |
---|
360 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
361 | 407 | .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, |
---|
362 | 408 | .dpcm_capture = 1, |
---|
363 | 409 | .ops = &broxton_rt286_fe_ops, |
---|
| 410 | + SND_SOC_DAILINK_REG(system, dummy, platform), |
---|
364 | 411 | }, |
---|
365 | 412 | [BXT_DPCM_AUDIO_REF_CP] = |
---|
366 | 413 | { |
---|
367 | 414 | .name = "Bxt Audio Reference cap", |
---|
368 | 415 | .stream_name = "refcap", |
---|
369 | | - .cpu_dai_name = "Reference Pin", |
---|
370 | | - .codec_name = "snd-soc-dummy", |
---|
371 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
372 | | - .platform_name = "0000:00:0e.0", |
---|
373 | 416 | .init = NULL, |
---|
374 | 417 | .dpcm_capture = 1, |
---|
375 | 418 | .nonatomic = 1, |
---|
376 | 419 | .dynamic = 1, |
---|
| 420 | + SND_SOC_DAILINK_REG(reference, dummy, platform), |
---|
377 | 421 | }, |
---|
378 | 422 | [BXT_DPCM_AUDIO_DMIC_CP] = |
---|
379 | 423 | { |
---|
380 | 424 | .name = "Bxt Audio DMIC cap", |
---|
381 | 425 | .stream_name = "dmiccap", |
---|
382 | | - .cpu_dai_name = "DMIC Pin", |
---|
383 | | - .codec_name = "snd-soc-dummy", |
---|
384 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
385 | | - .platform_name = "0000:00:0e.0", |
---|
386 | 426 | .init = NULL, |
---|
387 | 427 | .dpcm_capture = 1, |
---|
388 | 428 | .nonatomic = 1, |
---|
389 | 429 | .dynamic = 1, |
---|
390 | 430 | .ops = &broxton_dmic_ops, |
---|
| 431 | + SND_SOC_DAILINK_REG(dmic, dummy, platform), |
---|
391 | 432 | }, |
---|
392 | 433 | [BXT_DPCM_AUDIO_HDMI1_PB] = |
---|
393 | 434 | { |
---|
394 | 435 | .name = "Bxt HDMI Port1", |
---|
395 | 436 | .stream_name = "Hdmi1", |
---|
396 | | - .cpu_dai_name = "HDMI1 Pin", |
---|
397 | | - .codec_name = "snd-soc-dummy", |
---|
398 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
399 | | - .platform_name = "0000:00:0e.0", |
---|
400 | 437 | .dpcm_playback = 1, |
---|
401 | 438 | .init = NULL, |
---|
402 | 439 | .nonatomic = 1, |
---|
403 | 440 | .dynamic = 1, |
---|
| 441 | + SND_SOC_DAILINK_REG(hdmi1, dummy, platform), |
---|
404 | 442 | }, |
---|
405 | 443 | [BXT_DPCM_AUDIO_HDMI2_PB] = |
---|
406 | 444 | { |
---|
407 | 445 | .name = "Bxt HDMI Port2", |
---|
408 | 446 | .stream_name = "Hdmi2", |
---|
409 | | - .cpu_dai_name = "HDMI2 Pin", |
---|
410 | | - .codec_name = "snd-soc-dummy", |
---|
411 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
412 | | - .platform_name = "0000:00:0e.0", |
---|
413 | 447 | .dpcm_playback = 1, |
---|
414 | 448 | .init = NULL, |
---|
415 | 449 | .nonatomic = 1, |
---|
416 | 450 | .dynamic = 1, |
---|
| 451 | + SND_SOC_DAILINK_REG(hdmi2, dummy, platform), |
---|
417 | 452 | }, |
---|
418 | 453 | [BXT_DPCM_AUDIO_HDMI3_PB] = |
---|
419 | 454 | { |
---|
420 | 455 | .name = "Bxt HDMI Port3", |
---|
421 | 456 | .stream_name = "Hdmi3", |
---|
422 | | - .cpu_dai_name = "HDMI3 Pin", |
---|
423 | | - .codec_name = "snd-soc-dummy", |
---|
424 | | - .codec_dai_name = "snd-soc-dummy-dai", |
---|
425 | | - .platform_name = "0000:00:0e.0", |
---|
426 | 457 | .dpcm_playback = 1, |
---|
427 | 458 | .init = NULL, |
---|
428 | 459 | .nonatomic = 1, |
---|
429 | 460 | .dynamic = 1, |
---|
| 461 | + SND_SOC_DAILINK_REG(hdmi3, dummy, platform), |
---|
430 | 462 | }, |
---|
431 | 463 | /* Back End DAI links */ |
---|
432 | 464 | { |
---|
433 | 465 | /* SSP5 - Codec */ |
---|
434 | 466 | .name = "SSP5-Codec", |
---|
435 | 467 | .id = 0, |
---|
436 | | - .cpu_dai_name = "SSP5 Pin", |
---|
437 | | - .platform_name = "0000:00:0e.0", |
---|
438 | 468 | .no_pcm = 1, |
---|
439 | | - .codec_name = "i2c-INT343A:00", |
---|
440 | | - .codec_dai_name = "rt298-aif1", |
---|
441 | 469 | .init = broxton_rt298_codec_init, |
---|
442 | 470 | .dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF | |
---|
443 | 471 | SND_SOC_DAIFMT_CBS_CFS, |
---|
.. | .. |
---|
446 | 474 | .ops = &broxton_rt298_ops, |
---|
447 | 475 | .dpcm_playback = 1, |
---|
448 | 476 | .dpcm_capture = 1, |
---|
| 477 | + SND_SOC_DAILINK_REG(ssp5_pin, ssp5_codec, platform), |
---|
449 | 478 | }, |
---|
450 | 479 | { |
---|
451 | 480 | .name = "dmic01", |
---|
452 | 481 | .id = 1, |
---|
453 | | - .cpu_dai_name = "DMIC01 Pin", |
---|
454 | | - .codec_name = "dmic-codec", |
---|
455 | | - .codec_dai_name = "dmic-hifi", |
---|
456 | | - .platform_name = "0000:00:0e.0", |
---|
457 | 482 | .be_hw_params_fixup = broxton_dmic_fixup, |
---|
458 | 483 | .ignore_suspend = 1, |
---|
459 | 484 | .dpcm_capture = 1, |
---|
460 | 485 | .no_pcm = 1, |
---|
| 486 | + SND_SOC_DAILINK_REG(dmic_pin, dmic_codec, platform), |
---|
461 | 487 | }, |
---|
462 | 488 | { |
---|
463 | 489 | .name = "dmic16k", |
---|
464 | 490 | .id = 2, |
---|
465 | | - .cpu_dai_name = "DMIC16k Pin", |
---|
466 | | - .codec_name = "dmic-codec", |
---|
467 | | - .codec_dai_name = "dmic-hifi", |
---|
468 | | - .platform_name = "0000:00:0e.0", |
---|
469 | 491 | .be_hw_params_fixup = broxton_dmic_fixup, |
---|
470 | 492 | .ignore_suspend = 1, |
---|
471 | 493 | .dpcm_capture = 1, |
---|
472 | 494 | .no_pcm = 1, |
---|
| 495 | + SND_SOC_DAILINK_REG(dmic16k, dmic_codec, platform), |
---|
473 | 496 | }, |
---|
474 | 497 | { |
---|
475 | 498 | .name = "iDisp1", |
---|
476 | 499 | .id = 3, |
---|
477 | | - .cpu_dai_name = "iDisp1 Pin", |
---|
478 | | - .codec_name = "ehdaudio0D2", |
---|
479 | | - .codec_dai_name = "intel-hdmi-hifi1", |
---|
480 | | - .platform_name = "0000:00:0e.0", |
---|
481 | 500 | .init = broxton_hdmi_init, |
---|
482 | 501 | .dpcm_playback = 1, |
---|
483 | 502 | .no_pcm = 1, |
---|
| 503 | + SND_SOC_DAILINK_REG(idisp1_pin, idisp1_codec, platform), |
---|
484 | 504 | }, |
---|
485 | 505 | { |
---|
486 | 506 | .name = "iDisp2", |
---|
487 | 507 | .id = 4, |
---|
488 | | - .cpu_dai_name = "iDisp2 Pin", |
---|
489 | | - .codec_name = "ehdaudio0D2", |
---|
490 | | - .codec_dai_name = "intel-hdmi-hifi2", |
---|
491 | | - .platform_name = "0000:00:0e.0", |
---|
492 | 508 | .init = broxton_hdmi_init, |
---|
493 | 509 | .dpcm_playback = 1, |
---|
494 | 510 | .no_pcm = 1, |
---|
| 511 | + SND_SOC_DAILINK_REG(idisp2_pin, idisp2_codec, platform), |
---|
495 | 512 | }, |
---|
496 | 513 | { |
---|
497 | 514 | .name = "iDisp3", |
---|
498 | 515 | .id = 5, |
---|
499 | | - .cpu_dai_name = "iDisp3 Pin", |
---|
500 | | - .codec_name = "ehdaudio0D2", |
---|
501 | | - .codec_dai_name = "intel-hdmi-hifi3", |
---|
502 | | - .platform_name = "0000:00:0e.0", |
---|
503 | 516 | .init = broxton_hdmi_init, |
---|
504 | 517 | .dpcm_playback = 1, |
---|
505 | 518 | .no_pcm = 1, |
---|
| 519 | + SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform), |
---|
506 | 520 | }, |
---|
507 | 521 | }; |
---|
508 | 522 | |
---|
.. | .. |
---|
514 | 528 | struct snd_soc_component *component = NULL; |
---|
515 | 529 | int err, i = 0; |
---|
516 | 530 | char jack_name[NAME_SIZE]; |
---|
| 531 | + |
---|
| 532 | + if (list_empty(&ctx->hdmi_pcm_list)) |
---|
| 533 | + return -EINVAL; |
---|
| 534 | + |
---|
| 535 | + if (ctx->common_hdmi_codec_drv) { |
---|
| 536 | + pcm = list_first_entry(&ctx->hdmi_pcm_list, struct bxt_hdmi_pcm, |
---|
| 537 | + head); |
---|
| 538 | + component = pcm->codec_dai->component; |
---|
| 539 | + return hda_dsp_hdmi_build_controls(card, component); |
---|
| 540 | + } |
---|
517 | 541 | |
---|
518 | 542 | list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { |
---|
519 | 543 | component = pcm->codec_dai->component; |
---|
.. | .. |
---|
533 | 557 | |
---|
534 | 558 | i++; |
---|
535 | 559 | } |
---|
536 | | - |
---|
537 | | - if (!component) |
---|
538 | | - return -EINVAL; |
---|
539 | 560 | |
---|
540 | 561 | return hdac_hdmi_jack_port_init(component, &card->dapm); |
---|
541 | 562 | } |
---|
.. | .. |
---|
578 | 599 | struct bxt_rt286_private *ctx; |
---|
579 | 600 | struct snd_soc_card *card = |
---|
580 | 601 | (struct snd_soc_card *)pdev->id_entry->driver_data; |
---|
| 602 | + struct snd_soc_acpi_mach *mach; |
---|
| 603 | + const char *platform_name; |
---|
| 604 | + int ret; |
---|
581 | 605 | int i; |
---|
582 | 606 | |
---|
583 | 607 | for (i = 0; i < ARRAY_SIZE(broxton_rt298_dais); i++) { |
---|
584 | | - if (!strncmp(card->dai_link[i].codec_name, "i2c-INT343A:00", |
---|
585 | | - I2C_NAME_SIZE)) { |
---|
| 608 | + if (!strncmp(card->dai_link[i].codecs->name, "i2c-INT343A:00", |
---|
| 609 | + I2C_NAME_SIZE)) { |
---|
586 | 610 | if (!strncmp(card->name, "broxton-rt298", |
---|
587 | | - PLATFORM_NAME_SIZE)) { |
---|
| 611 | + PLATFORM_NAME_SIZE)) { |
---|
588 | 612 | card->dai_link[i].name = "SSP5-Codec"; |
---|
589 | | - card->dai_link[i].cpu_dai_name = "SSP5 Pin"; |
---|
| 613 | + card->dai_link[i].cpus->dai_name = "SSP5 Pin"; |
---|
590 | 614 | } else if (!strncmp(card->name, "geminilake-rt298", |
---|
591 | | - PLATFORM_NAME_SIZE)) { |
---|
| 615 | + PLATFORM_NAME_SIZE)) { |
---|
592 | 616 | card->dai_link[i].name = "SSP2-Codec"; |
---|
593 | | - card->dai_link[i].cpu_dai_name = "SSP2 Pin"; |
---|
| 617 | + card->dai_link[i].cpus->dai_name = "SSP2 Pin"; |
---|
594 | 618 | } |
---|
595 | 619 | } |
---|
596 | 620 | } |
---|
.. | .. |
---|
604 | 628 | card->dev = &pdev->dev; |
---|
605 | 629 | snd_soc_card_set_drvdata(card, ctx); |
---|
606 | 630 | |
---|
| 631 | + /* override plaform name, if required */ |
---|
| 632 | + mach = pdev->dev.platform_data; |
---|
| 633 | + platform_name = mach->mach_params.platform; |
---|
| 634 | + |
---|
| 635 | + ret = snd_soc_fixup_dai_links_platform_name(card, |
---|
| 636 | + platform_name); |
---|
| 637 | + if (ret) |
---|
| 638 | + return ret; |
---|
| 639 | + |
---|
| 640 | + ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; |
---|
| 641 | + |
---|
607 | 642 | return devm_snd_soc_register_card(&pdev->dev, card); |
---|
608 | 643 | } |
---|
609 | 644 | |
---|