soc-acpi-intel-mtl-match.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * soc-acpi-intel-mtl-match.c - tables and support for MTL ACPI enumeration.
  4. *
  5. * Copyright (c) 2022, Intel Corporation.
  6. *
  7. */
  8. #include <sound/soc-acpi.h>
  9. #include <sound/soc-acpi-intel-match.h>
  10. #include "soc-acpi-intel-sdw-mockup-match.h"
  11. static const struct snd_soc_acpi_codecs mtl_max98357a_amp = {
  12. .num_codecs = 1,
  13. .codecs = {"MX98357A"}
  14. };
  15. static const struct snd_soc_acpi_codecs mtl_rt5682_rt5682s_hp = {
  16. .num_codecs = 2,
  17. .codecs = {"10EC5682", "RTL5682"},
  18. };
  19. static const struct snd_soc_acpi_codecs mtl_lt6911_hdmi = {
  20. .num_codecs = 1,
  21. .codecs = {"INTC10B0"}
  22. };
  23. static const struct snd_soc_acpi_codecs mtl_essx_83x6 = {
  24. .num_codecs = 3,
  25. .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},
  26. };
  27. struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_machines[] = {
  28. {
  29. .comp_ids = &mtl_rt5682_rt5682s_hp,
  30. .drv_name = "mtl_mx98357_rt5682",
  31. .machine_quirk = snd_soc_acpi_codec_list,
  32. .quirk_data = &mtl_max98357a_amp,
  33. .sof_tplg_filename = "sof-mtl-max98357a-rt5682.tplg",
  34. },
  35. {
  36. .comp_ids = &mtl_essx_83x6,
  37. .drv_name = "sof-essx8336",
  38. .sof_tplg_filename = "sof-mtl-es8336", /* the tplg suffix is added at run time */
  39. .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
  40. SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
  41. SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
  42. },
  43. {},
  44. };
  45. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_mtl_machines);
  46. static const struct snd_soc_acpi_endpoint single_endpoint = {
  47. .num = 0,
  48. .aggregated = 0,
  49. .group_position = 0,
  50. .group_id = 0,
  51. };
  52. static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
  53. {
  54. .adr = 0x000030025D071101ull,
  55. .num_endpoints = 1,
  56. .endpoints = &single_endpoint,
  57. .name_prefix = "rt711"
  58. }
  59. };
  60. static const struct snd_soc_acpi_link_adr mtl_rvp[] = {
  61. {
  62. .mask = BIT(0),
  63. .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
  64. .adr_d = rt711_sdca_0_adr,
  65. },
  66. {}
  67. };
  68. /* this table is used when there is no I2S codec present */
  69. struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = {
  70. /* mockup tests need to be first */
  71. {
  72. .link_mask = GENMASK(3, 0),
  73. .links = sdw_mockup_headset_2amps_mic,
  74. .drv_name = "sof_sdw",
  75. .sof_tplg_filename = "sof-mtl-rt711-rt1308-rt715.tplg",
  76. },
  77. {
  78. .comp_ids = &mtl_essx_83x6,
  79. .drv_name = "mtl_es83x6_c1_h02",
  80. .machine_quirk = snd_soc_acpi_codec_list,
  81. .quirk_data = &mtl_lt6911_hdmi,
  82. .sof_tplg_filename = "sof-mtl-es83x6-ssp1-hdmi-ssp02.tplg",
  83. },
  84. {
  85. .link_mask = BIT(0) | BIT(1) | BIT(3),
  86. .links = sdw_mockup_headset_1amp_mic,
  87. .drv_name = "sof_sdw",
  88. .sof_tplg_filename = "sof-mtl-rt711-rt1308-mono-rt715.tplg",
  89. },
  90. {
  91. .link_mask = GENMASK(2, 0),
  92. .links = sdw_mockup_mic_headset_1amp,
  93. .drv_name = "sof_sdw",
  94. .sof_tplg_filename = "sof-mtl-rt715-rt711-rt1308-mono.tplg",
  95. },
  96. {
  97. .link_mask = BIT(0),
  98. .links = mtl_rvp,
  99. .drv_name = "sof_sdw",
  100. .sof_tplg_filename = "sof-mtl-rt711.tplg",
  101. },
  102. {},
  103. };
  104. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_mtl_sdw_machines);