Merge branch 'topic/hda-acomp-base' into for-next
authorTakashi Iwai <tiwai@suse.de>
Mon, 22 Jul 2019 07:18:07 +0000 (09:18 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 22 Jul 2019 07:19:04 +0000 (09:19 +0200)
Pull the support for AMD / Nvidia HD-audio compmonent notification

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c
sound/hda/hdac_controller.c
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_intel.c
sound/usb/line6/podhd.c
sound/usb/line6/variax.c

index 860543a4c840207cda8e4a8c3ec873868b27b8ed..12dd9b318db18adcc087c64ae5a4db7e9661d30f 100644 (file)
@@ -77,7 +77,7 @@ void snd_pcm_group_init(struct snd_pcm_group *group)
        spin_lock_init(&group->lock);
        mutex_init(&group->mutex);
        INIT_LIST_HEAD(&group->substreams);
-       refcount_set(&group->refs, 0);
+       refcount_set(&group->refs, 1);
 }
 
 /* define group lock helpers */
@@ -1096,8 +1096,7 @@ static void snd_pcm_group_unref(struct snd_pcm_group *group,
 
        if (!group)
                return;
-       do_free = refcount_dec_and_test(&group->refs) &&
-               list_empty(&group->substreams);
+       do_free = refcount_dec_and_test(&group->refs);
        snd_pcm_group_unlock(group, substream->pcm->nonatomic);
        if (do_free)
                kfree(group);
@@ -2020,6 +2019,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
        snd_pcm_group_lock_irq(target_group, nonatomic);
        snd_pcm_stream_lock(substream1);
        snd_pcm_group_assign(substream1, target_group);
+       refcount_inc(&target_group->refs);
        snd_pcm_stream_unlock(substream1);
        snd_pcm_group_unlock_irq(target_group, nonatomic);
  _end:
@@ -2056,13 +2056,14 @@ static int snd_pcm_unlink(struct snd_pcm_substream *substream)
        snd_pcm_group_lock_irq(group, nonatomic);
 
        relink_to_local(substream);
+       refcount_dec(&group->refs);
 
        /* detach the last stream, too */
        if (list_is_singular(&group->substreams)) {
                relink_to_local(list_first_entry(&group->substreams,
                                                 struct snd_pcm_substream,
                                                 link_list));
-               do_free = !refcount_read(&group->refs);
+               do_free = refcount_dec_and_test(&group->refs);
        }
 
        snd_pcm_group_unlock_irq(group, nonatomic);
index 3b0110545070ac1fec24e44aac251490c18203d7..196bbc85699e57203f9caf740bb950badba58fee 100644 (file)
@@ -447,6 +447,8 @@ static void azx_int_disable(struct hdac_bus *bus)
        list_for_each_entry(azx_dev, &bus->stream_list, list)
                snd_hdac_stream_updateb(azx_dev, SD_CTL, SD_INT_MASK, 0);
 
+       synchronize_irq(bus->irq);
+
        /* disable SIE for all streams */
        snd_hdac_chip_writeb(bus, INTCTL, 0);
 
index e30e86ca6b72d5d1dd3ef34446315892c4119538..51f10ed9bc43205c8de07545f48588e050207d69 100644 (file)
@@ -2942,7 +2942,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;
+       bool forced_resume = !codec->relaxed_resume && codec->jacktbl.used;
        int ret;
 
        /* The get/put pair below enforces the runtime resume even if the
index cb8b0945547cdf2c0382fdc7e0bdb794401150b8..fdde80d959663ea34ff4e212b42eb764894dce39 100644 (file)
@@ -1301,9 +1301,9 @@ static int azx_free(struct azx *chip)
        }
 
        if (bus->chip_init) {
+               azx_stop_chip(chip);
                azx_clear_irq_pending(chip);
                azx_stop_all_streams(chip);
-               azx_stop_chip(chip);
        }
 
        if (bus->irq >= 0)
index f0662bd4e50fbf865d253ac2d516fdd173d10dad..27bf61c177c02e34315b1ae89c09d98422bc6f14 100644 (file)
@@ -368,7 +368,7 @@ static const struct line6_properties podhd_properties_table[] = {
                .name = "POD HD500",
                .capabilities   = LINE6_CAP_PCM
                                | LINE6_CAP_HWMON,
-               .altsetting = 1,
+               .altsetting = 0,
                .ep_ctrl_r = 0x81,
                .ep_ctrl_w = 0x01,
                .ep_audio_r = 0x86,
index 0d24c72c155fb36dcd53446aa6977239ad97af36..ed158f04de80f9c0a0b4c1bfbde24b1895bce543 100644 (file)
@@ -244,5 +244,5 @@ static struct usb_driver variax_driver = {
 
 module_usb_driver(variax_driver);
 
-MODULE_DESCRIPTION("Vairax Workbench USB driver");
+MODULE_DESCRIPTION("Variax Workbench USB driver");
 MODULE_LICENSE("GPL");