Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: Intel: updates for 6.10 - part4

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

More cleanups from Brent, notably the removal of the redundant
cml_rt1011_rt5682 machine driver, fixes for SoundWire platforms and
changes to sof_rt5682 to allow for 96+ sampling rates.

For the rest of this kernel cycle, we are still working on SoundWire
updates for MeteorLake (usual missing ACPI signature required for
topology selection and jack detection information). We'll provide
those patches as soon as they are reviewed/validated.

+297 -717
+3 -9
sound/soc/intel/boards/Kconfig
··· 595 595 596 596 config SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH 597 597 tristate "CML with RT1011 and RT5682 in I2S Mode" 598 - depends on I2C && ACPI 599 - depends on MFD_INTEL_LPSS || COMPILE_TEST 600 - depends on SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC 601 - select SND_SOC_RT1011 602 - select SND_SOC_RT5682_I2C 603 - select SND_SOC_DMIC 604 - select SND_SOC_HDAC_HDMI 605 - select SND_SOC_INTEL_HDA_DSP_COMMON 598 + imply SND_SOC_INTEL_SOF_RT5682_MACH 606 599 help 607 600 This adds support for ASoC machine driver for SOF platform with 608 - RT1011 + RT5682 I2S codec. 601 + RT1011 + RT5682 I2S codec. This option is deprecated and please used 602 + SND_SOC_INTEL_SOF_RT5682_MACH instead. 609 603 Say Y if you have such a device. 610 604 If unsure select "N". 611 605
-2
sound/soc/intel/boards/Makefile
··· 24 24 snd-soc-sof_es8336-objs := sof_es8336.o 25 25 snd-soc-sof_nau8825-objs := sof_nau8825.o 26 26 snd-soc-sof_da7219-objs := sof_da7219.o 27 - snd-soc-cml_rt1011_rt5682-objs := cml_rt1011_rt5682.o 28 27 snd-soc-kbl_da7219_max98357a-objs := kbl_da7219_max98357a.o 29 28 snd-soc-kbl_da7219_max98927-objs := kbl_da7219_max98927.o 30 29 snd-soc-kbl_rt5663_max98927-objs := kbl_rt5663_max98927.o ··· 70 71 obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH) += snd-soc-sst-byt-cht-da7213.o 71 72 obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH) += snd-soc-sst-byt-cht-es8316.o 72 73 obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) += snd-soc-sst-byt-cht-nocodec.o 73 - obj-$(CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH) += snd-soc-cml_rt1011_rt5682.o 74 74 obj-$(CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH) += snd-soc-kbl_da7219_max98357a.o 75 75 obj-$(CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH) += snd-soc-kbl_da7219_max98927.o 76 76 obj-$(CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH) += snd-soc-kbl_rt5663_max98927.o
-609
sound/soc/intel/boards/cml_rt1011_rt5682.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - // Copyright(c) 2019 Intel Corporation. 3 - 4 - /* 5 - * Intel Cometlake I2S Machine driver for RT1011 + RT5682 codec 6 - */ 7 - 8 - #include <linux/input.h> 9 - #include <linux/module.h> 10 - #include <linux/platform_device.h> 11 - #include <linux/clk.h> 12 - #include <linux/dmi.h> 13 - #include <linux/slab.h> 14 - #include <linux/acpi.h> 15 - #include <sound/core.h> 16 - #include <sound/jack.h> 17 - #include <sound/pcm.h> 18 - #include <sound/pcm_params.h> 19 - #include <sound/soc.h> 20 - #include <sound/rt5682.h> 21 - #include <sound/soc-acpi.h> 22 - #include "../../codecs/rt1011.h" 23 - #include "../../codecs/rt5682.h" 24 - #include "../../codecs/hdac_hdmi.h" 25 - #include "hda_dsp_common.h" 26 - 27 - /* The platform clock outputs 24Mhz clock to codec as I2S MCLK */ 28 - #define CML_PLAT_CLK 24000000 29 - #define CML_RT1011_CODEC_DAI "rt1011-aif" 30 - #define CML_RT5682_CODEC_DAI "rt5682-aif1" 31 - #define NAME_SIZE 32 32 - 33 - #define SOF_RT1011_SPEAKER_WL BIT(0) 34 - #define SOF_RT1011_SPEAKER_WR BIT(1) 35 - #define SOF_RT1011_SPEAKER_TL BIT(2) 36 - #define SOF_RT1011_SPEAKER_TR BIT(3) 37 - 38 - /* Default: Woofer speakers */ 39 - static unsigned long sof_rt1011_quirk = SOF_RT1011_SPEAKER_WL | 40 - SOF_RT1011_SPEAKER_WR; 41 - 42 - static int sof_rt1011_quirk_cb(const struct dmi_system_id *id) 43 - { 44 - sof_rt1011_quirk = (unsigned long)id->driver_data; 45 - return 1; 46 - } 47 - 48 - static const struct dmi_system_id sof_rt1011_quirk_table[] = { 49 - { 50 - .callback = sof_rt1011_quirk_cb, 51 - .matches = { 52 - DMI_MATCH(DMI_SYS_VENDOR, "Google"), 53 - DMI_MATCH(DMI_PRODUCT_NAME, "Helios"), 54 - }, 55 - .driver_data = (void *)(SOF_RT1011_SPEAKER_WL | SOF_RT1011_SPEAKER_WR | 56 - SOF_RT1011_SPEAKER_TL | SOF_RT1011_SPEAKER_TR), 57 - }, 58 - { 59 - } 60 - }; 61 - 62 - static struct snd_soc_jack hdmi_jack[3]; 63 - 64 - struct hdmi_pcm { 65 - struct list_head head; 66 - struct snd_soc_dai *codec_dai; 67 - int device; 68 - }; 69 - 70 - struct card_private { 71 - char codec_name[SND_ACPI_I2C_ID_LEN]; 72 - struct snd_soc_jack headset; 73 - struct list_head hdmi_pcm_list; 74 - bool common_hdmi_codec_drv; 75 - }; 76 - 77 - static const struct snd_kcontrol_new cml_controls[] = { 78 - SOC_DAPM_PIN_SWITCH("Headphone Jack"), 79 - SOC_DAPM_PIN_SWITCH("Headset Mic"), 80 - SOC_DAPM_PIN_SWITCH("WL Ext Spk"), 81 - SOC_DAPM_PIN_SWITCH("WR Ext Spk"), 82 - }; 83 - 84 - static const struct snd_kcontrol_new cml_rt1011_tt_controls[] = { 85 - SOC_DAPM_PIN_SWITCH("TL Ext Spk"), 86 - SOC_DAPM_PIN_SWITCH("TR Ext Spk"), 87 - }; 88 - 89 - static const struct snd_soc_dapm_widget cml_rt1011_rt5682_widgets[] = { 90 - SND_SOC_DAPM_SPK("WL Ext Spk", NULL), 91 - SND_SOC_DAPM_SPK("WR Ext Spk", NULL), 92 - SND_SOC_DAPM_HP("Headphone Jack", NULL), 93 - SND_SOC_DAPM_MIC("Headset Mic", NULL), 94 - SND_SOC_DAPM_MIC("SoC DMIC", NULL), 95 - }; 96 - 97 - static const struct snd_soc_dapm_widget cml_rt1011_tt_widgets[] = { 98 - SND_SOC_DAPM_SPK("TL Ext Spk", NULL), 99 - SND_SOC_DAPM_SPK("TR Ext Spk", NULL), 100 - }; 101 - 102 - static const struct snd_soc_dapm_route cml_rt1011_rt5682_map[] = { 103 - /*WL/WR speaker*/ 104 - {"WL Ext Spk", NULL, "WL SPO"}, 105 - {"WR Ext Spk", NULL, "WR SPO"}, 106 - 107 - /* HP jack connectors - unknown if we have jack detection */ 108 - { "Headphone Jack", NULL, "HPOL" }, 109 - { "Headphone Jack", NULL, "HPOR" }, 110 - 111 - /* other jacks */ 112 - { "IN1P", NULL, "Headset Mic" }, 113 - 114 - /* DMIC */ 115 - {"DMic", NULL, "SoC DMIC"}, 116 - }; 117 - 118 - static const struct snd_soc_dapm_route cml_rt1011_tt_map[] = { 119 - /*TL/TR speaker*/ 120 - {"TL Ext Spk", NULL, "TL SPO" }, 121 - {"TR Ext Spk", NULL, "TR SPO" }, 122 - }; 123 - 124 - static struct snd_soc_jack_pin jack_pins[] = { 125 - { 126 - .pin = "Headphone Jack", 127 - .mask = SND_JACK_HEADPHONE, 128 - }, 129 - { 130 - .pin = "Headset Mic", 131 - .mask = SND_JACK_MICROPHONE, 132 - }, 133 - }; 134 - 135 - static int cml_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd) 136 - { 137 - struct card_private *ctx = snd_soc_card_get_drvdata(rtd->card); 138 - struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; 139 - struct snd_soc_jack *jack; 140 - int ret; 141 - 142 - /* need to enable ASRC function for 24MHz mclk rate */ 143 - rt5682_sel_asrc_clk_src(component, RT5682_DA_STEREO1_FILTER | 144 - RT5682_AD_STEREO1_FILTER, 145 - RT5682_CLK_SEL_I2S1_ASRC); 146 - 147 - /* 148 - * Headset buttons map to the google Reference headset. 149 - * These can be configured by userspace. 150 - */ 151 - ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", 152 - SND_JACK_HEADSET | SND_JACK_BTN_0 | 153 - SND_JACK_BTN_1 | SND_JACK_BTN_2 | 154 - SND_JACK_BTN_3, 155 - &ctx->headset, 156 - jack_pins, 157 - ARRAY_SIZE(jack_pins)); 158 - if (ret) { 159 - dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); 160 - return ret; 161 - } 162 - 163 - jack = &ctx->headset; 164 - 165 - snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); 166 - snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); 167 - snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); 168 - snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); 169 - ret = snd_soc_component_set_jack(component, jack, NULL); 170 - if (ret) 171 - dev_err(rtd->dev, "Headset Jack call-back failed: %d\n", ret); 172 - 173 - return ret; 174 - }; 175 - 176 - static void cml_rt5682_codec_exit(struct snd_soc_pcm_runtime *rtd) 177 - { 178 - struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; 179 - 180 - snd_soc_component_set_jack(component, NULL, NULL); 181 - } 182 - 183 - static int cml_rt1011_spk_init(struct snd_soc_pcm_runtime *rtd) 184 - { 185 - int ret = 0; 186 - struct snd_soc_card *card = rtd->card; 187 - 188 - if (sof_rt1011_quirk & (SOF_RT1011_SPEAKER_TL | 189 - SOF_RT1011_SPEAKER_TR)) { 190 - 191 - ret = snd_soc_add_card_controls(card, cml_rt1011_tt_controls, 192 - ARRAY_SIZE(cml_rt1011_tt_controls)); 193 - if (ret) 194 - return ret; 195 - 196 - ret = snd_soc_dapm_new_controls(&card->dapm, 197 - cml_rt1011_tt_widgets, 198 - ARRAY_SIZE(cml_rt1011_tt_widgets)); 199 - if (ret) 200 - return ret; 201 - 202 - ret = snd_soc_dapm_add_routes(&card->dapm, cml_rt1011_tt_map, 203 - ARRAY_SIZE(cml_rt1011_tt_map)); 204 - 205 - if (ret) 206 - return ret; 207 - } 208 - 209 - return ret; 210 - } 211 - 212 - static int cml_rt5682_hw_params(struct snd_pcm_substream *substream, 213 - struct snd_pcm_hw_params *params) 214 - { 215 - struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 216 - struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); 217 - int clk_id, clk_freq, pll_out, ret; 218 - 219 - clk_id = RT5682_PLL1_S_MCLK; 220 - clk_freq = CML_PLAT_CLK; 221 - 222 - pll_out = params_rate(params) * 512; 223 - 224 - ret = snd_soc_dai_set_pll(codec_dai, 0, clk_id, clk_freq, pll_out); 225 - if (ret < 0) 226 - dev_warn(rtd->dev, "snd_soc_dai_set_pll err = %d\n", ret); 227 - 228 - /* Configure sysclk for codec */ 229 - ret = snd_soc_dai_set_sysclk(codec_dai, RT5682_SCLK_S_PLL1, 230 - pll_out, SND_SOC_CLOCK_IN); 231 - if (ret < 0) 232 - dev_warn(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret); 233 - 234 - /* 235 - * slot_width should be equal or large than data length, set them 236 - * be the same 237 - */ 238 - ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x0, 0x0, 2, 239 - params_width(params)); 240 - if (ret < 0) 241 - dev_warn(rtd->dev, "set TDM slot err:%d\n", ret); 242 - return ret; 243 - } 244 - 245 - static int cml_rt1011_hw_params(struct snd_pcm_substream *substream, 246 - struct snd_pcm_hw_params *params) 247 - { 248 - struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 249 - struct snd_soc_dai *codec_dai; 250 - struct snd_soc_card *card = rtd->card; 251 - int srate, i, ret = 0; 252 - 253 - srate = params_rate(params); 254 - 255 - for_each_rtd_codec_dais(rtd, i, codec_dai) { 256 - 257 - /* 100 Fs to drive 24 bit data */ 258 - ret = snd_soc_dai_set_pll(codec_dai, 0, RT1011_PLL1_S_BCLK, 259 - 100 * srate, 256 * srate); 260 - if (ret < 0) { 261 - dev_err(card->dev, "codec_dai clock not set\n"); 262 - return ret; 263 - } 264 - 265 - ret = snd_soc_dai_set_sysclk(codec_dai, 266 - RT1011_FS_SYS_PRE_S_PLL1, 267 - 256 * srate, SND_SOC_CLOCK_IN); 268 - if (ret < 0) { 269 - dev_err(card->dev, "codec_dai clock not set\n"); 270 - return ret; 271 - } 272 - 273 - /* 274 - * Codec TDM is configured as 24 bit capture/ playback. 275 - * 2 CH PB is done over 4 codecs - 2 Woofers and 2 Tweeters. 276 - * The Left woofer and tweeter plays the Left playback data 277 - * and similar by the Right. 278 - * Hence 2 codecs (1 T and 1 W pair) share same Rx slot. 279 - * The feedback is captured for each codec individually. 280 - * Hence all 4 codecs use 1 Tx slot each for feedback. 281 - */ 282 - if (sof_rt1011_quirk & (SOF_RT1011_SPEAKER_WL | 283 - SOF_RT1011_SPEAKER_WR)) { 284 - if (!strcmp(codec_dai->component->name, "i2c-10EC1011:00")) { 285 - ret = snd_soc_dai_set_tdm_slot(codec_dai, 286 - 0x4, 0x1, 4, 24); 287 - if (ret < 0) 288 - break; 289 - } 290 - 291 - if (!strcmp(codec_dai->component->name, "i2c-10EC1011:01")) { 292 - ret = snd_soc_dai_set_tdm_slot(codec_dai, 293 - 0x8, 0x2, 4, 24); 294 - if (ret < 0) 295 - break; 296 - } 297 - } 298 - 299 - if (sof_rt1011_quirk & (SOF_RT1011_SPEAKER_TL | 300 - SOF_RT1011_SPEAKER_TR)) { 301 - if (!strcmp(codec_dai->component->name, "i2c-10EC1011:02")) { 302 - ret = snd_soc_dai_set_tdm_slot(codec_dai, 303 - 0x1, 0x1, 4, 24); 304 - if (ret < 0) 305 - break; 306 - } 307 - 308 - if (!strcmp(codec_dai->component->name, "i2c-10EC1011:03")) { 309 - ret = snd_soc_dai_set_tdm_slot(codec_dai, 310 - 0x2, 0x2, 4, 24); 311 - if (ret < 0) 312 - break; 313 - } 314 - } 315 - } 316 - if (ret < 0) 317 - dev_err(rtd->dev, 318 - "set codec TDM slot for %s failed with error %d\n", 319 - codec_dai->component->name, ret); 320 - return ret; 321 - } 322 - 323 - static struct snd_soc_ops cml_rt5682_ops = { 324 - .hw_params = cml_rt5682_hw_params, 325 - }; 326 - 327 - static const struct snd_soc_ops cml_rt1011_ops = { 328 - .hw_params = cml_rt1011_hw_params, 329 - }; 330 - 331 - static int sof_card_late_probe(struct snd_soc_card *card) 332 - { 333 - struct card_private *ctx = snd_soc_card_get_drvdata(card); 334 - struct snd_soc_component *component = NULL; 335 - char jack_name[NAME_SIZE]; 336 - struct hdmi_pcm *pcm; 337 - int ret, i = 0; 338 - 339 - if (list_empty(&ctx->hdmi_pcm_list)) 340 - return -EINVAL; 341 - 342 - if (ctx->common_hdmi_codec_drv) { 343 - pcm = list_first_entry(&ctx->hdmi_pcm_list, struct hdmi_pcm, 344 - head); 345 - component = pcm->codec_dai->component; 346 - return hda_dsp_hdmi_build_controls(card, component); 347 - } 348 - 349 - list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { 350 - component = pcm->codec_dai->component; 351 - snprintf(jack_name, sizeof(jack_name), 352 - "HDMI/DP, pcm=%d Jack", pcm->device); 353 - ret = snd_soc_card_jack_new(card, jack_name, 354 - SND_JACK_AVOUT, &hdmi_jack[i]); 355 - if (ret) 356 - return ret; 357 - 358 - ret = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device, 359 - &hdmi_jack[i]); 360 - if (ret < 0) 361 - return ret; 362 - 363 - i++; 364 - } 365 - 366 - return hdac_hdmi_jack_port_init(component, &card->dapm); 367 - } 368 - 369 - static int hdmi_init(struct snd_soc_pcm_runtime *rtd) 370 - { 371 - struct card_private *ctx = snd_soc_card_get_drvdata(rtd->card); 372 - struct snd_soc_dai *dai = snd_soc_rtd_to_codec(rtd, 0); 373 - struct hdmi_pcm *pcm; 374 - 375 - pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); 376 - if (!pcm) 377 - return -ENOMEM; 378 - 379 - pcm->device = dai->id; 380 - pcm->codec_dai = dai; 381 - 382 - list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); 383 - 384 - return 0; 385 - } 386 - 387 - /* Cometlake digital audio interface glue - connects codec <--> CPU */ 388 - 389 - SND_SOC_DAILINK_DEF(ssp0_pin, 390 - DAILINK_COMP_ARRAY(COMP_CPU("SSP0 Pin"))); 391 - SND_SOC_DAILINK_DEF(ssp0_codec, 392 - DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00", 393 - CML_RT5682_CODEC_DAI))); 394 - 395 - SND_SOC_DAILINK_DEF(ssp1_pin, 396 - DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin"))); 397 - SND_SOC_DAILINK_DEF(ssp1_codec_2spk, 398 - DAILINK_COMP_ARRAY( 399 - /* WL */ COMP_CODEC("i2c-10EC1011:00", CML_RT1011_CODEC_DAI), 400 - /* WR */ COMP_CODEC("i2c-10EC1011:01", CML_RT1011_CODEC_DAI))); 401 - SND_SOC_DAILINK_DEF(ssp1_codec_4spk, 402 - DAILINK_COMP_ARRAY( 403 - /* WL */ COMP_CODEC("i2c-10EC1011:00", CML_RT1011_CODEC_DAI), 404 - /* WR */ COMP_CODEC("i2c-10EC1011:01", CML_RT1011_CODEC_DAI), 405 - /* TL */ COMP_CODEC("i2c-10EC1011:02", CML_RT1011_CODEC_DAI), 406 - /* TR */ COMP_CODEC("i2c-10EC1011:03", CML_RT1011_CODEC_DAI))); 407 - 408 - 409 - SND_SOC_DAILINK_DEF(dmic_pin, 410 - DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin"))); 411 - 412 - SND_SOC_DAILINK_DEF(dmic16k_pin, 413 - DAILINK_COMP_ARRAY(COMP_CPU("DMIC16k Pin"))); 414 - 415 - SND_SOC_DAILINK_DEF(dmic_codec, 416 - DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi"))); 417 - 418 - SND_SOC_DAILINK_DEF(idisp1_pin, 419 - DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin"))); 420 - SND_SOC_DAILINK_DEF(idisp1_codec, 421 - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1"))); 422 - 423 - SND_SOC_DAILINK_DEF(idisp2_pin, 424 - DAILINK_COMP_ARRAY(COMP_CPU("iDisp2 Pin"))); 425 - SND_SOC_DAILINK_DEF(idisp2_codec, 426 - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2"))); 427 - 428 - SND_SOC_DAILINK_DEF(idisp3_pin, 429 - DAILINK_COMP_ARRAY(COMP_CPU("iDisp3 Pin"))); 430 - SND_SOC_DAILINK_DEF(idisp3_codec, 431 - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3"))); 432 - 433 - SND_SOC_DAILINK_DEF(platform, 434 - DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:1f.3"))); 435 - 436 - static struct snd_soc_dai_link cml_rt1011_rt5682_dailink[] = { 437 - /* Back End DAI links */ 438 - { 439 - /* SSP0 - Codec */ 440 - .name = "SSP0-Codec", 441 - .id = 0, 442 - .init = cml_rt5682_codec_init, 443 - .exit = cml_rt5682_codec_exit, 444 - .ignore_pmdown_time = 1, 445 - .ops = &cml_rt5682_ops, 446 - .dpcm_playback = 1, 447 - .dpcm_capture = 1, 448 - .no_pcm = 1, 449 - SND_SOC_DAILINK_REG(ssp0_pin, ssp0_codec, platform), 450 - }, 451 - { 452 - .name = "dmic01", 453 - .id = 1, 454 - .ignore_suspend = 1, 455 - .dpcm_capture = 1, 456 - .no_pcm = 1, 457 - SND_SOC_DAILINK_REG(dmic_pin, dmic_codec, platform), 458 - }, 459 - { 460 - .name = "dmic16k", 461 - .id = 2, 462 - .ignore_suspend = 1, 463 - .dpcm_capture = 1, 464 - .no_pcm = 1, 465 - SND_SOC_DAILINK_REG(dmic16k_pin, dmic_codec, platform), 466 - }, 467 - { 468 - .name = "iDisp1", 469 - .id = 3, 470 - .init = hdmi_init, 471 - .dpcm_playback = 1, 472 - .no_pcm = 1, 473 - SND_SOC_DAILINK_REG(idisp1_pin, idisp1_codec, platform), 474 - }, 475 - { 476 - .name = "iDisp2", 477 - .id = 4, 478 - .init = hdmi_init, 479 - .dpcm_playback = 1, 480 - .no_pcm = 1, 481 - SND_SOC_DAILINK_REG(idisp2_pin, idisp2_codec, platform), 482 - }, 483 - { 484 - .name = "iDisp3", 485 - .id = 5, 486 - .init = hdmi_init, 487 - .dpcm_playback = 1, 488 - .no_pcm = 1, 489 - SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform), 490 - }, 491 - { 492 - /* 493 - * SSP1 - Codec : added to end of list ensuring 494 - * reuse of common topologies for other end points 495 - * and changing only SSP1's codec 496 - */ 497 - .name = "SSP1-Codec", 498 - .id = 6, 499 - .dpcm_playback = 1, 500 - .dpcm_capture = 1, /* Capture stream provides Feedback */ 501 - .no_pcm = 1, 502 - .init = cml_rt1011_spk_init, 503 - .ops = &cml_rt1011_ops, 504 - SND_SOC_DAILINK_REG(ssp1_pin, ssp1_codec_2spk, platform), 505 - }, 506 - }; 507 - 508 - static struct snd_soc_codec_conf rt1011_conf[] = { 509 - { 510 - .dlc = COMP_CODEC_CONF("i2c-10EC1011:00"), 511 - .name_prefix = "WL", 512 - }, 513 - { 514 - .dlc = COMP_CODEC_CONF("i2c-10EC1011:01"), 515 - .name_prefix = "WR", 516 - }, 517 - /* single configuration structure for 2 and 4 channels */ 518 - { 519 - .dlc = COMP_CODEC_CONF("i2c-10EC1011:02"), 520 - .name_prefix = "TL", 521 - }, 522 - { 523 - .dlc = COMP_CODEC_CONF("i2c-10EC1011:03"), 524 - .name_prefix = "TR", 525 - }, 526 - }; 527 - 528 - /* Cometlake audio machine driver for RT1011 and RT5682 */ 529 - static struct snd_soc_card snd_soc_card_cml = { 530 - .name = "cml_rt1011_rt5682", 531 - .owner = THIS_MODULE, 532 - .dai_link = cml_rt1011_rt5682_dailink, 533 - .num_links = ARRAY_SIZE(cml_rt1011_rt5682_dailink), 534 - .codec_conf = rt1011_conf, 535 - .num_configs = ARRAY_SIZE(rt1011_conf), 536 - .dapm_widgets = cml_rt1011_rt5682_widgets, 537 - .num_dapm_widgets = ARRAY_SIZE(cml_rt1011_rt5682_widgets), 538 - .dapm_routes = cml_rt1011_rt5682_map, 539 - .num_dapm_routes = ARRAY_SIZE(cml_rt1011_rt5682_map), 540 - .controls = cml_controls, 541 - .num_controls = ARRAY_SIZE(cml_controls), 542 - .fully_routed = true, 543 - .late_probe = sof_card_late_probe, 544 - }; 545 - 546 - static int snd_cml_rt1011_probe(struct platform_device *pdev) 547 - { 548 - struct snd_soc_dai_link *dai_link; 549 - struct card_private *ctx; 550 - struct snd_soc_acpi_mach *mach; 551 - const char *platform_name; 552 - int ret, i; 553 - 554 - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 555 - if (!ctx) 556 - return -ENOMEM; 557 - 558 - INIT_LIST_HEAD(&ctx->hdmi_pcm_list); 559 - mach = pdev->dev.platform_data; 560 - snd_soc_card_cml.dev = &pdev->dev; 561 - platform_name = mach->mach_params.platform; 562 - 563 - dmi_check_system(sof_rt1011_quirk_table); 564 - 565 - dev_dbg(&pdev->dev, "sof_rt1011_quirk = %lx\n", sof_rt1011_quirk); 566 - 567 - /* when 4 speaker is available, update codec config */ 568 - if (sof_rt1011_quirk & (SOF_RT1011_SPEAKER_TL | 569 - SOF_RT1011_SPEAKER_TR)) { 570 - for_each_card_prelinks(&snd_soc_card_cml, i, dai_link) { 571 - if (!strcmp(dai_link->codecs[0].dai_name, 572 - CML_RT1011_CODEC_DAI)) { 573 - dai_link->codecs = ssp1_codec_4spk; 574 - dai_link->num_codecs = ARRAY_SIZE(ssp1_codec_4spk); 575 - } 576 - } 577 - } 578 - 579 - /* set platform name for each dailink */ 580 - ret = snd_soc_fixup_dai_links_platform_name(&snd_soc_card_cml, 581 - platform_name); 582 - if (ret) 583 - return ret; 584 - 585 - ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; 586 - 587 - snd_soc_card_set_drvdata(&snd_soc_card_cml, ctx); 588 - 589 - return devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cml); 590 - } 591 - 592 - static struct platform_driver snd_cml_rt1011_rt5682_driver = { 593 - .probe = snd_cml_rt1011_probe, 594 - .driver = { 595 - .name = "cml_rt1011_rt5682", 596 - .pm = &snd_soc_pm_ops, 597 - }, 598 - }; 599 - module_platform_driver(snd_cml_rt1011_rt5682_driver); 600 - 601 - /* Module information */ 602 - MODULE_DESCRIPTION("Cometlake Audio Machine driver - RT1011 and RT5682 in I2S mode"); 603 - MODULE_AUTHOR("Naveen Manohar <naveen.m@intel.com>"); 604 - MODULE_AUTHOR("Sathya Prakash M R <sathya.prakash.m.r@intel.com>"); 605 - MODULE_AUTHOR("Shuming Fan <shumingf@realtek.com>"); 606 - MODULE_AUTHOR("Mac Chiang <mac.chiang@intel.com>"); 607 - MODULE_LICENSE("GPL v2"); 608 - MODULE_ALIAS("platform:cml_rt1011_rt5682"); 609 - MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON);
+8
sound/soc/intel/boards/sof_da7219.c
··· 398 398 SOF_SSP_PORT_BT_OFFLOAD(2) | 399 399 SOF_BT_OFFLOAD_PRESENT), 400 400 }, 401 + { 402 + .name = "mtl_da7219_def", 403 + .driver_data = (kernel_ulong_t)(SOF_DA7219_MCLK_EN | 404 + SOF_SSP_PORT_CODEC(2) | 405 + SOF_SSP_PORT_AMP(0) | 406 + SOF_SSP_PORT_BT_OFFLOAD(1) | 407 + SOF_BT_OFFLOAD_PRESENT), 408 + }, 401 409 { } 402 410 }; 403 411 MODULE_DEVICE_TABLE(platform, board_ids);
+158 -20
sound/soc/intel/boards/sof_realtek_common.c
··· 15 15 #include "../../codecs/rt1011.h" 16 16 #include "../../codecs/rt1015.h" 17 17 #include "../../codecs/rt1308.h" 18 + #include "../common/soc-intel-quirks.h" 18 19 #include "sof_realtek_common.h" 19 20 20 21 /* 21 - * Current only 2-amp configuration is supported for rt1011 22 + * Common structures and functions 23 + */ 24 + static const struct snd_kcontrol_new realtek_4spk_kcontrols[] = { 25 + SOC_DAPM_PIN_SWITCH("WL Ext Spk"), 26 + SOC_DAPM_PIN_SWITCH("WR Ext Spk"), 27 + SOC_DAPM_PIN_SWITCH("TL Ext Spk"), 28 + SOC_DAPM_PIN_SWITCH("TR Ext Spk"), 29 + }; 30 + 31 + static const struct snd_soc_dapm_widget realtek_4spk_widgets[] = { 32 + SND_SOC_DAPM_SPK("WL Ext Spk", NULL), 33 + SND_SOC_DAPM_SPK("WR Ext Spk", NULL), 34 + SND_SOC_DAPM_SPK("TL Ext Spk", NULL), 35 + SND_SOC_DAPM_SPK("TR Ext Spk", NULL), 36 + }; 37 + 38 + /* helper function to get the number of specific codec */ 39 + static unsigned int get_num_codecs(const char *hid) 40 + { 41 + struct acpi_device *adev; 42 + unsigned int dev_num = 0; 43 + 44 + for_each_acpi_dev_match(adev, hid, NULL, -1) 45 + dev_num++; 46 + 47 + return dev_num; 48 + } 49 + 50 + /* 51 + * Realtek ALC1011 22 52 */ 23 53 static const struct snd_soc_dapm_route speaker_map_lr[] = { 24 54 /* speaker */ ··· 56 26 { "Right Spk", NULL, "Right SPO" }, 57 27 }; 58 28 59 - /* 60 - * Make sure device's Unique ID follows this configuration: 61 - * 62 - * Two speakers: 63 - * 0: left, 1: right 64 - * Four speakers: 65 - * 0: Woofer left, 1: Woofer right 66 - * 2: Tweeter left, 3: Tweeter right 67 - */ 68 - static struct snd_soc_codec_conf rt1011_codec_confs[] = { 29 + static const struct snd_soc_dapm_route rt1011_4spk_routes[] = { 30 + {"WL Ext Spk", NULL, "WL SPO" }, 31 + {"WR Ext Spk", NULL, "WR SPO" }, 32 + {"TL Ext Spk", NULL, "TL SPO" }, 33 + {"TR Ext Spk", NULL, "TR SPO" }, 34 + }; 35 + 36 + static struct snd_soc_codec_conf rt1011_2spk_codec_confs[] = { 69 37 { 70 38 .dlc = COMP_CODEC_CONF(RT1011_DEV0_NAME), 71 39 .name_prefix = "Left", ··· 71 43 { 72 44 .dlc = COMP_CODEC_CONF(RT1011_DEV1_NAME), 73 45 .name_prefix = "Right", 46 + }, 47 + }; 48 + 49 + static struct snd_soc_codec_conf rt1011_4spk_codec_confs[] = { 50 + { 51 + .dlc = COMP_CODEC_CONF(RT1011_DEV0_NAME), 52 + .name_prefix = "WL", 53 + }, 54 + { 55 + .dlc = COMP_CODEC_CONF(RT1011_DEV1_NAME), 56 + .name_prefix = "WR", 57 + }, 58 + { 59 + .dlc = COMP_CODEC_CONF(RT1011_DEV2_NAME), 60 + .name_prefix = "TL", 61 + }, 62 + { 63 + .dlc = COMP_CODEC_CONF(RT1011_DEV3_NAME), 64 + .name_prefix = "TR", 74 65 }, 75 66 }; 76 67 ··· 102 55 .name = RT1011_DEV1_NAME, 103 56 .dai_name = RT1011_CODEC_DAI, 104 57 }, 58 + { 59 + .name = RT1011_DEV2_NAME, 60 + .dai_name = RT1011_CODEC_DAI, 61 + }, 62 + { 63 + .name = RT1011_DEV3_NAME, 64 + .dai_name = RT1011_CODEC_DAI, 65 + }, 105 66 }; 106 67 107 68 static const struct { ··· 118 63 } rt1011_tdm_mask[] = { 119 64 {.tx = 0x4, .rx = 0x1}, 120 65 {.tx = 0x8, .rx = 0x2}, 66 + {.tx = 0x1, .rx = 0x1}, 67 + {.tx = 0x2, .rx = 0x2}, 121 68 }; 122 69 123 70 static int rt1011_hw_params(struct snd_pcm_substream *substream, ··· 175 118 static int rt1011_init(struct snd_soc_pcm_runtime *rtd) 176 119 { 177 120 struct snd_soc_card *card = rtd->card; 121 + unsigned int num_codecs = get_num_codecs(RT1011_ACPI_HID); 178 122 int ret; 179 123 180 - ret = snd_soc_dapm_add_routes(&card->dapm, speaker_map_lr, 181 - ARRAY_SIZE(speaker_map_lr)); 182 - if (ret) 183 - dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret); 124 + switch (num_codecs) { 125 + case 2: 126 + if (!soc_intel_is_cml()) { 127 + ret = snd_soc_dapm_add_routes(&card->dapm, speaker_map_lr, 128 + ARRAY_SIZE(speaker_map_lr)); 129 + if (ret) { 130 + dev_err(rtd->dev, "fail to add rt1011 routes, ret %d\n", 131 + ret); 132 + return ret; 133 + } 134 + 135 + break; 136 + } 137 + 138 + /* 139 + * register speaker widgets "WL Ext Spk" and "WR Ext Spk" to 140 + * keep backward compatible with cml devices 141 + */ 142 + fallthrough; 143 + case 4: 144 + ret = snd_soc_dapm_new_controls(&card->dapm, realtek_4spk_widgets, 145 + num_codecs); 146 + if (ret) { 147 + dev_err(rtd->dev, "fail to add rt1011 widgets, ret %d\n", 148 + ret); 149 + return ret; 150 + } 151 + 152 + ret = snd_soc_add_card_controls(card, realtek_4spk_kcontrols, 153 + num_codecs); 154 + if (ret) { 155 + dev_err(rtd->dev, "fail to add rt1011 controls, ret %d\n", 156 + ret); 157 + return ret; 158 + } 159 + 160 + ret = snd_soc_dapm_add_routes(&card->dapm, rt1011_4spk_routes, 161 + num_codecs); 162 + if (ret) { 163 + dev_err(rtd->dev, "fail to add rt1011 routes, ret %d\n", 164 + ret); 165 + return ret; 166 + } 167 + break; 168 + default: 169 + dev_err(rtd->dev, "rt1011: invalid num_codecs %d\n", num_codecs); 170 + return -EINVAL; 171 + } 172 + 184 173 return ret; 185 174 } 186 175 187 - void sof_rt1011_dai_link(struct snd_soc_dai_link *link) 176 + void sof_rt1011_dai_link(struct device *dev, struct snd_soc_dai_link *link) 188 177 { 178 + unsigned int num_codecs = get_num_codecs(RT1011_ACPI_HID); 179 + 189 180 link->codecs = rt1011_dai_link_components; 190 - link->num_codecs = ARRAY_SIZE(rt1011_dai_link_components); 181 + 182 + switch (num_codecs) { 183 + case 2: 184 + case 4: 185 + link->num_codecs = num_codecs; 186 + break; 187 + default: 188 + dev_err(dev, "rt1011: invalid num_codecs %d\n", num_codecs); 189 + break; 190 + } 191 + 191 192 link->init = rt1011_init; 192 193 link->ops = &rt1011_ops; 193 194 } 194 195 EXPORT_SYMBOL_NS(sof_rt1011_dai_link, SND_SOC_INTEL_SOF_REALTEK_COMMON); 195 196 196 - void sof_rt1011_codec_conf(struct snd_soc_card *card) 197 + void sof_rt1011_codec_conf(struct device *dev, struct snd_soc_card *card) 197 198 { 198 - card->codec_conf = rt1011_codec_confs; 199 - card->num_configs = ARRAY_SIZE(rt1011_codec_confs); 199 + unsigned int num_codecs = get_num_codecs(RT1011_ACPI_HID); 200 + 201 + switch (num_codecs) { 202 + case 2: 203 + if (soc_intel_is_cml()) { 204 + /* 205 + * use name prefix 'WL' and 'WR' for speaker widgets to 206 + * keep backward compatible with cml devices 207 + */ 208 + card->codec_conf = rt1011_4spk_codec_confs; 209 + } else { 210 + card->codec_conf = rt1011_2spk_codec_confs; 211 + } 212 + 213 + card->num_configs = num_codecs; 214 + break; 215 + case 4: 216 + card->codec_conf = rt1011_4spk_codec_confs; 217 + card->num_configs = ARRAY_SIZE(rt1011_4spk_codec_confs); 218 + break; 219 + default: 220 + dev_err(dev, "rt1011: invalid num_codecs %d\n", num_codecs); 221 + break; 222 + } 223 + 200 224 } 201 225 EXPORT_SYMBOL_NS(sof_rt1011_codec_conf, SND_SOC_INTEL_SOF_REALTEK_COMMON); 202 226
+2 -2
sound/soc/intel/boards/sof_realtek_common.h
··· 23 23 #define RT1011_DEV2_NAME "i2c-" RT1011_ACPI_HID ":02" 24 24 #define RT1011_DEV3_NAME "i2c-" RT1011_ACPI_HID ":03" 25 25 26 - void sof_rt1011_dai_link(struct snd_soc_dai_link *link); 27 - void sof_rt1011_codec_conf(struct snd_soc_card *card); 26 + void sof_rt1011_dai_link(struct device *dev, struct snd_soc_dai_link *link); 27 + void sof_rt1011_codec_conf(struct device *dev, struct snd_soc_card *card); 28 28 29 29 /* 30 30 * Realtek ALC1015 (AUTO)
+31 -6
sound/soc/intel/boards/sof_rt5682.c
··· 340 340 clk_id = RT5682_SCLK_S_PLL1; 341 341 break; 342 342 case CODEC_RT5682S: 343 - pll_id = RT5682S_PLL2; 344 - clk_id = RT5682S_SCLK_S_PLL2; 343 + /* 344 + * For MCLK = 24.576MHz and sample rate = 96KHz case, use PLL1 We don't test 345 + * pll_out or params_rate() here since rt5682s PLL2 doesn't support 24.576MHz 346 + * input, so we have no choice but to use PLL1. Besides, we will not use PLL at 347 + * all if pll_in == pll_out. ex, MCLK = 24.576Mhz and sample rate = 48KHz 348 + */ 349 + if (pll_in == 24576000) { 350 + pll_id = RT5682S_PLL1; 351 + clk_id = RT5682S_SCLK_S_PLL1; 352 + } else { 353 + pll_id = RT5682S_PLL2; 354 + clk_id = RT5682S_SCLK_S_PLL2; 355 + } 345 356 break; 346 357 default: 347 358 dev_err(rtd->dev, "invalid codec type %d\n", ctx->codec_type); ··· 587 576 max_98390_dai_link(dev, ctx->amp_link); 588 577 break; 589 578 case CODEC_RT1011: 590 - sof_rt1011_dai_link(ctx->amp_link); 579 + sof_rt1011_dai_link(dev, ctx->amp_link); 591 580 break; 592 581 case CODEC_RT1015: 593 582 sof_rt1015_dai_link(ctx->amp_link); ··· 617 606 { 618 607 struct snd_soc_acpi_mach *mach = pdev->dev.platform_data; 619 608 struct sof_card_private *ctx; 609 + char *card_name; 620 610 bool is_legacy_cpu = false; 621 611 int ret; 622 612 ··· 643 631 return -ENOMEM; 644 632 645 633 if (ctx->codec_type == CODEC_RT5650) { 646 - sof_audio_card_rt5682.name = devm_kstrdup(&pdev->dev, "rt5650", 647 - GFP_KERNEL); 634 + card_name = devm_kstrdup(&pdev->dev, "rt5650", GFP_KERNEL); 635 + if (!card_name) 636 + return -ENOMEM; 637 + 638 + sof_audio_card_rt5682.name = card_name; 648 639 649 640 /* create speaker dai link also */ 650 641 if (ctx->amp_type == CODEC_NONE) 651 642 ctx->amp_type = CODEC_RT5650; 643 + } 644 + 645 + if (ctx->amp_type == CODEC_RT1011 && soc_intel_is_cml()) { 646 + /* backward-compatible with existing cml devices */ 647 + card_name = devm_kstrdup(&pdev->dev, "cml_rt1011_rt5682", 648 + GFP_KERNEL); 649 + if (!card_name) 650 + return -ENOMEM; 651 + 652 + sof_audio_card_rt5682.name = card_name; 652 653 } 653 654 654 655 if (is_legacy_cpu) { ··· 708 683 max_98390_set_codec_conf(&pdev->dev, &sof_audio_card_rt5682); 709 684 break; 710 685 case CODEC_RT1011: 711 - sof_rt1011_codec_conf(&sof_audio_card_rt5682); 686 + sof_rt1011_codec_conf(&pdev->dev, &sof_audio_card_rt5682); 712 687 break; 713 688 case CODEC_RT1015: 714 689 sof_rt1015_codec_conf(&sof_audio_card_rt5682);
+43 -44
sound/soc/intel/boards/sof_sdw.c
··· 27 27 dev_dbg(dev, "quirk realtek,jack-detect-source %ld\n", 28 28 SOF_JACK_JDSRC(sof_sdw_quirk)); 29 29 if (sof_sdw_quirk & SOF_SDW_FOUR_SPK) 30 - dev_dbg(dev, "quirk SOF_SDW_FOUR_SPK enabled\n"); 30 + dev_err(dev, "quirk SOF_SDW_FOUR_SPK enabled but no longer supported\n"); 31 31 if (sof_sdw_quirk & SOF_SDW_TGL_HDMI) 32 32 dev_dbg(dev, "quirk SOF_SDW_TGL_HDMI enabled\n"); 33 33 if (sof_sdw_quirk & SOF_SDW_PCH_DMIC) ··· 80 80 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), 81 81 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "098F"), 82 82 }, 83 - .driver_data = (void *)(RT711_JD2 | 84 - SOF_SDW_FOUR_SPK), 83 + .driver_data = (void *)(RT711_JD2), 85 84 }, 86 85 { 87 86 .callback = sof_sdw_quirk_cb, ··· 88 89 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), 89 90 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0990"), 90 91 }, 91 - .driver_data = (void *)(RT711_JD2 | 92 - SOF_SDW_FOUR_SPK), 92 + .driver_data = (void *)(RT711_JD2), 93 93 }, 94 94 /* IceLake devices */ 95 95 { ··· 139 141 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5D") 140 142 }, 141 143 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 142 - RT711_JD2 | 143 - SOF_SDW_FOUR_SPK), 144 + RT711_JD2), 144 145 }, 145 146 { 146 147 .callback = sof_sdw_quirk_cb, ··· 148 151 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5E") 149 152 }, 150 153 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 151 - RT711_JD2 | 152 - SOF_SDW_FOUR_SPK), 154 + RT711_JD2), 153 155 }, 154 156 { 155 157 .callback = sof_sdw_quirk_cb, ··· 158 162 }, 159 163 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 160 164 SOF_SDW_PCH_DMIC | 161 - SOF_SDW_FOUR_SPK | 162 165 SOF_BT_OFFLOAD_SSP(2) | 163 166 SOF_SSP_BT_OFFLOAD_PRESENT), 164 167 }, ··· 168 173 DMI_MATCH(DMI_PRODUCT_NAME, "Ripto"), 169 174 }, 170 175 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 171 - SOF_SDW_PCH_DMIC | 172 - SOF_SDW_FOUR_SPK), 176 + SOF_SDW_PCH_DMIC), 173 177 }, 174 178 { 175 179 /* ··· 252 258 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A32") 253 259 }, 254 260 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 255 - RT711_JD2 | 256 - SOF_SDW_FOUR_SPK), 261 + RT711_JD2), 257 262 }, 258 263 { 259 264 .callback = sof_sdw_quirk_cb, ··· 283 290 }, 284 291 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 285 292 SOF_SDW_PCH_DMIC | 286 - SOF_SDW_FOUR_SPK | 287 293 SOF_BT_OFFLOAD_SSP(2) | 288 294 SOF_SSP_BT_OFFLOAD_PRESENT), 289 295 }, ··· 293 301 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AF0") 294 302 }, 295 303 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 296 - RT711_JD2 | 297 - SOF_SDW_FOUR_SPK), 304 + RT711_JD2), 298 305 }, 299 306 { 300 307 .callback = sof_sdw_quirk_cb, ··· 302 311 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AF3"), 303 312 }, 304 313 /* No Jack */ 305 - .driver_data = (void *)(SOF_SDW_TGL_HDMI | 306 - SOF_SDW_FOUR_SPK), 314 + .driver_data = (void *)(SOF_SDW_TGL_HDMI), 307 315 }, 308 316 { 309 317 .callback = sof_sdw_quirk_cb, ··· 311 321 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AFE") 312 322 }, 313 323 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 314 - RT711_JD2 | 315 - SOF_SDW_FOUR_SPK), 324 + RT711_JD2), 316 325 }, 317 326 { 318 327 .callback = sof_sdw_quirk_cb, ··· 320 331 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AFF") 321 332 }, 322 333 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 323 - RT711_JD2 | 324 - SOF_SDW_FOUR_SPK), 334 + RT711_JD2), 325 335 }, 326 336 { 327 337 .callback = sof_sdw_quirk_cb, ··· 329 341 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B00") 330 342 }, 331 343 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 332 - RT711_JD2 | 333 - SOF_SDW_FOUR_SPK), 344 + RT711_JD2), 334 345 }, 335 346 { 336 347 .callback = sof_sdw_quirk_cb, ··· 338 351 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B01") 339 352 }, 340 353 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 341 - RT711_JD2 | 342 - SOF_SDW_FOUR_SPK), 354 + RT711_JD2), 343 355 }, 344 356 { 345 357 .callback = sof_sdw_quirk_cb, ··· 347 361 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B11") 348 362 }, 349 363 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 350 - RT711_JD2 | 351 - SOF_SDW_FOUR_SPK), 364 + RT711_JD2), 352 365 }, 353 366 { 354 367 .callback = sof_sdw_quirk_cb, ··· 356 371 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B12") 357 372 }, 358 373 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 359 - RT711_JD2 | 360 - SOF_SDW_FOUR_SPK), 374 + RT711_JD2), 361 375 }, 362 376 { 363 377 .callback = sof_sdw_quirk_cb, ··· 384 400 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B29"), 385 401 }, 386 402 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 387 - RT711_JD2 | 388 - SOF_SDW_FOUR_SPK), 403 + RT711_JD2), 389 404 }, 390 405 { 391 406 .callback = sof_sdw_quirk_cb, ··· 412 429 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0BDA") 413 430 }, 414 431 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 432 + RT711_JD2), 433 + }, 434 + { 435 + .callback = sof_sdw_quirk_cb, 436 + .matches = { 437 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), 438 + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C0F") 439 + }, 440 + .driver_data = (void *)(SOF_SDW_TGL_HDMI | 415 441 RT711_JD2 | 416 442 SOF_SDW_FOUR_SPK), 417 443 }, ··· 431 439 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C10"), 432 440 }, 433 441 /* No Jack */ 434 - .driver_data = (void *)(SOF_SDW_TGL_HDMI | 435 - SOF_SDW_FOUR_SPK), 442 + .driver_data = (void *)(SOF_SDW_TGL_HDMI), 436 443 }, 437 444 { 438 445 .callback = sof_sdw_quirk_cb, ··· 440 449 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C11") 441 450 }, 442 451 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 443 - RT711_JD2 | 444 - SOF_SDW_FOUR_SPK), 452 + RT711_JD2), 445 453 }, 446 454 { 447 455 .callback = sof_sdw_quirk_cb, ··· 449 459 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C40") 450 460 }, 451 461 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 452 - RT711_JD2 | 453 - SOF_SDW_FOUR_SPK), 462 + RT711_JD2), 454 463 }, 455 464 { 456 465 .callback = sof_sdw_quirk_cb, ··· 458 469 DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C4F") 459 470 }, 460 471 .driver_data = (void *)(SOF_SDW_TGL_HDMI | 461 - RT711_JD2 | 462 - SOF_SDW_FOUR_SPK), 472 + RT711_JD2), 463 473 }, 464 474 /* MeteorLake devices */ 465 475 { ··· 486 498 SOF_BT_OFFLOAD_SSP(1) | 487 499 SOF_SSP_BT_OFFLOAD_PRESENT), 488 500 }, 501 + { 502 + .callback = sof_sdw_quirk_cb, 503 + .matches = { 504 + DMI_MATCH(DMI_SYS_VENDOR, "HP"), 505 + DMI_MATCH(DMI_PRODUCT_NAME, "OMEN Transcend Gaming Laptop"), 506 + }, 507 + .driver_data = (void *)(RT711_JD2), 508 + }, 509 + 489 510 /* LunarLake devices */ 490 511 { 491 512 .callback = sof_sdw_quirk_cb, ··· 734 737 .dai_name = "rt712-sdca-aif2", 735 738 .dai_type = SOF_SDW_DAI_TYPE_AMP, 736 739 .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, 740 + .init = sof_sdw_rt_amp_init, 741 + .exit = sof_sdw_rt_amp_exit, 737 742 .rtd_init = rt712_spk_rtd_init, 738 743 }, 739 744 }, ··· 911 912 .dai_type = SOF_SDW_DAI_TYPE_AMP, 912 913 /* No feedback capability is provided by rt722-sdca codec driver*/ 913 914 .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, 915 + .init = sof_sdw_rt_amp_init, 916 + .exit = sof_sdw_rt_amp_exit, 914 917 .rtd_init = rt722_spk_rtd_init, 915 918 }, 916 919 { ··· 1988 1987 amp_num += codec_info_list[i].amp_num; 1989 1988 1990 1989 card->components = devm_kasprintf(card->dev, GFP_KERNEL, 1991 - "cfg-spk:%d cfg-amp:%d", 1992 - (sof_sdw_quirk & SOF_SDW_FOUR_SPK) 1993 - ? 4 : 2, amp_num); 1990 + "cfg-amp:%d", amp_num); 1994 1991 if (!card->components) 1995 1992 return -ENOMEM; 1996 1993
+1
sound/soc/intel/boards/sof_sdw_common.h
··· 45 45 }; 46 46 47 47 #define SOF_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0)) 48 + /* Deprecated and no longer supported by the code */ 48 49 #define SOF_SDW_FOUR_SPK BIT(4) 49 50 #define SOF_SDW_TGL_HDMI BIT(5) 50 51 #define SOF_SDW_PCH_DMIC BIT(6)
+7 -12
sound/soc/intel/common/soc-acpi-intel-adl-match.c
··· 453 453 .codecs = {"MX98357A"} 454 454 }; 455 455 456 - static const struct snd_soc_acpi_codecs adl_max98360a_amp = { 457 - .num_codecs = 1, 458 - .codecs = {"MX98360A"} 459 - }; 460 - 461 456 static const struct snd_soc_acpi_codecs adl_rt5682_rt5682s_hp = { 462 457 .num_codecs = 2, 463 458 .codecs = {RT5682_ACPI_HID, RT5682S_ACPI_HID}, ··· 505 510 SND_SOC_ACPI_TPLG_INTEL_SSP_MSB | 506 511 SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER, 507 512 }, 508 - { 509 - .id = "DLGS7219", 510 - .drv_name = "adl_da7219_def", 511 - .machine_quirk = snd_soc_acpi_codec_list, 512 - .quirk_data = &adl_max98360a_amp, 513 - .sof_tplg_filename = "sof-adl-max98360a-da7219.tplg", 514 - }, 515 513 /* place boards for each headphone codec: sof driver will complete the 516 514 * tplg name and machine driver will detect the amp type 517 515 */ 518 516 { 519 517 .id = CS42L42_ACPI_HID, 520 518 .drv_name = "adl_cs42l42_def", 519 + .sof_tplg_filename = "sof-adl", /* the tplg suffix is added at run time */ 520 + .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME | 521 + SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME, 522 + }, 523 + { 524 + .id = DA7219_ACPI_HID, 525 + .drv_name = "adl_da7219_def", 521 526 .sof_tplg_filename = "sof-adl", /* the tplg suffix is added at run time */ 522 527 .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME | 523 528 SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
+1 -1
sound/soc/intel/common/soc-acpi-intel-cml-match.c
··· 42 42 struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = { 43 43 { 44 44 .id = "10EC5682", 45 - .drv_name = "cml_rt1011_rt5682", 45 + .drv_name = "cml_rt5682_def", 46 46 .machine_quirk = snd_soc_acpi_codec_list, 47 47 .quirk_data = &rt1011_spk_codecs, 48 48 .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",
+36
sound/soc/intel/common/soc-acpi-intel-mtl-match.c
··· 77 77 SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME, 78 78 }, 79 79 { 80 + .id = DA7219_ACPI_HID, 81 + .drv_name = "mtl_da7219_def", 82 + .sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */ 83 + .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME | 84 + SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME, 85 + }, 86 + { 80 87 .id = NAU8825_ACPI_HID, 81 88 .drv_name = "mtl_nau8825_def", 82 89 .sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */ ··· 300 293 .num_endpoints = 1, 301 294 .endpoints = &spk_r_endpoint, 302 295 .name_prefix = "rt1316-2" 296 + } 297 + }; 298 + 299 + static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = { 300 + { 301 + .adr = 0x000330025D131601ull, 302 + .num_endpoints = 1, 303 + .endpoints = &single_endpoint, 304 + .name_prefix = "rt1316-1" 303 305 } 304 306 }; 305 307 ··· 578 562 {} 579 563 }; 580 564 565 + static const struct snd_soc_acpi_link_adr mtl_rt711_l0_rt1316_l3[] = { 566 + { 567 + .mask = BIT(0), 568 + .num_adr = ARRAY_SIZE(rt711_sdca_0_adr), 569 + .adr_d = rt711_sdca_0_adr, 570 + }, 571 + { 572 + .mask = BIT(3), 573 + .num_adr = ARRAY_SIZE(rt1316_3_single_adr), 574 + .adr_d = rt1316_3_single_adr, 575 + }, 576 + {} 577 + }; 578 + 581 579 static const struct snd_soc_acpi_adr_device mx8363_2_adr[] = { 582 580 { 583 581 .adr = 0x000230019F836300ull, ··· 732 702 .links = mtl_3_in_1_sdca, 733 703 .drv_name = "sof_sdw", 734 704 .sof_tplg_filename = "sof-mtl-rt711-l0-rt1316-l23-rt714-l1.tplg", 705 + }, 706 + { 707 + .link_mask = 0x9, /* 2 active links required */ 708 + .links = mtl_rt711_l0_rt1316_l3, 709 + .drv_name = "sof_sdw", 710 + .sof_tplg_filename = "sof-mtl-rt711-l0-rt1316-l3.tplg", 735 711 }, 736 712 { 737 713 .link_mask = BIT(0),
+7 -12
sound/soc/intel/common/soc-acpi-intel-rpl-match.c
··· 361 361 .codecs = {"MX98357A"} 362 362 }; 363 363 364 - static const struct snd_soc_acpi_codecs rpl_max98360a_amp = { 365 - .num_codecs = 1, 366 - .codecs = {"MX98360A"}, 367 - }; 368 - 369 364 static const struct snd_soc_acpi_codecs rpl_lt6911_hdmi = { 370 365 .num_codecs = 1, 371 366 .codecs = {"INTC10B0"} ··· 407 412 SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME, 408 413 }, 409 414 { 415 + .id = DA7219_ACPI_HID, 416 + .drv_name = "rpl_da7219_def", 417 + .sof_tplg_filename = "sof-rpl", /* the tplg suffix is added at run time */ 418 + .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME | 419 + SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME, 420 + }, 421 + { 410 422 .id = NAU8825_ACPI_HID, 411 423 .drv_name = "rpl_nau8825_def", 412 424 .sof_tplg_filename = "sof-rpl", /* the tplg suffix is added at run time */ ··· 439 437 .id = "INTC10B0", 440 438 .drv_name = "rpl_lt6911_hdmi_ssp", 441 439 .sof_tplg_filename = "sof-rpl-nocodec-hdmi-ssp02.tplg" 442 - }, 443 - { 444 - .id = "DLGS7219", 445 - .drv_name = "rpl_da7219_def", 446 - .machine_quirk = snd_soc_acpi_codec_list, 447 - .quirk_data = &rpl_max98360a_amp, 448 - .sof_tplg_filename = "sof-rpl-max98360a-da7219.tplg", 449 440 }, 450 441 {}, 451 442 };