Merge branch 'for-linus' into for-next
authorTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2020 08:19:24 +0000 (09:19 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2020 08:19:34 +0000 (09:19 +0100)
Merge 5.5-rc devel branch back for applying the conflicting USB-audio
fix.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
1  2 
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_realtek.c
sound/pci/ice1712/ice1724.c
sound/usb/pcm.c

@@@ -282,12 -282,13 +282,13 @@@ enum 
  
  /* quirks for old Intel chipsets */
  #define AZX_DCAPS_INTEL_ICH \
-       (AZX_DCAPS_OLD_SSYNC | AZX_DCAPS_NO_ALIGN_BUFSIZE)
+       (AZX_DCAPS_OLD_SSYNC | AZX_DCAPS_NO_ALIGN_BUFSIZE |\
+        AZX_DCAPS_SYNC_WRITE)
  
  /* quirks for Intel PCH */
  #define AZX_DCAPS_INTEL_PCH_BASE \
        (AZX_DCAPS_NO_ALIGN_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY |\
-        AZX_DCAPS_SNOOP_TYPE(SCH))
+        AZX_DCAPS_SNOOP_TYPE(SCH) | AZX_DCAPS_SYNC_WRITE)
  
  /* PCH up to IVB; no runtime PM; bind with i915 gfx */
  #define AZX_DCAPS_INTEL_PCH_NOPM \
  #define AZX_DCAPS_INTEL_HASWELL \
        (/*AZX_DCAPS_ALIGN_BUFSIZE |*/ AZX_DCAPS_COUNT_LPIB_DELAY |\
         AZX_DCAPS_PM_RUNTIME | AZX_DCAPS_I915_COMPONENT |\
-        AZX_DCAPS_SNOOP_TYPE(SCH))
+        AZX_DCAPS_SNOOP_TYPE(SCH) | AZX_DCAPS_SYNC_WRITE)
  
  /* Broadwell HDMI can't use position buffer reliably, force to use LPIB */
  #define AZX_DCAPS_INTEL_BROADWELL \
        (/*AZX_DCAPS_ALIGN_BUFSIZE |*/ AZX_DCAPS_POSFIX_LPIB |\
         AZX_DCAPS_PM_RUNTIME | AZX_DCAPS_I915_COMPONENT |\
-        AZX_DCAPS_SNOOP_TYPE(SCH))
+        AZX_DCAPS_SNOOP_TYPE(SCH) | AZX_DCAPS_SYNC_WRITE)
  
  #define AZX_DCAPS_INTEL_BAYTRAIL \
        (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_I915_COMPONENT)
@@@ -790,7 -791,6 +791,7 @@@ static int azx_acquire_irq(struct azx *
                return -1;
        }
        bus->irq = chip->pci->irq;
 +      chip->card->sync_irq = bus->irq;
        pci_intx(chip->pci, !chip->msi);
        return 0;
  }
