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.

Merge tag 'sound-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"It became more than wished, partly because of vacations. But all
changes are fairly device-specific and should be safe to apply:

- A regression fix for Oops at ASoC HD-audio probe

- A series of TAS2781 HD-audio codec fixes

- A random build regression fix with SPI helpers

- Minor endianness fix for USB-audio mixer code

- ASoC FSL driver error handling fix

- ASoC Mediatek driver register fix

- A series of ASoC meson g12a driver fixes

- A few usual HD-audio oneliner quirks"

* tag 'sound-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP ProBook 440 G6
ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux
ASoC: meson: g12a-toacodec: Fix event generation
ASoC: meson: g12a-tohdmitx: Validate written enum values
ASoC: meson: g12a-toacodec: Validate written enum values
ASoC: SOF: Intel: hda-codec: Delay the codec device registration
ALSA: hda: cs35l41: fix building without CONFIG_SPI
ALSA: hda/realtek: fix mute/micmute LEDs for a HP ZBook
ALSA: hda/realtek: enable SND_PCI_QUIRK for hp pavilion 14-ec1xxx series
ASoC: mediatek: mt8186: fix AUD_PAD_TOP register and offset
ALSA: scarlett2: Convert meter levels from little-endian
ALSA: hda/tas2781: remove sound controls in unbind
ALSA: hda/tas2781: move set_drv_data outside tasdevice_init
ALSA: hda/tas2781: fix typos in comment
ALSA: hda/tas2781: do not use regcache
ASoC: fsl_rpmsg: Fix error handler with pm_runtime_enable

