pci-tgl.c 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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
  7. //
  8. // Author: Liam Girdwood <liam.r.girdwood@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. 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_TYPE_3) | BIT(SOF_IPC_TYPE_4),
  29. .ipc_default = SOF_IPC_TYPE_3,
  30. .dspless_mode_supported = true, /* Only supported for HDaudio */
  31. .default_fw_path = {
  32. [SOF_IPC_TYPE_3] = "intel/sof",
  33. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/tgl",
  34. },
  35. .default_lib_path = {
  36. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/tgl",
  37. },
  38. .default_tplg_path = {
  39. [SOF_IPC_TYPE_3] = "intel/sof-tplg",
  40. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
  41. },
  42. .default_fw_filename = {
  43. [SOF_IPC_TYPE_3] = "sof-tgl.ri",
  44. [SOF_IPC_TYPE_4] = "sof-tgl.ri",
  45. },
  46. .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
  47. .ops = &sof_tgl_ops,
  48. .ops_init = sof_tgl_ops_init,
  49. .ops_free = hda_ops_free,
  50. };
  51. static const struct sof_dev_desc tglh_desc = {
  52. .machines = snd_soc_acpi_intel_tgl_machines,
  53. .alt_machines = snd_soc_acpi_intel_tgl_sdw_machines,
  54. .use_acpi_target_states = true,
  55. .resindex_lpe_base = 0,
  56. .resindex_pcicfg_base = -1,
  57. .resindex_imr_base = -1,
  58. .irqindex_host_ipc = -1,
  59. .chip_info = &tglh_chip_info,
  60. .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
  61. .ipc_default = SOF_IPC_TYPE_3,
  62. .dspless_mode_supported = true, /* Only supported for HDaudio */
  63. .default_fw_path = {
  64. [SOF_IPC_TYPE_3] = "intel/sof",
  65. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/tgl-h",
  66. },
  67. .default_lib_path = {
  68. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/tgl-h",
  69. },
  70. .default_tplg_path = {
  71. [SOF_IPC_TYPE_3] = "intel/sof-tplg",
  72. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
  73. },
  74. .default_fw_filename = {
  75. [SOF_IPC_TYPE_3] = "sof-tgl-h.ri",
  76. [SOF_IPC_TYPE_4] = "sof-tgl-h.ri",
  77. },
  78. .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
  79. .ops = &sof_tgl_ops,
  80. .ops_init = sof_tgl_ops_init,
  81. .ops_free = hda_ops_free,
  82. };
  83. static const struct sof_dev_desc ehl_desc = {
  84. .machines = snd_soc_acpi_intel_ehl_machines,
  85. .use_acpi_target_states = true,
  86. .resindex_lpe_base = 0,
  87. .resindex_pcicfg_base = -1,
  88. .resindex_imr_base = -1,
  89. .irqindex_host_ipc = -1,
  90. .chip_info = &ehl_chip_info,
  91. .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
  92. .ipc_default = SOF_IPC_TYPE_3,
  93. .dspless_mode_supported = true, /* Only supported for HDaudio */
  94. .default_fw_path = {
  95. [SOF_IPC_TYPE_3] = "intel/sof",
  96. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/ehl",
  97. },
  98. .default_lib_path = {
  99. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/ehl",
  100. },
  101. .default_tplg_path = {
  102. [SOF_IPC_TYPE_3] = "intel/sof-tplg",
  103. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
  104. },
  105. .default_fw_filename = {
  106. [SOF_IPC_TYPE_3] = "sof-ehl.ri",
  107. [SOF_IPC_TYPE_4] = "sof-ehl.ri",
  108. },
  109. .nocodec_tplg_filename = "sof-ehl-nocodec.tplg",
  110. .ops = &sof_tgl_ops,
  111. .ops_init = sof_tgl_ops_init,
  112. .ops_free = hda_ops_free,
  113. };
  114. static const struct sof_dev_desc adls_desc = {
  115. .machines = snd_soc_acpi_intel_adl_machines,
  116. .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
  117. .use_acpi_target_states = true,
  118. .resindex_lpe_base = 0,
  119. .resindex_pcicfg_base = -1,
  120. .resindex_imr_base = -1,
  121. .irqindex_host_ipc = -1,
  122. .chip_info = &adls_chip_info,
  123. .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
  124. .ipc_default = SOF_IPC_TYPE_3,
  125. .dspless_mode_supported = true, /* Only supported for HDaudio */
  126. .default_fw_path = {
  127. [SOF_IPC_TYPE_3] = "intel/sof",
  128. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/adl-s",
  129. },
  130. .default_lib_path = {
  131. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/adl-s",
  132. },
  133. .default_tplg_path = {
  134. [SOF_IPC_TYPE_3] = "intel/sof-tplg",
  135. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
  136. },
  137. .default_fw_filename = {
  138. [SOF_IPC_TYPE_3] = "sof-adl-s.ri",
  139. [SOF_IPC_TYPE_4] = "sof-adl-s.ri",
  140. },
  141. .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
  142. .ops = &sof_tgl_ops,
  143. .ops_init = sof_tgl_ops_init,
  144. .ops_free = hda_ops_free,
  145. };
  146. static const struct sof_dev_desc adl_desc = {
  147. .machines = snd_soc_acpi_intel_adl_machines,
  148. .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
  149. .use_acpi_target_states = true,
  150. .resindex_lpe_base = 0,
  151. .resindex_pcicfg_base = -1,
  152. .resindex_imr_base = -1,
  153. .irqindex_host_ipc = -1,
  154. .chip_info = &tgl_chip_info,
  155. .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
  156. .ipc_default = SOF_IPC_TYPE_3,
  157. .dspless_mode_supported = true, /* Only supported for HDaudio */
  158. .default_fw_path = {
  159. [SOF_IPC_TYPE_3] = "intel/sof",
  160. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/adl",
  161. },
  162. .default_lib_path = {
  163. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/adl",
  164. },
  165. .default_tplg_path = {
  166. [SOF_IPC_TYPE_3] = "intel/sof-tplg",
  167. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
  168. },
  169. .default_fw_filename = {
  170. [SOF_IPC_TYPE_3] = "sof-adl.ri",
  171. [SOF_IPC_TYPE_4] = "sof-adl.ri",
  172. },
  173. .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
  174. .ops = &sof_tgl_ops,
  175. .ops_init = sof_tgl_ops_init,
  176. .ops_free = hda_ops_free,
  177. };
  178. static const struct sof_dev_desc adln_desc = {
  179. .machines = snd_soc_acpi_intel_adl_machines,
  180. .alt_machines = snd_soc_acpi_intel_adl_sdw_machines,
  181. .use_acpi_target_states = true,
  182. .resindex_lpe_base = 0,
  183. .resindex_pcicfg_base = -1,
  184. .resindex_imr_base = -1,
  185. .irqindex_host_ipc = -1,
  186. .chip_info = &tgl_chip_info,
  187. .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
  188. .ipc_default = SOF_IPC_TYPE_3,
  189. .dspless_mode_supported = true, /* Only supported for HDaudio */
  190. .default_fw_path = {
  191. [SOF_IPC_TYPE_3] = "intel/sof",
  192. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/adl-n",
  193. },
  194. .default_lib_path = {
  195. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/adl-n",
  196. },
  197. .default_tplg_path = {
  198. [SOF_IPC_TYPE_3] = "intel/sof-tplg",
  199. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
  200. },
  201. .default_fw_filename = {
  202. [SOF_IPC_TYPE_3] = "sof-adl-n.ri",
  203. [SOF_IPC_TYPE_4] = "sof-adl-n.ri",
  204. },
  205. .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
  206. .ops = &sof_tgl_ops,
  207. .ops_init = sof_tgl_ops_init,
  208. .ops_free = hda_ops_free,
  209. };
  210. static const struct sof_dev_desc rpls_desc = {
  211. .machines = snd_soc_acpi_intel_rpl_machines,
  212. .alt_machines = snd_soc_acpi_intel_rpl_sdw_machines,
  213. .use_acpi_target_states = true,
  214. .resindex_lpe_base = 0,
  215. .resindex_pcicfg_base = -1,
  216. .resindex_imr_base = -1,
  217. .irqindex_host_ipc = -1,
  218. .chip_info = &adls_chip_info,
  219. .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
  220. .ipc_default = SOF_IPC_TYPE_3,
  221. .dspless_mode_supported = true, /* Only supported for HDaudio */
  222. .default_fw_path = {
  223. [SOF_IPC_TYPE_3] = "intel/sof",
  224. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/rpl-s",
  225. },
  226. .default_lib_path = {
  227. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/rpl-s",
  228. },
  229. .default_tplg_path = {
  230. [SOF_IPC_TYPE_3] = "intel/sof-tplg",
  231. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
  232. },
  233. .default_fw_filename = {
  234. [SOF_IPC_TYPE_3] = "sof-rpl-s.ri",
  235. [SOF_IPC_TYPE_4] = "sof-rpl-s.ri",
  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. static const struct sof_dev_desc rpl_desc = {
  243. .machines = snd_soc_acpi_intel_rpl_machines,
  244. .alt_machines = snd_soc_acpi_intel_rpl_sdw_machines,
  245. .use_acpi_target_states = true,
  246. .resindex_lpe_base = 0,
  247. .resindex_pcicfg_base = -1,
  248. .resindex_imr_base = -1,
  249. .irqindex_host_ipc = -1,
  250. .chip_info = &tgl_chip_info,
  251. .ipc_supported_mask = BIT(SOF_IPC_TYPE_3) | BIT(SOF_IPC_TYPE_4),
  252. .ipc_default = SOF_IPC_TYPE_3,
  253. .dspless_mode_supported = true, /* Only supported for HDaudio */
  254. .default_fw_path = {
  255. [SOF_IPC_TYPE_3] = "intel/sof",
  256. [SOF_IPC_TYPE_4] = "intel/sof-ipc4/rpl",
  257. },
  258. .default_lib_path = {
  259. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/rpl",
  260. },
  261. .default_tplg_path = {
  262. [SOF_IPC_TYPE_3] = "intel/sof-tplg",
  263. [SOF_IPC_TYPE_4] = "intel/sof-ipc4-tplg",
  264. },
  265. .default_fw_filename = {
  266. [SOF_IPC_TYPE_3] = "sof-rpl.ri",
  267. [SOF_IPC_TYPE_4] = "sof-rpl.ri",
  268. },
  269. .nocodec_tplg_filename = "sof-rpl-nocodec.tplg",
  270. .ops = &sof_tgl_ops,
  271. .ops_init = sof_tgl_ops_init,
  272. .ops_free = hda_ops_free,
  273. };
  274. /* PCI IDs */
  275. static const struct pci_device_id sof_pci_ids[] = {
  276. { PCI_DEVICE_DATA(INTEL, HDA_TGL_LP, &tgl_desc) },
  277. { PCI_DEVICE_DATA(INTEL, HDA_TGL_H, &tglh_desc) },
  278. { PCI_DEVICE_DATA(INTEL, HDA_EHL_0, &ehl_desc) },
  279. { PCI_DEVICE_DATA(INTEL, HDA_EHL_3, &ehl_desc) },
  280. { PCI_DEVICE_DATA(INTEL, HDA_ADL_S, &adls_desc) },
  281. { PCI_DEVICE_DATA(INTEL, HDA_RPL_S, &rpls_desc) },
  282. { PCI_DEVICE_DATA(INTEL, HDA_ADL_P, &adl_desc) },
  283. { PCI_DEVICE_DATA(INTEL, HDA_ADL_PS, &adl_desc) },
  284. { PCI_DEVICE_DATA(INTEL, HDA_RPL_P_0, &rpl_desc) },
  285. { PCI_DEVICE_DATA(INTEL, HDA_RPL_P_1, &rpl_desc) },
  286. { PCI_DEVICE_DATA(INTEL, HDA_ADL_M, &adl_desc) },
  287. { PCI_DEVICE_DATA(INTEL, HDA_ADL_PX, &adl_desc) },
  288. { PCI_DEVICE_DATA(INTEL, HDA_RPL_M, &rpl_desc) },
  289. { PCI_DEVICE_DATA(INTEL, HDA_RPL_PX, &rpl_desc) },
  290. { PCI_DEVICE_DATA(INTEL, HDA_ADL_N, &adln_desc) },
  291. { 0, }
  292. };
  293. MODULE_DEVICE_TABLE(pci, sof_pci_ids);
  294. /* pci_driver definition */
  295. static struct pci_driver snd_sof_pci_intel_tgl_driver = {
  296. .name = "sof-audio-pci-intel-tgl",
  297. .id_table = sof_pci_ids,
  298. .probe = hda_pci_intel_probe,
  299. .remove = sof_pci_remove,
  300. .shutdown = sof_pci_shutdown,
  301. .driver = {
  302. .pm = &sof_pci_pm,
  303. },
  304. };
  305. module_pci_driver(snd_sof_pci_intel_tgl_driver);
  306. MODULE_LICENSE("Dual BSD/GPL");
  307. MODULE_DESCRIPTION("SOF support for TigerLake platforms");
  308. MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_GENERIC);
  309. MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
  310. MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_CNL);
  311. MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);