tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2 head: daae4c583534a3e20f08701ef6659066ebf60ca7 commit: a8d218f4fe8116395e4c4a13b63029ecf00d4035 [171/173] ASoC: Intel: bytcht_es8316: Add quirk for the Teclast X98+ II config: x86_64-rhel-7.6 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: git checkout a8d218f4fe8116395e4c4a13b63029ecf00d4035 # save the attached .config to linux build tree make ARCH=x86_64
All warnings (new ones prefixed by >>):
sound/soc/intel/boards/bytcht_es8316.c: In function 'snd_byt_cht_es8316_mc_probe':
sound/soc/intel/boards/bytcht_es8316.c:508:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
quirk = (int)dmi_id->driver_data; ^
vim +508 sound/soc/intel/boards/bytcht_es8316.c
457 458 static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) 459 { 460 static const char * const mic_name[] = { "in1", "in2" }; 461 struct property_entry props[MAX_NO_PROPS] = {}; 462 struct byt_cht_es8316_private *priv; 463 const struct dmi_system_id *dmi_id; 464 struct device *dev = &pdev->dev; 465 struct snd_soc_acpi_mach *mach; 466 const char *platform_name; 467 struct acpi_device *adev; 468 struct device *codec_dev; 469 unsigned int cnt = 0; 470 int dai_index = 0; 471 int i; 472 int ret = 0; 473 474 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 475 if (!priv) 476 return -ENOMEM; 477 478 mach = dev->platform_data; 479 /* fix index of codec dai */ 480 for (i = 0; i < ARRAY_SIZE(byt_cht_es8316_dais); i++) { 481 if (!strcmp(byt_cht_es8316_dais[i].codec_name, 482 "i2c-ESSX8316:00")) { 483 dai_index = i; 484 break; 485 } 486 } 487 488 /* fixup codec name based on HID */ 489 adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1); 490 if (adev) { 491 snprintf(codec_name, sizeof(codec_name), 492 "i2c-%s", acpi_dev_name(adev)); 493 put_device(&adev->dev); 494 byt_cht_es8316_dais[dai_index].codec_name = codec_name; 495 } 496 497 /* override plaform name, if required */ 498 platform_name = mach->mach_params.platform; 499 500 ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_es8316_card, 501 platform_name); 502 if (ret) 503 return ret; 504 505 /* Check for BYTCR or other platform and setup quirks */ 506 dmi_id = dmi_first_match(byt_cht_es8316_quirk_table); 507 if (dmi_id) {
508 quirk = (int)dmi_id->driver_data;
509 } else if (x86_match_cpu(baytrail_cpu_ids) && 510 mach->mach_params.acpi_ipc_irq_index == 0) { 511 /* On BYTCR default to SSP0, internal-mic-in2-map, mono-spk */ 512 quirk = BYT_CHT_ES8316_SSP0 | BYT_CHT_ES8316_INTMIC_IN2_MAP | 513 BYT_CHT_ES8316_MONO_SPEAKER; 514 } else { 515 /* Others default to internal-mic-in1-map, mono-speaker */ 516 quirk = BYT_CHT_ES8316_INTMIC_IN1_MAP | 517 BYT_CHT_ES8316_MONO_SPEAKER; 518 } 519 if (quirk_override != -1) { 520 dev_info(dev, "Overriding quirk 0x%x => 0x%x\n", quirk, 521 quirk_override); 522 quirk = quirk_override; 523 } 524 log_quirks(dev); 525 526 if (quirk & BYT_CHT_ES8316_SSP0) 527 byt_cht_es8316_dais[dai_index].cpu_dai_name = "ssp0-port"; 528 529 /* get the clock */ 530 priv->mclk = devm_clk_get(dev, "pmc_plt_clk_3"); 531 if (IS_ERR(priv->mclk)) { 532 ret = PTR_ERR(priv->mclk); 533 dev_err(dev, "clk_get pmc_plt_clk_3 failed: %d\n", ret); 534 return ret; 535 } 536 537 /* get speaker enable GPIO */ 538 codec_dev = bus_find_device_by_name(&i2c_bus_type, NULL, codec_name); 539 if (!codec_dev) 540 return -EPROBE_DEFER; 541 542 if (quirk & BYT_CHT_ES8316_JD_INVERTED) 543 props[cnt++] = PROPERTY_ENTRY_BOOL("everest,jack-detect-inverted"); 544 545 if (cnt) { 546 ret = device_add_properties(codec_dev, props); 547 if (ret) 548 return ret; 549 } 550 551 devm_acpi_dev_add_driver_gpios(codec_dev, byt_cht_es8316_gpios); 552 priv->speaker_en_gpio = 553 gpiod_get_index(codec_dev, "speaker-enable", 0, 554 /* see comment in byt_cht_es8316_resume */ 555 GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE); 556 put_device(codec_dev); 557 558 if (IS_ERR(priv->speaker_en_gpio)) { 559 ret = PTR_ERR(priv->speaker_en_gpio); 560 switch (ret) { 561 case -ENOENT: 562 priv->speaker_en_gpio = NULL; 563 break; 564 default: 565 dev_err(dev, "get speaker GPIO failed: %d\n", ret); 566 /* fall through */ 567 case -EPROBE_DEFER: 568 return ret; 569 } 570 } 571 572 /* register the soc card */ 573 snprintf(long_name, sizeof(long_name), "bytcht-es8316-%s-spk-%s-mic", 574 (quirk & BYT_CHT_ES8316_MONO_SPEAKER) ? "mono" : "stereo", 575 mic_name[BYT_CHT_ES8316_MAP(quirk)]); 576 byt_cht_es8316_card.long_name = long_name; 577 byt_cht_es8316_card.dev = dev; 578 snd_soc_card_set_drvdata(&byt_cht_es8316_card, priv); 579 580 ret = devm_snd_soc_register_card(dev, &byt_cht_es8316_card); 581 if (ret) { 582 gpiod_put(priv->speaker_en_gpio); 583 dev_err(dev, "snd_soc_register_card failed: %d\n", ret); 584 return ret; 585 } 586 platform_set_drvdata(pdev, &byt_cht_es8316_card); 587 return 0; 588 } 589
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation