1 // SPDX-License-Identifier: GPL-2.0-only 2 /* 3 * soc-apci-intel-tgl-match.c - tables and support for ICL ACPI enumeration. 4 * 5 * Copyright (c) 2019, Intel Corporation. 6 * 7 */ 8 9 #include <sound/soc-acpi.h> 10 #include <sound/soc-acpi-intel-match.h> 11 12 static struct snd_soc_acpi_codecs tgl_codecs = { 13 .num_codecs = 1, 14 .codecs = {"MX98357A"} 15 }; 16 17 static const struct snd_soc_acpi_endpoint single_endpoint = { 18 .num = 0, 19 .aggregated = 0, 20 .group_position = 0, 21 .group_id = 0, 22 }; 23 24 static const struct snd_soc_acpi_endpoint spk_l_endpoint = { 25 .num = 0, 26 .aggregated = 1, 27 .group_position = 0, 28 .group_id = 1, 29 }; 30 31 static const struct snd_soc_acpi_endpoint spk_r_endpoint = { 32 .num = 0, 33 .aggregated = 1, 34 .group_position = 1, 35 .group_id = 1, 36 }; 37 38 static const struct snd_soc_acpi_adr_device rt711_0_adr[] = { 39 { 40 .adr = 0x000010025D071100, 41 .num_endpoints = 1, 42 .endpoints = &single_endpoint, 43 } 44 }; 45 46 static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = { 47 { 48 .adr = 0x000120025D130800, 49 .num_endpoints = 1, 50 .endpoints = &spk_l_endpoint, 51 }, 52 { 53 .adr = 0x000122025D130800, 54 .num_endpoints = 1, 55 .endpoints = &spk_r_endpoint, 56 } 57 }; 58 59 static const struct snd_soc_acpi_adr_device mx8373_1_adr[] = { 60 { 61 .adr = 0x000123019F837300, 62 .num_endpoints = 1, 63 .endpoints = &spk_l_endpoint, 64 }, 65 { 66 .adr = 0x000127019F837300, 67 .num_endpoints = 1, 68 .endpoints = &spk_r_endpoint, 69 } 70 }; 71 72 static const struct snd_soc_acpi_adr_device rt5682_0_adr[] = { 73 { 74 .adr = 0x000021025D568200, 75 .num_endpoints = 1, 76 .endpoints = &single_endpoint, 77 } 78 }; 79 80 static const struct snd_soc_acpi_link_adr tgl_i2s_rt1308[] = { 81 { 82 .mask = BIT(0), 83 .num_adr = ARRAY_SIZE(rt711_0_adr), 84 .adr_d = rt711_0_adr, 85 }, 86 {} 87 }; 88 89 static const struct snd_soc_acpi_link_adr tgl_rvp[] = { 90 { 91 .mask = BIT(0), 92 .num_adr = ARRAY_SIZE(rt711_0_adr), 93 .adr_d = rt711_0_adr, 94 }, 95 { 96 .mask = BIT(1), 97 .num_adr = ARRAY_SIZE(rt1308_1_adr), 98 .adr_d = rt1308_1_adr, 99 }, 100 {} 101 }; 102 103 static const struct snd_soc_acpi_link_adr tgl_chromebook_base[] = { 104 { 105 .mask = BIT(0), 106 .num_adr = ARRAY_SIZE(rt5682_0_adr), 107 .adr_d = rt5682_0_adr, 108 }, 109 { 110 .mask = BIT(1), 111 .num_adr = ARRAY_SIZE(mx8373_1_adr), 112 .adr_d = mx8373_1_adr, 113 }, 114 {} 115 }; 116 117 static struct snd_soc_acpi_codecs tgl_max98373_amp = { 118 .num_codecs = 1, 119 .codecs = {"MX98373"} 120 }; 121 122 struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_machines[] = { 123 { 124 .id = "10EC1308", 125 .drv_name = "sof_sdw", 126 .link_mask = 0x1, /* RT711 on SoundWire link0 */ 127 .links = tgl_i2s_rt1308, 128 .sof_fw_filename = "sof-tgl.ri", 129 .sof_tplg_filename = "sof-tgl-rt711-i2s-rt1308.tplg", 130 }, 131 { 132 .id = "10EC5682", 133 .drv_name = "tgl_max98357a_rt5682", 134 .machine_quirk = snd_soc_acpi_codec_list, 135 .quirk_data = &tgl_codecs, 136 .sof_fw_filename = "sof-tgl.ri", 137 .sof_tplg_filename = "sof-tgl-max98357a-rt5682.tplg", 138 }, 139 { 140 .id = "10EC5682", 141 .drv_name = "tgl_max98373_rt5682", 142 .machine_quirk = snd_soc_acpi_codec_list, 143 .quirk_data = &tgl_max98373_amp, 144 .sof_fw_filename = "sof-tgl.ri", 145 .sof_tplg_filename = "sof-tgl-max98373-rt5682.tplg", 146 }, 147 {}, 148 }; 149 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_tgl_machines); 150 151 /* this table is used when there is no I2S codec present */ 152 struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = { 153 { 154 .link_mask = 0x3, /* rt711 on link 0 and 2 rt1308s on link 1 */ 155 .links = tgl_rvp, 156 .drv_name = "sof_sdw", 157 .sof_fw_filename = "sof-tgl.ri", 158 .sof_tplg_filename = "sof-tgl-rt711-rt1308.tplg", 159 }, 160 { 161 .link_mask = 0x3, /* rt5682 on link0 & 2xmax98373 on link 1 */ 162 .links = tgl_chromebook_base, 163 .drv_name = "sof_sdw", 164 .sof_fw_filename = "sof-tgl.ri", 165 .sof_tplg_filename = "sof-tgl-sdw-max98373-rt5682.tplg", 166 }, 167 { 168 .link_mask = 0x1, /* this will only enable rt5682 for now */ 169 .links = tgl_chromebook_base, 170 .drv_name = "sof_sdw", 171 .sof_fw_filename = "sof-tgl.ri", 172 .sof_tplg_filename = "sof-tgl-rt5682.tplg", 173 }, 174 {}, 175 }; 176 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_tgl_sdw_machines); 177 178 MODULE_LICENSE("GPL v2"); 179 MODULE_DESCRIPTION("Intel Common ACPI Match module"); 180