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. All rights reserved. 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_adr_device rt711_sdca_0_adr[] = { 40 { 41 .adr = 0x000030025D071101ull, 42 .num_endpoints = 1, 43 .endpoints = &single_endpoint, 44 .name_prefix = "rt711" 45 } 46 }; 47 48 static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = { 49 { 50 .adr = 0x000230025D131601ull, 51 .num_endpoints = 1, 52 .endpoints = &spk_l_endpoint, 53 .name_prefix = "rt1316-1" 54 } 55 }; 56 57 static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = { 58 { 59 .adr = 0x000331025D131601ull, 60 .num_endpoints = 1, 61 .endpoints = &spk_r_endpoint, 62 .name_prefix = "rt1316-2" 63 } 64 }; 65 66 static const struct snd_soc_acpi_adr_device rt714_1_adr[] = { 67 { 68 .adr = 0x000130025D071401ull, 69 .num_endpoints = 1, 70 .endpoints = &single_endpoint, 71 .name_prefix = "rt714" 72 } 73 }; 74 75 static const struct snd_soc_acpi_link_adr lnl_rvp[] = { 76 { 77 .mask = BIT(0), 78 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr), 79 .adr_d = rt711_sdca_0_adr, 80 }, 81 {} 82 }; 83 84 static const struct snd_soc_acpi_link_adr lnl_3_in_1_sdca[] = { 85 { 86 .mask = BIT(0), 87 .num_adr = ARRAY_SIZE(rt711_sdca_0_adr), 88 .adr_d = rt711_sdca_0_adr, 89 }, 90 { 91 .mask = BIT(2), 92 .num_adr = ARRAY_SIZE(rt1316_2_group1_adr), 93 .adr_d = rt1316_2_group1_adr, 94 }, 95 { 96 .mask = BIT(3), 97 .num_adr = ARRAY_SIZE(rt1316_3_group1_adr), 98 .adr_d = rt1316_3_group1_adr, 99 }, 100 { 101 .mask = BIT(1), 102 .num_adr = ARRAY_SIZE(rt714_1_adr), 103 .adr_d = rt714_1_adr, 104 }, 105 {} 106 }; 107 108 /* this table is used when there is no I2S codec present */ 109 struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[] = { 110 /* mockup tests need to be first */ 111 { 112 .link_mask = GENMASK(3, 0), 113 .links = sdw_mockup_headset_2amps_mic, 114 .drv_name = "sof_sdw", 115 .sof_tplg_filename = "sof-lnl-rt711-rt1308-rt715.tplg", 116 }, 117 { 118 .link_mask = BIT(0) | BIT(1) | BIT(3), 119 .links = sdw_mockup_headset_1amp_mic, 120 .drv_name = "sof_sdw", 121 .sof_tplg_filename = "sof-lnl-rt711-rt1308-mono-rt715.tplg", 122 }, 123 { 124 .link_mask = GENMASK(2, 0), 125 .links = sdw_mockup_mic_headset_1amp, 126 .drv_name = "sof_sdw", 127 .sof_tplg_filename = "sof-lnl-rt715-rt711-rt1308-mono.tplg", 128 }, 129 { 130 .link_mask = GENMASK(3, 0), 131 .links = lnl_3_in_1_sdca, 132 .drv_name = "sof_sdw", 133 .sof_tplg_filename = "sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg", 134 }, 135 { 136 .link_mask = BIT(0), 137 .links = lnl_rvp, 138 .drv_name = "sof_sdw", 139 .sof_tplg_filename = "sof-lnl-rt711.tplg", 140 }, 141 {}, 142 }; 143 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_lnl_sdw_machines); 144