Merge tag 'sound-5.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "One significant regression fix is for HD-audio buffer preallocation. In 5.6 it was set to non-prompt for x86 and forced to 0, but this turned out to be problematic for some applications, hence it gets reverted. Distros would need to restore CONFIG_SND_HDA_PREALLOC_SIZE value to the earlier values they've used in the past. Other than that, we've received quite a few small fixes for HD-audio and USB-audio. Most of them are for dealing with the broken TRX40 mobos and the runtime PM without HD-audio codecs" * tag 'sound-5.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda: call runtime_allow() for all hda controllers ALSA: hda: Allow setting preallocation again for x86 ALSA: hda: Explicitly permit using autosuspend if runtime PM is supported ALSA: hda: Skip controller resume if not needed ALSA: hda: Keep the controller initialization even if no codecs found ALSA: hda: Release resources at error in delayed probe ALSA: hda: Honor PM disablement in PM freeze and thaw_noirq ops ALSA: hda: Don't release card at firmware loading error ALSA: usb-audio: Check mapping at creating connector controls, too ALSA: usb-audio: Don't create jack controls for PCM terminals ALSA: usb-audio: Don't override ignore_ctl_error value from the map ALSA: usb-audio: Filter error from connector kctl ops, too ALSA: hda/realtek - Enable the headset mic on Asus FX505DT ALSA: ctxfi: Remove unnecessary cast in kfree
This commit is contained in:
@@ -168,7 +168,7 @@ static int src_get_rsc_ctrl_blk(void **rblk)
|
||||
|
||||
static int src_put_rsc_ctrl_blk(void *blk)
|
||||
{
|
||||
kfree((struct src_rsc_ctrl_blk *)blk);
|
||||
kfree(blk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -494,7 +494,7 @@ static int src_mgr_get_ctrl_blk(void **rblk)
|
||||
|
||||
static int src_mgr_put_ctrl_blk(void *blk)
|
||||
{
|
||||
kfree((struct src_mgr_ctrl_blk *)blk);
|
||||
kfree(blk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -515,7 +515,7 @@ static int srcimp_mgr_get_ctrl_blk(void **rblk)
|
||||
|
||||
static int srcimp_mgr_put_ctrl_blk(void *blk)
|
||||
{
|
||||
kfree((struct srcimp_mgr_ctrl_blk *)blk);
|
||||
kfree(blk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -702,7 +702,7 @@ static int amixer_rsc_get_ctrl_blk(void **rblk)
|
||||
|
||||
static int amixer_rsc_put_ctrl_blk(void *blk)
|
||||
{
|
||||
kfree((struct amixer_rsc_ctrl_blk *)blk);
|
||||
kfree(blk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -909,7 +909,7 @@ static int dai_get_ctrl_blk(void **rblk)
|
||||
|
||||
static int dai_put_ctrl_blk(void *blk)
|
||||
{
|
||||
kfree((struct dai_ctrl_blk *)blk);
|
||||
kfree(blk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -958,7 +958,7 @@ static int dao_get_ctrl_blk(void **rblk)
|
||||
|
||||
static int dao_put_ctrl_blk(void *blk)
|
||||
{
|
||||
kfree((struct dao_ctrl_blk *)blk);
|
||||
kfree(blk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1156,7 +1156,7 @@ static int daio_mgr_get_ctrl_blk(struct hw *hw, void **rblk)
|
||||
|
||||
static int daio_mgr_put_ctrl_blk(void *blk)
|
||||
{
|
||||
kfree((struct daio_mgr_ctrl_blk *)blk);
|
||||
kfree(blk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -2951,7 +2951,7 @@ static int hda_codec_runtime_resume(struct device *dev)
|
||||
static int hda_codec_force_resume(struct device *dev)
|
||||
{
|
||||
struct hda_codec *codec = dev_to_hda_codec(dev);
|
||||
bool forced_resume = !codec->relaxed_resume && codec->jacktbl.used;
|
||||
bool forced_resume = hda_codec_need_resume(codec);
|
||||
int ret;
|
||||
|
||||
/* The get/put pair below enforces the runtime resume even if the
|
||||
|
@@ -1027,7 +1027,7 @@ static int azx_suspend(struct device *dev)
|
||||
chip = card->private_data;
|
||||
bus = azx_bus(chip);
|
||||
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
|
||||
__azx_runtime_suspend(chip);
|
||||
pm_runtime_force_suspend(dev);
|
||||
if (bus->irq >= 0) {
|
||||
free_irq(bus->irq, chip);
|
||||
bus->irq = -1;
|
||||
@@ -1044,7 +1044,9 @@ static int azx_suspend(struct device *dev)
|
||||
static int azx_resume(struct device *dev)
|
||||
{
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct hda_codec *codec;
|
||||
struct azx *chip;
|
||||
bool forced_resume = false;
|
||||
|
||||
if (!azx_is_pm_ready(card))
|
||||
return 0;
|
||||
@@ -1055,7 +1057,20 @@ static int azx_resume(struct device *dev)
|
||||
chip->msi = 0;
|
||||
if (azx_acquire_irq(chip, 1) < 0)
|
||||
return -EIO;
|
||||
__azx_runtime_resume(chip, false);
|
||||
|
||||
/* check for the forced resume */
|
||||
list_for_each_codec(codec, &chip->bus) {
|
||||
if (hda_codec_need_resume(codec)) {
|
||||
forced_resume = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (forced_resume)
|
||||
pm_runtime_get_noresume(dev);
|
||||
pm_runtime_force_resume(dev);
|
||||
if (forced_resume)
|
||||
pm_runtime_put(dev);
|
||||
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
|
||||
|
||||
trace_azx_resume(chip);
|
||||
@@ -1071,6 +1086,8 @@ static int azx_freeze_noirq(struct device *dev)
|
||||
struct azx *chip = card->private_data;
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
|
||||
if (!azx_is_pm_ready(card))
|
||||
return 0;
|
||||
if (chip->driver_type == AZX_DRIVER_SKL)
|
||||
pci_set_power_state(pci, PCI_D3hot);
|
||||
|
||||
@@ -1083,6 +1100,8 @@ static int azx_thaw_noirq(struct device *dev)
|
||||
struct azx *chip = card->private_data;
|
||||
struct pci_dev *pci = to_pci_dev(dev);
|
||||
|
||||
if (!azx_is_pm_ready(card))
|
||||
return 0;
|
||||
if (chip->driver_type == AZX_DRIVER_SKL)
|
||||
pci_set_power_state(pci, PCI_D0);
|
||||
|
||||
@@ -1098,12 +1117,12 @@ static int azx_runtime_suspend(struct device *dev)
|
||||
if (!azx_is_pm_ready(card))
|
||||
return 0;
|
||||
chip = card->private_data;
|
||||
if (!azx_has_pm_runtime(chip))
|
||||
return 0;
|
||||
|
||||
/* enable controller wake up event */
|
||||
azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) |
|
||||
STATESTS_INT_MASK);
|
||||
if (snd_power_get_state(card) == SNDRV_CTL_POWER_D0) {
|
||||
azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) |
|
||||
STATESTS_INT_MASK);
|
||||
}
|
||||
|
||||
__azx_runtime_suspend(chip);
|
||||
trace_azx_runtime_suspend(chip);
|
||||
@@ -1114,17 +1133,18 @@ static int azx_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct snd_card *card = dev_get_drvdata(dev);
|
||||
struct azx *chip;
|
||||
bool from_rt = snd_power_get_state(card) == SNDRV_CTL_POWER_D0;
|
||||
|
||||
if (!azx_is_pm_ready(card))
|
||||
return 0;
|
||||
chip = card->private_data;
|
||||
if (!azx_has_pm_runtime(chip))
|
||||
return 0;
|
||||
__azx_runtime_resume(chip, true);
|
||||
__azx_runtime_resume(chip, from_rt);
|
||||
|
||||
/* disable controller Wake Up event*/
|
||||
azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) &
|
||||
~STATESTS_INT_MASK);
|
||||
if (from_rt) {
|
||||
azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) &
|
||||
~STATESTS_INT_MASK);
|
||||
}
|
||||
|
||||
trace_azx_runtime_resume(chip);
|
||||
return 0;
|
||||
@@ -1199,10 +1219,8 @@ static void azx_vs_set_state(struct pci_dev *pci,
|
||||
if (!disabled) {
|
||||
dev_info(chip->card->dev,
|
||||
"Start delayed initialization\n");
|
||||
if (azx_probe_continue(chip) < 0) {
|
||||
if (azx_probe_continue(chip) < 0)
|
||||
dev_err(chip->card->dev, "initialization error\n");
|
||||
hda->init_failed = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dev_info(chip->card->dev, "%s via vga_switcheroo\n",
|
||||
@@ -1335,12 +1353,15 @@ static int register_vga_switcheroo(struct azx *chip)
|
||||
/*
|
||||
* destructor
|
||||
*/
|
||||
static int azx_free(struct azx *chip)
|
||||
static void azx_free(struct azx *chip)
|
||||
{
|
||||
struct pci_dev *pci = chip->pci;
|
||||
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
|
||||
struct hdac_bus *bus = azx_bus(chip);
|
||||
|
||||
if (hda->freed)
|
||||
return;
|
||||
|
||||
if (azx_has_pm_runtime(chip) && chip->running)
|
||||
pm_runtime_get_noresume(&pci->dev);
|
||||
chip->running = 0;
|
||||
@@ -1384,9 +1405,8 @@ static int azx_free(struct azx *chip)
|
||||
|
||||
if (chip->driver_caps & AZX_DCAPS_I915_COMPONENT)
|
||||
snd_hdac_i915_exit(bus);
|
||||
kfree(hda);
|
||||
|
||||
return 0;
|
||||
hda->freed = 1;
|
||||
}
|
||||
|
||||
static int azx_dev_disconnect(struct snd_device *device)
|
||||
@@ -1402,7 +1422,8 @@ static int azx_dev_disconnect(struct snd_device *device)
|
||||
|
||||
static int azx_dev_free(struct snd_device *device)
|
||||
{
|
||||
return azx_free(device->device_data);
|
||||
azx_free(device->device_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef SUPPORT_VGA_SWITCHEROO
|
||||
@@ -1769,7 +1790,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
hda = kzalloc(sizeof(*hda), GFP_KERNEL);
|
||||
hda = devm_kzalloc(&pci->dev, sizeof(*hda), GFP_KERNEL);
|
||||
if (!hda) {
|
||||
pci_disable_device(pci);
|
||||
return -ENOMEM;
|
||||
@@ -1810,7 +1831,6 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
|
||||
|
||||
err = azx_bus_init(chip, model[dev]);
|
||||
if (err < 0) {
|
||||
kfree(hda);
|
||||
pci_disable_device(pci);
|
||||
return err;
|
||||
}
|
||||
@@ -2005,7 +2025,7 @@ static int azx_first_init(struct azx *chip)
|
||||
/* codec detection */
|
||||
if (!azx_bus(chip)->codec_mask) {
|
||||
dev_err(card->dev, "no codecs found!\n");
|
||||
return -ENODEV;
|
||||
/* keep running the rest for the runtime PM */
|
||||
}
|
||||
|
||||
if (azx_acquire_irq(chip, 0) < 0)
|
||||
@@ -2027,24 +2047,15 @@ static void azx_firmware_cb(const struct firmware *fw, void *context)
|
||||
{
|
||||
struct snd_card *card = context;
|
||||
struct azx *chip = card->private_data;
|
||||
struct pci_dev *pci = chip->pci;
|
||||
|
||||
if (!fw) {
|
||||
dev_err(card->dev, "Cannot load firmware, aborting\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
chip->fw = fw;
|
||||
if (fw)
|
||||
chip->fw = fw;
|
||||
else
|
||||
dev_err(card->dev, "Cannot load firmware, continue without patching\n");
|
||||
if (!chip->disabled) {
|
||||
/* continue probing */
|
||||
if (azx_probe_continue(chip))
|
||||
goto error;
|
||||
azx_probe_continue(chip);
|
||||
}
|
||||
return; /* OK */
|
||||
|
||||
error:
|
||||
snd_card_free(card);
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2308,9 +2319,11 @@ static int azx_probe_continue(struct azx *chip)
|
||||
#endif
|
||||
|
||||
/* create codec instances */
|
||||
err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]);
|
||||
if (err < 0)
|
||||
goto out_free;
|
||||
if (bus->codec_mask) {
|
||||
err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]);
|
||||
if (err < 0)
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SND_HDA_PATCH_LOADER
|
||||
if (chip->fw) {
|
||||
@@ -2324,7 +2337,7 @@ static int azx_probe_continue(struct azx *chip)
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
if ((probe_only[dev] & 1) == 0) {
|
||||
if (bus->codec_mask && !(probe_only[dev] & 1)) {
|
||||
err = azx_codec_configure(chip);
|
||||
if (err < 0)
|
||||
goto out_free;
|
||||
@@ -2341,17 +2354,23 @@ static int azx_probe_continue(struct azx *chip)
|
||||
|
||||
set_default_power_save(chip);
|
||||
|
||||
if (azx_has_pm_runtime(chip))
|
||||
if (azx_has_pm_runtime(chip)) {
|
||||
pm_runtime_use_autosuspend(&pci->dev);
|
||||
pm_runtime_allow(&pci->dev);
|
||||
pm_runtime_put_autosuspend(&pci->dev);
|
||||
}
|
||||
|
||||
out_free:
|
||||
if (err < 0 || !hda->need_i915_power)
|
||||
if (err < 0) {
|
||||
azx_free(chip);
|
||||
return err;
|
||||
}
|
||||
|
||||
if (!hda->need_i915_power)
|
||||
display_power(chip, false);
|
||||
if (err < 0)
|
||||
hda->init_failed = 1;
|
||||
complete_all(&hda->probe_wait);
|
||||
to_hda_bus(bus)->bus_probing = 0;
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void azx_remove(struct pci_dev *pci)
|
||||
|
@@ -27,6 +27,7 @@ struct hda_intel {
|
||||
unsigned int use_vga_switcheroo:1;
|
||||
unsigned int vga_switcheroo_registered:1;
|
||||
unsigned int init_failed:1; /* delayed init failed */
|
||||
unsigned int freed:1; /* resources already released */
|
||||
|
||||
bool need_i915_power:1; /* the hda controller needs i915 power */
|
||||
};
|
||||
|
@@ -7378,6 +7378,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
|
||||
SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
|
||||
SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
|
||||
SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
|
||||
SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
|
||||
SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
|
||||
SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
|
||||
SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
|
||||
|
Reference in New Issue
Block a user