soc-acpi-intel-rpl-match.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * soc-apci-intel-rpl-match.c - tables and support for RPL ACPI enumeration.
  4. *
  5. * Copyright (c) 2022 Intel Corporation.
  6. */
  7. #include <sound/soc-acpi.h>
  8. #include <sound/soc-acpi-intel-match.h>
  9. static const struct snd_soc_acpi_endpoint single_endpoint = {
  10. .num = 0,
  11. .aggregated = 0,
  12. .group_position = 0,
  13. .group_id = 0,
  14. };
  15. static const struct snd_soc_acpi_endpoint spk_l_endpoint = {
  16. .num = 0,
  17. .aggregated = 1,
  18. .group_position = 0,
  19. .group_id = 1,
  20. };
  21. static const struct snd_soc_acpi_endpoint spk_r_endpoint = {
  22. .num = 0,
  23. .aggregated = 1,
  24. .group_position = 1,
  25. .group_id = 1,
  26. };
  27. static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
  28. {
  29. .adr = 0x000020025D071100ull,
  30. .num_endpoints = 1,
  31. .endpoints = &single_endpoint,
  32. .name_prefix = "rt711"
  33. }
  34. };
  35. static const struct snd_soc_acpi_link_adr rpl_rvp[] = {
  36. {
  37. .mask = BIT(0),
  38. .num_adr = ARRAY_SIZE(rt711_0_adr),
  39. .adr_d = rt711_0_adr,
  40. },
  41. {}
  42. };
  43. static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
  44. {
  45. .adr = 0x000030025D071101ull,
  46. .num_endpoints = 1,
  47. .endpoints = &single_endpoint,
  48. .name_prefix = "rt711"
  49. }
  50. };
  51. static const struct snd_soc_acpi_adr_device rt1316_1_group1_adr[] = {
  52. {
  53. .adr = 0x000131025D131601ull, /* unique ID is set for some reason */
  54. .num_endpoints = 1,
  55. .endpoints = &spk_l_endpoint,
  56. .name_prefix = "rt1316-1"
  57. }
  58. };
  59. static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = {
  60. {
  61. .adr = 0x000330025D131601ull,
  62. .num_endpoints = 1,
  63. .endpoints = &spk_r_endpoint,
  64. .name_prefix = "rt1316-2"
  65. }
  66. };
  67. static const struct snd_soc_acpi_adr_device rt714_2_adr[] = {
  68. {
  69. .adr = 0x000230025D071401ull,
  70. .num_endpoints = 1,
  71. .endpoints = &single_endpoint,
  72. .name_prefix = "rt714"
  73. }
  74. };
  75. static const struct snd_soc_acpi_link_adr rpl_sdca_3_in_1[] = {
  76. {
  77. .mask = BIT(0),
  78. .num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
  79. .adr_d = rt711_sdca_0_adr,
  80. },
  81. {
  82. .mask = BIT(1),
  83. .num_adr = ARRAY_SIZE(rt1316_1_group1_adr),
  84. .adr_d = rt1316_1_group1_adr,
  85. },
  86. {
  87. .mask = BIT(2),
  88. .num_adr = ARRAY_SIZE(rt714_2_adr),
  89. .adr_d = rt714_2_adr,
  90. },
  91. {
  92. .mask = BIT(3),
  93. .num_adr = ARRAY_SIZE(rt1316_3_group1_adr),
  94. .adr_d = rt1316_3_group1_adr,
  95. },
  96. {}
  97. };
  98. struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[] = {
  99. {},
  100. };
  101. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_rpl_machines);
  102. /* this table is used when there is no I2S codec present */
  103. struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_sdw_machines[] = {
  104. {
  105. .link_mask = 0xF, /* 4 active links required */
  106. .links = rpl_sdca_3_in_1,
  107. .drv_name = "sof_sdw",
  108. .sof_tplg_filename = "sof-rpl-rt711-l0-rt1316-l13-rt714-l2.tplg",
  109. },
  110. {
  111. .link_mask = 0x1, /* link0 required */
  112. .links = rpl_rvp,
  113. .drv_name = "sof_sdw",
  114. .sof_tplg_filename = "sof-rpl-rt711.tplg",
  115. },
  116. {},
  117. };
  118. EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_rpl_sdw_machines);