1 // SPDX-License-Identifier: GPL-2.0-only 2 /* 3 * soc-acpi-intel-lnl-match.c - tables and support for LNL ACPI enumeration. 4 * 5 * Copyright (c) 2023, Intel Corporation 6 * 7 */ 8 9 #include <sound/soc-acpi.h> 10 #include <sound/soc-acpi-intel-match.h> 11 #include "soc-acpi-intel-sdw-mockup-match.h" 12 13 struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_machines[] = { 14 {}, 15 }; 16 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_lnl_machines); 17 18 static const struct snd_soc_acpi_endpoint single_endpoint = { 19 .num = 0, 20 .aggregated = 0, 21 .group_position = 0, 22 .group_id = 0, 23 }; 24 25 static const struct snd_soc_acpi_endpoint spk_l_endpoint = { 26 .num = 0, 27 .aggregated = 1, 28 .group_position = 0, 29 .group_id = 1, 30 }; 31 32 static const struct snd_soc_acpi_endpoint spk_r_endpoint = { 33 .num = 0, 34 .aggregated = 1, 35 .group_position = 1, 36 .group_id = 1, 37 }; 38 39 static const struct snd_soc_acpi_endpoint rt712_endpoints[] = { 40 { 41 .num = 0, 42 .aggregated = 0, 43 .group_position = 0, 44 .group_id = 0, 45 }, 46 { 47 .num = 1, 48 .aggregated = 0, 49 .group_position = 0, 50 .group_id = 0, 51 }, 52 }; 53 54 /* 55 * RT722 is a multi-function codec, three endpoints are created for 56 * its headset, amp and dmic functions. 57 */ 58 static const struct snd_soc_acpi_endpoint rt722_endpoints[] = { 59 { 60 .num = 0, 61 .aggregated = 0, 62 .group_position = 0, 63 .group_id = 0, 64 }, 65 { 66 .num = 1, 67 .aggregated = 0, 68 .group_position = 0, 69 .group_id = 0, 70 }, 71 { 72 .num = 2, 73 .aggregated = 0, 74 .group_position = 0, 75 .group_id = 0, 76 }, 77 }; 78 79 static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = { 80 { /* Jack Playback Endpoint */ 81 .num = 0, 82 .aggregated = 0, 83 .group_position = 0, 84 .group_id = 0, 85 }, 86 { /* DMIC Capture Endpoint */ 87 .num = 1, 88 .aggregated = 0, 89 .group_position = 0, 90 .group_id = 0, 91 }, 92 { /* Jack Capture Endpoint */ 93 .num = 2, 94 .aggregated = 0, 95 .group_position = 0, 96 .group_id = 0, 97 }, 98 { /* Speaker Playback Endpoint */ 99 .num = 3, 100 .aggregated = 0, 101 .group_position = 0, 102 .group_id = 0, 103 }, 104 }; 105 106 static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = { 107 { 108 .adr = 0x00003001FA424301ull, 109 .num_endpoints = ARRAY_SIZE(cs42l43_endpoints), 110 .endpoints = cs42l43_endpoints, 111 .name_prefix = "cs42l43" 112 } 113 }; 114 115 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = { 116 { 117 .adr = 0x000030025D071101ull, 118 .num_endpoints = 1, 119 .endpoints = &single_endpoint, 120 .name_prefix = "rt711" 121 } 122 }; 123 124 static const struct snd_soc_acpi_adr_device rt712_2_single_adr[] = { 125 { 126 .adr = 0x000230025D071201ull, 127 .num_endpoints = ARRAY_SIZE(rt712_endpoints), 128 .endpoints = rt712_endpoints, 129 .name_prefix = "rt712" 130 } 131 }; 132 133 static const struct snd_soc_acpi_adr_device rt1712_3_single_adr[] = { 134 { 135 .adr = 0x000330025D171201ull, 136 .num_endpoints = 1, 137 .endpoints = &single_endpoint, 138 .name_prefix = "rt712-dmic" 139 } 140 }; 141 142 static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = { 143 { 144 .adr = 0x000030025d072201ull, 145 .num_endpoints = ARRAY_SIZE(rt722_endpoints), 146 .endpoints = rt722_endpoints, 147 .name_prefix = "rt722" 148 } 149 }; 150 151 static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = { 152 { 153 .adr = 0x000230025D131601ull, 154 .num_endpoints = 1, 155 .endpoints = &spk_l_endpoint, 156 .name_prefix = "rt1316-1" 157 } 158 }; 159 160 static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = { 161 { 162 .adr = 0x000331025D131601ull, 163 .num_endpoints = 1, 164 .endpoints = &spk_r_endpoint, 165 .name_prefix = "rt1316-2" 166 } 167 }; 168 169 static const struct snd_soc_acpi_adr_device rt1318_1_group1_adr[] = { 170 { 171 .adr = 0x000130025D131801ull, 172 .num_endpoints = 1, 173 .endpoints = &spk_l_endpoint, 174 .name_prefix = "rt1318-1" 175 } 176 }; 177 178 static const struct snd_soc_acpi_adr_device rt1318_2_group1_adr[] = { 179 { 180 .adr = 0x000232025D131801ull, 181 .num_endpoints = 1, 182 .endpoints = &spk_r_endpoint, 183 .name_prefix = "rt1318-2" 184 } 185 }; 186 187 static const struct snd_soc_acpi_adr_device rt714_0_adr[] = { 188 { 189 .adr = 0x000030025D071401ull, 190 .num_endpoints = 1, 191 .endpoints = &single_endpoint, 192 .name_prefix = "rt714" 193 } 194 }; 195 196 static const struct snd_soc_acpi_adr_device rt714_1_adr[] = { 197 { 198 .adr = 0x000130025D071401ull, 199 .num_endpoints = 1, 200 .endpoints = &single_endpoint, 201 .name_prefix = "rt714" 202 } 203 }; 204 205 static const struct snd_soc_acpi_link_adr lnl_cs42l43_l0[] = { 206 { 207 .mask = BIT(0), 208 .num_adr = ARRAY_SIZE(cs42l43_0_adr), 209 .adr_d = cs42l43_0_adr, 210 }, 211 {} 212 }; 213 214 static const struct snd_soc_acpi_link_adr lnl_rvp[] = { 215 { 216 .mask = BIT(0), 217 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr), 218 .adr_d = rt711_sdca_0_adr, 219 }, 220 {} 221 }; 222 223 static const struct snd_soc_acpi_link_adr lnl_712_only[] = { 224 { 225 .mask = BIT(2), 226 .num_adr = ARRAY_SIZE(rt712_2_single_adr), 227 .adr_d = rt712_2_single_adr, 228 }, 229 { 230 .mask = BIT(3), 231 .num_adr = ARRAY_SIZE(rt1712_3_single_adr), 232 .adr_d = rt1712_3_single_adr, 233 }, 234 {} 235 }; 236 237 static const struct snd_soc_acpi_link_adr lnl_rt722_only[] = { 238 { 239 .mask = BIT(0), 240 .num_adr = ARRAY_SIZE(rt722_0_single_adr), 241 .adr_d = rt722_0_single_adr, 242 }, 243 {} 244 }; 245 246 static const struct snd_soc_acpi_link_adr lnl_3_in_1_sdca[] = { 247 { 248 .mask = BIT(0), 249 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr), 250 .adr_d = rt711_sdca_0_adr, 251 }, 252 { 253 .mask = BIT(2), 254 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr), 255 .adr_d = rt1316_2_group1_adr, 256 }, 257 { 258 .mask = BIT(3), 259 .num_adr = ARRAY_SIZE(rt1316_3_group1_adr), 260 .adr_d = rt1316_3_group1_adr, 261 }, 262 { 263 .mask = BIT(1), 264 .num_adr = ARRAY_SIZE(rt714_1_adr), 265 .adr_d = rt714_1_adr, 266 }, 267 {} 268 }; 269 270 static const struct snd_soc_acpi_link_adr lnl_sdw_rt1318_l12_rt714_l0[] = { 271 { 272 .mask = BIT(1), 273 .num_adr = ARRAY_SIZE(rt1318_1_group1_adr), 274 .adr_d = rt1318_1_group1_adr, 275 }, 276 { 277 .mask = BIT(2), 278 .num_adr = ARRAY_SIZE(rt1318_2_group1_adr), 279 .adr_d = rt1318_2_group1_adr, 280 }, 281 { 282 .mask = BIT(0), 283 .num_adr = ARRAY_SIZE(rt714_0_adr), 284 .adr_d = rt714_0_adr, 285 }, 286 {} 287 }; 288 289 /* this table is used when there is no I2S codec present */ 290 struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[] = { 291 /* mockup tests need to be first */ 292 { 293 .link_mask = GENMASK(3, 0), 294 .links = sdw_mockup_headset_2amps_mic, 295 .drv_name = "sof_sdw", 296 .sof_tplg_filename = "sof-lnl-rt711-rt1308-rt715.tplg", 297 }, 298 { 299 .link_mask = BIT(0) | BIT(1) | BIT(3), 300 .links = sdw_mockup_headset_1amp_mic, 301 .drv_name = "sof_sdw", 302 .sof_tplg_filename = "sof-lnl-rt711-rt1308-mono-rt715.tplg", 303 }, 304 { 305 .link_mask = GENMASK(2, 0), 306 .links = sdw_mockup_mic_headset_1amp, 307 .drv_name = "sof_sdw", 308 .sof_tplg_filename = "sof-lnl-rt715-rt711-rt1308-mono.tplg", 309 }, 310 { 311 .link_mask = GENMASK(3, 0), 312 .links = lnl_3_in_1_sdca, 313 .drv_name = "sof_sdw", 314 .sof_tplg_filename = "sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg", 315 }, 316 { 317 .link_mask = BIT(0), 318 .links = lnl_cs42l43_l0, 319 .drv_name = "sof_sdw", 320 .sof_tplg_filename = "sof-lnl-cs42l43-l0.tplg", 321 }, 322 { 323 .link_mask = BIT(0), 324 .links = lnl_rvp, 325 .drv_name = "sof_sdw", 326 .sof_tplg_filename = "sof-lnl-rt711.tplg", 327 }, 328 { 329 .link_mask = BIT(2) | BIT(3), 330 .links = lnl_712_only, 331 .drv_name = "sof_sdw", 332 .sof_tplg_filename = "sof-lnl-rt712-l2-rt1712-l3.tplg", 333 }, 334 { 335 .link_mask = BIT(0), 336 .links = lnl_rt722_only, 337 .drv_name = "sof_sdw", 338 .sof_tplg_filename = "sof-lnl-rt722-l0.tplg", 339 }, 340 { 341 .link_mask = GENMASK(2, 0), 342 .links = lnl_sdw_rt1318_l12_rt714_l0, 343 .drv_name = "sof_sdw", 344 .sof_tplg_filename = "sof-lnl-rt1318-l12-rt714-l0.tplg" 345 }, 346 {}, 347 }; 348 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_lnl_sdw_machines); 349
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.