diff options
Diffstat (limited to 'sound/soc/intel/atom/sst/sst_acpi.c')
-rw-r--r-- | sound/soc/intel/atom/sst/sst_acpi.c | 232 |
1 files changed, 169 insertions, 63 deletions
diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c index dd250b8b26f2..0e928d54305d 100644 --- a/sound/soc/intel/atom/sst/sst_acpi.c +++ b/sound/soc/intel/atom/sst/sst_acpi.c | |||
@@ -303,8 +303,6 @@ static int sst_acpi_probe(struct platform_device *pdev) | |||
303 | dev_err(dev, "No matching machine driver found\n"); | 303 | dev_err(dev, "No matching machine driver found\n"); |
304 | return -ENODEV; | 304 | return -ENODEV; |
305 | } | 305 | } |
306 | if (mach->machine_quirk) | ||
307 | mach = mach->machine_quirk(mach); | ||
308 | 306 | ||
309 | pdata = mach->pdata; | 307 | pdata = mach->pdata; |
310 | 308 | ||
@@ -360,23 +358,9 @@ static int sst_acpi_probe(struct platform_device *pdev) | |||
360 | if (ret < 0) | 358 | if (ret < 0) |
361 | return ret; | 359 | return ret; |
362 | 360 | ||
363 | /* need to save shim registers in BYT */ | ||
364 | ctx->shim_regs64 = devm_kzalloc(ctx->dev, sizeof(*ctx->shim_regs64), | ||
365 | GFP_KERNEL); | ||
366 | if (!ctx->shim_regs64) { | ||
367 | ret = -ENOMEM; | ||
368 | goto do_sst_cleanup; | ||
369 | } | ||
370 | |||
371 | sst_configure_runtime_pm(ctx); | 361 | sst_configure_runtime_pm(ctx); |
372 | platform_set_drvdata(pdev, ctx); | 362 | platform_set_drvdata(pdev, ctx); |
373 | return ret; | 363 | return ret; |
374 | |||
375 | do_sst_cleanup: | ||
376 | sst_context_cleanup(ctx); | ||
377 | platform_set_drvdata(pdev, NULL); | ||
378 | dev_err(ctx->dev, "failed with %d\n", ret); | ||
379 | return ret; | ||
380 | } | 364 | } |
381 | 365 | ||
382 | /** | 366 | /** |
@@ -453,12 +437,20 @@ static const struct dmi_system_id cht_table[] = { | |||
453 | 437 | ||
454 | 438 | ||
455 | static struct sst_acpi_mach cht_surface_mach = { | 439 | static struct sst_acpi_mach cht_surface_mach = { |
456 | "10EC5640", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, | 440 | .id = "10EC5640", |
457 | &chv_platform_data }; | 441 | .drv_name = "cht-bsw-rt5645", |
442 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
443 | .board = "cht-bsw", | ||
444 | .pdata = &chv_platform_data, | ||
445 | }; | ||
458 | 446 | ||
459 | static struct sst_acpi_mach byt_thinkpad_10 = { | 447 | static struct sst_acpi_mach byt_thinkpad_10 = { |
460 | "10EC5640", "cht-bsw-rt5672", "intel/fw_sst_0f28.bin", "cht-bsw", NULL, | 448 | .id = "10EC5640", |
461 | &byt_rvp_platform_data }; | 449 | .drv_name = "cht-bsw-rt5672", |
450 | .fw_filename = "intel/fw_sst_0f28.bin", | ||
451 | .board = "cht-bsw", | ||
452 | .pdata = &byt_rvp_platform_data, | ||
453 | }; | ||
462 | 454 | ||
463 | static struct sst_acpi_mach *cht_quirk(void *arg) | 455 | static struct sst_acpi_mach *cht_quirk(void *arg) |
464 | { | 456 | { |
@@ -486,68 +478,182 @@ static struct sst_acpi_mach *byt_quirk(void *arg) | |||
486 | 478 | ||
487 | 479 | ||
488 | static struct sst_acpi_mach sst_acpi_bytcr[] = { | 480 | static struct sst_acpi_mach sst_acpi_bytcr[] = { |
489 | {"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", byt_quirk, | 481 | { |
490 | &byt_rvp_platform_data }, | 482 | .id = "10EC5640", |
491 | {"10EC5642", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NULL, | 483 | .drv_name = "bytcr_rt5640", |
492 | &byt_rvp_platform_data }, | 484 | .fw_filename = "intel/fw_sst_0f28.bin", |
493 | {"INTCCFFD", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NULL, | 485 | .board = "bytcr_rt5640", |
494 | &byt_rvp_platform_data }, | 486 | .machine_quirk = byt_quirk, |
495 | {"10EC5651", "bytcr_rt5651", "intel/fw_sst_0f28.bin", "bytcr_rt5651", NULL, | 487 | .pdata = &byt_rvp_platform_data, |
496 | &byt_rvp_platform_data }, | 488 | }, |
497 | {"DLGS7212", "bytcht_da7213", "intel/fw_sst_0f28.bin", "bytcht_da7213", NULL, | 489 | { |
498 | &byt_rvp_platform_data }, | 490 | .id = "10EC5642", |
499 | {"DLGS7213", "bytcht_da7213", "intel/fw_sst_0f28.bin", "bytcht_da7213", NULL, | 491 | .drv_name = "bytcr_rt5640", |
500 | &byt_rvp_platform_data }, | 492 | .fw_filename = "intel/fw_sst_0f28.bin", |
493 | .board = "bytcr_rt5640", | ||
494 | .pdata = &byt_rvp_platform_data | ||
495 | }, | ||
496 | { | ||
497 | .id = "INTCCFFD", | ||
498 | .drv_name = "bytcr_rt5640", | ||
499 | .fw_filename = "intel/fw_sst_0f28.bin", | ||
500 | .board = "bytcr_rt5640", | ||
501 | .pdata = &byt_rvp_platform_data | ||
502 | }, | ||
503 | { | ||
504 | .id = "10EC5651", | ||
505 | .drv_name = "bytcr_rt5651", | ||
506 | .fw_filename = "intel/fw_sst_0f28.bin", | ||
507 | .board = "bytcr_rt5651", | ||
508 | .pdata = &byt_rvp_platform_data | ||
509 | }, | ||
510 | { | ||
511 | .id = "DLGS7212", | ||
512 | .drv_name = "bytcht_da7213", | ||
513 | .fw_filename = "intel/fw_sst_0f28.bin", | ||
514 | .board = "bytcht_da7213", | ||
515 | .pdata = &byt_rvp_platform_data | ||
516 | }, | ||
517 | { | ||
518 | .id = "DLGS7213", | ||
519 | .drv_name = "bytcht_da7213", | ||
520 | .fw_filename = "intel/fw_sst_0f28.bin", | ||
521 | .board = "bytcht_da7213", | ||
522 | .pdata = &byt_rvp_platform_data | ||
523 | }, | ||
501 | /* some Baytrail platforms rely on RT5645, use CHT machine driver */ | 524 | /* some Baytrail platforms rely on RT5645, use CHT machine driver */ |
502 | {"10EC5645", "cht-bsw-rt5645", "intel/fw_sst_0f28.bin", "cht-bsw", NULL, | 525 | { |
503 | &byt_rvp_platform_data }, | 526 | .id = "10EC5645", |
504 | {"10EC5648", "cht-bsw-rt5645", "intel/fw_sst_0f28.bin", "cht-bsw", NULL, | 527 | .drv_name = "cht-bsw-rt5645", |
505 | &byt_rvp_platform_data }, | 528 | .fw_filename = "intel/fw_sst_0f28.bin", |
529 | .board = "cht-bsw", | ||
530 | .pdata = &byt_rvp_platform_data | ||
531 | }, | ||
532 | { | ||
533 | .id = "10EC5648", | ||
534 | .drv_name = "cht-bsw-rt5645", | ||
535 | .fw_filename = "intel/fw_sst_0f28.bin", | ||
536 | .board = "cht-bsw", | ||
537 | .pdata = &byt_rvp_platform_data | ||
538 | }, | ||
506 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) | 539 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) |
507 | /* | 540 | /* |
508 | * This is always last in the table so that it is selected only when | 541 | * This is always last in the table so that it is selected only when |
509 | * enabled explicitly and there is no codec-related information in SSDT | 542 | * enabled explicitly and there is no codec-related information in SSDT |
510 | */ | 543 | */ |
511 | {"80860F28", "bytcht_nocodec", "intel/fw_sst_0f28.bin", "bytcht_nocodec", NULL, | 544 | { |
512 | &byt_rvp_platform_data }, | 545 | .id = "80860F28", |
546 | .drv_name = "bytcht_nocodec", | ||
547 | .fw_filename = "intel/fw_sst_0f28.bin", | ||
548 | .board = "bytcht_nocodec", | ||
549 | .pdata = &byt_rvp_platform_data | ||
550 | }, | ||
513 | #endif | 551 | #endif |
514 | {}, | 552 | {}, |
515 | }; | 553 | }; |
516 | 554 | ||
517 | /* Cherryview-based platforms: CherryTrail and Braswell */ | 555 | /* Cherryview-based platforms: CherryTrail and Braswell */ |
518 | static struct sst_acpi_mach sst_acpi_chv[] = { | 556 | static struct sst_acpi_mach sst_acpi_chv[] = { |
519 | {"10EC5670", "cht-bsw-rt5672", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, | 557 | { |
520 | &chv_platform_data }, | 558 | .id = "10EC5670", |
521 | {"10EC5672", "cht-bsw-rt5672", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, | 559 | .drv_name = "cht-bsw-rt5672", |
522 | &chv_platform_data }, | 560 | .fw_filename = "intel/fw_sst_22a8.bin", |
523 | {"10EC5645", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, | 561 | .board = "cht-bsw", |
524 | &chv_platform_data }, | 562 | .pdata = &chv_platform_data |
525 | {"10EC5650", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, | 563 | }, |
526 | &chv_platform_data }, | 564 | { |
527 | {"10EC3270", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, | 565 | .id = "10EC5672", |
528 | &chv_platform_data }, | 566 | .drv_name = "cht-bsw-rt5672", |
529 | 567 | .fw_filename = "intel/fw_sst_22a8.bin", | |
530 | {"193C9890", "cht-bsw-max98090", "intel/fw_sst_22a8.bin", "cht-bsw", NULL, | 568 | .board = "cht-bsw", |
531 | &chv_platform_data }, | 569 | .pdata = &chv_platform_data |
532 | {"DLGS7212", "bytcht_da7213", "intel/fw_sst_22a8.bin", "bytcht_da7213", NULL, | 570 | }, |
533 | &chv_platform_data }, | 571 | { |
534 | {"DLGS7213", "bytcht_da7213", "intel/fw_sst_22a8.bin", "bytcht_da7213", NULL, | 572 | .id = "10EC5645", |
535 | &chv_platform_data }, | 573 | .drv_name = "cht-bsw-rt5645", |
574 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
575 | .board = "cht-bsw", | ||
576 | .pdata = &chv_platform_data | ||
577 | }, | ||
578 | { | ||
579 | .id = "10EC5650", | ||
580 | .drv_name = "cht-bsw-rt5645", | ||
581 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
582 | .board = "cht-bsw", | ||
583 | .pdata = &chv_platform_data | ||
584 | }, | ||
585 | { | ||
586 | .id = "10EC3270", | ||
587 | .drv_name = "cht-bsw-rt5645", | ||
588 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
589 | .board = "cht-bsw", | ||
590 | .pdata = &chv_platform_data | ||
591 | }, | ||
592 | |||
593 | { | ||
594 | .id = "193C9890", | ||
595 | .drv_name = "cht-bsw-max98090", | ||
596 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
597 | .board = "cht-bsw", | ||
598 | .pdata = &chv_platform_data | ||
599 | }, | ||
600 | { | ||
601 | .id = "DLGS7212", | ||
602 | .drv_name = "bytcht_da7213", | ||
603 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
604 | .board = "bytcht_da7213", | ||
605 | .pdata = &chv_platform_data | ||
606 | }, | ||
607 | { | ||
608 | .id = "DLGS7213", | ||
609 | .drv_name = "bytcht_da7213", | ||
610 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
611 | .board = "bytcht_da7213", | ||
612 | .pdata = &chv_platform_data | ||
613 | }, | ||
614 | { | ||
615 | .id = "ESSX8316", | ||
616 | .drv_name = "bytcht_es8316", | ||
617 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
618 | .board = "bytcht_es8316", | ||
619 | .pdata = &chv_platform_data | ||
620 | }, | ||
536 | /* some CHT-T platforms rely on RT5640, use Baytrail machine driver */ | 621 | /* some CHT-T platforms rely on RT5640, use Baytrail machine driver */ |
537 | {"10EC5640", "bytcr_rt5640", "intel/fw_sst_22a8.bin", "bytcr_rt5640", cht_quirk, | 622 | { |
538 | &chv_platform_data }, | 623 | .id = "10EC5640", |
539 | {"10EC3276", "bytcr_rt5640", "intel/fw_sst_22a8.bin", "bytcr_rt5640", NULL, | 624 | .drv_name = "bytcr_rt5640", |
540 | &chv_platform_data }, | 625 | .fw_filename = "intel/fw_sst_22a8.bin", |
626 | .board = "bytcr_rt5640", | ||
627 | .machine_quirk = cht_quirk, | ||
628 | .pdata = &chv_platform_data | ||
629 | }, | ||
630 | { | ||
631 | .id = "10EC3276", | ||
632 | .drv_name = "bytcr_rt5640", | ||
633 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
634 | .board = "bytcr_rt5640", | ||
635 | .pdata = &chv_platform_data | ||
636 | }, | ||
541 | /* some CHT-T platforms rely on RT5651, use Baytrail machine driver */ | 637 | /* some CHT-T platforms rely on RT5651, use Baytrail machine driver */ |
542 | {"10EC5651", "bytcr_rt5651", "intel/fw_sst_22a8.bin", "bytcr_rt5651", NULL, | 638 | { |
543 | &chv_platform_data }, | 639 | .id = "10EC5651", |
640 | .drv_name = "bytcr_rt5651", | ||
641 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
642 | .board = "bytcr_rt5651", | ||
643 | .pdata = &chv_platform_data | ||
644 | }, | ||
544 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) | 645 | #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) |
545 | /* | 646 | /* |
546 | * This is always last in the table so that it is selected only when | 647 | * This is always last in the table so that it is selected only when |
547 | * enabled explicitly and there is no codec-related information in SSDT | 648 | * enabled explicitly and there is no codec-related information in SSDT |
548 | */ | 649 | */ |
549 | {"808622A8", "bytcht_nocodec", "intel/fw_sst_22a8.bin", "bytcht_nocodec", NULL, | 650 | { |
550 | &chv_platform_data }, | 651 | .id = "808622A8", |
652 | .drv_name = "bytcht_nocodec", | ||
653 | .fw_filename = "intel/fw_sst_22a8.bin", | ||
654 | .board = "bytcht_nocodec", | ||
655 | .pdata = &chv_platform_data | ||
656 | }, | ||
551 | #endif | 657 | #endif |
552 | {}, | 658 | {}, |
553 | }; | 659 | }; |