pci-mtl.c 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
  2. //
  3. // This file is provided under a dual BSD/GPLv2 license. When using or
  4. // redistributing this file, you may do so under either license.
  5. //
  6. // Copyright(c) 2018-2022 Intel Corporation
  7. //
  8. // Author: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
  9. //
  10. #include <linux/module.h>
  11. #include <linux/pci.h>
  12. #include <sound/soc-acpi.h>
  13. #include <sound/soc-acpi-intel-match.h>
  14. #include <sound/sof.h>
  15. #include "../ops.h"
  16. #include "../sof-pci-dev.h"
  17. /* platform specific devices */
  18. #include "hda.h"
  19. #include "mtl.h"
  20. static const struct sof_dev_desc mtl_desc = {
  21. .use_acpi_target_states = true,
  22. .machines = snd_soc_acpi_intel_mtl_machines,
  23. .alt_machines = snd_soc_acpi_intel_mtl_sdw_machines,
  24. .resindex_lpe_base = 0,
  25. .resindex_pcicfg_base = -1,
  26. .resindex_imr_base = -1,
  27. .irqindex_host_ipc = -1,
  28. .chip_info = &mtl_chip_info,
  29. .ipc_supported_mask = BIT(SOF_IPC_TYPE_4),
  30. .ipc_default = SOF_IPC_TYPE_4,
  31. .dspless_mode_supported = true, /* Only supported for HDaudio */
  32. .default_fw_path = {
  33. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/mtl",
  34. },
  35. .default_lib_path = {
  36. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/mtl",
  37. },
  38. .default_tplg_path = {
  39. [SOF_IPC_TYPE_4] = "intel/sof-ace-tplg",
  40. },
  41. .default_fw_filename = {
  42. [SOF_IPC_TYPE_4] = "sof-mtl.ri",
  43. },
  44. .nocodec_tplg_filename = "sof-mtl-nocodec.tplg",
  45. .ops = &sof_mtl_ops,
  46. .ops_init = sof_mtl_ops_init,
  47. .ops_free = hda_ops_free,
  48. };
  49. static const struct sof_dev_desc arl_desc = {
  50. .use_acpi_target_states = true,
  51. .machines = snd_soc_acpi_intel_arl_machines,
  52. .alt_machines = snd_soc_acpi_intel_arl_sdw_machines,
  53. .resindex_lpe_base = 0,
  54. .resindex_pcicfg_base = -1,
  55. .resindex_imr_base = -1,
  56. .irqindex_host_ipc = -1,
  57. .chip_info = &mtl_chip_info,
  58. .ipc_supported_mask = BIT(SOF_IPC_TYPE_4),
  59. .ipc_default = SOF_IPC_TYPE_4,
  60. .dspless_mode_supported = true, /* Only supported for HDaudio */
  61. .default_fw_path = {
  62. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/arl",
  63. },
  64. .default_lib_path = {
  65. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/arl",
  66. },
  67. .default_tplg_path = {
  68. [SOF_IPC_TYPE_4] = "intel/sof-ace-tplg",
  69. },
  70. .default_fw_filename = {
  71. [SOF_IPC_TYPE_4] = "sof-arl.ri",
  72. },
  73. .nocodec_tplg_filename = "sof-arl-nocodec.tplg",
  74. .ops = &sof_mtl_ops,
  75. .ops_init = sof_mtl_ops_init,
  76. .ops_free = hda_ops_free,
  77. };
  78. static const struct sof_dev_desc arl_s_desc = {
  79. .use_acpi_target_states = true,
  80. .machines = snd_soc_acpi_intel_arl_machines,
  81. .alt_machines = snd_soc_acpi_intel_arl_sdw_machines,
  82. .resindex_lpe_base = 0,
  83. .resindex_pcicfg_base = -1,
  84. .resindex_imr_base = -1,
  85. .irqindex_host_ipc = -1,
  86. .chip_info = &arl_s_chip_info,
  87. .ipc_supported_mask = BIT(SOF_IPC_TYPE_4),
  88. .ipc_default = SOF_IPC_TYPE_4,
  89. .dspless_mode_supported = true, /* Only supported for HDaudio */
  90. .default_fw_path = {
  91. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/arl-s",
  92. },
  93. .default_lib_path = {
  94. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/arl-s",
  95. },
  96. .default_tplg_path = {
  97. [SOF_IPC_TYPE_4] = "intel/sof-ace-tplg",
  98. },
  99. .default_fw_filename = {
  100. [SOF_IPC_TYPE_4] = "sof-arl-s.ri",
  101. },
  102. .nocodec_tplg_filename = "sof-arl-nocodec.tplg",
  103. .ops = &sof_mtl_ops,
  104. .ops_init = sof_mtl_ops_init,
  105. .ops_free = hda_ops_free,
  106. };
  107. /* PCI IDs */
  108. static const struct pci_device_id sof_pci_ids[] = {
  109. { PCI_DEVICE_DATA(INTEL, HDA_MTL, &mtl_desc) },
  110. { PCI_DEVICE_DATA(INTEL, HDA_ARL_S, &arl_s_desc) },
  111. { PCI_DEVICE_DATA(INTEL, HDA_ARL, &arl_desc) },
  112. { 0, }
  113. };
  114. MODULE_DEVICE_TABLE(pci, sof_pci_ids);
  115. /* pci_driver definition */
  116. static struct pci_driver snd_sof_pci_intel_mtl_driver = {
  117. .name = "sof-audio-pci-intel-mtl",
  118. .id_table = sof_pci_ids,
  119. .probe = hda_pci_intel_probe,
  120. .remove = sof_pci_remove,
  121. .shutdown = sof_pci_shutdown,
  122. .driver = {
  123. .pm = &sof_pci_pm,
  124. },
  125. };
  126. module_pci_driver(snd_sof_pci_intel_mtl_driver);
  127. MODULE_LICENSE("Dual BSD/GPL");
  128. MODULE_DESCRIPTION("SOF support for MeteorLake platforms");
  129. MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_GENERIC);
  130. MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
  131. MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);