@@@ -1029,7 -1029,6 +1030,7 @@@ static int azx_suspend(struct device *d
        if (bus->irq >= 0) {
                free_irq(bus->irq, chip);
                bus->irq = -1;
 +              chip->card->sync_irq = -1;
        }
  
        if (chip->msi)
@@@ -1412,7 -1411,17 +1413,17 @@@ static bool atpx_present(void
        acpi_handle dhandle, atpx_handle;
        acpi_status status;
  
-       while ((pdev = pci_get_class(PCI_BASE_CLASS_DISPLAY << 16, pdev)) != NULL) {
+       while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
+               dhandle = ACPI_HANDLE(&pdev->dev);
+               if (dhandle) {
+                       status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
+                       if (!ACPI_FAILURE(status)) {
+                               pci_dev_put(pdev);
+                               return true;
+                       }
+               }
+       }
+       while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) {
                dhandle = ACPI_HANDLE(&pdev->dev);
                if (dhandle) {
                        status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
@@@ -1490,7 -1499,7 +1501,7 @@@ static bool check_hdmi_disabled(struct 
  /*
   * white/black-listing for position_fix
   */
 -static struct snd_pci_quirk position_fix_list[] = {
 +static const struct snd_pci_quirk position_fix_list[] = {
        SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB),
        SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB),
@@@ -1583,7 -1592,7 +1594,7 @@@ static void assign_position_fix(struct 
  /*
   * black-lists for probe_mask
   */
 -static struct snd_pci_quirk probe_mask_list[] = {
 +static const struct snd_pci_quirk probe_mask_list[] = {
        /* Thinkpad often breaks the controller communication when accessing
         * to the non-working (or non-existing) modem codec slot.
         */
@@@ -1631,7 -1640,7 +1642,7 @@@ static void check_probe_mask(struct az
  /*
   * white/black-list for enable_msi
   */
 -static struct snd_pci_quirk msi_black_list[] = {
 +static const struct snd_pci_quirk msi_black_list[] = {
        SND_PCI_QUIRK(0x103c, 0x2191, "HP", 0), /* AMD Hudson */
        SND_PCI_QUIRK(0x103c, 0x2192, "HP", 0), /* AMD Hudson */
        SND_PCI_QUIRK(0x103c, 0x21f7, "HP", 0), /* AMD Hudson */
@@@ -1743,7 -1752,7 +1754,7 @@@ static int azx_create(struct snd_card *
                      int dev, unsigned int driver_caps,
                      struct azx **rchip)
  {
 -      static struct snd_device_ops ops = {
 +      static const struct snd_device_ops ops = {
                .dev_disconnect = azx_dev_disconnect,
                .dev_free = azx_dev_free,
        };
  
        if (chip->driver_type == AZX_DRIVER_NVIDIA) {
                dev_dbg(chip->card->dev, "Enable delay in RIRB handling\n");
 -              chip->bus.needs_damn_long_delay = 1;
 +              chip->bus.core.needs_damn_long_delay = 1;
        }
  
        err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
@@@ -1885,6 -1894,7 +1896,6 @@@ static int azx_first_init(struct azx *c
        }
  
        pci_set_master(pci);
 -      synchronize_irq(bus->irq);
  
        gcap = azx_readw(chip, GCAP);
        dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap);
@@@ -2043,7 -2053,6 +2054,7 @@@ static int disable_msi_reset_irq(struc
  
        free_irq(bus->irq, chip);
        bus->irq = -1;
 +      chip->card->sync_irq = -1;
        pci_disable_msi(chip->pci);
        chip->msi = 0;
        err = azx_acquire_irq(chip, 1);
@@@ -2164,7 -2173,7 +2175,7 @@@ out_free
   * So we keep a list of devices where we disable powersaving as its known
   * to causes problems on these devices.
   */
 -static struct snd_pci_quirk power_save_blacklist[] = {
 +static const struct snd_pci_quirk power_save_blacklist[] = {
        /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
        SND_PCI_QUIRK(0x1849, 0xc892, "Asrock B85M-ITX", 0),
        /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
@@@ -430,6 -430,7 +430,7 @@@ static void alc_fill_eapd_coef(struct h
                break;
        case 0x10ec0899:
        case 0x10ec0900:
+       case 0x10ec0b00:
        case 0x10ec1168:
        case 0x10ec1220:
                alc_update_coef_idx(codec, 0x7, 1<<1, 0);
@@@ -464,10 -465,10 +465,10 @@@ static void set_eapd(struct hda_codec *
  static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
  {
        /* We currently only handle front, HP */
 -      static hda_nid_t pins[] = {
 +      static const hda_nid_t pins[] = {
                0x0f, 0x10, 0x14, 0x15, 0x17, 0
        };
 -      hda_nid_t *p;
 +      const hda_nid_t *p;
        for (p = pins; *p; p++)
                set_eapd(codec, *p, on);
  }
@@@ -501,6 -502,7 +502,7 @@@ static void alc_shutup_pins(struct hda_
        struct alc_spec *spec = codec->spec;
  
        switch (codec->core.vendor_id) {
+       case 0x10ec0283:
        case 0x10ec0286:
        case 0x10ec0288:
        case 0x10ec0298:
@@@ -1935,19 -1937,19 +1937,19 @@@ static void alc889_fixup_dac_route(stru
  {
        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
                /* fake the connections during parsing the tree */
 -              hda_nid_t conn1[2] = { 0x0c, 0x0d };
 -              hda_nid_t conn2[2] = { 0x0e, 0x0f };
 -              snd_hda_override_conn_list(codec, 0x14, 2, conn1);
 -              snd_hda_override_conn_list(codec, 0x15, 2, conn1);
 -              snd_hda_override_conn_list(codec, 0x18, 2, conn2);
 -              snd_hda_override_conn_list(codec, 0x1a, 2, conn2);
 +              static const hda_nid_t conn1[] = { 0x0c, 0x0d };
 +              static const hda_nid_t conn2[] = { 0x0e, 0x0f };
 +              snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
 +              snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
 +              snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
 +              snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
        } else if (action == HDA_FIXUP_ACT_PROBE) {
                /* restore the connections */
 -              hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
 -              snd_hda_override_conn_list(codec, 0x14, 5, conn);
 -              snd_hda_override_conn_list(codec, 0x15, 5, conn);
 -              snd_hda_override_conn_list(codec, 0x18, 5, conn);
 -              snd_hda_override_conn_list(codec, 0x1a, 5, conn);
 +              static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
 +              snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
 +              snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
 +              snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
 +              snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
        }
  }
  
  static void alc889_fixup_mbp_vref(struct hda_codec *codec,
                                  const struct hda_fixup *fix, int action)
  {
 +      static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
        struct alc_spec *spec = codec->spec;
 -      static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 };
        int i;
  
        if (action != HDA_FIXUP_ACT_INIT)
@@@ -1992,7 -1994,7 +1994,7 @@@ static void alc889_fixup_mac_pins(struc
  static void alc889_fixup_imac91_vref(struct hda_codec *codec,
                                     const struct hda_fixup *fix, int action)
  {
 -      static hda_nid_t nids[2] = { 0x18, 0x1a };
 +      static const hda_nid_t nids[] = { 0x18, 0x1a };
  
        if (action == HDA_FIXUP_ACT_INIT)
                alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
  static void alc889_fixup_mba11_vref(struct hda_codec *codec,
                                    const struct hda_fixup *fix, int action)
  {
 -      static hda_nid_t nids[1] = { 0x18 };
 +      static const hda_nid_t nids[] = { 0x18 };
  
        if (action == HDA_FIXUP_ACT_INIT)
                alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
  static void alc889_fixup_mba21_vref(struct hda_codec *codec,
                                    const struct hda_fixup *fix, int action)
  {
 -      static hda_nid_t nids[2] = { 0x18, 0x19 };
 +      static const hda_nid_t nids[] = { 0x18, 0x19 };
  
        if (action == HDA_FIXUP_ACT_INIT)
                alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
@@@ -2094,7 -2096,7 +2096,7 @@@ static void alc1220_fixup_clevo_p950(st
                                     const struct hda_fixup *fix,
                                     int action)
  {
 -      hda_nid_t conn1[1] = { 0x0c };
 +      static const hda_nid_t conn1[] = { 0x0c };
  
        if (action != HDA_FIXUP_ACT_PRE_PROBE)
                return;
        /* We therefore want to make sure 0x14 (front headphone) and
         * 0x1b (speakers) use the stereo DAC 0x02
         */
 -      snd_hda_override_conn_list(codec, 0x14, 1, conn1);
 -      snd_hda_override_conn_list(codec, 0x1b, 1, conn1);
 +      snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
 +      snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
  }
  
  static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
@@@ -2525,6 -2527,7 +2527,7 @@@ static int patch_alc882(struct hda_code
        case 0x10ec0882:
        case 0x10ec0885:
        case 0x10ec0900:
+       case 0x10ec0b00:
        case 0x10ec1220:
                break;
        default:
@@@ -5243,7 -5246,7 +5246,7 @@@ static void alc_fixup_tpt470_dock(struc
         * the speaker output becomes too low by some reason on Thinkpads with
         * ALC298 codec
         */
 -      static hda_nid_t preferred_pairs[] = {
 +      static const hda_nid_t preferred_pairs[] = {
                0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
                0
        };
@@@ -5515,9 -5518,9 +5518,9 @@@ static void alc290_fixup_mono_speakers(
                /* DAC node 0x03 is giving mono output. We therefore want to
                   make sure 0x14 (front speaker) and 0x15 (headphones) use the
                   stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
 -              hda_nid_t conn1[2] = { 0x0c };
 -              snd_hda_override_conn_list(codec, 0x14, 1, conn1);
 -              snd_hda_override_conn_list(codec, 0x15, 1, conn1);
 +              static const hda_nid_t conn1[] = { 0x0c };
 +              snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
 +              snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
        }
  }
  
@@@ -5532,8 -5535,8 +5535,8 @@@ static void alc298_fixup_speaker_volume
                   Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
                   speaker's volume now. */
  
 -              hda_nid_t conn1[1] = { 0x0c };
 -              snd_hda_override_conn_list(codec, 0x17, 1, conn1);
 +              static const hda_nid_t conn1[] = { 0x0c };
 +              snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
        }
  }
  
@@@ -5542,8 -5545,8 +5545,8 @@@ static void alc295_fixup_disable_dac3(s
                                      const struct hda_fixup *fix, int action)
  {
        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
 -              hda_nid_t conn[2] = { 0x02, 0x03 };
 -              snd_hda_override_conn_list(codec, 0x17, 2, conn);
 +              static const hda_nid_t conn[] = { 0x02, 0x03 };
 +              snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
        }
  }
  
@@@ -5552,8 -5555,8 +5555,8 @@@ static void alc285_fixup_speaker2_to_da
                                          const struct hda_fixup *fix, int action)
  {
        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
 -              hda_nid_t conn[1] = { 0x02 };
 -              snd_hda_override_conn_list(codec, 0x17, 1, conn);
 +              static const hda_nid_t conn[] = { 0x02 };
 +              snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
        }
  }
  
@@@ -5631,7 -5634,7 +5634,7 @@@ static void alc274_fixup_bind_dacs(stru
                                    const struct hda_fixup *fix, int action)
  {
        struct alc_spec *spec = codec->spec;
 -      static hda_nid_t preferred_pairs[] = {
 +      static const hda_nid_t preferred_pairs[] = {
                0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
                0
        };
@@@ -5844,7 -5847,6 +5847,7 @@@ enum 
        ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
        ALC288_FIXUP_DELL_XPS_13,
        ALC288_FIXUP_DISABLE_AAMIX,
 +      ALC292_FIXUP_DELL_E7X_AAMIX,
        ALC292_FIXUP_DELL_E7X,
        ALC292_FIXUP_DISABLE_AAMIX,
        ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
        ALC256_FIXUP_ASUS_HEADSET_MIC,
        ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
        ALC299_FIXUP_PREDATOR_SPK,
-       ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC,
        ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
-       ALC294_FIXUP_ASUS_INTSPK_GPIO,
+       ALC289_FIXUP_DELL_SPK2,
+       ALC289_FIXUP_DUAL_SPK,
+       ALC294_FIXUP_SPK2_TO_DAC1,
+       ALC294_FIXUP_ASUS_DUAL_SPK,
  };
  
  static const struct hda_fixup alc269_fixups[] = {
                .chained = true,
                .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
        },
 -      [ALC292_FIXUP_DELL_E7X] = {
 +      [ALC292_FIXUP_DELL_E7X_AAMIX] = {
                .type = HDA_FIXUP_FUNC,
                .v.func = alc_fixup_dell_xps13,
                .chained = true,
                .chain_id = ALC292_FIXUP_DISABLE_AAMIX
        },
 +      [ALC292_FIXUP_DELL_E7X] = {
 +              .type = HDA_FIXUP_FUNC,
 +              .v.func = snd_hda_gen_fixup_micmute_led,
 +              /* micmute fixup must be applied at last */
 +              .chained_before = true,
 +              .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
 +      },
        [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
                .type = HDA_FIXUP_PINS,
                .v.pins = (const struct hda_pintbl[]) {
                        { }
                }
        },
-       [ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC] = {
+       [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
                .type = HDA_FIXUP_PINS,
                .v.pins = (const struct hda_pintbl[]) {
-                       { 0x14, 0x411111f0 }, /* disable confusing internal speaker */
-                       { 0x19, 0x04a11150 }, /* use as headset mic, without its own jack detect */
+                       { 0x19, 0x04a11040 },
+                       { 0x21, 0x04211020 },
                        { }
                },
                .chained = true,
-               .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
+               .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
        },
-       [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
+       [ALC289_FIXUP_DELL_SPK2] = {
                .type = HDA_FIXUP_PINS,
                .v.pins = (const struct hda_pintbl[]) {
-                       { 0x19, 0x04a11040 },
-                       { 0x21, 0x04211020 },
+                       { 0x17, 0x90170130 }, /* bass spk */
                        { }
                },
                .chained = true,
-               .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
+               .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
        },
-       [ALC294_FIXUP_ASUS_INTSPK_GPIO] = {
+       [ALC289_FIXUP_DUAL_SPK] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = alc285_fixup_speaker2_to_dac1,
+               .chained = true,
+               .chain_id = ALC289_FIXUP_DELL_SPK2
+       },
+       [ALC294_FIXUP_SPK2_TO_DAC1] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = alc285_fixup_speaker2_to_dac1,
+               .chained = true,
+               .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
+       },
+       [ALC294_FIXUP_ASUS_DUAL_SPK] = {
                .type = HDA_FIXUP_FUNC,
                /* The GPIO must be pulled to initialize the AMP */
                .v.func = alc_fixup_gpio4,
                .chained = true,
-               .chain_id = ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC
+               .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
        },
  };
  
  static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
+       SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
+       SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
        SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
        SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
        SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
        SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
-       SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_INTSPK_GPIO),
+       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, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
        SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
@@@ -9245,6 -9257,7 +9265,7 @@@ static const struct hda_device_id snd_h
        HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
        HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
        HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
+       HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
        HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
        HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
        {} /* terminator */
@@@ -647,6 -647,7 +647,7 @@@ static int snd_vt1724_set_pro_rate(stru
        unsigned long flags;
        unsigned char mclk_change;
        unsigned int i, old_rate;
+       bool call_set_rate = false;
  
        if (rate > ice->hw_rates->list[ice->hw_rates->count - 1])
                return -EINVAL;
                 * setting clock rate for internal clock mode */
                old_rate = ice->get_rate(ice);
                if (force || (old_rate != rate))
-                       ice->set_rate(ice, rate);
+                       call_set_rate = true;
                else if (rate == ice->cur_rate) {
                        spin_unlock_irqrestore(&ice->reg_lock, flags);
                        return 0;
        }
  
        ice->cur_rate = rate;
+       spin_unlock_irqrestore(&ice->reg_lock, flags);
+       if (call_set_rate)
+               ice->set_rate(ice, rate);
  
        /* setting master clock */
        mclk_change = ice->set_mclk(ice, rate);
  
-       spin_unlock_irqrestore(&ice->reg_lock, flags);
        if (mclk_change && ice->gpio.i2s_mclk_changed)
                ice->gpio.i2s_mclk_changed(ice);
        if (ice->gpio.set_pro_rate)
@@@ -704,7 -707,7 +707,7 @@@ static int snd_vt1724_pcm_hw_params(str
                                    struct snd_pcm_hw_params *hw_params)
  {
        struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
 -      int i, chs, err;
 +      int i, chs;
  
        chs = params_channels(hw_params);
        mutex_lock(&ice->open_mutex);
        }
        mutex_unlock(&ice->open_mutex);
  
 -      err = snd_vt1724_set_pro_rate(ice, params_rate(hw_params), 0);
 -      if (err < 0)
 -              return err;
 -
 -      return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
 +      return snd_vt1724_set_pro_rate(ice, params_rate(hw_params), 0);
  }
  
  static int snd_vt1724_pcm_hw_free(struct snd_pcm_substream *substream)
                if (ice->pcm_reserved[i] == substream)
                        ice->pcm_reserved[i] = NULL;
        mutex_unlock(&ice->open_mutex);
 -      return snd_pcm_lib_free_pages(substream);
 +      return 0;
  }
  
  static int snd_vt1724_playback_pro_prepare(struct snd_pcm_substream *substream)
@@@ -1096,6 -1103,7 +1099,6 @@@ static int snd_vt1724_capture_pro_close
  static const struct snd_pcm_ops snd_vt1724_playback_pro_ops = {
        .open =         snd_vt1724_playback_pro_open,
        .close =        snd_vt1724_playback_pro_close,
 -      .ioctl =        snd_pcm_lib_ioctl,
        .hw_params =    snd_vt1724_pcm_hw_params,
        .hw_free =      snd_vt1724_pcm_hw_free,
        .prepare =      snd_vt1724_playback_pro_prepare,
  static const struct snd_pcm_ops snd_vt1724_capture_pro_ops = {
        .open =         snd_vt1724_capture_pro_open,
        .close =        snd_vt1724_capture_pro_close,
 -      .ioctl =        snd_pcm_lib_ioctl,
        .hw_params =    snd_vt1724_pcm_hw_params,
        .hw_free =      snd_vt1724_pcm_hw_free,
        .prepare =      snd_vt1724_pcm_prepare,
@@@ -1136,8 -1145,9 +1139,8 @@@ static int snd_vt1724_pcm_profi(struct 
        pcm->info_flags = 0;
        strcpy(pcm->name, "ICE1724");
  
 -      snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
 -                                            &ice->pci->dev,
 -                                            256*1024, 256*1024);
 +      snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
 +                                     &ice->pci->dev, 256*1024, 256*1024);
  
        ice->pcm_pro = pcm;
  
@@@ -1272,6 -1282,7 +1275,6 @@@ static int snd_vt1724_capture_spdif_clo
  static const struct snd_pcm_ops snd_vt1724_playback_spdif_ops = {
        .open =         snd_vt1724_playback_spdif_open,
        .close =        snd_vt1724_playback_spdif_close,
 -      .ioctl =        snd_pcm_lib_ioctl,
        .hw_params =    snd_vt1724_pcm_hw_params,
        .hw_free =      snd_vt1724_pcm_hw_free,
        .prepare =      snd_vt1724_playback_spdif_prepare,
  static const struct snd_pcm_ops snd_vt1724_capture_spdif_ops = {
        .open =         snd_vt1724_capture_spdif_open,
        .close =        snd_vt1724_capture_spdif_close,
 -      .ioctl =        snd_pcm_lib_ioctl,
        .hw_params =    snd_vt1724_pcm_hw_params,
        .hw_free =      snd_vt1724_pcm_hw_free,
        .prepare =      snd_vt1724_pcm_prepare,
@@@ -1331,8 -1343,9 +1334,8 @@@ static int snd_vt1724_pcm_spdif(struct 
        pcm->info_flags = 0;
        strcpy(pcm->name, name);
  
 -      snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
 -                                            &ice->pci->dev,
 -                                            256*1024, 256*1024);
 +      snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
 +                                     &ice->pci->dev, 256*1024, 256*1024);
  
        ice->pcm = pcm;
  
@@@ -1414,6 -1427,7 +1417,6 @@@ static int snd_vt1724_playback_indep_cl
  static const struct snd_pcm_ops snd_vt1724_playback_indep_ops = {
        .open =         snd_vt1724_playback_indep_open,
        .close =        snd_vt1724_playback_indep_close,
 -      .ioctl =        snd_pcm_lib_ioctl,
        .hw_params =    snd_vt1724_pcm_hw_params,
        .hw_free =      snd_vt1724_pcm_hw_free,
        .prepare =      snd_vt1724_playback_indep_prepare,
@@@ -1443,8 -1457,9 +1446,8 @@@ static int snd_vt1724_pcm_indep(struct 
        pcm->info_flags = 0;
        strcpy(pcm->name, "ICE1724 Surround PCM");
  
 -      snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
 -                                            &ice->pci->dev,
 -                                            256*1024, 256*1024);
 +      snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
 +                                     &ice->pci->dev, 256*1024, 256*1024);
  
        ice->pcm_ds = pcm;
  
@@@ -1463,7 -1478,7 +1466,7 @@@ static int snd_vt1724_ac97_mixer(struc
        if (!(ice->eeprom.data[ICE_EEP2_ACLINK] & VT1724_CFG_PRO_I2S)) {
                struct snd_ac97_bus *pbus;
                struct snd_ac97_template ac97;
 -              static struct snd_ac97_bus_ops ops = {
 +              static const struct snd_ac97_bus_ops ops = {
                        .write = snd_vt1724_ac97_write,
                        .read = snd_vt1724_ac97_read,
                };
@@@ -2170,13 -2185,13 +2173,13 @@@ static const struct snd_kcontrol_new sn
   *
   */
  
 -static struct snd_ice1712_card_info no_matched;
 +static const struct snd_ice1712_card_info no_matched;
  
  
  /*
    ooAoo cards with no controls
  */
 -static unsigned char ooaoo_sq210_eeprom[] = {
 +static const unsigned char ooaoo_sq210_eeprom[] = {
        [ICE_EEP2_SYSCONF]     = 0x4c,  /* 49MHz crystal, no mpu401, no ADC,
                                           1xDACs */
        [ICE_EEP2_ACLINK]      = 0x80,  /* I2S */
  };
  
  
 -static struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = {
 +static const struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = {
        {
                .name = "ooAoo SQ210a",
                .model = "sq210a",
        { } /* terminator */
  };
  
 -static struct snd_ice1712_card_info *card_tables[] = {
 +static const struct snd_ice1712_card_info *card_tables[] = {
        snd_vt1724_revo_cards,
        snd_vt1724_amp_cards,
        snd_vt1724_aureon_cards,
@@@ -2276,7 -2291,7 +2279,7 @@@ static int snd_vt1724_read_eeprom(struc
  {
        const int dev = 0xa0;           /* EEPROM device address */
        unsigned int i, size;
 -      struct snd_ice1712_card_info * const *tbl, *c;
 +      const struct snd_ice1712_card_info * const *tbl, *c;
  
        if (!modelname || !*modelname) {
                ice->eeprom.subvendor = 0;
@@@ -2502,7 -2517,7 +2505,7 @@@ static int snd_vt1724_create(struct snd
  {
        struct snd_ice1712 *ice;
        int err;
 -      static struct snd_device_ops ops = {
 +      static const struct snd_device_ops ops = {
                .dev_free =     snd_vt1724_dev_free,
        };
  
        ice->irq = -1;
        pci_set_master(pci);
        snd_vt1724_proc_init(ice);
 -      synchronize_irq(pci->irq);
  
        card->private_data = ice;
  
        }
  
        ice->irq = pci->irq;
 +      card->sync_irq = ice->irq;
  
        snd_vt1724_chip_reset(ice);
        if (snd_vt1724_read_eeprom(ice, modelname) < 0) {
@@@ -2590,7 -2605,7 +2593,7 @@@ static int snd_vt1724_probe(struct pci_
        struct snd_card *card;
        struct snd_ice1712 *ice;
        int pcm_dev = 0, err;
 -      struct snd_ice1712_card_info * const *tbl, *c;
 +      const struct snd_ice1712_card_info * const *tbl, *c;
  
        if (dev >= SNDRV_CARDS)
                return -ENODEV;
diff --combined sound/usb/pcm.c
@@@ -260,31 -260,18 +260,31 @@@ static int start_endpoints(struct snd_u
        return 0;
  }
  
 -static void stop_endpoints(struct snd_usb_substream *subs, bool wait)
 +static void sync_pending_stops(struct snd_usb_substream *subs)
 +{
 +      snd_usb_endpoint_sync_pending_stop(subs->sync_endpoint);
 +      snd_usb_endpoint_sync_pending_stop(subs->data_endpoint);
 +}
 +
 +static void stop_endpoints(struct snd_usb_substream *subs)
  {
        if (test_and_clear_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags))
                snd_usb_endpoint_stop(subs->sync_endpoint);
  
        if (test_and_clear_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags))
                snd_usb_endpoint_stop(subs->data_endpoint);
 +}
  
 -      if (wait) {
 -              snd_usb_endpoint_sync_pending_stop(subs->sync_endpoint);
 -              snd_usb_endpoint_sync_pending_stop(subs->data_endpoint);
 +/* PCM sync_stop callback */
 +static int snd_usb_pcm_sync_stop(struct snd_pcm_substream *substream)
 +{
 +      struct snd_usb_substream *subs = substream->runtime->private_data;
 +
 +      if (!snd_usb_lock_shutdown(subs->stream->chip)) {
 +              sync_pending_stops(subs);
 +              snd_usb_unlock_shutdown(subs->stream->chip);
        }
 +      return 0;
  }
  
  static int search_roland_implicit_fb(struct usb_device *dev, int ifnum,
@@@ -519,9 -506,9 +519,9 @@@ static int set_format(struct snd_usb_su
        if (WARN_ON(!iface))
                return -EINVAL;
        alts = usb_altnum_to_altsetting(iface, fmt->altsetting);
-       altsd = get_iface_desc(alts);
-       if (WARN_ON(altsd->bAlternateSetting != fmt->altsetting))
+       if (WARN_ON(!alts))
                return -EINVAL;
+       altsd = get_iface_desc(alts);
  
        if (fmt == subs->cur_audiofmt && !subs->need_setup_fmt)
                return 0;
@@@ -713,8 -700,7 +713,8 @@@ static int configure_endpoint(struct sn
        int ret;
  
        /* format changed */
 -      stop_endpoints(subs, true);
 +      stop_endpoints(subs);
 +      sync_pending_stops(subs);
        ret = snd_usb_endpoint_set_params(subs->data_endpoint,
                                          subs->pcm_format,
                                          subs->channels,
@@@ -802,6 -788,11 +802,6 @@@ static int snd_usb_hw_params(struct snd
        if (ret)
                return ret;
  
 -      ret = snd_pcm_lib_malloc_pages(substream,
 -                                     params_buffer_bytes(hw_params));
 -      if (ret < 0)
 -              goto stop_pipeline;
 -
        subs->pcm_format = params_format(hw_params);
        subs->period_bytes = params_period_bytes(hw_params);
        subs->period_frames = params_period_size(hw_params);
@@@ -859,14 -850,13 +859,14 @@@ static int snd_usb_hw_free(struct snd_p
        subs->cur_rate = 0;
        subs->period_bytes = 0;
        if (!snd_usb_lock_shutdown(subs->stream->chip)) {
 -              stop_endpoints(subs, true);
 +              stop_endpoints(subs);
 +              sync_pending_stops(subs);
                snd_usb_endpoint_deactivate(subs->sync_endpoint);
                snd_usb_endpoint_deactivate(subs->data_endpoint);
                snd_usb_unlock_shutdown(subs->stream->chip);
        }
  
 -      return snd_pcm_lib_free_pages(substream);
 +      return 0;
  }
  
  /*
@@@ -895,6 -885,9 +895,6 @@@ static int snd_usb_pcm_prepare(struct s
                goto unlock;
        }
  
 -      snd_usb_endpoint_sync_pending_stop(subs->sync_endpoint);
 -      snd_usb_endpoint_sync_pending_stop(subs->data_endpoint);
 -
        ret = snd_usb_pcm_change_state(subs, UAC3_PD_STATE_D0);
        if (ret < 0)
                goto unlock;
@@@ -1352,6 -1345,7 +1352,6 @@@ static int snd_usb_pcm_close(struct snd
        struct snd_usb_substream *subs = &as->substream[direction];
        int ret;
  
 -      stop_endpoints(subs, true);
        snd_media_stop_pipeline(subs);
  
        if (!as->chip->keep_iface &&
@@@ -1728,7 -1722,7 +1728,7 @@@ static int snd_usb_substream_playback_t
                subs->running = 1;
                return 0;
        case SNDRV_PCM_TRIGGER_STOP:
 -              stop_endpoints(subs, false);
 +              stop_endpoints(subs);
                subs->running = 0;
                return 0;
        case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
                return 0;
        case SNDRV_PCM_TRIGGER_SUSPEND:
                if (subs->stream->chip->setup_fmt_after_resume_quirk) {
 -                      stop_endpoints(subs, true);
 +                      stop_endpoints(subs);
                        subs->need_setup_fmt = true;
                        return 0;
                }
@@@ -1765,7 -1759,7 +1765,7 @@@ static int snd_usb_substream_capture_tr
                subs->running = 1;
                return 0;
        case SNDRV_PCM_TRIGGER_STOP:
 -              stop_endpoints(subs, false);
 +              stop_endpoints(subs);
                subs->running = 0;
                return 0;
        case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
                return 0;
        case SNDRV_PCM_TRIGGER_SUSPEND:
                if (subs->stream->chip->setup_fmt_after_resume_quirk) {
 -                      stop_endpoints(subs, true);
 +                      stop_endpoints(subs);
                        subs->need_setup_fmt = true;
                        return 0;
                }
  static const struct snd_pcm_ops snd_usb_playback_ops = {
        .open =         snd_usb_pcm_open,
        .close =        snd_usb_pcm_close,
 -      .ioctl =        snd_pcm_lib_ioctl,
        .hw_params =    snd_usb_hw_params,
        .hw_free =      snd_usb_hw_free,
        .prepare =      snd_usb_pcm_prepare,
        .trigger =      snd_usb_substream_playback_trigger,
 +      .sync_stop =    snd_usb_pcm_sync_stop,
        .pointer =      snd_usb_pcm_pointer,
  };
  
  static const struct snd_pcm_ops snd_usb_capture_ops = {
        .open =         snd_usb_pcm_open,
        .close =        snd_usb_pcm_close,
 -      .ioctl =        snd_pcm_lib_ioctl,
        .hw_params =    snd_usb_hw_params,
        .hw_free =      snd_usb_hw_free,
        .prepare =      snd_usb_pcm_prepare,
        .trigger =      snd_usb_substream_capture_trigger,
 +      .sync_stop =    snd_usb_pcm_sync_stop,
        .pointer =      snd_usb_pcm_pointer,
  };
  
@@@ -1826,9 -1820,9 +1826,9 @@@ void snd_usb_preallocate_buffer(struct 
        struct device *dev = subs->dev->bus->controller;
  
        if (snd_usb_use_vmalloc)
 -              snd_pcm_lib_preallocate_pages(s, SNDRV_DMA_TYPE_VMALLOC,
 -                                            NULL, 0, 0);
 +              snd_pcm_set_managed_buffer(s, SNDRV_DMA_TYPE_VMALLOC,
 +                                         NULL, 0, 0);
        else
 -              snd_pcm_lib_preallocate_pages(s, SNDRV_DMA_TYPE_DEV_SG,
 -                                            dev, 64*1024, 512*1024);
 +              snd_pcm_set_managed_buffer(s, SNDRV_DMA_TYPE_DEV_SG,
 +                                         dev, 64*1024, 512*1024);
  }