pci-tgl.c 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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-2021 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 tgl_desc = {
  20. .machines = snd_soc_acpi_intel_tgl_machines,
  21. .alt_machines = snd_soc_acpi_intel_tgl_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 = &tgl_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/tgl",
  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-tgl.ri",
  40. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  41. },
  42. .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
  43. .ops = &sof_tgl_ops,
  44. .ops_init = sof_tgl_ops_init,
  45. .ops_free = hda_ops_free,
  46. };
  47. static const struct sof_dev_desc tglh_desc = {
  48. .machines = snd_soc_acpi_intel_tgl_machines,
  49. .alt_machines = snd_soc_acpi_intel_tgl_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 = &tglh_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/tgl-h",
  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-tgl-h.ri",
  68. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  69. },
  70. .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
  71. .ops = &sof_tgl_ops,
  72. .ops_init = sof_tgl_ops_init,
  73. .ops_free = hda_ops_free,
  74. };
  75. static const struct sof_dev_desc ehl_desc = {
  76. .machines = snd_soc_acpi_intel_ehl_machines,
  77. .use_acpi_target_states = true,
  78. .resindex_lpe_base = 0,
  79. .resindex_pcicfg_base = -1,
  80. .resindex_imr_base = -1,
  81. .irqindex_host_ipc = -1,
  82. .chip_info = &ehl_chip_info,
  83. .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
  84. .ipc_default = SOF_IPC,
  85. .default_fw_path = {
  86. [SOF_IPC] = "intel/sof",
  87. [SOF_INTEL_IPC4] = "intel/avs/ehl",
  88. },
  89. .default_tplg_path = {
  90. [SOF_IPC] = "intel/sof-tplg",
  91. [SOF_INTEL_IPC4] = "intel/avs-tplg",
  92. },
  93. .default_fw_filename = {
  94. [SOF_IPC] = "sof-ehl.ri",
  95. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  96. },
  97. .nocodec_tplg_filename = "sof-ehl-nocodec.tplg",
  98. .ops = &sof_tgl_ops,
  99. .ops_init = sof_tgl_ops_init,
  100. .ops_free = hda_ops_free,
  101. };
  102. static const struct sof_dev_desc adls_desc = {
  103. .machines = snd_soc_acpi_intel_adl_machines,
  104. .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
  105. .use_acpi_target_states = true,
  106. .resindex_lpe_base = 0,
  107. .resindex_pcicfg_base = -1,
  108. .resindex_imr_base = -1,
  109. .irqindex_host_ipc = -1,
  110. .chip_info = &adls_chip_info,
  111. .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
  112. .ipc_default = SOF_IPC,
  113. .default_fw_path = {
  114. [SOF_IPC] = "intel/sof",
  115. [SOF_INTEL_IPC4] = "intel/avs/adl-s",
  116. },
  117. .default_tplg_path = {
  118. [SOF_IPC] = "intel/sof-tplg",
  119. [SOF_INTEL_IPC4] = "intel/avs-tplg",
  120. },
  121. .default_fw_filename = {
  122. [SOF_IPC] = "sof-adl-s.ri",
  123. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  124. },
  125. .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
  126. .ops = &sof_tgl_ops,
  127. .ops_init = sof_tgl_ops_init,
  128. .ops_free = hda_ops_free,
  129. };
  130. static const struct sof_dev_desc adl_desc = {
  131. .machines = snd_soc_acpi_intel_adl_machines,
  132. .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
  133. .use_acpi_target_states = true,
  134. .resindex_lpe_base = 0,
  135. .resindex_pcicfg_base = -1,
  136. .resindex_imr_base = -1,
  137. .irqindex_host_ipc = -1,
  138. .chip_info = &tgl_chip_info,
  139. .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
  140. .ipc_default = SOF_IPC,
  141. .default_fw_path = {
  142. [SOF_IPC] = "intel/sof",
  143. [SOF_INTEL_IPC4] = "intel/avs/adl",
  144. },
  145. .default_tplg_path = {
  146. [SOF_IPC] = "intel/sof-tplg",
  147. [SOF_INTEL_IPC4] = "intel/avs-tplg",
  148. },
  149. .default_fw_filename = {
  150. [SOF_IPC] = "sof-adl.ri",
  151. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  152. },
  153. .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
  154. .ops = &sof_tgl_ops,
  155. .ops_init = sof_tgl_ops_init,
  156. .ops_free = hda_ops_free,
  157. };
  158. static const struct sof_dev_desc adl_n_desc = {
  159. .machines = snd_soc_acpi_intel_adl_machines,
  160. .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
  161. .use_acpi_target_states = true,
  162. .resindex_lpe_base = 0,
  163. .resindex_pcicfg_base = -1,
  164. .resindex_imr_base = -1,
  165. .irqindex_host_ipc = -1,
  166. .chip_info = &tgl_chip_info,
  167. .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
  168. .ipc_default = SOF_IPC,
  169. .default_fw_path = {
  170. [SOF_IPC] = "intel/sof",
  171. [SOF_INTEL_IPC4] = "intel/avs/adl-n",
  172. },
  173. .default_tplg_path = {
  174. [SOF_IPC] = "intel/sof-tplg",
  175. [SOF_INTEL_IPC4] = "intel/avs-tplg",
  176. },
  177. .default_fw_filename = {
  178. [SOF_IPC] = "sof-adl-n.ri",
  179. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  180. },
  181. .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
  182. .ops = &sof_tgl_ops,
  183. .ops_init = sof_tgl_ops_init,
  184. .ops_free = hda_ops_free,
  185. };
  186. static const struct sof_dev_desc rpls_desc = {
  187. .machines = snd_soc_acpi_intel_rpl_machines,
  188. .alt_machines = snd_soc_acpi_intel_rpl_sdw_machines,
  189. .use_acpi_target_states = true,
  190. .resindex_lpe_base = 0,
  191. .resindex_pcicfg_base = -1,
  192. .resindex_imr_base = -1,
  193. .irqindex_host_ipc = -1,
  194. .chip_info = &adls_chip_info,
  195. .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
  196. .ipc_default = SOF_IPC,
  197. .default_fw_path = {
  198. [SOF_IPC] = "intel/sof",
  199. [SOF_INTEL_IPC4] = "intel/avs/rpl-s",
  200. },
  201. .default_tplg_path = {
  202. [SOF_IPC] = "intel/sof-tplg",
  203. [SOF_INTEL_IPC4] = "intel/avs-tplg",
  204. },
  205. .default_fw_filename = {
  206. [SOF_IPC] = "sof-rpl-s.ri",
  207. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  208. },
  209. .nocodec_tplg_filename = "sof-rpl-nocodec.tplg",
  210. .ops = &sof_tgl_ops,
  211. .ops_init = sof_tgl_ops_init,
  212. .ops_free = hda_ops_free,
  213. };
  214. static const struct sof_dev_desc rpl_desc = {
  215. .machines = snd_soc_acpi_intel_rpl_machines,
  216. .alt_machines = snd_soc_acpi_intel_rpl_sdw_machines,
  217. .use_acpi_target_states = true,
  218. .resindex_lpe_base = 0,
  219. .resindex_pcicfg_base = -1,
  220. .resindex_imr_base = -1,
  221. .irqindex_host_ipc = -1,
  222. .chip_info = &tgl_chip_info,
  223. .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4),
  224. .ipc_default = SOF_IPC,
  225. .default_fw_path = {
  226. [SOF_IPC] = "intel/sof",
  227. [SOF_INTEL_IPC4] = "intel/avs/rpl",
  228. },
  229. .default_tplg_path = {
  230. [SOF_IPC] = "intel/sof-tplg",
  231. [SOF_INTEL_IPC4] = "intel/avs-tplg",
  232. },
  233. .default_fw_filename = {
  234. [SOF_IPC] = "sof-rpl.ri",
  235. [SOF_INTEL_IPC4] = "dsp_basefw.bin",
  236. },
  237. .nocodec_tplg_filename = "sof-rpl-nocodec.tplg",
  238. .ops = &sof_tgl_ops,
  239. .ops_init = sof_tgl_ops_init,
  240. .ops_free = hda_ops_free,
  241. };
  242. /* PCI IDs */
  243. static const struct pci_device_id sof_pci_ids[] = {
  244. { PCI_DEVICE(0x8086, 0xa0c8), /* TGL-LP */
  245. .driver_data = (unsigned long)&tgl_desc},
  246. { PCI_DEVICE(0x8086, 0x43c8), /* TGL-H */
  247. .driver_data = (unsigned long)&tglh_desc},
  248. { PCI_DEVICE(0x8086, 0x4b55), /* EHL */
  249. .driver_data = (unsigned long)&ehl_desc},
  250. { PCI_DEVICE(0x8086, 0x4b58), /* EHL */
  251. .driver_data = (unsigned long)&ehl_desc},
  252. { PCI_DEVICE(0x8086, 0x7ad0), /* ADL-S */
  253. .driver_data = (unsigned long)&adls_desc},
  254. { PCI_DEVICE(0x8086, 0x7a50), /* RPL-S */
  255. .driver_data = (unsigned long)&rpls_desc},
  256. { PCI_DEVICE(0x8086, 0x51c8), /* ADL-P */
  257. .driver_data = (unsigned long)&adl_desc},
  258. { PCI_DEVICE(0x8086, 0x51c9), /* ADL-PS */
  259. .driver_data = (unsigned long)&adl_desc},
  260. { PCI_DEVICE(0x8086, 0x51ca), /* RPL-P */
  261. .driver_data = (unsigned long)&rpl_desc},
  262. { PCI_DEVICE(0x8086, 0x51cb), /* RPL-P */
  263. .driver_data = (unsigned long)&rpl_desc},
  264. { PCI_DEVICE(0x8086, 0x51cc), /* ADL-M */
  265. .driver_data = (unsigned long)&adl_desc},
  266. { PCI_DEVICE(0x8086, 0x51cd), /* ADL-P */
  267. .driver_data = (unsigned long)&adl_desc},
  268. { PCI_DEVICE(0x8086, 0x51ce), /* RPL-M */
  269. .driver_data = (unsigned long)&rpl_desc},
  270. { PCI_DEVICE(0x8086, 0x51cf), /* RPL-PX */
  271. .driver_data = (unsigned long)&rpl_desc},
  272. { PCI_DEVICE(0x8086, 0x54c8), /* ADL-N */
  273. .driver_data = (unsigned long)&adl_n_desc},
  274. { 0, }
  275. };
  276. MODULE_DEVICE_TABLE(pci, sof_pci_ids);
  277. /* pci_driver definition */
  278. static struct pci_driver snd_sof_pci_intel_tgl_driver = {
  279. .name = "sof-audio-pci-intel-tgl",
  280. .id_table = sof_pci_ids,
  281. .probe = hda_pci_intel_probe,
  282. .remove = sof_pci_remove,
  283. .shutdown = sof_pci_shutdown,
  284. .driver = {
  285. .pm = &sof_pci_pm,
  286. },
  287. };
  288. module_pci_driver(snd_sof_pci_intel_tgl_driver);
  289. MODULE_LICENSE("Dual BSD/GPL");
  290. MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
  291. MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);