pci-cnl.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 Intel Corporation. All rights reserved.
  7. //
  8. // Author: Liam Girdwood <[email protected]>
  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. static const struct sof_dev_desc cnl_desc = {
  20. .machines = snd_soc_acpi_intel_cnl_machines,
  21. .alt_machines = snd_soc_acpi_intel_cnl_sdw_machines,
  22. .use_acpi_target_states = true,
  23. .resindex_lpe_base = 0,
  24. .resindex_pcicfg_base = -1,
  25. .resindex_imr_base = -1,
  26. .irqindex_host_ipc = -1,
  27. .chip_info = &cnl_chip_info,
  28. .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
  29. .ipc_default = SOF_IPC,
  30. .default_fw_path = {
  31. [SOF_IPC] = "intel/sof",
  32. [SOF_INTEL_IPC4] = "intel/avs/cnl",
  33. },
  34. .default_tplg_path = {
  35. [SOF_IPC] = "intel/sof-tplg",
  36. [SOF_INTEL_IPC4] = "intel/avs-tplg",
  37. },
  38. .default_fw_filename = {
  39. [SOF_IPC] = "sof-cnl.ri",
  40. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  41. },
  42. .nocodec_tplg_filename = "sof-cnl-nocodec.tplg",
  43. .ops = &sof_cnl_ops,
  44. .ops_init = sof_cnl_ops_init,
  45. .ops_free = hda_ops_free,
  46. };
  47. static const struct sof_dev_desc cfl_desc = {
  48. .machines = snd_soc_acpi_intel_cfl_machines,
  49. .alt_machines = snd_soc_acpi_intel_cfl_sdw_machines,
  50. .use_acpi_target_states = true,
  51. .resindex_lpe_base = 0,
  52. .resindex_pcicfg_base = -1,
  53. .resindex_imr_base = -1,
  54. .irqindex_host_ipc = -1,
  55. .chip_info = &cnl_chip_info,
  56. .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
  57. .ipc_default = SOF_IPC,
  58. .default_fw_path = {
  59. [SOF_IPC] = "intel/sof",
  60. [SOF_INTEL_IPC4] = "intel/avs/cnl",
  61. },
  62. .default_tplg_path = {
  63. [SOF_IPC] = "intel/sof-tplg",
  64. [SOF_INTEL_IPC4] = "intel/avs-tplg",
  65. },
  66. .default_fw_filename = {
  67. [SOF_IPC] = "sof-cfl.ri",
  68. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  69. },
  70. .nocodec_tplg_filename = "sof-cnl-nocodec.tplg",
  71. .ops = &sof_cnl_ops,
  72. .ops_init = sof_cnl_ops_init,
  73. .ops_free = hda_ops_free,
  74. };
  75. static const struct sof_dev_desc cml_desc = {
  76. .machines = snd_soc_acpi_intel_cml_machines,
  77. .alt_machines = snd_soc_acpi_intel_cml_sdw_machines,
  78. .use_acpi_target_states = true,
  79. .resindex_lpe_base = 0,
  80. .resindex_pcicfg_base = -1,
  81. .resindex_imr_base = -1,
  82. .irqindex_host_ipc = -1,
  83. .chip_info = &cnl_chip_info,
  84. .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
  85. .ipc_default = SOF_IPC,
  86. .default_fw_path = {
  87. [SOF_IPC] = "intel/sof",
  88. [SOF_INTEL_IPC4] = "intel/avs/cnl",
  89. },
  90. .default_tplg_path = {
  91. [SOF_IPC] = "intel/sof-tplg",
  92. [SOF_INTEL_IPC4] = "intel/avs-tplg",
  93. },
  94. .default_fw_filename = {
  95. [SOF_IPC] = "sof-cml.ri",
  96. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  97. },
  98. .nocodec_tplg_filename = "sof-cnl-nocodec.tplg",
  99. .ops = &sof_cnl_ops,
  100. .ops_init = sof_cnl_ops_init,
  101. .ops_free = hda_ops_free,
  102. };
  103. /* PCI IDs */
  104. static const struct pci_device_id sof_pci_ids[] = {
  105. { PCI_DEVICE(0x8086, 0x9dc8), /* CNL-LP */
  106. .driver_data = (unsigned long)&cnl_desc},
  107. { PCI_DEVICE(0x8086, 0xa348), /* CNL-H */
  108. .driver_data = (unsigned long)&cfl_desc},
  109. { PCI_DEVICE(0x8086, 0x02c8), /* CML-LP */
  110. .driver_data = (unsigned long)&cml_desc},
  111. { PCI_DEVICE(0x8086, 0x06c8), /* CML-H */
  112. .driver_data = (unsigned long)&cml_desc},
  113. { PCI_DEVICE(0x8086, 0xa3f0), /* CML-S */
  114. .driver_data = (unsigned long)&cml_desc},
  115. { 0, }
  116. };
  117. MODULE_DEVICE_TABLE(pci, sof_pci_ids);
  118. /* pci_driver definition */
  119. static struct pci_driver snd_sof_pci_intel_cnl_driver = {
  120. .name = "sof-audio-pci-intel-cnl",
  121. .id_table = sof_pci_ids,
  122. .probe = hda_pci_intel_probe,
  123. .remove = sof_pci_remove,
  124. .shutdown = sof_pci_shutdown,
  125. .driver = {
  126. .pm = &sof_pci_pm,
  127. },
  128. };
  129. module_pci_driver(snd_sof_pci_intel_cnl_driver);
  130. MODULE_LICENSE("Dual BSD/GPL");
  131. MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
  132. MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);