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: boards: updates for 6.10 - part1

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

This series from Brent Lu adds common helpers and board configurations
to reduce the number of quirks.

+513 -807
+1
sound/soc/intel/boards/Kconfig
··· 624 624 select SND_SOC_MAX98357A 625 625 select SND_SOC_MAX98373_I2C 626 626 select SND_SOC_DMIC 627 + select SND_SOC_INTEL_SOF_BOARD_HELPERS 627 628 select SND_SOC_INTEL_SOF_MAXIM_COMMON 628 629 select SND_SOC_INTEL_SOF_SSP_COMMON 629 630 help
+96 -50
sound/soc/intel/boards/sof_board_helpers.c
··· 74 74 * DAI Link Helpers 75 75 */ 76 76 77 + enum sof_dmic_be_type { 78 + SOF_DMIC_01, 79 + SOF_DMIC_16K, 80 + }; 81 + 77 82 /* DEFAULT_LINK_ORDER: the order used in sof_rt5682 */ 78 83 #define DEFAULT_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_CODEC, \ 79 84 SOF_LINK_DMIC01, \ ··· 102 97 } 103 98 }; 104 99 105 - int sof_intel_board_set_codec_link(struct device *dev, 106 - struct snd_soc_dai_link *link, int be_id, 107 - enum sof_ssp_codec codec_type, int ssp_codec) 100 + static int set_ssp_codec_link(struct device *dev, struct snd_soc_dai_link *link, 101 + int be_id, enum sof_ssp_codec codec_type, 102 + int ssp_codec) 108 103 { 109 104 struct snd_soc_dai_link_component *cpus; 110 105 111 - dev_dbg(dev, "link %d: codec %s, ssp %d\n", be_id, 106 + dev_dbg(dev, "link %d: ssp codec %s, ssp %d\n", be_id, 112 107 sof_ssp_get_codec_name(codec_type), ssp_codec); 113 108 114 109 /* link name */ ··· 149 144 150 145 return 0; 151 146 } 152 - EXPORT_SYMBOL_NS(sof_intel_board_set_codec_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); 153 147 154 - int sof_intel_board_set_dmic_link(struct device *dev, 155 - struct snd_soc_dai_link *link, int be_id, 156 - enum sof_dmic_be_type be_type) 148 + static int set_dmic_link(struct device *dev, struct snd_soc_dai_link *link, 149 + int be_id, enum sof_dmic_be_type be_type) 157 150 { 158 151 struct snd_soc_dai_link_component *cpus; 159 152 ··· 199 196 200 197 return 0; 201 198 } 202 - EXPORT_SYMBOL_NS(sof_intel_board_set_dmic_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); 203 199 204 - int sof_intel_board_set_intel_hdmi_link(struct device *dev, 205 - struct snd_soc_dai_link *link, int be_id, 206 - int hdmi_id, bool idisp_codec) 200 + static int set_idisp_hdmi_link(struct device *dev, struct snd_soc_dai_link *link, 201 + int be_id, int hdmi_id, bool idisp_codec) 207 202 { 208 203 struct snd_soc_dai_link_component *cpus, *codecs; 209 204 210 - dev_dbg(dev, "link %d: intel hdmi, hdmi id %d, idisp codec %d\n", 211 - be_id, hdmi_id, idisp_codec); 205 + dev_dbg(dev, "link %d: idisp hdmi %d, idisp codec %d\n", be_id, hdmi_id, 206 + idisp_codec); 212 207 213 208 /* link name */ 214 209 link->name = devm_kasprintf(dev, GFP_KERNEL, "iDisp%d", hdmi_id); ··· 257 256 258 257 return 0; 259 258 } 260 - EXPORT_SYMBOL_NS(sof_intel_board_set_intel_hdmi_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); 261 259 262 - int sof_intel_board_set_ssp_amp_link(struct device *dev, 263 - struct snd_soc_dai_link *link, int be_id, 264 - enum sof_ssp_codec amp_type, int ssp_amp) 260 + static int set_ssp_amp_link(struct device *dev, struct snd_soc_dai_link *link, 261 + int be_id, enum sof_ssp_codec amp_type, int ssp_amp) 265 262 { 266 263 struct snd_soc_dai_link_component *cpus; 267 264 ··· 297 298 298 299 return 0; 299 300 } 300 - EXPORT_SYMBOL_NS(sof_intel_board_set_ssp_amp_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); 301 301 302 - int sof_intel_board_set_bt_link(struct device *dev, 303 - struct snd_soc_dai_link *link, int be_id, 304 - int ssp_bt) 302 + static int set_bt_offload_link(struct device *dev, struct snd_soc_dai_link *link, 303 + int be_id, int ssp_bt) 305 304 { 306 305 struct snd_soc_dai_link_component *cpus; 307 306 ··· 338 341 339 342 return 0; 340 343 } 341 - EXPORT_SYMBOL_NS(sof_intel_board_set_bt_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); 342 344 343 - int sof_intel_board_set_hdmi_in_link(struct device *dev, 344 - struct snd_soc_dai_link *link, int be_id, 345 - int ssp_hdmi) 345 + static int set_hdmi_in_link(struct device *dev, struct snd_soc_dai_link *link, 346 + int be_id, int ssp_hdmi) 346 347 { 347 348 struct snd_soc_dai_link_component *cpus; 348 349 ··· 378 383 379 384 return 0; 380 385 } 381 - EXPORT_SYMBOL_NS(sof_intel_board_set_hdmi_in_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); 382 386 383 387 static int calculate_num_links(struct sof_card_private *ctx) 384 388 { ··· 421 427 int ret; 422 428 int ssp_hdmi_in = 0; 423 429 unsigned long link_order, link; 430 + unsigned long link_ids, be_id; 424 431 425 432 num_links = calculate_num_links(ctx); 426 433 ··· 435 440 else 436 441 link_order = DEFAULT_LINK_ORDER; 437 442 438 - dev_dbg(dev, "create dai links, link_order 0x%lx\n", link_order); 443 + if (ctx->link_id_overwrite) 444 + link_ids = ctx->link_id_overwrite; 445 + else 446 + link_ids = 0; 447 + 448 + dev_dbg(dev, "create dai links, link_order 0x%lx, id_overwrite 0x%lx\n", 449 + link_order, link_ids); 439 450 440 451 while (link_order) { 441 452 link = link_order & SOF_LINK_ORDER_MASK; 442 453 link_order >>= SOF_LINK_ORDER_SHIFT; 454 + 455 + if (ctx->link_id_overwrite) { 456 + be_id = link_ids & SOF_LINK_IDS_MASK; 457 + link_ids >>= SOF_LINK_IDS_SHIFT; 458 + } else { 459 + /* use array index as link id */ 460 + be_id = idx; 461 + } 443 462 444 463 switch (link) { 445 464 case SOF_LINK_CODEC: ··· 461 452 if (ctx->codec_type == CODEC_NONE) 462 453 continue; 463 454 464 - ret = sof_intel_board_set_codec_link(dev, &links[idx], 465 - idx, 466 - ctx->codec_type, 467 - ctx->ssp_codec); 455 + ret = set_ssp_codec_link(dev, &links[idx], be_id, 456 + ctx->codec_type, ctx->ssp_codec); 468 457 if (ret) { 469 458 dev_err(dev, "fail to set codec link, ret %d\n", 470 459 ret); ··· 478 471 continue; 479 472 480 473 /* at least we have dmic01 */ 481 - ret = sof_intel_board_set_dmic_link(dev, &links[idx], 482 - idx, SOF_DMIC_01); 474 + ret = set_dmic_link(dev, &links[idx], be_id, SOF_DMIC_01); 483 475 if (ret) { 484 476 dev_err(dev, "fail to set dmic01 link, ret %d\n", 485 477 ret); ··· 493 487 continue; 494 488 495 489 /* set up 2 BE links at most */ 496 - ret = sof_intel_board_set_dmic_link(dev, &links[idx], 497 - idx, SOF_DMIC_16K); 490 + ret = set_dmic_link(dev, &links[idx], be_id, 491 + SOF_DMIC_16K); 498 492 if (ret) { 499 493 dev_err(dev, "fail to set dmic16k link, ret %d\n", 500 494 ret); ··· 506 500 case SOF_LINK_IDISP_HDMI: 507 501 /* idisp HDMI */ 508 502 for (i = 1; i <= ctx->hdmi_num; i++) { 509 - ret = sof_intel_board_set_intel_hdmi_link(dev, 510 - &links[idx], 511 - idx, i, 512 - ctx->hdmi.idisp_codec); 503 + ret = set_idisp_hdmi_link(dev, &links[idx], 504 + be_id, i, 505 + ctx->hdmi.idisp_codec); 513 506 if (ret) { 514 507 dev_err(dev, "fail to set hdmi link, ret %d\n", 515 508 ret); ··· 516 511 } 517 512 518 513 idx++; 514 + be_id++; 519 515 } 520 516 break; 521 517 case SOF_LINK_AMP: ··· 524 518 if (ctx->amp_type == CODEC_NONE) 525 519 continue; 526 520 527 - ret = sof_intel_board_set_ssp_amp_link(dev, &links[idx], 528 - idx, 529 - ctx->amp_type, 530 - ctx->ssp_amp); 521 + ret = set_ssp_amp_link(dev, &links[idx], be_id, 522 + ctx->amp_type, ctx->ssp_amp); 531 523 if (ret) { 532 524 dev_err(dev, "fail to set amp link, ret %d\n", 533 525 ret); ··· 540 536 if (!ctx->bt_offload_present) 541 537 continue; 542 538 543 - ret = sof_intel_board_set_bt_link(dev, &links[idx], idx, 544 - ctx->ssp_bt); 539 + ret = set_bt_offload_link(dev, &links[idx], be_id, 540 + ctx->ssp_bt); 545 541 if (ret) { 546 542 dev_err(dev, "fail to set bt link, ret %d\n", 547 543 ret); ··· 553 549 case SOF_LINK_HDMI_IN: 554 550 /* HDMI-In */ 555 551 for_each_set_bit(ssp_hdmi_in, &ctx->ssp_mask_hdmi_in, 32) { 556 - ret = sof_intel_board_set_hdmi_in_link(dev, 557 - &links[idx], 558 - idx, 559 - ssp_hdmi_in); 552 + ret = set_hdmi_in_link(dev, &links[idx], be_id, 553 + ssp_hdmi_in); 560 554 if (ret) { 561 555 dev_err(dev, "fail to set hdmi-in link, ret %d\n", 562 556 ret); ··· 562 560 } 563 561 564 562 idx++; 563 + be_id++; 565 564 } 566 565 break; 567 566 case SOF_LINK_NONE: ··· 586 583 return 0; 587 584 } 588 585 EXPORT_SYMBOL_NS(sof_intel_board_set_dai_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); 586 + 587 + struct sof_card_private * 588 + sof_intel_board_get_ctx(struct device *dev, unsigned long board_quirk) 589 + { 590 + struct sof_card_private *ctx; 591 + 592 + dev_dbg(dev, "create ctx, board_quirk 0x%lx\n", board_quirk); 593 + 594 + ctx = devm_kzalloc(dev, sizeof(struct sof_card_private), GFP_KERNEL); 595 + if (!ctx) 596 + return NULL; 597 + 598 + ctx->codec_type = sof_ssp_detect_codec_type(dev); 599 + ctx->amp_type = sof_ssp_detect_amp_type(dev); 600 + 601 + ctx->dmic_be_num = 2; 602 + ctx->hdmi_num = (board_quirk & SOF_NUM_IDISP_HDMI_MASK) >> 603 + SOF_NUM_IDISP_HDMI_SHIFT; 604 + /* default number of HDMI DAI's */ 605 + if (!ctx->hdmi_num) 606 + ctx->hdmi_num = 3; 607 + 608 + /* port number/mask of peripherals attached to ssp interface */ 609 + if (ctx->codec_type != CODEC_NONE) 610 + ctx->ssp_codec = (board_quirk & SOF_SSP_PORT_CODEC_MASK) >> 611 + SOF_SSP_PORT_CODEC_SHIFT; 612 + 613 + if (ctx->amp_type != CODEC_NONE) 614 + ctx->ssp_amp = (board_quirk & SOF_SSP_PORT_AMP_MASK) >> 615 + SOF_SSP_PORT_AMP_SHIFT; 616 + 617 + if (board_quirk & SOF_BT_OFFLOAD_PRESENT) { 618 + ctx->bt_offload_present = true; 619 + ctx->ssp_bt = (board_quirk & SOF_SSP_PORT_BT_OFFLOAD_MASK) >> 620 + SOF_SSP_PORT_BT_OFFLOAD_SHIFT; 621 + } 622 + 623 + ctx->ssp_mask_hdmi_in = (board_quirk & SOF_SSP_MASK_HDMI_CAPTURE_MASK) >> 624 + SOF_SSP_MASK_HDMI_CAPTURE_SHIFT; 625 + 626 + return ctx; 627 + } 628 + EXPORT_SYMBOL_NS(sof_intel_board_get_ctx, SND_SOC_INTEL_SOF_BOARD_HELPERS); 589 629 590 630 struct snd_soc_dai *get_codec_dai_by_name(struct snd_soc_pcm_runtime *rtd, 591 631 const char * const dai_name[], int num_dais)
+73 -24
sound/soc/intel/boards/sof_board_helpers.h
··· 10 10 #include "sof_hdmi_common.h" 11 11 #include "sof_ssp_common.h" 12 12 13 + /* 14 + * Common board quirks: from bit 8 to 31, LSB 8 bits reserved for machine 15 + * drivers 16 + */ 17 + 18 + /* SSP port number for headphone codec: 3 bits */ 19 + #define SOF_SSP_PORT_CODEC_SHIFT 8 20 + #define SOF_SSP_PORT_CODEC_MASK (GENMASK(10, 8)) 21 + #define SOF_SSP_PORT_CODEC(quirk) \ 22 + (((quirk) << SOF_SSP_PORT_CODEC_SHIFT) & SOF_SSP_PORT_CODEC_MASK) 23 + 24 + /* SSP port number for speaker amplifier: 3 bits */ 25 + #define SOF_SSP_PORT_AMP_SHIFT 11 26 + #define SOF_SSP_PORT_AMP_MASK (GENMASK(13, 11)) 27 + #define SOF_SSP_PORT_AMP(quirk) \ 28 + (((quirk) << SOF_SSP_PORT_AMP_SHIFT) & SOF_SSP_PORT_AMP_MASK) 29 + 30 + /* SSP port number for BT audio offload: 3 bits */ 31 + #define SOF_SSP_PORT_BT_OFFLOAD_SHIFT 14 32 + #define SOF_SSP_PORT_BT_OFFLOAD_MASK (GENMASK(16, 14)) 33 + #define SOF_SSP_PORT_BT_OFFLOAD(quirk) \ 34 + (((quirk) << SOF_SSP_PORT_BT_OFFLOAD_SHIFT) & SOF_SSP_PORT_BT_OFFLOAD_MASK) 35 + 36 + /* SSP port mask for HDMI capture: 6 bits */ 37 + #define SOF_SSP_MASK_HDMI_CAPTURE_SHIFT 17 38 + #define SOF_SSP_MASK_HDMI_CAPTURE_MASK (GENMASK(22, 17)) 39 + #define SOF_SSP_MASK_HDMI_CAPTURE(quirk) \ 40 + (((quirk) << SOF_SSP_MASK_HDMI_CAPTURE_SHIFT) & SOF_SSP_MASK_HDMI_CAPTURE_MASK) 41 + 42 + /* Number of idisp HDMI BE link: 3 bits */ 43 + #define SOF_NUM_IDISP_HDMI_SHIFT 23 44 + #define SOF_NUM_IDISP_HDMI_MASK (GENMASK(25, 23)) 45 + #define SOF_NUM_IDISP_HDMI(quirk) \ 46 + (((quirk) << SOF_NUM_IDISP_HDMI_SHIFT) & SOF_NUM_IDISP_HDMI_MASK) 47 + 48 + /* Board uses BT audio offload */ 49 + #define SOF_BT_OFFLOAD_PRESENT BIT(26) 50 + 13 51 enum { 14 52 SOF_LINK_NONE = 0, 15 53 SOF_LINK_CODEC, ··· 70 32 (((k5) & SOF_LINK_ORDER_MASK) << (SOF_LINK_ORDER_SHIFT * 4)) | \ 71 33 (((k6) & SOF_LINK_ORDER_MASK) << (SOF_LINK_ORDER_SHIFT * 5)) | \ 72 34 (((k7) & SOF_LINK_ORDER_MASK) << (SOF_LINK_ORDER_SHIFT * 6))) 35 + 36 + #define SOF_LINK_IDS_MASK (0xF) 37 + #define SOF_LINK_IDS_SHIFT (4) 38 + 39 + #define SOF_LINK_IDS(k1, k2, k3, k4, k5, k6, k7) \ 40 + ((((k1) & SOF_LINK_IDS_MASK) << (SOF_LINK_IDS_SHIFT * 0)) | \ 41 + (((k2) & SOF_LINK_IDS_MASK) << (SOF_LINK_IDS_SHIFT * 1)) | \ 42 + (((k3) & SOF_LINK_IDS_MASK) << (SOF_LINK_IDS_SHIFT * 2)) | \ 43 + (((k4) & SOF_LINK_IDS_MASK) << (SOF_LINK_IDS_SHIFT * 3)) | \ 44 + (((k5) & SOF_LINK_IDS_MASK) << (SOF_LINK_IDS_SHIFT * 4)) | \ 45 + (((k6) & SOF_LINK_IDS_MASK) << (SOF_LINK_IDS_SHIFT * 5)) | \ 46 + (((k7) & SOF_LINK_IDS_MASK) << (SOF_LINK_IDS_SHIFT * 6))) 47 + 48 + /* 49 + * sof_da7219_private: private data for da7219 machine driver 50 + * 51 + * @is_jsl_board: true for JSL boards 52 + * @mclk_en: true for mclk pin is connected 53 + * @pll_bypass: true for PLL bypass mode 54 + */ 55 + struct sof_da7219_private { 56 + bool is_jsl_board; 57 + bool mclk_en; 58 + bool pll_bypass; 59 + }; 73 60 74 61 /* 75 62 * sof_rt5682_private: private data for rt5682 machine driver ··· 124 61 * @codec_link: pointer to headset codec dai link 125 62 * @amp_link: pointer to speaker amplifier dai link 126 63 * @link_order_overwrite: custom DAI link order 64 + * @link_id_overwrite: custom DAI link ID 65 + * @da7219: private data for da7219 machine driver 127 66 * @rt5682: private data for rt5682 machine driver 128 67 */ 129 68 struct sof_card_private { ··· 149 84 struct snd_soc_dai_link *amp_link; 150 85 151 86 unsigned long link_order_overwrite; 87 + /* 88 + * A variable stores id for all BE DAI links, use SOF_LINK_IDS macro to 89 + * build the value; use DAI link array index as id if zero. 90 + */ 91 + unsigned long link_id_overwrite; 152 92 153 93 union { 94 + struct sof_da7219_private da7219; 154 95 struct sof_rt5682_private rt5682; 155 96 }; 156 - }; 157 - 158 - enum sof_dmic_be_type { 159 - SOF_DMIC_01, 160 - SOF_DMIC_16K, 161 97 }; 162 98 163 99 int sof_intel_board_card_late_probe(struct snd_soc_card *card); 164 100 int sof_intel_board_set_dai_link(struct device *dev, struct snd_soc_card *card, 165 101 struct sof_card_private *ctx); 166 - 167 - int sof_intel_board_set_codec_link(struct device *dev, 168 - struct snd_soc_dai_link *link, int be_id, 169 - enum sof_ssp_codec codec_type, int ssp_codec); 170 - int sof_intel_board_set_dmic_link(struct device *dev, 171 - struct snd_soc_dai_link *link, int be_id, 172 - enum sof_dmic_be_type be_type); 173 - int sof_intel_board_set_intel_hdmi_link(struct device *dev, 174 - struct snd_soc_dai_link *link, int be_id, 175 - int hdmi_id, bool idisp_codec); 176 - int sof_intel_board_set_ssp_amp_link(struct device *dev, 177 - struct snd_soc_dai_link *link, int be_id, 178 - enum sof_ssp_codec amp_type, int ssp_amp); 179 - int sof_intel_board_set_bt_link(struct device *dev, 180 - struct snd_soc_dai_link *link, int be_id, 181 - int ssp_bt); 182 - int sof_intel_board_set_hdmi_in_link(struct device *dev, 183 - struct snd_soc_dai_link *link, int be_id, 184 - int ssp_hdmi); 102 + struct sof_card_private * 103 + sof_intel_board_get_ctx(struct device *dev, unsigned long board_quirk); 185 104 186 105 struct snd_soc_dai *get_codec_dai_by_name(struct snd_soc_pcm_runtime *rtd, 187 106 const char * const dai_name[], int num_dais);
+16 -56
sound/soc/intel/boards/sof_cs42l42.c
··· 22 22 #include "../common/soc-intel-quirks.h" 23 23 #include "sof_board_helpers.h" 24 24 #include "sof_maxim_common.h" 25 - #include "sof_ssp_common.h" 26 - 27 - #define SOF_CS42L42_SSP_CODEC(quirk) ((quirk) & GENMASK(2, 0)) 28 - #define SOF_CS42L42_SSP_CODEC_MASK (GENMASK(2, 0)) 29 - #define SOF_CS42L42_SSP_AMP_SHIFT 4 30 - #define SOF_CS42L42_SSP_AMP_MASK (GENMASK(6, 4)) 31 - #define SOF_CS42L42_SSP_AMP(quirk) \ 32 - (((quirk) << SOF_CS42L42_SSP_AMP_SHIFT) & SOF_CS42L42_SSP_AMP_MASK) 33 - #define SOF_CS42L42_NUM_HDMIDEV_SHIFT 7 34 - #define SOF_CS42L42_NUM_HDMIDEV_MASK (GENMASK(9, 7)) 35 - #define SOF_CS42L42_NUM_HDMIDEV(quirk) \ 36 - (((quirk) << SOF_CS42L42_NUM_HDMIDEV_SHIFT) & SOF_CS42L42_NUM_HDMIDEV_MASK) 37 - #define SOF_BT_OFFLOAD_PRESENT BIT(25) 38 - #define SOF_CS42L42_SSP_BT_SHIFT 26 39 - #define SOF_CS42L42_SSP_BT_MASK (GENMASK(28, 26)) 40 - #define SOF_CS42L42_SSP_BT(quirk) \ 41 - (((quirk) << SOF_CS42L42_SSP_BT_SHIFT) & SOF_CS42L42_SSP_BT_MASK) 42 25 43 26 static struct snd_soc_jack_pin jack_pins[] = { 44 27 { ··· 35 52 }; 36 53 37 54 /* Default: SSP2 */ 38 - static unsigned long sof_cs42l42_quirk = SOF_CS42L42_SSP_CODEC(2); 55 + static unsigned long sof_cs42l42_quirk = SOF_SSP_PORT_CODEC(2); 39 56 40 57 static int sof_cs42l42_init(struct snd_soc_pcm_runtime *rtd) 41 58 { ··· 212 229 struct sof_card_private *ctx; 213 230 int ret; 214 231 215 - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 216 - if (!ctx) 217 - return -ENOMEM; 218 - 219 232 if (pdev->id_entry && pdev->id_entry->driver_data) 220 233 sof_cs42l42_quirk = (unsigned long)pdev->id_entry->driver_data; 221 234 222 - ctx->codec_type = sof_ssp_detect_codec_type(&pdev->dev); 223 - ctx->amp_type = sof_ssp_detect_amp_type(&pdev->dev); 235 + dev_dbg(&pdev->dev, "sof_cs42l42_quirk = %lx\n", sof_cs42l42_quirk); 236 + 237 + /* initialize ctx with board quirk */ 238 + ctx = sof_intel_board_get_ctx(&pdev->dev, sof_cs42l42_quirk); 239 + if (!ctx) 240 + return -ENOMEM; 224 241 225 242 if (soc_intel_is_glk()) { 226 243 ctx->dmic_be_num = 1; 227 - ctx->hdmi_num = 3; 228 244 229 245 /* overwrite the DAI link order for GLK boards */ 230 246 ctx->link_order_overwrite = GLK_LINK_ORDER; 231 - } else { 232 - ctx->dmic_be_num = 2; 233 - ctx->hdmi_num = (sof_cs42l42_quirk & SOF_CS42L42_NUM_HDMIDEV_MASK) >> 234 - SOF_CS42L42_NUM_HDMIDEV_SHIFT; 235 - /* default number of HDMI DAI's */ 236 - if (!ctx->hdmi_num) 237 - ctx->hdmi_num = 3; 238 247 } 239 248 240 249 if (mach->mach_params.codec_mask & IDISP_CODEC_MASK) 241 250 ctx->hdmi.idisp_codec = true; 242 - 243 - dev_dbg(&pdev->dev, "sof_cs42l42_quirk = %lx\n", sof_cs42l42_quirk); 244 - 245 - /* port number of peripherals attached to ssp interface */ 246 - ctx->ssp_bt = (sof_cs42l42_quirk & SOF_CS42L42_SSP_BT_MASK) >> 247 - SOF_CS42L42_SSP_BT_SHIFT; 248 - 249 - ctx->ssp_amp = (sof_cs42l42_quirk & SOF_CS42L42_SSP_AMP_MASK) >> 250 - SOF_CS42L42_SSP_AMP_SHIFT; 251 - 252 - ctx->ssp_codec = sof_cs42l42_quirk & SOF_CS42L42_SSP_CODEC_MASK; 253 - 254 - if (sof_cs42l42_quirk & SOF_BT_OFFLOAD_PRESENT) 255 - ctx->bt_offload_present = true; 256 251 257 252 /* update dai_link */ 258 253 ret = sof_card_dai_links_create(&pdev->dev, &sof_audio_card_cs42l42, ctx); ··· 254 293 static const struct platform_device_id board_ids[] = { 255 294 { 256 295 .name = "glk_cs4242_mx98357a", 257 - .driver_data = (kernel_ulong_t)(SOF_CS42L42_SSP_CODEC(2) | 258 - SOF_CS42L42_SSP_AMP(1)), 296 + .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(2) | 297 + SOF_SSP_PORT_AMP(1)), 259 298 }, 260 299 { 261 300 .name = "jsl_cs4242_mx98360a", 262 - .driver_data = (kernel_ulong_t)(SOF_CS42L42_SSP_CODEC(0) | 263 - SOF_CS42L42_SSP_AMP(1)), 301 + .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(0) | 302 + SOF_SSP_PORT_AMP(1)), 264 303 }, 265 304 { 266 305 .name = "adl_mx98360a_cs4242", 267 - .driver_data = (kernel_ulong_t)(SOF_CS42L42_SSP_CODEC(0) | 268 - SOF_CS42L42_SSP_AMP(1) | 269 - SOF_CS42L42_NUM_HDMIDEV(4) | 270 - SOF_BT_OFFLOAD_PRESENT | 271 - SOF_CS42L42_SSP_BT(2)), 306 + .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(0) | 307 + SOF_SSP_PORT_AMP(1) | 308 + SOF_NUM_IDISP_HDMI(4) | 309 + SOF_BT_OFFLOAD_PRESENT | 310 + SOF_SSP_PORT_BT_OFFLOAD(2)), 272 311 }, 273 312 { } 274 313 }; ··· 290 329 MODULE_LICENSE("GPL"); 291 330 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); 292 331 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON); 293 - MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_SSP_COMMON);
+131 -279
sound/soc/intel/boards/sof_da7219.c
··· 15 15 #include <sound/soc-acpi.h> 16 16 #include <sound/sof.h> 17 17 #include "../../codecs/da7219.h" 18 - #include "hda_dsp_common.h" 19 - #include "sof_hdmi_common.h" 18 + #include "sof_board_helpers.h" 20 19 #include "sof_maxim_common.h" 21 - #include "sof_ssp_common.h" 22 20 23 - /* Board Quirks */ 24 - #define SOF_DA7219_JSL_BOARD BIT(2) 21 + /* Driver-specific board quirks: from bit 0 to 7 */ 22 + #define SOF_DA7219_JSL_BOARD BIT(0) 23 + #define SOF_DA7219_MCLK_EN BIT(1) 25 24 26 25 #define DIALOG_CODEC_DAI "da7219-hifi" 27 - 28 - struct card_private { 29 - struct snd_soc_jack headset_jack; 30 - struct sof_hdmi_private hdmi; 31 - enum sof_ssp_codec codec_type; 32 - enum sof_ssp_codec amp_type; 33 - 34 - unsigned int pll_bypass:1; 35 - }; 36 26 37 27 static int platform_clock_control(struct snd_soc_dapm_widget *w, 38 28 struct snd_kcontrol *k, int event) 39 29 { 40 30 struct snd_soc_dapm_context *dapm = w->dapm; 41 31 struct snd_soc_card *card = dapm->card; 42 - struct card_private *ctx = snd_soc_card_get_drvdata(card); 32 + struct sof_card_private *ctx = snd_soc_card_get_drvdata(card); 43 33 struct snd_soc_dai *codec_dai; 44 34 int ret = 0; 45 35 46 - if (ctx->pll_bypass) 36 + if (ctx->da7219.pll_bypass) 47 37 return ret; 48 38 49 39 /* PLL SRM mode */ ··· 64 74 SOC_DAPM_PIN_SWITCH("Headphone Jack"), 65 75 SOC_DAPM_PIN_SWITCH("Headset Mic"), 66 76 SOC_DAPM_PIN_SWITCH("Line Out"), 67 - SOC_DAPM_PIN_SWITCH("Left Spk"), 68 - SOC_DAPM_PIN_SWITCH("Right Spk"), 69 77 }; 70 78 71 79 static const struct snd_soc_dapm_widget widgets[] = { ··· 71 83 SND_SOC_DAPM_MIC("Headset Mic", NULL), 72 84 SND_SOC_DAPM_LINE("Line Out", NULL), 73 85 74 - SND_SOC_DAPM_SPK("Left Spk", NULL), 75 - SND_SOC_DAPM_SPK("Right Spk", NULL), 76 - 77 86 SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0, 78 87 platform_clock_control, SND_SOC_DAPM_POST_PMD | 79 88 SND_SOC_DAPM_PRE_PMU), 80 - 81 - SND_SOC_DAPM_MIC("SoC DMIC", NULL), 82 89 }; 83 90 84 91 static const struct snd_soc_dapm_route audio_map[] = { ··· 85 102 { "Headphone Jack", NULL, "Platform Clock" }, 86 103 { "Headset Mic", NULL, "Platform Clock" }, 87 104 { "Line Out", NULL, "Platform Clock" }, 88 - 89 - /* digital mics */ 90 - {"DMic", NULL, "SoC DMIC"}, 91 105 }; 92 106 93 107 static struct snd_soc_jack_pin jack_pins[] = { ··· 104 124 105 125 static int da7219_codec_init(struct snd_soc_pcm_runtime *rtd) 106 126 { 107 - struct card_private *ctx = snd_soc_card_get_drvdata(rtd->card); 127 + struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); 108 128 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); 109 129 struct snd_soc_component *component = codec_dai->component; 110 130 struct snd_soc_jack *jack = &ctx->headset_jack; ··· 127 147 * Use PLL bypass mode if MCLK is available, be sure to set the 128 148 * frequency of MCLK to 12.288 or 24.576MHz on topology side. 129 149 */ 130 - if (mclk_rate == 12288000 || mclk_rate == 24576000) { 150 + if (ctx->da7219.mclk_en && 151 + (mclk_rate == 12288000 || mclk_rate == 24576000)) { 131 152 /* PLL bypass mode */ 132 153 dev_dbg(rtd->dev, "pll bypass mode, mclk rate %d\n", mclk_rate); 133 154 ··· 138 157 return ret; 139 158 } 140 159 141 - ctx->pll_bypass = 1; 160 + ctx->da7219.pll_bypass = true; 142 161 } 143 162 144 163 /* ··· 167 186 } 168 187 169 188 return ret; 189 + } 190 + 191 + static void da7219_codec_exit(struct snd_soc_pcm_runtime *rtd) 192 + { 193 + struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; 194 + 195 + snd_soc_component_set_jack(component, NULL, NULL); 170 196 } 171 197 172 198 static int max98373_hw_params(struct snd_pcm_substream *substream, ··· 210 222 .hw_params = max98373_hw_params, 211 223 }; 212 224 213 - static int hdmi_init(struct snd_soc_pcm_runtime *rtd) 214 - { 215 - struct card_private *ctx = snd_soc_card_get_drvdata(rtd->card); 216 - struct snd_soc_dai *dai = snd_soc_rtd_to_codec(rtd, 0); 217 - 218 - ctx->hdmi.hdmi_comp = dai->component; 219 - 220 - return 0; 221 - } 222 - 223 225 static int card_late_probe(struct snd_soc_card *card) 224 226 { 225 - struct card_private *ctx = snd_soc_card_get_drvdata(card); 226 - 227 - if (!ctx->hdmi.idisp_codec) 228 - return 0; 229 - 230 - if (!ctx->hdmi.hdmi_comp) 231 - return -EINVAL; 232 - 233 - return hda_dsp_hdmi_build_controls(card, ctx->hdmi.hdmi_comp); 227 + return sof_intel_board_card_late_probe(card); 234 228 } 235 - 236 - SND_SOC_DAILINK_DEF(ssp0_pin, 237 - DAILINK_COMP_ARRAY(COMP_CPU("SSP0 Pin"))); 238 - SND_SOC_DAILINK_DEF(ssp0_codec, 239 - DAILINK_COMP_ARRAY(COMP_CODEC("i2c-DLGS7219:00", DIALOG_CODEC_DAI))); 240 - 241 - SND_SOC_DAILINK_DEF(ssp1_pin, 242 - DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin"))); 243 - 244 - SND_SOC_DAILINK_DEF(ssp2_pin, 245 - DAILINK_COMP_ARRAY(COMP_CPU("SSP2 Pin"))); 246 - SND_SOC_DAILINK_DEF(dummy_codec, 247 - DAILINK_COMP_ARRAY(COMP_CODEC("snd-soc-dummy", "snd-soc-dummy-dai"))); 248 - 249 - SND_SOC_DAILINK_DEF(dmic_pin, 250 - DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin"))); 251 - SND_SOC_DAILINK_DEF(dmic_codec, 252 - DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi"))); 253 - 254 - SND_SOC_DAILINK_DEF(dmic16k_pin, 255 - DAILINK_COMP_ARRAY(COMP_CPU("DMIC16k Pin"))); 256 - 257 - SND_SOC_DAILINK_DEF(idisp1_pin, 258 - DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin"))); 259 - SND_SOC_DAILINK_DEF(idisp1_codec, 260 - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1"))); 261 - 262 - SND_SOC_DAILINK_DEF(idisp2_pin, 263 - DAILINK_COMP_ARRAY(COMP_CPU("iDisp2 Pin"))); 264 - SND_SOC_DAILINK_DEF(idisp2_codec, 265 - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2"))); 266 - 267 - SND_SOC_DAILINK_DEF(idisp3_pin, 268 - DAILINK_COMP_ARRAY(COMP_CPU("iDisp3 Pin"))); 269 - SND_SOC_DAILINK_DEF(idisp3_codec, 270 - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3"))); 271 - 272 - SND_SOC_DAILINK_DEF(idisp4_pin, 273 - DAILINK_COMP_ARRAY(COMP_CPU("iDisp4 Pin"))); 274 - SND_SOC_DAILINK_DEF(idisp4_codec, 275 - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi4"))); 276 - 277 - SND_SOC_DAILINK_DEF(platform, /* subject to be overridden during probe */ 278 - DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:1f.3"))); 279 - 280 - static struct snd_soc_dai_link jsl_dais[] = { 281 - /* Back End DAI links */ 282 - { 283 - .name = "SSP1-Codec", 284 - .id = 0, 285 - .ignore_pmdown_time = 1, 286 - .no_pcm = 1, 287 - .dpcm_playback = 1, 288 - .dpcm_capture = 1, /* IV feedback */ 289 - SND_SOC_DAILINK_REG(ssp1_pin, max_98373_components, platform), 290 - }, 291 - { 292 - .name = "SSP0-Codec", 293 - .id = 1, 294 - .no_pcm = 1, 295 - .init = da7219_codec_init, 296 - .ignore_pmdown_time = 1, 297 - .dpcm_playback = 1, 298 - .dpcm_capture = 1, 299 - SND_SOC_DAILINK_REG(ssp0_pin, ssp0_codec, platform), 300 - }, 301 - { 302 - .name = "dmic01", 303 - .id = 2, 304 - .ignore_suspend = 1, 305 - .dpcm_capture = 1, 306 - .no_pcm = 1, 307 - SND_SOC_DAILINK_REG(dmic_pin, dmic_codec, platform), 308 - }, 309 - { 310 - .name = "iDisp1", 311 - .id = 3, 312 - .init = hdmi_init, 313 - .dpcm_playback = 1, 314 - .no_pcm = 1, 315 - SND_SOC_DAILINK_REG(idisp1_pin, idisp1_codec, platform), 316 - }, 317 - { 318 - .name = "iDisp2", 319 - .id = 4, 320 - .init = hdmi_init, 321 - .dpcm_playback = 1, 322 - .no_pcm = 1, 323 - SND_SOC_DAILINK_REG(idisp2_pin, idisp2_codec, platform), 324 - }, 325 - { 326 - .name = "iDisp3", 327 - .id = 5, 328 - .init = hdmi_init, 329 - .dpcm_playback = 1, 330 - .no_pcm = 1, 331 - SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform), 332 - }, 333 - { 334 - .name = "dmic16k", 335 - .id = 6, 336 - .ignore_suspend = 1, 337 - .dpcm_capture = 1, 338 - .no_pcm = 1, 339 - SND_SOC_DAILINK_REG(dmic16k_pin, dmic_codec, platform), 340 - } 341 - }; 342 - 343 - static struct snd_soc_dai_link adl_dais[] = { 344 - /* Back End DAI links */ 345 - { 346 - .name = "SSP0-Codec", 347 - .id = 0, 348 - .no_pcm = 1, 349 - .init = da7219_codec_init, 350 - .ignore_pmdown_time = 1, 351 - .dpcm_playback = 1, 352 - .dpcm_capture = 1, 353 - SND_SOC_DAILINK_REG(ssp0_pin, ssp0_codec, platform), 354 - }, 355 - { 356 - .name = "dmic01", 357 - .id = 1, 358 - .ignore_suspend = 1, 359 - .dpcm_capture = 1, 360 - .no_pcm = 1, 361 - SND_SOC_DAILINK_REG(dmic_pin, dmic_codec, platform), 362 - }, 363 - { 364 - .name = "dmic16k", 365 - .id = 2, 366 - .ignore_suspend = 1, 367 - .dpcm_capture = 1, 368 - .no_pcm = 1, 369 - SND_SOC_DAILINK_REG(dmic16k_pin, dmic_codec, platform), 370 - }, 371 - { 372 - .name = "iDisp1", 373 - .id = 3, 374 - .init = hdmi_init, 375 - .dpcm_playback = 1, 376 - .no_pcm = 1, 377 - SND_SOC_DAILINK_REG(idisp1_pin, idisp1_codec, platform), 378 - }, 379 - { 380 - .name = "iDisp2", 381 - .id = 4, 382 - .init = hdmi_init, 383 - .dpcm_playback = 1, 384 - .no_pcm = 1, 385 - SND_SOC_DAILINK_REG(idisp2_pin, idisp2_codec, platform), 386 - }, 387 - { 388 - .name = "iDisp3", 389 - .id = 5, 390 - .init = hdmi_init, 391 - .dpcm_playback = 1, 392 - .no_pcm = 1, 393 - SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform), 394 - }, 395 - { 396 - .name = "iDisp4", 397 - .id = 6, 398 - .init = hdmi_init, 399 - .dpcm_playback = 1, 400 - .no_pcm = 1, 401 - SND_SOC_DAILINK_REG(idisp4_pin, idisp4_codec, platform), 402 - }, 403 - { 404 - .name = "SSP1-Codec", 405 - .id = 7, 406 - .no_pcm = 1, 407 - .dpcm_playback = 1, 408 - /* feedback stream or firmware-generated echo reference */ 409 - .dpcm_capture = 1, 410 - SND_SOC_DAILINK_REG(ssp1_pin, max_98373_components, platform), 411 - }, 412 - { 413 - .name = "SSP2-BT", 414 - .id = 8, 415 - .no_pcm = 1, 416 - .dpcm_playback = 1, 417 - .dpcm_capture = 1, 418 - SND_SOC_DAILINK_REG(ssp2_pin, dummy_codec, platform), 419 - }, 420 - }; 421 229 422 230 static struct snd_soc_card card_da7219 = { 423 231 .name = "da7219", /* the sof- prefix is added by the core */ ··· 228 444 .late_probe = card_late_probe, 229 445 }; 230 446 447 + static struct snd_soc_dai_link_component da7219_component[] = { 448 + { 449 + .name = "i2c-DLGS7219:00", 450 + .dai_name = DIALOG_CODEC_DAI, 451 + } 452 + }; 453 + 454 + static int 455 + sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card, 456 + struct sof_card_private *ctx) 457 + { 458 + int ret; 459 + 460 + ret = sof_intel_board_set_dai_link(dev, card, ctx); 461 + if (ret) 462 + return ret; 463 + 464 + if (!ctx->codec_link) { 465 + dev_err(dev, "codec link not available"); 466 + return -EINVAL; 467 + } 468 + 469 + /* codec-specific fields for headphone codec */ 470 + ctx->codec_link->codecs = da7219_component; 471 + ctx->codec_link->num_codecs = ARRAY_SIZE(da7219_component); 472 + ctx->codec_link->init = da7219_codec_init; 473 + ctx->codec_link->exit = da7219_codec_exit; 474 + 475 + if (ctx->amp_type == CODEC_NONE) 476 + return 0; 477 + 478 + if (!ctx->amp_link) { 479 + dev_err(dev, "amp link not available"); 480 + return -EINVAL; 481 + } 482 + 483 + /* codec-specific fields for speaker amplifier */ 484 + switch (ctx->amp_type) { 485 + case CODEC_MAX98360A: 486 + max_98360a_dai_link(ctx->amp_link); 487 + break; 488 + case CODEC_MAX98373: 489 + ctx->amp_link->codecs = max_98373_components; 490 + ctx->amp_link->num_codecs = ARRAY_SIZE(max_98373_components); 491 + ctx->amp_link->init = max_98373_spk_codec_init; 492 + if (ctx->da7219.is_jsl_board) { 493 + ctx->amp_link->ops = &max98373_ops; /* use local ops */ 494 + } else { 495 + /* TBD: implement the amp for later platform */ 496 + dev_err(dev, "max98373 not support yet\n"); 497 + return -EINVAL; 498 + } 499 + break; 500 + default: 501 + dev_err(dev, "invalid amp type %d\n", ctx->amp_type); 502 + return -EINVAL; 503 + } 504 + 505 + return 0; 506 + } 507 + 508 + #define JSL_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_AMP, \ 509 + SOF_LINK_CODEC, \ 510 + SOF_LINK_DMIC01, \ 511 + SOF_LINK_IDISP_HDMI, \ 512 + SOF_LINK_DMIC16K, \ 513 + SOF_LINK_NONE, \ 514 + SOF_LINK_NONE) 515 + 231 516 static int audio_probe(struct platform_device *pdev) 232 517 { 233 518 struct snd_soc_acpi_mach *mach = pdev->dev.platform_data; 234 - struct snd_soc_dai_link *dai_links; 235 - struct card_private *ctx; 519 + struct sof_card_private *ctx; 236 520 unsigned long board_quirk = 0; 237 - int ret, amp_idx; 238 - 239 - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 240 - if (!ctx) 241 - return -ENOMEM; 521 + int ret; 242 522 243 523 if (pdev->id_entry && pdev->id_entry->driver_data) 244 524 board_quirk = (unsigned long)pdev->id_entry->driver_data; 245 525 246 - ctx->codec_type = sof_ssp_detect_codec_type(&pdev->dev); 247 - ctx->amp_type = sof_ssp_detect_amp_type(&pdev->dev); 526 + dev_dbg(&pdev->dev, "board_quirk = %lx\n", board_quirk); 527 + 528 + /* initialize ctx with board quirk */ 529 + ctx = sof_intel_board_get_ctx(&pdev->dev, board_quirk); 530 + if (!ctx) 531 + return -ENOMEM; 248 532 249 533 if (mach->mach_params.codec_mask & IDISP_CODEC_MASK) 250 534 ctx->hdmi.idisp_codec = true; 251 535 252 536 if (board_quirk & SOF_DA7219_JSL_BOARD) { 537 + ctx->da7219.is_jsl_board = true; 538 + 539 + /* overwrite the DAI link order for JSL boards */ 540 + ctx->link_order_overwrite = JSL_LINK_ORDER; 541 + 253 542 /* backward-compatible with existing devices */ 254 543 switch (ctx->amp_type) { 255 544 case CODEC_MAX98360A: ··· 337 480 default: 338 481 break; 339 482 } 340 - 341 - dai_links = jsl_dais; 342 - amp_idx = 0; 343 - 344 - card_da7219.num_links = ARRAY_SIZE(jsl_dais); 345 - } else { 346 - dai_links = adl_dais; 347 - amp_idx = 7; 348 - 349 - card_da7219.num_links = ARRAY_SIZE(adl_dais); 350 483 } 351 484 352 - dev_dbg(&pdev->dev, "board_quirk = %lx\n", board_quirk); 485 + if (board_quirk & SOF_DA7219_MCLK_EN) 486 + ctx->da7219.mclk_en = true; 353 487 354 - /* speaker amp */ 488 + /* update dai_link */ 489 + ret = sof_card_dai_links_create(&pdev->dev, &card_da7219, ctx); 490 + if (ret) 491 + return ret; 492 + 493 + /* update codec_conf */ 355 494 switch (ctx->amp_type) { 356 - case CODEC_MAX98360A: 357 - max_98360a_dai_link(&dai_links[amp_idx]); 358 - break; 359 495 case CODEC_MAX98373: 360 - dai_links[amp_idx].codecs = max_98373_components; 361 - dai_links[amp_idx].num_codecs = ARRAY_SIZE(max_98373_components); 362 - dai_links[amp_idx].init = max_98373_spk_codec_init; 363 - if (board_quirk & SOF_DA7219_JSL_BOARD) { 364 - dai_links[amp_idx].ops = &max98373_ops; /* use local ops */ 365 - } else { 366 - /* TBD: implement the amp for later platform */ 367 - dev_err(&pdev->dev, "max98373 not support yet\n"); 368 - return -EINVAL; 369 - } 370 - 371 496 max_98373_set_codec_conf(&card_da7219); 497 + break; 498 + case CODEC_MAX98360A: 499 + case CODEC_NONE: 500 + /* no codec conf required */ 372 501 break; 373 502 default: 374 503 dev_err(&pdev->dev, "invalid amp type %d\n", ctx->amp_type); 375 504 return -EINVAL; 376 505 } 377 - 378 - card_da7219.dai_link = dai_links; 379 506 380 507 card_da7219.dev = &pdev->dev; 381 508 ··· 375 534 376 535 static const struct platform_device_id board_ids[] = { 377 536 { 378 - .name = "jsl_mx98373_da7219", 379 - .driver_data = (kernel_ulong_t)(SOF_DA7219_JSL_BOARD), 537 + .name = "jsl_da7219_def", 538 + .driver_data = (kernel_ulong_t)(SOF_DA7219_JSL_BOARD | 539 + SOF_SSP_PORT_CODEC(0) | 540 + SOF_SSP_PORT_AMP(1)), 380 541 }, 381 542 { 382 - .name = "jsl_mx98360_da7219", 383 - .driver_data = (kernel_ulong_t)(SOF_DA7219_JSL_BOARD), 543 + .name = "adl_da7219_def", 544 + .driver_data = (kernel_ulong_t)(SOF_DA7219_MCLK_EN | 545 + SOF_SSP_PORT_CODEC(0) | 546 + SOF_SSP_PORT_AMP(1) | 547 + SOF_NUM_IDISP_HDMI(4) | 548 + SOF_SSP_PORT_BT_OFFLOAD(2) | 549 + SOF_BT_OFFLOAD_PRESENT), 384 550 }, 385 551 { 386 - .name = "adl_mx98360_da7219", 387 - /* no quirk needed for this board */ 552 + .name = "rpl_da7219_def", 553 + .driver_data = (kernel_ulong_t)(SOF_DA7219_MCLK_EN | 554 + SOF_SSP_PORT_CODEC(0) | 555 + SOF_SSP_PORT_AMP(1) | 556 + SOF_NUM_IDISP_HDMI(4) | 557 + SOF_SSP_PORT_BT_OFFLOAD(2) | 558 + SOF_BT_OFFLOAD_PRESENT), 388 559 }, 389 560 { } 390 561 }; ··· 417 564 MODULE_AUTHOR("Yong Zhi <yong.zhi@intel.com>"); 418 565 MODULE_AUTHOR("Brent Lu <brent.lu@intel.com>"); 419 566 MODULE_LICENSE("GPL v2"); 420 - MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON); 567 + MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); 421 568 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON); 422 - MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_SSP_COMMON);
+19 -69
sound/soc/intel/boards/sof_nau8825.c
··· 24 24 #include "sof_realtek_common.h" 25 25 #include "sof_maxim_common.h" 26 26 #include "sof_nuvoton_common.h" 27 - #include "sof_ssp_common.h" 28 27 29 - #define SOF_NAU8825_SSP_CODEC(quirk) ((quirk) & GENMASK(2, 0)) 30 - #define SOF_NAU8825_SSP_CODEC_MASK (GENMASK(2, 0)) 31 - #define SOF_NAU8825_SSP_AMP_SHIFT 4 32 - #define SOF_NAU8825_SSP_AMP_MASK (GENMASK(6, 4)) 33 - #define SOF_NAU8825_SSP_AMP(quirk) \ 34 - (((quirk) << SOF_NAU8825_SSP_AMP_SHIFT) & SOF_NAU8825_SSP_AMP_MASK) 35 - #define SOF_NAU8825_NUM_HDMIDEV_SHIFT 7 36 - #define SOF_NAU8825_NUM_HDMIDEV_MASK (GENMASK(9, 7)) 37 - #define SOF_NAU8825_NUM_HDMIDEV(quirk) \ 38 - (((quirk) << SOF_NAU8825_NUM_HDMIDEV_SHIFT) & SOF_NAU8825_NUM_HDMIDEV_MASK) 39 - 40 - /* BT audio offload: reserve 3 bits for future */ 41 - #define SOF_BT_OFFLOAD_SSP_SHIFT 10 42 - #define SOF_BT_OFFLOAD_SSP_MASK (GENMASK(12, 10)) 43 - #define SOF_BT_OFFLOAD_SSP(quirk) \ 44 - (((quirk) << SOF_BT_OFFLOAD_SSP_SHIFT) & SOF_BT_OFFLOAD_SSP_MASK) 45 - #define SOF_SSP_BT_OFFLOAD_PRESENT BIT(13) 46 - 47 - static unsigned long sof_nau8825_quirk = SOF_NAU8825_SSP_CODEC(0); 28 + static unsigned long sof_nau8825_quirk = SOF_SSP_PORT_CODEC(0); 48 29 49 30 static struct snd_soc_jack_pin jack_pins[] = { 50 31 { ··· 245 264 struct sof_card_private *ctx; 246 265 int ret; 247 266 248 - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 249 - if (!ctx) 250 - return -ENOMEM; 251 - 252 267 if (pdev->id_entry && pdev->id_entry->driver_data) 253 268 sof_nau8825_quirk = (unsigned long)pdev->id_entry->driver_data; 254 269 255 - ctx->codec_type = sof_ssp_detect_codec_type(&pdev->dev); 256 - ctx->amp_type = sof_ssp_detect_amp_type(&pdev->dev); 257 - 258 270 dev_dbg(&pdev->dev, "sof_nau8825_quirk = %lx\n", sof_nau8825_quirk); 259 271 260 - /* default number of DMIC DAI's */ 261 - ctx->dmic_be_num = 2; 262 - ctx->hdmi_num = (sof_nau8825_quirk & SOF_NAU8825_NUM_HDMIDEV_MASK) >> 263 - SOF_NAU8825_NUM_HDMIDEV_SHIFT; 264 - /* default number of HDMI DAI's */ 265 - if (!ctx->hdmi_num) 266 - ctx->hdmi_num = 3; 272 + /* initialize ctx with board quirk */ 273 + ctx = sof_intel_board_get_ctx(&pdev->dev, sof_nau8825_quirk); 274 + if (!ctx) 275 + return -ENOMEM; 267 276 268 277 if (mach->mach_params.codec_mask & IDISP_CODEC_MASK) 269 278 ctx->hdmi.idisp_codec = true; 270 - 271 - /* port number of peripherals attached to ssp interface */ 272 - ctx->ssp_bt = (sof_nau8825_quirk & SOF_BT_OFFLOAD_SSP_MASK) >> 273 - SOF_BT_OFFLOAD_SSP_SHIFT; 274 - 275 - ctx->ssp_amp = (sof_nau8825_quirk & SOF_NAU8825_SSP_AMP_MASK) >> 276 - SOF_NAU8825_SSP_AMP_SHIFT; 277 - 278 - ctx->ssp_codec = sof_nau8825_quirk & SOF_NAU8825_SSP_CODEC_MASK; 279 - 280 - if (sof_nau8825_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) 281 - ctx->bt_offload_present = true; 282 279 283 280 /* update dai_link */ 284 281 ret = sof_card_dai_links_create(&pdev->dev, &sof_audio_card_nau8825, ctx); ··· 271 312 case CODEC_RT1015P: 272 313 sof_rt1015p_codec_conf(&sof_audio_card_nau8825); 273 314 break; 274 - case CODEC_NONE: 275 315 case CODEC_MAX98360A: 276 316 case CODEC_NAU8318: 277 317 case CODEC_RT1019P: 318 + case CODEC_NONE: 278 319 /* no codec conf required */ 279 320 break; 280 321 default: ··· 298 339 299 340 static const struct platform_device_id board_ids[] = { 300 341 { 301 - .name = "sof_nau8825", 302 - .driver_data = (kernel_ulong_t)(SOF_NAU8825_SSP_CODEC(0) | 303 - SOF_NAU8825_NUM_HDMIDEV(4) | 304 - SOF_BT_OFFLOAD_SSP(2) | 305 - SOF_SSP_BT_OFFLOAD_PRESENT), 306 - 307 - }, 308 - { 309 342 .name = "adl_rt1019p_8825", 310 - .driver_data = (kernel_ulong_t)(SOF_NAU8825_SSP_CODEC(0) | 311 - SOF_NAU8825_SSP_AMP(2) | 312 - SOF_NAU8825_NUM_HDMIDEV(4)), 343 + .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(0) | 344 + SOF_SSP_PORT_AMP(2) | 345 + SOF_NUM_IDISP_HDMI(4)), 313 346 }, 314 347 { 315 348 .name = "adl_nau8825_def", 316 - .driver_data = (kernel_ulong_t)(SOF_NAU8825_SSP_CODEC(0) | 317 - SOF_NAU8825_SSP_AMP(1) | 318 - SOF_NAU8825_NUM_HDMIDEV(4) | 319 - SOF_BT_OFFLOAD_SSP(2) | 320 - SOF_SSP_BT_OFFLOAD_PRESENT), 349 + .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(0) | 350 + SOF_SSP_PORT_AMP(1) | 351 + SOF_NUM_IDISP_HDMI(4) | 352 + SOF_SSP_PORT_BT_OFFLOAD(2) | 353 + SOF_BT_OFFLOAD_PRESENT), 321 354 }, 322 355 { 323 356 .name = "rpl_nau8825_def", 324 - .driver_data = (kernel_ulong_t)(SOF_NAU8825_SSP_CODEC(0) | 325 - SOF_NAU8825_SSP_AMP(1) | 326 - SOF_NAU8825_NUM_HDMIDEV(4) | 327 - SOF_BT_OFFLOAD_SSP(2) | 328 - SOF_SSP_BT_OFFLOAD_PRESENT), 357 + .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(0) | 358 + SOF_SSP_PORT_AMP(1) | 359 + SOF_NUM_IDISP_HDMI(4) | 360 + SOF_SSP_PORT_BT_OFFLOAD(2) | 361 + SOF_BT_OFFLOAD_PRESENT), 329 362 }, 330 363 { } 331 364 }; ··· 343 392 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON); 344 393 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_NUVOTON_COMMON); 345 394 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_REALTEK_COMMON); 346 - MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_SSP_COMMON);
+84 -132
sound/soc/intel/boards/sof_rt5682.c
··· 27 27 #include "sof_board_helpers.h" 28 28 #include "sof_maxim_common.h" 29 29 #include "sof_realtek_common.h" 30 - #include "sof_ssp_common.h" 31 30 32 - #define SOF_RT5682_SSP_CODEC(quirk) ((quirk) & GENMASK(2, 0)) 33 - #define SOF_RT5682_SSP_CODEC_MASK (GENMASK(2, 0)) 34 - #define SOF_RT5682_MCLK_EN BIT(3) 35 - #define SOF_RT5682_SSP_AMP_SHIFT 6 36 - #define SOF_RT5682_SSP_AMP_MASK (GENMASK(8, 6)) 37 - #define SOF_RT5682_SSP_AMP(quirk) \ 38 - (((quirk) << SOF_RT5682_SSP_AMP_SHIFT) & SOF_RT5682_SSP_AMP_MASK) 39 - #define SOF_RT5682_MCLK_BYTCHT_EN BIT(9) 40 - #define SOF_RT5682_NUM_HDMIDEV_SHIFT 10 41 - #define SOF_RT5682_NUM_HDMIDEV_MASK (GENMASK(12, 10)) 42 - #define SOF_RT5682_NUM_HDMIDEV(quirk) \ 43 - ((quirk << SOF_RT5682_NUM_HDMIDEV_SHIFT) & SOF_RT5682_NUM_HDMIDEV_MASK) 44 - 45 - /* BT audio offload: reserve 3 bits for future */ 46 - #define SOF_BT_OFFLOAD_SSP_SHIFT 19 47 - #define SOF_BT_OFFLOAD_SSP_MASK (GENMASK(21, 19)) 48 - #define SOF_BT_OFFLOAD_SSP(quirk) \ 49 - (((quirk) << SOF_BT_OFFLOAD_SSP_SHIFT) & SOF_BT_OFFLOAD_SSP_MASK) 50 - #define SOF_SSP_BT_OFFLOAD_PRESENT BIT(22) 51 - 52 - /* HDMI capture*/ 53 - #define SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT 27 54 - #define SOF_SSP_HDMI_CAPTURE_PRESENT_MASK (GENMASK(30, 27)) 55 - #define SOF_HDMI_CAPTURE_SSP_MASK(quirk) \ 56 - (((quirk) << SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT) & SOF_SSP_HDMI_CAPTURE_PRESENT_MASK) 31 + /* Driver-specific board quirks: from bit 0 to 7 */ 32 + #define SOF_RT5682_MCLK_EN BIT(0) 33 + #define SOF_RT5682_MCLK_BYTCHT_EN BIT(1) 57 34 58 35 /* Default: MCLK on, MCLK 19.2M, SSP0 */ 59 36 static unsigned long sof_rt5682_quirk = SOF_RT5682_MCLK_EN | 60 - SOF_RT5682_SSP_CODEC(0); 37 + SOF_SSP_PORT_CODEC(0); 61 38 62 39 static int sof_rt5682_quirk_cb(const struct dmi_system_id *id) 63 40 { ··· 49 72 DMI_MATCH(DMI_SYS_VENDOR, "Circuitco"), 50 73 DMI_MATCH(DMI_PRODUCT_NAME, "Minnowboard Max"), 51 74 }, 52 - .driver_data = (void *)(SOF_RT5682_SSP_CODEC(2)), 75 + .driver_data = (void *)(SOF_SSP_PORT_CODEC(2)), 53 76 }, 54 77 { 55 78 .callback = sof_rt5682_quirk_cb, ··· 57 80 DMI_MATCH(DMI_SYS_VENDOR, "AAEON"), 58 81 DMI_MATCH(DMI_PRODUCT_NAME, "UP-CHT01"), 59 82 }, 60 - .driver_data = (void *)(SOF_RT5682_SSP_CODEC(2)), 83 + .driver_data = (void *)(SOF_SSP_PORT_CODEC(2)), 61 84 }, 62 85 { 63 86 .callback = sof_rt5682_quirk_cb, ··· 66 89 DMI_MATCH(DMI_PRODUCT_NAME, "WhiskeyLake Client"), 67 90 }, 68 91 .driver_data = (void *)(SOF_RT5682_MCLK_EN | 69 - SOF_RT5682_SSP_CODEC(1)), 92 + SOF_SSP_PORT_CODEC(1)), 70 93 }, 71 94 { 72 95 .callback = sof_rt5682_quirk_cb, ··· 74 97 DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Hatch"), 75 98 }, 76 99 .driver_data = (void *)(SOF_RT5682_MCLK_EN | 77 - SOF_RT5682_SSP_CODEC(0) | 78 - SOF_RT5682_SSP_AMP(1)), 100 + SOF_SSP_PORT_CODEC(0) | 101 + SOF_SSP_PORT_AMP(1)), 79 102 }, 80 103 { 81 104 .callback = sof_rt5682_quirk_cb, ··· 84 107 DMI_MATCH(DMI_PRODUCT_NAME, "Ice Lake Client"), 85 108 }, 86 109 .driver_data = (void *)(SOF_RT5682_MCLK_EN | 87 - SOF_RT5682_SSP_CODEC(0)), 110 + SOF_SSP_PORT_CODEC(0)), 88 111 }, 89 112 { 90 113 .callback = sof_rt5682_quirk_cb, ··· 93 116 DMI_MATCH(DMI_OEM_STRING, "AUDIO-MAX98373_ALC5682I_I2S_UP4"), 94 117 }, 95 118 .driver_data = (void *)(SOF_RT5682_MCLK_EN | 96 - SOF_RT5682_SSP_CODEC(0) | 97 - SOF_RT5682_SSP_AMP(2) | 98 - SOF_RT5682_NUM_HDMIDEV(4)), 119 + SOF_SSP_PORT_CODEC(0) | 120 + SOF_SSP_PORT_AMP(2) | 121 + SOF_NUM_IDISP_HDMI(4)), 99 122 }, 100 123 { 101 124 .callback = sof_rt5682_quirk_cb, ··· 105 128 DMI_MATCH(DMI_OEM_STRING, "AUDIO-ADL_MAX98373_ALC5682I_I2S"), 106 129 }, 107 130 .driver_data = (void *)(SOF_RT5682_MCLK_EN | 108 - SOF_RT5682_SSP_CODEC(0) | 109 - SOF_RT5682_SSP_AMP(2) | 110 - SOF_RT5682_NUM_HDMIDEV(4)), 131 + SOF_SSP_PORT_CODEC(0) | 132 + SOF_SSP_PORT_AMP(2) | 133 + SOF_NUM_IDISP_HDMI(4)), 111 134 }, 112 135 { 113 136 .callback = sof_rt5682_quirk_cb, ··· 116 139 DMI_MATCH(DMI_OEM_STRING, "AUDIO-MAX98390_ALC5682I_I2S"), 117 140 }, 118 141 .driver_data = (void *)(SOF_RT5682_MCLK_EN | 119 - SOF_RT5682_SSP_CODEC(0) | 120 - SOF_RT5682_SSP_AMP(2) | 121 - SOF_RT5682_NUM_HDMIDEV(4)), 142 + SOF_SSP_PORT_CODEC(0) | 143 + SOF_SSP_PORT_AMP(2) | 144 + SOF_NUM_IDISP_HDMI(4)), 122 145 }, 123 146 { 124 147 .callback = sof_rt5682_quirk_cb, ··· 127 150 DMI_MATCH(DMI_OEM_STRING, "AUDIO-MAX98360_ALC5682I_I2S_AMP_SSP2"), 128 151 }, 129 152 .driver_data = (void *)(SOF_RT5682_MCLK_EN | 130 - SOF_RT5682_SSP_CODEC(0) | 131 - SOF_RT5682_SSP_AMP(2) | 132 - SOF_RT5682_NUM_HDMIDEV(4)), 153 + SOF_SSP_PORT_CODEC(0) | 154 + SOF_SSP_PORT_AMP(2) | 155 + SOF_NUM_IDISP_HDMI(4)), 133 156 }, 134 157 { 135 158 .callback = sof_rt5682_quirk_cb, ··· 137 160 DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Rex"), 138 161 }, 139 162 .driver_data = (void *)(SOF_RT5682_MCLK_EN | 140 - SOF_RT5682_SSP_CODEC(2) | 141 - SOF_RT5682_SSP_AMP(0) | 142 - SOF_RT5682_NUM_HDMIDEV(3) | 143 - SOF_BT_OFFLOAD_SSP(1) | 144 - SOF_SSP_BT_OFFLOAD_PRESENT 163 + SOF_SSP_PORT_CODEC(2) | 164 + SOF_SSP_PORT_AMP(0) | 165 + SOF_SSP_PORT_BT_OFFLOAD(1) | 166 + SOF_BT_OFFLOAD_PRESENT 145 167 ), 146 168 }, 147 169 {} ··· 606 630 { 607 631 struct snd_soc_acpi_mach *mach = pdev->dev.platform_data; 608 632 struct sof_card_private *ctx; 633 + bool is_legacy_cpu; 609 634 int ret; 610 - 611 - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 612 - if (!ctx) 613 - return -ENOMEM; 614 635 615 636 if (pdev->id_entry && pdev->id_entry->driver_data) 616 637 sof_rt5682_quirk = (unsigned long)pdev->id_entry->driver_data; 617 638 618 639 dmi_check_system(sof_rt5682_quirk_table); 619 640 620 - ctx->codec_type = sof_ssp_detect_codec_type(&pdev->dev); 621 - ctx->amp_type = sof_ssp_detect_amp_type(&pdev->dev); 641 + if (soc_intel_is_byt() || soc_intel_is_cht()) { 642 + is_legacy_cpu = true; 643 + 644 + /* default quirk for legacy cpu */ 645 + sof_rt5682_quirk = SOF_RT5682_MCLK_EN | 646 + SOF_RT5682_MCLK_BYTCHT_EN | 647 + SOF_SSP_PORT_CODEC(2); 648 + } 649 + 650 + dev_dbg(&pdev->dev, "sof_rt5682_quirk = %lx\n", sof_rt5682_quirk); 651 + 652 + /* initialize ctx with board quirk */ 653 + ctx = sof_intel_board_get_ctx(&pdev->dev, sof_rt5682_quirk); 654 + if (!ctx) 655 + return -ENOMEM; 622 656 623 657 if (ctx->codec_type == CODEC_RT5650) { 624 658 sof_audio_card_rt5682.name = devm_kstrdup(&pdev->dev, "rt5650", ··· 639 653 ctx->amp_type = CODEC_RT5650; 640 654 } 641 655 642 - if (soc_intel_is_byt() || soc_intel_is_cht()) { 656 + if (is_legacy_cpu) { 643 657 ctx->rt5682.is_legacy_cpu = true; 644 658 ctx->dmic_be_num = 0; 645 659 /* HDMI is not supported by SOF on Baytrail/CherryTrail */ 646 660 ctx->hdmi_num = 0; 647 - /* default quirk for legacy cpu */ 648 - sof_rt5682_quirk = SOF_RT5682_MCLK_EN | 649 - SOF_RT5682_MCLK_BYTCHT_EN | 650 - SOF_RT5682_SSP_CODEC(2); 651 661 } else { 652 - ctx->dmic_be_num = 2; 653 - ctx->hdmi_num = (sof_rt5682_quirk & SOF_RT5682_NUM_HDMIDEV_MASK) >> 654 - SOF_RT5682_NUM_HDMIDEV_SHIFT; 655 - /* default number of HDMI DAI's */ 656 - if (!ctx->hdmi_num) 657 - ctx->hdmi_num = 3; 658 - 659 662 if (mach->mach_params.codec_mask & IDISP_CODEC_MASK) 660 663 ctx->hdmi.idisp_codec = true; 661 664 } ··· 669 694 } 670 695 } 671 696 672 - dev_dbg(&pdev->dev, "sof_rt5682_quirk = %lx\n", sof_rt5682_quirk); 673 - 674 - /* port number/mask of peripherals attached to ssp interface */ 675 - ctx->ssp_mask_hdmi_in = (sof_rt5682_quirk & SOF_SSP_HDMI_CAPTURE_PRESENT_MASK) >> 676 - SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT; 677 - 678 - ctx->ssp_bt = (sof_rt5682_quirk & SOF_BT_OFFLOAD_SSP_MASK) >> 679 - SOF_BT_OFFLOAD_SSP_SHIFT; 680 - 681 - ctx->ssp_amp = (sof_rt5682_quirk & SOF_RT5682_SSP_AMP_MASK) >> 682 - SOF_RT5682_SSP_AMP_SHIFT; 683 - 684 - ctx->ssp_codec = sof_rt5682_quirk & SOF_RT5682_SSP_CODEC_MASK; 685 - 686 - if (sof_rt5682_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) 687 - ctx->bt_offload_present = true; 688 - 689 697 /* update dai_link */ 690 698 ret = sof_card_dai_links_create(&pdev->dev, &sof_audio_card_rt5682, ctx); 691 699 if (ret) ··· 691 733 case CODEC_RT1015P: 692 734 sof_rt1015p_codec_conf(&sof_audio_card_rt5682); 693 735 break; 694 - case CODEC_NONE: 695 736 case CODEC_MAX98357A: 696 737 case CODEC_MAX98360A: 697 738 case CODEC_RT1019P: 698 739 case CODEC_RT5650: 740 + case CODEC_NONE: 699 741 /* no codec conf required */ 700 742 break; 701 743 default: ··· 722 764 .name = "sof_rt5682", 723 765 }, 724 766 { 725 - .name = "cml_rt1015_rt5682", 767 + .name = "cml_rt5682_def", 726 768 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 727 - SOF_RT5682_SSP_CODEC(0) | 728 - SOF_RT5682_SSP_AMP(1)), 769 + SOF_SSP_PORT_CODEC(0) | 770 + SOF_SSP_PORT_AMP(1)), 729 771 }, 730 772 { 731 773 .name = "jsl_rt5682_def", 732 774 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 733 - SOF_RT5682_SSP_CODEC(0) | 734 - SOF_RT5682_SSP_AMP(1)), 775 + SOF_SSP_PORT_CODEC(0) | 776 + SOF_SSP_PORT_AMP(1)), 735 777 }, 736 778 { 737 779 .name = "tgl_rt5682_def", 738 780 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 739 - SOF_RT5682_SSP_CODEC(0) | 740 - SOF_RT5682_SSP_AMP(1) | 741 - SOF_RT5682_NUM_HDMIDEV(4) | 742 - SOF_BT_OFFLOAD_SSP(2) | 743 - SOF_SSP_BT_OFFLOAD_PRESENT), 781 + SOF_SSP_PORT_CODEC(0) | 782 + SOF_SSP_PORT_AMP(1) | 783 + SOF_NUM_IDISP_HDMI(4) | 784 + SOF_SSP_PORT_BT_OFFLOAD(2) | 785 + SOF_BT_OFFLOAD_PRESENT), 744 786 }, 745 787 { 746 788 .name = "adl_rt5682_def", 747 789 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 748 - SOF_RT5682_SSP_CODEC(0) | 749 - SOF_RT5682_SSP_AMP(1) | 750 - SOF_RT5682_NUM_HDMIDEV(4) | 751 - SOF_BT_OFFLOAD_SSP(2) | 752 - SOF_SSP_BT_OFFLOAD_PRESENT), 790 + SOF_SSP_PORT_CODEC(0) | 791 + SOF_SSP_PORT_AMP(1) | 792 + SOF_NUM_IDISP_HDMI(4) | 793 + SOF_SSP_PORT_BT_OFFLOAD(2) | 794 + SOF_BT_OFFLOAD_PRESENT), 753 795 }, 754 796 { 755 797 .name = "adl_mx98357_rt5682", 756 798 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 757 - SOF_RT5682_SSP_CODEC(0) | 758 - SOF_RT5682_SSP_AMP(2) | 759 - SOF_RT5682_NUM_HDMIDEV(4)), 799 + SOF_SSP_PORT_CODEC(0) | 800 + SOF_SSP_PORT_AMP(2) | 801 + SOF_NUM_IDISP_HDMI(4)), 760 802 }, 761 803 { 762 804 .name = "adl_rt5682_c1_h02", 763 805 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 764 - SOF_RT5682_SSP_CODEC(1) | 765 - SOF_RT5682_NUM_HDMIDEV(3) | 806 + SOF_SSP_PORT_CODEC(1) | 766 807 /* SSP 0 and SSP 2 are used for HDMI IN */ 767 - SOF_HDMI_CAPTURE_SSP_MASK(0x5)), 808 + SOF_SSP_MASK_HDMI_CAPTURE(0x5)), 768 809 }, 769 810 { 770 811 .name = "rpl_mx98357_rt5682", 771 812 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 772 - SOF_RT5682_SSP_CODEC(0) | 773 - SOF_RT5682_SSP_AMP(2) | 774 - SOF_RT5682_NUM_HDMIDEV(4)), 813 + SOF_SSP_PORT_CODEC(0) | 814 + SOF_SSP_PORT_AMP(2) | 815 + SOF_NUM_IDISP_HDMI(4)), 775 816 }, 776 817 { 777 818 .name = "rpl_rt5682_def", 778 819 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 779 - SOF_RT5682_SSP_CODEC(0) | 780 - SOF_RT5682_SSP_AMP(1) | 781 - SOF_RT5682_NUM_HDMIDEV(4) | 782 - SOF_BT_OFFLOAD_SSP(2) | 783 - SOF_SSP_BT_OFFLOAD_PRESENT), 820 + SOF_SSP_PORT_CODEC(0) | 821 + SOF_SSP_PORT_AMP(1) | 822 + SOF_NUM_IDISP_HDMI(4) | 823 + SOF_SSP_PORT_BT_OFFLOAD(2) | 824 + SOF_BT_OFFLOAD_PRESENT), 784 825 }, 785 826 { 786 827 .name = "rpl_rt5682_c1_h02", 787 828 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 788 - SOF_RT5682_SSP_CODEC(1) | 789 - SOF_RT5682_NUM_HDMIDEV(3) | 829 + SOF_SSP_PORT_CODEC(1) | 790 830 /* SSP 0 and SSP 2 are used for HDMI IN */ 791 - SOF_HDMI_CAPTURE_SSP_MASK(0x5)), 831 + SOF_SSP_MASK_HDMI_CAPTURE(0x5)), 792 832 }, 793 833 { 794 834 .name = "mtl_mx98357_rt5682", 795 835 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 796 - SOF_RT5682_SSP_CODEC(0) | 797 - SOF_RT5682_SSP_AMP(1) | 798 - SOF_RT5682_NUM_HDMIDEV(3) | 799 - SOF_BT_OFFLOAD_SSP(2) | 800 - SOF_SSP_BT_OFFLOAD_PRESENT), 836 + SOF_SSP_PORT_CODEC(0) | 837 + SOF_SSP_PORT_AMP(1) | 838 + SOF_SSP_PORT_BT_OFFLOAD(2) | 839 + SOF_BT_OFFLOAD_PRESENT), 801 840 }, 802 841 { 803 842 .name = "mtl_mx98360_rt5682", 804 843 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 805 - SOF_RT5682_SSP_CODEC(0) | 806 - SOF_RT5682_SSP_AMP(1) | 807 - SOF_RT5682_NUM_HDMIDEV(3)), 844 + SOF_SSP_PORT_CODEC(0) | 845 + SOF_SSP_PORT_AMP(1)), 808 846 }, 809 847 { 810 848 .name = "mtl_rt5682_def", 811 849 .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | 812 - SOF_RT5682_SSP_CODEC(2) | 813 - SOF_RT5682_SSP_AMP(0) | 814 - SOF_RT5682_NUM_HDMIDEV(3) | 815 - SOF_BT_OFFLOAD_SSP(1) | 816 - SOF_SSP_BT_OFFLOAD_PRESENT), 850 + SOF_SSP_PORT_CODEC(2) | 851 + SOF_SSP_PORT_AMP(0) | 852 + SOF_SSP_PORT_BT_OFFLOAD(1) | 853 + SOF_BT_OFFLOAD_PRESENT), 817 854 }, 818 855 { } 819 856 }; ··· 834 881 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); 835 882 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON); 836 883 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_REALTEK_COMMON); 837 - MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_SSP_COMMON);
+74 -190
sound/soc/intel/boards/sof_ssp_amp.c
··· 20 20 #include "sof_board_helpers.h" 21 21 #include "sof_realtek_common.h" 22 22 #include "sof_cirrus_common.h" 23 - #include "sof_ssp_common.h" 24 23 25 - /* SSP port ID for speaker amplifier */ 26 - #define SOF_AMPLIFIER_SSP(quirk) ((quirk) & GENMASK(3, 0)) 27 - #define SOF_AMPLIFIER_SSP_MASK (GENMASK(3, 0)) 28 - 29 - /* HDMI capture*/ 30 - #define SOF_HDMI_CAPTURE_SSP_MASK_SHIFT 4 31 - #define SOF_HDMI_CAPTURE_SSP_MASK_MASK (GENMASK(9, 4)) 32 - #define SOF_HDMI_CAPTURE_SSP_MASK(quirk) \ 33 - (((quirk) << SOF_HDMI_CAPTURE_SSP_MASK_SHIFT) & SOF_HDMI_CAPTURE_SSP_MASK_MASK) 34 - 35 - /* HDMI playback */ 36 - #define SOF_HDMI_PLAYBACK_PRESENT BIT(13) 37 - #define SOF_NO_OF_HDMI_PLAYBACK_SHIFT 14 38 - #define SOF_NO_OF_HDMI_PLAYBACK_MASK (GENMASK(16, 14)) 39 - #define SOF_NO_OF_HDMI_PLAYBACK(quirk) \ 40 - (((quirk) << SOF_NO_OF_HDMI_PLAYBACK_SHIFT) & SOF_NO_OF_HDMI_PLAYBACK_MASK) 41 - 42 - /* BT audio offload */ 43 - #define SOF_SSP_BT_OFFLOAD_PRESENT BIT(17) 44 - #define SOF_BT_OFFLOAD_SSP_SHIFT 18 45 - #define SOF_BT_OFFLOAD_SSP_MASK (GENMASK(20, 18)) 46 - #define SOF_BT_OFFLOAD_SSP(quirk) \ 47 - (((quirk) << SOF_BT_OFFLOAD_SSP_SHIFT) & SOF_BT_OFFLOAD_SSP_MASK) 24 + /* Driver-specific board quirks: from bit 0 to 7 */ 25 + #define SOF_HDMI_PLAYBACK_PRESENT BIT(0) 48 26 49 27 /* Default: SSP2 */ 50 - static unsigned long sof_ssp_amp_quirk = SOF_AMPLIFIER_SSP(2); 28 + static unsigned long sof_ssp_amp_quirk = SOF_SSP_PORT_AMP(2); 51 29 52 30 static const struct dmi_system_id chromebook_platforms[] = { 53 31 { ··· 53 75 #define HDMI_IN_BE_ID 0 54 76 #define SPK_BE_ID 2 55 77 #define DMIC01_BE_ID 3 56 - #define DMIC16K_BE_ID 4 57 78 #define INTEL_HDMI_BE_ID 5 79 + /* extra BE links to support no-hdmi-in boards */ 80 + #define DMIC16K_BE_ID 4 81 + #define BT_OFFLOAD_BE_ID 8 58 82 59 - static struct snd_soc_dai_link * 60 - sof_card_dai_links_create(struct device *dev, enum sof_ssp_codec amp_type, 61 - int ssp_amp, int dmic_be_num, int hdmi_num, 62 - bool idisp_codec) 83 + #define SSP_AMP_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_HDMI_IN, \ 84 + SOF_LINK_AMP, \ 85 + SOF_LINK_DMIC01, \ 86 + SOF_LINK_DMIC16K, \ 87 + SOF_LINK_IDISP_HDMI, \ 88 + SOF_LINK_BT_OFFLOAD, \ 89 + SOF_LINK_NONE) 90 + 91 + #define SSP_AMP_LINK_IDS SOF_LINK_ORDER(HDMI_IN_BE_ID, \ 92 + SPK_BE_ID, \ 93 + DMIC01_BE_ID, \ 94 + DMIC16K_BE_ID, \ 95 + INTEL_HDMI_BE_ID, \ 96 + BT_OFFLOAD_BE_ID, \ 97 + 0) 98 + 99 + static int 100 + sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card, 101 + struct sof_card_private *ctx) 63 102 { 64 - struct snd_soc_dai_link *links; 65 - int i; 66 - int id = 0; 67 103 int ret; 68 - bool fixed_be = false; 69 - int be_id; 70 - unsigned long ssp_mask_hdmi_in; 71 104 72 - links = devm_kcalloc(dev, sof_ssp_amp_card.num_links, 73 - sizeof(struct snd_soc_dai_link), GFP_KERNEL); 74 - if (!links) 75 - return NULL; 105 + ret = sof_intel_board_set_dai_link(dev, card, ctx); 106 + if (ret) 107 + return ret; 76 108 77 - /* HDMI-In SSP */ 78 - ssp_mask_hdmi_in = (sof_ssp_amp_quirk & SOF_HDMI_CAPTURE_SSP_MASK_MASK) >> 79 - SOF_HDMI_CAPTURE_SSP_MASK_SHIFT; 109 + if (ctx->amp_type == CODEC_NONE) 110 + return 0; 80 111 81 - if (ssp_mask_hdmi_in) { 82 - int port = 0; 83 - 84 - /* the topology supports HDMI-IN uses fixed BE ID for DAI links */ 85 - fixed_be = true; 86 - 87 - be_id = HDMI_IN_BE_ID; 88 - for_each_set_bit(port, &ssp_mask_hdmi_in, 32) { 89 - ret = sof_intel_board_set_hdmi_in_link(dev, &links[id], 90 - be_id, port); 91 - if (ret) 92 - return NULL; 93 - 94 - id++; 95 - be_id++; 96 - } 112 + if (!ctx->amp_link) { 113 + dev_err(dev, "amp link not available"); 114 + return -EINVAL; 97 115 } 98 116 99 - /* codec SSP */ 100 - if (amp_type != CODEC_NONE) { 101 - be_id = fixed_be ? SPK_BE_ID : id; 102 - ret = sof_intel_board_set_ssp_amp_link(dev, &links[id], be_id, 103 - amp_type, ssp_amp); 104 - if (ret) 105 - return NULL; 106 - 107 - /* codec-specific fields */ 108 - switch (amp_type) { 109 - case CODEC_CS35L41: 110 - cs35l41_set_dai_link(&links[id]); 111 - break; 112 - case CODEC_RT1308: 113 - sof_rt1308_dai_link(&links[id]); 114 - break; 115 - default: 116 - dev_err(dev, "invalid amp type %d\n", amp_type); 117 - return NULL; 118 - } 119 - 120 - id++; 117 + /* codec-specific fields for speaker amplifier */ 118 + switch (ctx->amp_type) { 119 + case CODEC_CS35L41: 120 + cs35l41_set_dai_link(ctx->amp_link); 121 + break; 122 + case CODEC_RT1308: 123 + sof_rt1308_dai_link(ctx->amp_link); 124 + break; 125 + default: 126 + dev_err(dev, "invalid amp type %d\n", ctx->amp_type); 127 + return -EINVAL; 121 128 } 122 129 123 - /* dmic */ 124 - if (dmic_be_num > 0) { 125 - /* at least we have dmic01 */ 126 - be_id = fixed_be ? DMIC01_BE_ID : id; 127 - ret = sof_intel_board_set_dmic_link(dev, &links[id], be_id, 128 - SOF_DMIC_01); 129 - if (ret) 130 - return NULL; 131 - 132 - id++; 133 - } 134 - 135 - if (dmic_be_num > 1) { 136 - /* set up 2 BE links at most */ 137 - be_id = fixed_be ? DMIC16K_BE_ID : id; 138 - ret = sof_intel_board_set_dmic_link(dev, &links[id], be_id, 139 - SOF_DMIC_16K); 140 - if (ret) 141 - return NULL; 142 - 143 - id++; 144 - } 145 - 146 - /* HDMI playback */ 147 - for (i = 1; i <= hdmi_num; i++) { 148 - be_id = fixed_be ? (INTEL_HDMI_BE_ID + i - 1) : id; 149 - ret = sof_intel_board_set_intel_hdmi_link(dev, &links[id], be_id, 150 - i, idisp_codec); 151 - if (ret) 152 - return NULL; 153 - 154 - id++; 155 - } 156 - 157 - /* BT audio offload */ 158 - if (sof_ssp_amp_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) { 159 - int port = (sof_ssp_amp_quirk & SOF_BT_OFFLOAD_SSP_MASK) >> 160 - SOF_BT_OFFLOAD_SSP_SHIFT; 161 - 162 - ret = sof_intel_board_set_bt_link(dev, &links[id], id, port); 163 - if (ret) 164 - return NULL; 165 - 166 - id++; 167 - } 168 - 169 - return links; 130 + return 0; 170 131 } 171 132 172 133 static int sof_ssp_amp_probe(struct platform_device *pdev) 173 134 { 174 135 struct snd_soc_acpi_mach *mach = pdev->dev.platform_data; 175 - struct snd_soc_dai_link *dai_links; 176 136 struct sof_card_private *ctx; 177 137 int ret; 178 - 179 - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 180 - if (!ctx) 181 - return -ENOMEM; 182 138 183 139 if (pdev->id_entry && pdev->id_entry->driver_data) 184 140 sof_ssp_amp_quirk = (unsigned long)pdev->id_entry->driver_data; 185 141 186 - ctx->amp_type = sof_ssp_detect_amp_type(&pdev->dev); 142 + dev_dbg(&pdev->dev, "sof_ssp_amp_quirk = %lx\n", sof_ssp_amp_quirk); 187 143 188 - if (dmi_check_system(chromebook_platforms) || mach->mach_params.dmic_num > 0) 189 - ctx->dmic_be_num = 2; 190 - else 144 + /* initialize ctx with board quirk */ 145 + ctx = sof_intel_board_get_ctx(&pdev->dev, sof_ssp_amp_quirk); 146 + if (!ctx) 147 + return -ENOMEM; 148 + 149 + if (!dmi_check_system(chromebook_platforms) && 150 + (mach->mach_params.dmic_num == 0)) 191 151 ctx->dmic_be_num = 0; 192 152 193 - /* port number/mask of peripherals attached to ssp interface */ 194 - ctx->ssp_mask_hdmi_in = (sof_ssp_amp_quirk & SOF_HDMI_CAPTURE_SSP_MASK_MASK) >> 195 - SOF_HDMI_CAPTURE_SSP_MASK_SHIFT; 196 - 197 - ctx->ssp_bt = (sof_ssp_amp_quirk & SOF_BT_OFFLOAD_SSP_MASK) >> 198 - SOF_BT_OFFLOAD_SSP_SHIFT; 199 - 200 - ctx->ssp_amp = sof_ssp_amp_quirk & SOF_AMPLIFIER_SSP_MASK; 201 - 202 - /* set number of dai links */ 203 - sof_ssp_amp_card.num_links = ctx->dmic_be_num; 204 - 205 - if (ctx->amp_type != CODEC_NONE) 206 - sof_ssp_amp_card.num_links++; 207 - 208 - if (ctx->ssp_mask_hdmi_in) 209 - sof_ssp_amp_card.num_links += hweight32(ctx->ssp_mask_hdmi_in); 210 - 211 153 if (sof_ssp_amp_quirk & SOF_HDMI_PLAYBACK_PRESENT) { 212 - ctx->hdmi_num = (sof_ssp_amp_quirk & SOF_NO_OF_HDMI_PLAYBACK_MASK) >> 213 - SOF_NO_OF_HDMI_PLAYBACK_SHIFT; 214 - /* default number of HDMI DAI's */ 215 - if (!ctx->hdmi_num) 216 - ctx->hdmi_num = 3; 217 - 218 154 if (mach->mach_params.codec_mask & IDISP_CODEC_MASK) 219 155 ctx->hdmi.idisp_codec = true; 220 - 221 - sof_ssp_amp_card.num_links += ctx->hdmi_num; 222 156 } else { 223 157 ctx->hdmi_num = 0; 224 158 } 225 159 226 - if (sof_ssp_amp_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) { 227 - ctx->bt_offload_present = true; 228 - sof_ssp_amp_card.num_links++; 160 + ctx->link_order_overwrite = SSP_AMP_LINK_ORDER; 161 + 162 + if (ctx->ssp_mask_hdmi_in) { 163 + /* the topology supports HDMI-IN uses fixed BE ID for DAI links */ 164 + ctx->link_id_overwrite = SSP_AMP_LINK_IDS; 229 165 } 230 166 231 - dai_links = sof_card_dai_links_create(&pdev->dev, ctx->amp_type, 232 - ctx->ssp_amp, ctx->dmic_be_num, 233 - ctx->hdmi_num, 234 - ctx->hdmi.idisp_codec); 235 - if (!dai_links) 236 - return -ENOMEM; 237 - 238 - sof_ssp_amp_card.dai_link = dai_links; 167 + /* update dai_link */ 168 + ret = sof_card_dai_links_create(&pdev->dev, &sof_ssp_amp_card, ctx); 169 + if (ret) 170 + return ret; 239 171 240 172 /* update codec_conf */ 241 173 switch (ctx->amp_type) { 242 174 case CODEC_CS35L41: 243 175 cs35l41_set_codec_conf(&sof_ssp_amp_card); 244 176 break; 245 - case CODEC_NONE: 246 177 case CODEC_RT1308: 178 + case CODEC_NONE: 247 179 /* no codec conf required */ 248 180 break; 249 181 default: ··· 180 292 }, 181 293 { 182 294 .name = "tgl_rt1308_hdmi_ssp", 183 - .driver_data = (kernel_ulong_t)(SOF_AMPLIFIER_SSP(2) | 184 - SOF_HDMI_CAPTURE_SSP_MASK(0x22)), 295 + .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_AMP(2) | 296 + SOF_SSP_MASK_HDMI_CAPTURE(0x22)), 185 297 /* SSP 1 and SSP 5 are used for HDMI IN */ 186 298 }, 187 299 { 188 300 .name = "adl_cs35l41", 189 - .driver_data = (kernel_ulong_t)(SOF_AMPLIFIER_SSP(1) | 190 - SOF_NO_OF_HDMI_PLAYBACK(4) | 301 + .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_AMP(1) | 302 + SOF_NUM_IDISP_HDMI(4) | 191 303 SOF_HDMI_PLAYBACK_PRESENT | 192 - SOF_BT_OFFLOAD_SSP(2) | 193 - SOF_SSP_BT_OFFLOAD_PRESENT), 304 + SOF_SSP_PORT_BT_OFFLOAD(2) | 305 + SOF_BT_OFFLOAD_PRESENT), 194 306 }, 195 307 { 196 308 .name = "adl_lt6911_hdmi_ssp", 197 - .driver_data = (kernel_ulong_t)(SOF_HDMI_CAPTURE_SSP_MASK(0x5) | 309 + .driver_data = (kernel_ulong_t)(SOF_SSP_MASK_HDMI_CAPTURE(0x5) | 198 310 /* SSP 0 and SSP 2 are used for HDMI IN */ 199 - SOF_NO_OF_HDMI_PLAYBACK(3) | 200 311 SOF_HDMI_PLAYBACK_PRESENT), 201 312 }, 202 313 { 203 314 .name = "rpl_lt6911_hdmi_ssp", 204 - .driver_data = (kernel_ulong_t)(SOF_HDMI_CAPTURE_SSP_MASK(0x5) | 315 + .driver_data = (kernel_ulong_t)(SOF_SSP_MASK_HDMI_CAPTURE(0x5) | 205 316 /* SSP 0 and SSP 2 are used for HDMI IN */ 206 - SOF_NO_OF_HDMI_PLAYBACK(3) | 207 317 SOF_HDMI_PLAYBACK_PRESENT), 208 318 }, 209 319 { 210 320 .name = "mtl_lt6911_hdmi_ssp", 211 - .driver_data = (kernel_ulong_t)(SOF_HDMI_CAPTURE_SSP_MASK(0x5) | 212 - /* SSP 0 and SSP 2 are used for HDMI IN */ 213 - SOF_NO_OF_HDMI_PLAYBACK(3) | 214 - SOF_HDMI_PLAYBACK_PRESENT), 321 + .driver_data = (kernel_ulong_t)(SOF_SSP_MASK_HDMI_CAPTURE(0x5) | 322 + /* SSP 0 and SSP 2 are used for HDMI IN */ 323 + SOF_HDMI_PLAYBACK_PRESENT), 215 324 }, 216 325 { } 217 326 }; ··· 231 346 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); 232 347 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_REALTEK_COMMON); 233 348 MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_CIRRUS_COMMON); 234 - MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_SSP_COMMON);
+2 -2
sound/soc/intel/common/soc-acpi-intel-adl-match.c
··· 563 563 }, 564 564 { 565 565 .id = "10508825", 566 - .drv_name = "sof_nau8825", 566 + .drv_name = "adl_nau8825_def", 567 567 .sof_tplg_filename = "sof-adl-nau8825.tplg", 568 568 }, 569 569 { ··· 616 616 }, 617 617 { 618 618 .id = "DLGS7219", 619 - .drv_name = "adl_mx98360_da7219", 619 + .drv_name = "adl_da7219_def", 620 620 .machine_quirk = snd_soc_acpi_codec_list, 621 621 .quirk_data = &adl_max98360a_amp, 622 622 .sof_tplg_filename = "sof-adl-max98360a-da7219.tplg",
+3 -3
sound/soc/intel/common/soc-acpi-intel-cml-match.c
··· 49 49 }, 50 50 { 51 51 .id = "10EC5682", 52 - .drv_name = "cml_rt1015_rt5682", 52 + .drv_name = "cml_rt5682_def", 53 53 .machine_quirk = snd_soc_acpi_codec_list, 54 54 .quirk_data = &rt1015_spk_codecs, 55 55 .sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg", 56 56 }, 57 57 { 58 58 .id = "10EC5682", 59 - .drv_name = "sof_rt5682", 59 + .drv_name = "cml_rt5682_def", 60 60 .machine_quirk = snd_soc_acpi_codec_list, 61 61 .quirk_data = &max98357a_spk_codecs, 62 62 .sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg", 63 63 }, 64 64 { 65 65 .id = "10EC5682", 66 - .drv_name = "sof_rt5682", 66 + .drv_name = "cml_rt5682_def", 67 67 .sof_tplg_filename = "sof-cml-rt5682.tplg", 68 68 }, 69 69 {
+2 -2
sound/soc/intel/common/soc-acpi-intel-jsl-match.c
··· 52 52 struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[] = { 53 53 { 54 54 .id = "DLGS7219", 55 - .drv_name = "jsl_mx98373_da7219", 55 + .drv_name = "jsl_da7219_def", 56 56 .machine_quirk = snd_soc_acpi_codec_list, 57 57 .quirk_data = &mx98373_spk, 58 58 .sof_tplg_filename = "sof-jsl-da7219.tplg", 59 59 }, 60 60 { 61 61 .id = "DLGS7219", 62 - .drv_name = "jsl_mx98360_da7219", 62 + .drv_name = "jsl_da7219_def", 63 63 .machine_quirk = snd_soc_acpi_codec_list, 64 64 .quirk_data = &mx98360a_spk, 65 65 .sof_tplg_filename = "sof-jsl-da7219-mx98360a.tplg",
+12
sound/soc/intel/common/soc-acpi-intel-rpl-match.c
··· 455 455 .drv_name = "rpl_lt6911_hdmi_ssp", 456 456 .sof_tplg_filename = "sof-rpl-nocodec-hdmi-ssp02.tplg" 457 457 }, 458 + { 459 + .id = "DLGS7219", 460 + .drv_name = "rpl_da7219_def", 461 + .machine_quirk = snd_soc_acpi_codec_list, 462 + .quirk_data = &rpl_max98360a_amp, 463 + .sof_tplg_filename = "sof-rpl-max98360a-da7219.tplg", 464 + }, 465 + { 466 + .id = "10EC5650", 467 + .drv_name = "rpl_rt5682_def", 468 + .sof_tplg_filename = "sof-rpl-rt5650.tplg", 469 + }, 458 470 {}, 459 471 }; 460 472 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_rpl_machines);