+172 -132
+1 -3
sound/pci/hda/cs35l41_hda_property.c
··· 211 211 if (cfg->bus == SPI) { 212 212 cs35l41->index = id; 213 213 214 - #if IS_ENABLED(CONFIG_SPI) 215 214 /* 216 215 * Manually set the Chip Select for the second amp <cs_gpio_index> in the node. 217 216 * This is only supported for systems with 2 amps, since we cannot expand the ··· 219 220 * uses a native chip select), to ensure the second amp does not clash with the 220 221 * first. 221 222 */ 222 - if (cfg->cs_gpio_index >= 0) { 223 + if (IS_ENABLED(CONFIG_SPI) && cfg->cs_gpio_index >= 0) { 223 224 spi = to_spi_device(cs35l41->dev); 224 225 225 226 if (cfg->num_amps != 2) { ··· 250 251 spi_setup(spi); 251 252 } 252 253 } 253 - #endif 254 254 } else { 255 255 if (cfg->num_amps > 2) 256 256 /*
+3
sound/pci/hda/patch_realtek.c
··· 9799 9799 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN), 9800 9800 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), 9801 9801 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), 9802 + SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9802 9803 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT), 9803 9804 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT), 9804 9805 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), ··· 9882 9881 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9883 9882 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9884 9883 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9884 + SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED), 9885 9885 SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 9886 9886 SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 9887 9887 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), ··· 9927 9925 SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 9928 9926 SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 9929 9927 SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 9928 + SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9930 9929 SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9931 9930 SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9932 9931 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
+134 -110
sound/pci/hda/tas2781_hda_i2c.c
··· 65 65 CALIB_MAX 66 66 }; 67 67 68 + struct tas2781_hda { 69 + struct device *dev; 70 + struct tasdevice_priv *priv; 71 + struct snd_kcontrol *dsp_prog_ctl; 72 + struct snd_kcontrol *dsp_conf_ctl; 73 + struct snd_kcontrol *prof_ctl; 74 + struct snd_kcontrol *snd_ctls[3]; 75 + }; 76 + 68 77 static int tas2781_get_i2c_res(struct acpi_resource *ares, void *data) 69 78 { 70 79 struct tasdevice_priv *tas_priv = data; ··· 134 125 135 126 static void tas2781_hda_playback_hook(struct device *dev, int action) 136 127 { 137 - struct tasdevice_priv *tas_priv = dev_get_drvdata(dev); 128 + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); 138 129 139 - dev_dbg(tas_priv->dev, "%s: action = %d\n", __func__, action); 130 + dev_dbg(tas_hda->dev, "%s: action = %d\n", __func__, action); 140 131 switch (action) { 141 132 case HDA_GEN_PCM_ACT_OPEN: 142 133 pm_runtime_get_sync(dev); 143 - mutex_lock(&tas_priv->codec_lock); 144 - tasdevice_tuning_switch(tas_priv, 0); 145 - mutex_unlock(&tas_priv->codec_lock); 134 + mutex_lock(&tas_hda->priv->codec_lock); 135 + tasdevice_tuning_switch(tas_hda->priv, 0); 136 + mutex_unlock(&tas_hda->priv->codec_lock); 146 137 break; 147 138 case HDA_GEN_PCM_ACT_CLOSE: 148 - mutex_lock(&tas_priv->codec_lock); 149 - tasdevice_tuning_switch(tas_priv, 1); 150 - mutex_unlock(&tas_priv->codec_lock); 139 + mutex_lock(&tas_hda->priv->codec_lock); 140 + tasdevice_tuning_switch(tas_hda->priv, 1); 141 + mutex_unlock(&tas_hda->priv->codec_lock); 151 142 152 143 pm_runtime_mark_last_busy(dev); 153 144 pm_runtime_put_autosuspend(dev); 154 145 break; 155 146 default: 156 - dev_dbg(tas_priv->dev, "Playback action not supported: %d\n", 147 + dev_dbg(tas_hda->dev, "Playback action not supported: %d\n", 157 148 action); 158 149 break; 159 150 } ··· 430 421 } 431 422 } 432 423 433 - /* Update the calibrate data, including speaker impedance, f0, etc, into algo. 424 + /* Update the calibration data, including speaker impedance, f0, etc, into algo. 434 425 * Calibrate data is done by manufacturer in the factory. These data are used 435 - * by Algo for calucating the speaker temperature, speaker membrance excursion 426 + * by Algo for calculating the speaker temperature, speaker membrane excursion 436 427 * and f0 in real time during playback. 437 428 */ 438 429 static int tas2781_save_calibration(struct tasdevice_priv *tas_priv) ··· 486 477 return 0; 487 478 } 488 479 480 + static void tas2781_hda_remove_controls(struct tas2781_hda *tas_hda) 481 + { 482 + struct hda_codec *codec = tas_hda->priv->codec; 483 + 484 + if (tas_hda->dsp_prog_ctl) 485 + snd_ctl_remove(codec->card, tas_hda->dsp_prog_ctl); 486 + 487 + if (tas_hda->dsp_conf_ctl) 488 + snd_ctl_remove(codec->card, tas_hda->dsp_conf_ctl); 489 + 490 + for (int i = ARRAY_SIZE(tas_hda->snd_ctls) - 1; i >= 0; i--) 491 + if (tas_hda->snd_ctls[i]) 492 + snd_ctl_remove(codec->card, tas_hda->snd_ctls[i]); 493 + 494 + if (tas_hda->prof_ctl) 495 + snd_ctl_remove(codec->card, tas_hda->prof_ctl); 496 + } 497 + 489 498 static void tasdev_fw_ready(const struct firmware *fmw, void *context) 490 499 { 491 500 struct tasdevice_priv *tas_priv = context; 501 + struct tas2781_hda *tas_hda = dev_get_drvdata(tas_priv->dev); 492 502 struct hda_codec *codec = tas_priv->codec; 493 503 int i, ret; 494 504 ··· 518 490 if (ret) 519 491 goto out; 520 492 521 - ret = snd_ctl_add(codec->card, 522 - snd_ctl_new1(&tas2781_prof_ctrl, tas_priv)); 493 + tas_hda->prof_ctl = snd_ctl_new1(&tas2781_prof_ctrl, tas_priv); 494 + ret = snd_ctl_add(codec->card, tas_hda->prof_ctl); 523 495 if (ret) { 524 496 dev_err(tas_priv->dev, 525 497 "Failed to add KControl %s = %d\n", ··· 528 500 } 529 501 530 502 for (i = 0; i < ARRAY_SIZE(tas2781_snd_controls); i++) { 531 - ret = snd_ctl_add(codec->card, 532 - snd_ctl_new1(&tas2781_snd_controls[i], tas_priv)); 503 + tas_hda->snd_ctls[i] = snd_ctl_new1(&tas2781_snd_controls[i], 504 + tas_priv); 505 + ret = snd_ctl_add(codec->card, tas_hda->snd_ctls[i]); 533 506 if (ret) { 534 507 dev_err(tas_priv->dev, 535 508 "Failed to add KControl %s = %d\n", ··· 552 523 goto out; 553 524 } 554 525 555 - ret = snd_ctl_add(codec->card, 556 - snd_ctl_new1(&tas2781_dsp_prog_ctrl, tas_priv)); 526 + tas_hda->dsp_prog_ctl = snd_ctl_new1(&tas2781_dsp_prog_ctrl, 527 + tas_priv); 528 + ret = snd_ctl_add(codec->card, tas_hda->dsp_prog_ctl); 557 529 if (ret) { 558 530 dev_err(tas_priv->dev, 559 531 "Failed to add KControl %s = %d\n", ··· 562 532 goto out; 563 533 } 564 534 565 - ret = snd_ctl_add(codec->card, 566 - snd_ctl_new1(&tas2781_dsp_conf_ctrl, tas_priv)); 535 + tas_hda->dsp_conf_ctl = snd_ctl_new1(&tas2781_dsp_conf_ctrl, 536 + tas_priv); 537 + ret = snd_ctl_add(codec->card, tas_hda->dsp_conf_ctl); 567 538 if (ret) { 568 539 dev_err(tas_priv->dev, 569 540 "Failed to add KControl %s = %d\n", ··· 585 554 tas2781_save_calibration(tas_priv); 586 555 587 556 out: 588 - mutex_unlock(&tas_priv->codec_lock); 557 + mutex_unlock(&tas_hda->priv->codec_lock); 589 558 if (fmw) 590 559 release_firmware(fmw); 591 - pm_runtime_mark_last_busy(tas_priv->dev); 592 - pm_runtime_put_autosuspend(tas_priv->dev); 560 + pm_runtime_mark_last_busy(tas_hda->dev); 561 + pm_runtime_put_autosuspend(tas_hda->dev); 593 562 } 594 563 595 564 static int tas2781_hda_bind(struct device *dev, struct device *master, 596 565 void *master_data) 597 566 { 598 - struct tasdevice_priv *tas_priv = dev_get_drvdata(dev); 567 + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); 599 568 struct hda_component *comps = master_data; 600 569 struct hda_codec *codec; 601 570 unsigned int subid; 602 571 int ret; 603 572 604 - if (!comps || tas_priv->index < 0 || 605 - tas_priv->index >= HDA_MAX_COMPONENTS) 573 + if (!comps || tas_hda->priv->index < 0 || 574 + tas_hda->priv->index >= HDA_MAX_COMPONENTS) 606 575 return -EINVAL; 607 576 608 - comps = &comps[tas_priv->index]; 577 + comps = &comps[tas_hda->priv->index]; 609 578 if (comps->dev) 610 579 return -EBUSY; 611 580 ··· 614 583 615 584 switch (subid) { 616 585 case 0x17aa: 617 - tas_priv->catlog_id = LENOVO; 586 + tas_hda->priv->catlog_id = LENOVO; 618 587 break; 619 588 default: 620 - tas_priv->catlog_id = OTHERS; 589 + tas_hda->priv->catlog_id = OTHERS; 621 590 break; 622 591 } 623 592 ··· 627 596 628 597 strscpy(comps->name, dev_name(dev), sizeof(comps->name)); 629 598 630 - ret = tascodec_init(tas_priv, codec, tasdev_fw_ready); 599 + ret = tascodec_init(tas_hda->priv, codec, tasdev_fw_ready); 631 600 if (!ret) 632 601 comps->playback_hook = tas2781_hda_playback_hook; 633 602 ··· 640 609 static void tas2781_hda_unbind(struct device *dev, 641 610 struct device *master, void *master_data) 642 611 { 643 - struct tasdevice_priv *tas_priv = dev_get_drvdata(dev); 612 + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); 644 613 struct hda_component *comps = master_data; 645 - comps = &comps[tas_priv->index]; 614 + comps = &comps[tas_hda->priv->index]; 646 615 647 616 if (comps->dev == dev) { 648 617 comps->dev = NULL; ··· 650 619 comps->playback_hook = NULL; 651 620 } 652 621 653 - tasdevice_config_info_remove(tas_priv); 654 - tasdevice_dsp_remove(tas_priv); 622 + tas2781_hda_remove_controls(tas_hda); 655 623 656 - tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING; 624 + tasdevice_config_info_remove(tas_hda->priv); 625 + tasdevice_dsp_remove(tas_hda->priv); 626 + 627 + tas_hda->priv->fw_state = TASDEVICE_DSP_FW_PENDING; 657 628 } 658 629 659 630 static const struct component_ops tas2781_hda_comp_ops = { ··· 665 632 666 633 static void tas2781_hda_remove(struct device *dev) 667 634 { 668 - struct tasdevice_priv *tas_priv = dev_get_drvdata(dev); 635 + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); 669 636 670 - pm_runtime_get_sync(tas_priv->dev); 671 - pm_runtime_disable(tas_priv->dev); 637 + pm_runtime_get_sync(tas_hda->dev); 638 + pm_runtime_disable(tas_hda->dev); 672 639 673 - component_del(tas_priv->dev, &tas2781_hda_comp_ops); 640 + component_del(tas_hda->dev, &tas2781_hda_comp_ops); 674 641 675 - pm_runtime_put_noidle(tas_priv->dev); 642 + pm_runtime_put_noidle(tas_hda->dev); 676 643 677 - tasdevice_remove(tas_priv); 644 + tasdevice_remove(tas_hda->priv); 678 645 } 679 646 680 647 static int tas2781_hda_i2c_probe(struct i2c_client *clt) 681 648 { 682 - struct tasdevice_priv *tas_priv; 649 + struct tas2781_hda *tas_hda; 683 650 const char *device_name; 684 651 int ret; 685 652 ··· 688 655 else 689 656 return -ENODEV; 690 657 691 - tas_priv = tasdevice_kzalloc(clt); 692 - if (!tas_priv) 658 + tas_hda = devm_kzalloc(&clt->dev, sizeof(*tas_hda), GFP_KERNEL); 659 + if (!tas_hda) 693 660 return -ENOMEM; 694 661 695 - tas_priv->irq_info.irq = clt->irq; 696 - ret = tas2781_read_acpi(tas_priv, device_name); 662 + dev_set_drvdata(&clt->dev, tas_hda); 663 + tas_hda->dev = &clt->dev; 664 + 665 + tas_hda->priv = tasdevice_kzalloc(clt); 666 + if (!tas_hda->priv) 667 + return -ENOMEM; 668 + 669 + tas_hda->priv->irq_info.irq = clt->irq; 670 + ret = tas2781_read_acpi(tas_hda->priv, device_name); 697 671 if (ret) 698 - return dev_err_probe(tas_priv->dev, ret, 672 + return dev_err_probe(tas_hda->dev, ret, 699 673 "Platform not supported\n"); 700 674 701 - ret = tasdevice_init(tas_priv); 675 + ret = tasdevice_init(tas_hda->priv); 702 676 if (ret) 703 677 goto err; 704 678 705 - pm_runtime_set_autosuspend_delay(tas_priv->dev, 3000); 706 - pm_runtime_use_autosuspend(tas_priv->dev); 707 - pm_runtime_mark_last_busy(tas_priv->dev); 708 - pm_runtime_set_active(tas_priv->dev); 709 - pm_runtime_get_noresume(tas_priv->dev); 710 - pm_runtime_enable(tas_priv->dev); 679 + pm_runtime_set_autosuspend_delay(tas_hda->dev, 3000); 680 + pm_runtime_use_autosuspend(tas_hda->dev); 681 + pm_runtime_mark_last_busy(tas_hda->dev); 682 + pm_runtime_set_active(tas_hda->dev); 683 + pm_runtime_get_noresume(tas_hda->dev); 684 + pm_runtime_enable(tas_hda->dev); 711 685 712 - pm_runtime_put_autosuspend(tas_priv->dev); 686 + pm_runtime_put_autosuspend(tas_hda->dev); 713 687 714 - tas2781_reset(tas_priv); 688 + tas2781_reset(tas_hda->priv); 715 689 716 - ret = component_add(tas_priv->dev, &tas2781_hda_comp_ops); 690 + ret = component_add(tas_hda->dev, &tas2781_hda_comp_ops); 717 691 if (ret) { 718 - dev_err(tas_priv->dev, "Register component failed: %d\n", ret); 719 - pm_runtime_disable(tas_priv->dev); 692 + dev_err(tas_hda->dev, "Register component failed: %d\n", ret); 693 + pm_runtime_disable(tas_hda->dev); 720 694 } 721 695 722 696 err: ··· 739 699 740 700 static int tas2781_runtime_suspend(struct device *dev) 741 701 { 742 - struct tasdevice_priv *tas_priv = dev_get_drvdata(dev); 702 + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); 743 703 int i; 744 704 745 - dev_dbg(tas_priv->dev, "Runtime Suspend\n"); 705 + dev_dbg(tas_hda->dev, "Runtime Suspend\n"); 746 706 747 - mutex_lock(&tas_priv->codec_lock); 707 + mutex_lock(&tas_hda->priv->codec_lock); 748 708 749 - if (tas_priv->playback_started) { 750 - tasdevice_tuning_switch(tas_priv, 1); 751 - tas_priv->playback_started = false; 709 + if (tas_hda->priv->playback_started) { 710 + tasdevice_tuning_switch(tas_hda->priv, 1); 711 + tas_hda->priv->playback_started = false; 752 712 } 753 713 754 - for (i = 0; i < tas_priv->ndev; i++) { 755 - tas_priv->tasdevice[i].cur_book = -1; 756 - tas_priv->tasdevice[i].cur_prog = -1; 757 - tas_priv->tasdevice[i].cur_conf = -1; 714 + for (i = 0; i < tas_hda->priv->ndev; i++) { 715 + tas_hda->priv->tasdevice[i].cur_book = -1; 716 + tas_hda->priv->tasdevice[i].cur_prog = -1; 717 + tas_hda->priv->tasdevice[i].cur_conf = -1; 758 718 } 759 719 760 - regcache_cache_only(tas_priv->regmap, true); 761 - regcache_mark_dirty(tas_priv->regmap); 762 - 763 - mutex_unlock(&tas_priv->codec_lock); 720 + mutex_unlock(&tas_hda->priv->codec_lock); 764 721 765 722 return 0; 766 723 } 767 724 768 725 static int tas2781_runtime_resume(struct device *dev) 769 726 { 770 - struct tasdevice_priv *tas_priv = dev_get_drvdata(dev); 727 + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); 771 728 unsigned long calib_data_sz = 772 - tas_priv->ndev * TASDEVICE_SPEAKER_CALIBRATION_SIZE; 773 - int ret; 729 + tas_hda->priv->ndev * TASDEVICE_SPEAKER_CALIBRATION_SIZE; 774 730 775 - dev_dbg(tas_priv->dev, "Runtime Resume\n"); 731 + dev_dbg(tas_hda->dev, "Runtime Resume\n"); 776 732 777 - mutex_lock(&tas_priv->codec_lock); 733 + mutex_lock(&tas_hda->priv->codec_lock); 778 734 779 - regcache_cache_only(tas_priv->regmap, false); 780 - ret = regcache_sync(tas_priv->regmap); 781 - if (ret) { 782 - dev_err(tas_priv->dev, 783 - "Failed to restore register cache: %d\n", ret); 784 - goto out; 785 - } 786 - 787 - tasdevice_prmg_load(tas_priv, tas_priv->cur_prog); 735 + tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog); 788 736 789 737 /* If calibrated data occurs error, dsp will still works with default 790 738 * calibrated data inside algo. 791 739 */ 792 - if (tas_priv->cali_data.total_sz > calib_data_sz) 793 - tas2781_apply_calib(tas_priv); 740 + if (tas_hda->priv->cali_data.total_sz > calib_data_sz) 741 + tas2781_apply_calib(tas_hda->priv); 794 742 795 - out: 796 - mutex_unlock(&tas_priv->codec_lock); 743 + mutex_unlock(&tas_hda->priv->codec_lock); 797 744 798 - return ret; 745 + return 0; 799 746 } 800 747 801 748 static int tas2781_system_suspend(struct device *dev) 802 749 { 803 - struct tasdevice_priv *tas_priv = dev_get_drvdata(dev); 750 + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); 804 751 int ret; 805 752 806 - dev_dbg(tas_priv->dev, "System Suspend\n"); 753 + dev_dbg(tas_hda->priv->dev, "System Suspend\n"); 807 754 808 755 ret = pm_runtime_force_suspend(dev); 809 756 if (ret) 810 757 return ret; 811 758 812 759 /* Shutdown chip before system suspend */ 813 - regcache_cache_only(tas_priv->regmap, false); 814 - tasdevice_tuning_switch(tas_priv, 1); 815 - regcache_cache_only(tas_priv->regmap, true); 816 - regcache_mark_dirty(tas_priv->regmap); 760 + tasdevice_tuning_switch(tas_hda->priv, 1); 817 761 818 762 /* 819 763 * Reset GPIO may be shared, so cannot reset here. ··· 808 784 809 785 static int tas2781_system_resume(struct device *dev) 810 786 { 811 - struct tasdevice_priv *tas_priv = dev_get_drvdata(dev); 787 + struct tas2781_hda *tas_hda = dev_get_drvdata(dev); 812 788 unsigned long calib_data_sz = 813 - tas_priv->ndev * TASDEVICE_SPEAKER_CALIBRATION_SIZE; 789 + tas_hda->priv->ndev * TASDEVICE_SPEAKER_CALIBRATION_SIZE; 814 790 int i, ret; 815 791 816 - dev_dbg(tas_priv->dev, "System Resume\n"); 792 + dev_info(tas_hda->priv->dev, "System Resume\n"); 817 793 818 794 ret = pm_runtime_force_resume(dev); 819 795 if (ret) 820 796 return ret; 821 797 822 - mutex_lock(&tas_priv->codec_lock); 798 + mutex_lock(&tas_hda->priv->codec_lock); 823 799 824 - for (i = 0; i < tas_priv->ndev; i++) { 825 - tas_priv->tasdevice[i].cur_book = -1; 826 - tas_priv->tasdevice[i].cur_prog = -1; 827 - tas_priv->tasdevice[i].cur_conf = -1; 800 + for (i = 0; i < tas_hda->priv->ndev; i++) { 801 + tas_hda->priv->tasdevice[i].cur_book = -1; 802 + tas_hda->priv->tasdevice[i].cur_prog = -1; 803 + tas_hda->priv->tasdevice[i].cur_conf = -1; 828 804 } 829 - tas2781_reset(tas_priv); 830 - tasdevice_prmg_load(tas_priv, tas_priv->cur_prog); 805 + tas2781_reset(tas_hda->priv); 806 + tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog); 831 807 832 808 /* If calibrated data occurs error, dsp will still work with default 833 809 * calibrated data inside algo. 834 810 */ 835 - if (tas_priv->cali_data.total_sz > calib_data_sz) 836 - tas2781_apply_calib(tas_priv); 837 - mutex_unlock(&tas_priv->codec_lock); 811 + if (tas_hda->priv->cali_data.total_sz > calib_data_sz) 812 + tas2781_apply_calib(tas_hda->priv); 813 + mutex_unlock(&tas_hda->priv->codec_lock); 838 814 839 815 return 0; 840 816 }
+1 -3
sound/soc/codecs/tas2781-comlib.c
··· 39 39 static const struct regmap_config tasdevice_regmap = { 40 40 .reg_bits = 8, 41 41 .val_bits = 8, 42 - .cache_type = REGCACHE_RBTREE, 42 + .cache_type = REGCACHE_NONE, 43 43 .ranges = tasdevice_ranges, 44 44 .num_ranges = ARRAY_SIZE(tasdevice_ranges), 45 45 .max_register = 256 * 128, ··· 315 315 tas_priv->tasdevice[i].cur_prog = -1; 316 316 tas_priv->tasdevice[i].cur_conf = -1; 317 317 } 318 - 319 - dev_set_drvdata(tas_priv->dev, tas_priv); 320 318 321 319 mutex_init(&tas_priv->codec_lock); 322 320
+2
sound/soc/codecs/tas2781-i2c.c
··· 689 689 if (!tas_priv) 690 690 return -ENOMEM; 691 691 692 + dev_set_drvdata(&i2c->dev, tas_priv); 693 + 692 694 if (ACPI_HANDLE(&i2c->dev)) { 693 695 acpi_id = acpi_match_device(i2c->dev.driver->acpi_match_table, 694 696 &i2c->dev);
+8 -2
sound/soc/fsl/fsl_rpmsg.c
··· 238 238 ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component, 239 239 &fsl_rpmsg_dai, 1); 240 240 if (ret) 241 - return ret; 241 + goto err_pm_disable; 242 242 243 243 rpmsg->card_pdev = platform_device_register_data(&pdev->dev, 244 244 "imx-audio-rpmsg", ··· 248 248 if (IS_ERR(rpmsg->card_pdev)) { 249 249 dev_err(&pdev->dev, "failed to register rpmsg card\n"); 250 250 ret = PTR_ERR(rpmsg->card_pdev); 251 - return ret; 251 + goto err_pm_disable; 252 252 } 253 253 254 254 return 0; 255 + 256 + err_pm_disable: 257 + pm_runtime_disable(&pdev->dev); 258 + return ret; 255 259 } 256 260 257 261 static void fsl_rpmsg_remove(struct platform_device *pdev) 258 262 { 259 263 struct fsl_rpmsg *rpmsg = platform_get_drvdata(pdev); 264 + 265 + pm_runtime_disable(&pdev->dev); 260 266 261 267 if (rpmsg->card_pdev) 262 268 platform_device_unregister(rpmsg->card_pdev);
+1 -1
sound/soc/mediatek/mt8186/mt8186-dai-adda.c
··· 499 499 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 500 500 501 501 SND_SOC_DAPM_SUPPLY_S("AUD_PAD_TOP", SUPPLY_SEQ_ADDA_AUD_PAD_TOP, 502 - 0, 0, 0, 502 + AFE_AUD_PAD_TOP, RG_RX_FIFO_ON_SFT, 0, 503 503 mtk_adda_pad_top_event, 504 504 SND_SOC_DAPM_PRE_PMU), 505 505 SND_SOC_DAPM_SUPPLY_S("ADDA_MTKAIF_CFG", SUPPLY_SEQ_ADDA_MTKAIF_CFG,
+4 -1
sound/soc/meson/g12a-toacodec.c
··· 71 71 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 72 72 unsigned int mux, reg; 73 73 74 + if (ucontrol->value.enumerated.item[0] >= e->items) 75 + return -EINVAL; 76 + 74 77 mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]); 75 78 regmap_field_read(priv->field_dat_sel, &reg); 76 79 ··· 104 101 105 102 snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); 106 103 107 - return 0; 104 + return 1; 108 105 } 109 106 110 107 static SOC_ENUM_SINGLE_DECL(g12a_toacodec_mux_enum, TOACODEC_CTRL0,
+7 -1
sound/soc/meson/g12a-tohdmitx.c
··· 45 45 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 46 46 unsigned int mux, changed; 47 47 48 + if (ucontrol->value.enumerated.item[0] >= e->items) 49 + return -EINVAL; 50 + 48 51 mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]); 49 52 changed = snd_soc_component_test_bits(component, e->reg, 50 53 CTRL0_I2S_DAT_SEL, ··· 96 93 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 97 94 unsigned int mux, changed; 98 95 96 + if (ucontrol->value.enumerated.item[0] >= e->items) 97 + return -EINVAL; 98 + 99 99 mux = snd_soc_enum_item_to_val(e, ucontrol->value.enumerated.item[0]); 100 100 changed = snd_soc_component_test_bits(component, TOHDMITX_CTRL0, 101 101 CTRL0_SPDIF_SEL, ··· 118 112 119 113 snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); 120 114 121 - return 0; 115 + return 1; 122 116 } 123 117 124 118 static SOC_ENUM_SINGLE_DECL(g12a_tohdmitx_spdif_mux_enum, TOHDMITX_CTRL0,
+9 -9
sound/soc/sof/intel/hda-codec.c
··· 54 54 55 55 static int hda_codec_load_module(struct hda_codec *codec) 56 56 { 57 - int ret = request_codec_module(codec); 57 + int ret; 58 58 59 + ret = snd_hdac_device_register(&codec->core); 60 + if (ret) { 61 + dev_err(&codec->core.dev, "failed to register hdac device\n"); 62 + put_device(&codec->core.dev); 63 + return ret; 64 + } 65 + 66 + ret = request_codec_module(codec); 59 67 if (ret <= 0) { 60 68 codec->probe_id = HDA_CODEC_ID_GENERIC; 61 69 ret = request_codec_module(codec); ··· 124 116 static struct hda_codec *hda_codec_device_init(struct hdac_bus *bus, int addr, int type) 125 117 { 126 118 struct hda_codec *codec; 127 - int ret; 128 119 129 120 codec = snd_hda_codec_device_init(to_hda_bus(bus), addr, "ehdaudio%dD%d", bus->idx, addr); 130 121 if (IS_ERR(codec)) { ··· 132 125 } 133 126 134 127 codec->core.type = type; 135 - 136 - ret = snd_hdac_device_register(&codec->core); 137 - if (ret) { 138 - dev_err(bus->dev, "failed to register hdac device\n"); 139 - put_device(&codec->core.dev); 140 - return ERR_PTR(ret); 141 - } 142 128 143 129 return codec; 144 130 }
+2 -2
sound/usb/mixer_scarlett2.c
··· 1966 1966 __le16 num_meters; 1967 1967 __le32 magic; 1968 1968 } __packed req; 1969 - u32 resp[SCARLETT2_MAX_METERS]; 1969 + __le32 resp[SCARLETT2_MAX_METERS]; 1970 1970 int i, err; 1971 1971 1972 1972 req.pad = 0; ··· 1979 1979 1980 1980 /* copy, convert to u16 */ 1981 1981 for (i = 0; i < num_meters; i++) 1982 - levels[i] = resp[i]; 1982 + levels[i] = le32_to_cpu(resp[i]); 1983 1983 1984 1984 return 0; 1985 1985 }