--- /dev/null
+From e08b34e86dfdb72a62196ce0f03d33f48958d8b9 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 24 Apr 2013 07:55:20 +0200
+Subject: ALSA: emu10k1: Fix dock firmware loading
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit e08b34e86dfdb72a62196ce0f03d33f48958d8b9 upstream.
+
+The commit [b209c4df: ALSA: emu10k1: cache emu1010 firmware] broke the
+firmware loading of the dock, just (mistakenly) ignoring a different
+firmware for docks on some models. This patch revives them again.
+
+Bugzilla: https://bugs.archlinux.org/task/34865
+Reported-and-tested-by: Tobias Powalowski <tobias.powalowski@googlemail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/sound/emu10k1.h | 1 +
+ sound/pci/emu10k1/emu10k1_main.c | 39 +++++++++++++++++++++++++++++++++------
+ 2 files changed, 34 insertions(+), 6 deletions(-)
+
+--- a/include/sound/emu10k1.h
++++ b/include/sound/emu10k1.h
+@@ -1787,6 +1787,7 @@ struct snd_emu10k1 {
+ unsigned int next_free_voice;
+
+ const struct firmware *firmware;
++ const struct firmware *dock_fw;
+
+ #ifdef CONFIG_PM_SLEEP
+ unsigned int *saved_ptr;
+--- a/sound/pci/emu10k1/emu10k1_main.c
++++ b/sound/pci/emu10k1/emu10k1_main.c
+@@ -657,14 +657,14 @@ static int snd_emu10k1_cardbus_init(stru
+ return 0;
+ }
+
+-static int snd_emu1010_load_firmware(struct snd_emu10k1 *emu)
++static int snd_emu1010_load_firmware(struct snd_emu10k1 *emu,
++ const struct firmware *fw_entry)
+ {
+ int n, i;
+ int reg;
+ int value;
+ unsigned int write_post;
+ unsigned long flags;
+- const struct firmware *fw_entry = emu->firmware;
+
+ if (!fw_entry)
+ return -EIO;
+@@ -725,9 +725,34 @@ static int emu1010_firmware_thread(void
+ /* Return to Audio Dock programming mode */
+ snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n");
+ snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK);
+- err = snd_emu1010_load_firmware(emu);
+- if (err != 0)
+- continue;
++
++ if (!emu->dock_fw) {
++ const char *filename = NULL;
++ switch (emu->card_capabilities->emu_model) {
++ case EMU_MODEL_EMU1010:
++ filename = DOCK_FILENAME;
++ break;
++ case EMU_MODEL_EMU1010B:
++ filename = MICRO_DOCK_FILENAME;
++ break;
++ case EMU_MODEL_EMU1616:
++ filename = MICRO_DOCK_FILENAME;
++ break;
++ }
++ if (filename) {
++ err = request_firmware(&emu->dock_fw,
++ filename,
++ &emu->pci->dev);
++ if (err)
++ continue;
++ }
++ }
++
++ if (emu->dock_fw) {
++ err = snd_emu1010_load_firmware(emu, emu->dock_fw);
++ if (err)
++ continue;
++ }
+
+ snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0);
+ snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, ®);
+@@ -862,7 +887,7 @@ static int snd_emu10k1_emu1010_init(stru
+ filename, emu->firmware->size);
+ }
+
+- err = snd_emu1010_load_firmware(emu);
++ err = snd_emu1010_load_firmware(emu, emu->firmware);
+ if (err != 0) {
+ snd_printk(KERN_INFO "emu1010: Loading Firmware failed\n");
+ return err;
+@@ -1253,6 +1278,8 @@ static int snd_emu10k1_free(struct snd_e
+ kthread_stop(emu->emu1010.firmware_thread);
+ if (emu->firmware)
+ release_firmware(emu->firmware);
++ if (emu->dock_fw)
++ release_firmware(emu->dock_fw);
+ if (emu->irq >= 0)
+ free_irq(emu->irq, emu);
+ /* remove reserved page */
--- /dev/null
+From 7fc7d047216aa4923d401c637be2ebc6e3d5bd9b Mon Sep 17 00:00:00 2001
+From: Kailang Yang <kailang@realtek.com>
+Date: Thu, 25 Apr 2013 11:04:43 +0200
+Subject: ALSA: hda - Add the support for ALC286 codec
+
+From: Kailang Yang <kailang@realtek.com>
+
+commit 7fc7d047216aa4923d401c637be2ebc6e3d5bd9b upstream.
+
+It's yet another ALC269-variant.
+
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -2515,6 +2515,7 @@ enum {
+ ALC269_TYPE_ALC280,
+ ALC269_TYPE_ALC282,
+ ALC269_TYPE_ALC284,
++ ALC269_TYPE_ALC286,
+ };
+
+ /*
+@@ -2538,6 +2539,7 @@ static int alc269_parse_auto_config(stru
+ case ALC269_TYPE_ALC269VB:
+ case ALC269_TYPE_ALC269VD:
+ case ALC269_TYPE_ALC282:
++ case ALC269_TYPE_ALC286:
+ ssids = alc269_ssids;
+ break;
+ default:
+@@ -3172,6 +3174,9 @@ static int patch_alc269(struct hda_codec
+ case 0x10ec0292:
+ spec->codec_variant = ALC269_TYPE_ALC284;
+ break;
++ case 0x10ec0286:
++ spec->codec_variant = ALC269_TYPE_ALC286;
++ break;
+ }
+
+ /* automatic parse from the BIOS config */
+@@ -3878,6 +3883,7 @@ static const struct hda_codec_preset snd
+ { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 },
+ { .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 },
+ { .id = 0x10ec0284, .name = "ALC284", .patch = patch_alc269 },
++ { .id = 0x10ec0286, .name = "ALC286", .patch = patch_alc269 },
+ { .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 },
+ { .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 },
+ { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
--- /dev/null
+From 65033cc8d5ffd9b754e04da4be9cd1e8b61eeaff Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 16 Apr 2013 12:31:05 +0200
+Subject: ALSA: hda - Fix aamix activation with loopback control on VIA codecs
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 65033cc8d5ffd9b754e04da4be9cd1e8b61eeaff upstream.
+
+When we have a loopback mixer control, this should manage the state
+whether the output paths include the aamix or not. But the current
+code blindly initializes the output paths with aamix = true, thus the
+aamix is enabled unless the loopback mixer control is changed.
+
+Also, update_aamix_paths() called by the loopback mixer control put
+callback invokes snd_hda_activate_path() with aamix = true even for
+disabling the mixing. This leaves the aamix path even though the
+loopback control is turned off.
+
+This patch fixes these issues:
+- Introduced aamix_default() helper to indicate whether with_aamix is
+ true or false as default
+- Fix the argument in update_aamix_paths() for disabling loopback
+
+Reported-by: Lydia Wang <LydiaWang@viatech.com.cn>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/hda_generic.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/sound/pci/hda/hda_generic.c
++++ b/sound/pci/hda/hda_generic.c
+@@ -2072,6 +2072,14 @@ get_multiio_path(struct hda_codec *codec
+
+ static void update_automute_all(struct hda_codec *codec);
+
++/* Default value to be passed as aamix argument for snd_hda_activate_path();
++ * used for output paths
++ */
++static bool aamix_default(struct hda_gen_spec *spec)
++{
++ return !spec->have_aamix_ctl || spec->aamix_mode;
++}
++
+ static int set_multi_io(struct hda_codec *codec, int idx, bool output)
+ {
+ struct hda_gen_spec *spec = codec->spec;
+@@ -2087,11 +2095,11 @@ static int set_multi_io(struct hda_codec
+
+ if (output) {
+ set_pin_target(codec, nid, PIN_OUT, true);
+- snd_hda_activate_path(codec, path, true, true);
++ snd_hda_activate_path(codec, path, true, aamix_default(spec));
+ set_pin_eapd(codec, nid, true);
+ } else {
+ set_pin_eapd(codec, nid, false);
+- snd_hda_activate_path(codec, path, false, true);
++ snd_hda_activate_path(codec, path, false, aamix_default(spec));
+ set_pin_target(codec, nid, spec->multi_io[idx].ctl_in, true);
+ path_power_down_sync(codec, path);
+ }
+@@ -2182,8 +2190,8 @@ static void update_aamix_paths(struct hd
+ snd_hda_activate_path(codec, mix_path, true, true);
+ path_power_down_sync(codec, nomix_path);
+ } else {
+- snd_hda_activate_path(codec, mix_path, false, true);
+- snd_hda_activate_path(codec, nomix_path, true, true);
++ snd_hda_activate_path(codec, mix_path, false, false);
++ snd_hda_activate_path(codec, nomix_path, true, false);
+ path_power_down_sync(codec, mix_path);
+ }
+ }
+@@ -4729,7 +4737,8 @@ static void set_output_and_unmute(struct
+ return;
+ pin = path->path[path->depth - 1];
+ restore_pin_ctl(codec, pin);
+- snd_hda_activate_path(codec, path, path->active, true);
++ snd_hda_activate_path(codec, path, path->active,
++ aamix_default(codec->spec));
+ set_pin_eapd(codec, pin, path->active);
+ }
+
+@@ -4779,7 +4788,8 @@ static void init_multi_io(struct hda_cod
+ if (!spec->multi_io[i].ctl_in)
+ spec->multi_io[i].ctl_in =
+ snd_hda_codec_get_pin_target(codec, pin);
+- snd_hda_activate_path(codec, path, path->active, true);
++ snd_hda_activate_path(codec, path, path->active,
++ aamix_default(spec));
+ }
+ }
+
--- /dev/null
+From ebfc594c02148b6a85c2f178cf167a44a3c3ce10 Mon Sep 17 00:00:00 2001
+From: Daniel Mack <zonque@gmail.com>
+Date: Wed, 24 Apr 2013 19:38:42 +0200
+Subject: ALSA: snd-usb: try harder to find USB_DT_CS_ENDPOINT
+
+From: Daniel Mack <zonque@gmail.com>
+
+commit ebfc594c02148b6a85c2f178cf167a44a3c3ce10 upstream.
+
+The USB_DT_CS_ENDPOINT class-specific endpoint descriptor is usually
+stuffed directly after the standard USB endpoint descriptor, and this is
+where the driver currently expects it to be.
+
+There are, however, devices in the wild that have it the other way
+around in their descriptor sets, so the USB_DT_CS_ENDPOINT comes
+*before* the standard enpoint. Devices known to implement it that way
+are "Sennheiser BTD-500" and Plantronics USB headsets.
+
+When the driver can't find the USB_DT_CS_ENDPOINT, it won't be able to
+change sample rates, as the bitmask for the validity of this command is
+storen in bmAttributes of that descriptor.
+
+Fix this by searching the entire interface instead of just the extra
+bytes of the first endpoint, in case the latter fails.
+
+Signed-off-by: Daniel Mack <zonque@gmail.com>
+Reported-and-tested-by: Torstein Hegge <hegge@resisty.net>
+Reported-and-tested-by: Yves G <alsa-user@vivigatt.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/stream.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/sound/usb/stream.c
++++ b/sound/usb/stream.c
+@@ -396,6 +396,14 @@ static int parse_uac_endpoint_attributes
+ if (!csep && altsd->bNumEndpoints >= 2)
+ csep = snd_usb_find_desc(alts->endpoint[1].extra, alts->endpoint[1].extralen, NULL, USB_DT_CS_ENDPOINT);
+
++ /*
++ * If we can't locate the USB_DT_CS_ENDPOINT descriptor in the extra
++ * bytes after the first endpoint, go search the entire interface.
++ * Some devices have it directly *before* the standard endpoint.
++ */
++ if (!csep)
++ csep = snd_usb_find_desc(alts->extra, alts->extralen, NULL, USB_DT_CS_ENDPOINT);
++
+ if (!csep || csep->bLength < 7 ||
+ csep->bDescriptorSubtype != UAC_EP_GENERAL) {
+ snd_printk(KERN_WARNING "%d:%u:%d : no or invalid"
--- /dev/null
+From 1539d4f82ad534431cc67935e8e442ccf107d17d Mon Sep 17 00:00:00 2001
+From: Calvin Owens <jcalvinowens@gmail.com>
+Date: Fri, 12 Apr 2013 22:33:59 -0500
+Subject: ALSA: usb: Add quirk for 192KHz recording on E-Mu devices
+
+From: Calvin Owens <jcalvinowens@gmail.com>
+
+commit 1539d4f82ad534431cc67935e8e442ccf107d17d upstream.
+
+When recording at 176.2KHz or 192Khz, the device adds a 32-bit length
+header to the capture packets, which obviously needs to be ignored for
+recording to work properly.
+
+Userspace expected: L0 L1 L2 R0 R1 R2
+...but actually got: R2 L0 L1 L2 R0 R1
+
+Also, the last byte of the length header being interpreted as L0 of
+the first sample caused spikes every 0.5ms, resulting in a loud 16KHz
+tone (about the highest 'B' on a piano) being present throughout
+captures.
+
+Tested at all sample rates on an E-Mu 0404USB, and tested for
+regressions on a generic USB headset.
+
+Signed-off-by: Calvin Owens <jcalvinowens@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/card.h | 1 +
+ sound/usb/pcm.c | 2 +-
+ sound/usb/quirks.c | 1 +
+ sound/usb/stream.c | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+--- a/sound/usb/card.h
++++ b/sound/usb/card.h
+@@ -116,6 +116,7 @@ struct snd_usb_substream {
+ unsigned int altset_idx; /* USB data format: index of alternate setting */
+ unsigned int txfr_quirk:1; /* allow sub-frame alignment */
+ unsigned int fmt_type; /* USB audio format type (1-3) */
++ unsigned int pkt_offset_adj; /* Bytes to drop from beginning of packets (for non-compliant devices) */
+
+ unsigned int running: 1; /* running status */
+
+--- a/sound/usb/pcm.c
++++ b/sound/usb/pcm.c
+@@ -1170,7 +1170,7 @@ static void retire_capture_urb(struct sn
+ stride = runtime->frame_bits >> 3;
+
+ for (i = 0; i < urb->number_of_packets; i++) {
+- cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset;
++ cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset + subs->pkt_offset_adj;
+ if (urb->iso_frame_desc[i].status && printk_ratelimit()) {
+ snd_printdd(KERN_ERR "frame %d active: %d\n", i, urb->iso_frame_desc[i].status);
+ // continue;
+--- a/sound/usb/quirks.c
++++ b/sound/usb/quirks.c
+@@ -837,6 +837,7 @@ static void set_format_emu_quirk(struct
+ break;
+ }
+ snd_emuusb_set_samplerate(subs->stream->chip, emu_samplerate_id);
++ subs->pkt_offset_adj = (emu_samplerate_id >= EMU_QUIRK_SR_176400HZ) ? 4 : 0;
+ }
+
+ void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
+--- a/sound/usb/stream.c
++++ b/sound/usb/stream.c
+@@ -94,6 +94,7 @@ static void snd_usb_init_substream(struc
+ subs->dev = as->chip->dev;
+ subs->txfr_quirk = as->chip->txfr_quirk;
+ subs->speed = snd_usb_get_speed(subs->dev);
++ subs->pkt_offset_adj = 0;
+
+ snd_usb_set_pcm_ops(as->pcm, stream);
+
--- /dev/null
+From c75c5ab575af7db707689cdbb5a5c458e9a034bb Mon Sep 17 00:00:00 2001
+From: Clemens Ladisch <clemens@ladisch.de>
+Date: Sat, 27 Apr 2013 12:10:32 +0200
+Subject: ALSA: USB: adjust for changed 3.8 USB API
+
+From: Clemens Ladisch <clemens@ladisch.de>
+
+commit c75c5ab575af7db707689cdbb5a5c458e9a034bb upstream.
+
+The recent changes in the USB API ("implement new semantics for
+URB_ISO_ASAP") made the former meaning of the URB_ISO_ASAP flag the
+default, and changed this flag to mean that URBs can be delayed.
+This is not the behaviour wanted by any of the audio drivers because
+it leads to discontinuous playback with very small period sizes.
+Therefore, our URBs need to be submitted without this flag.
+
+Reported-by: Joe Rayhawk <jrayhawk@fairlystable.org>
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/6fire/pcm.c | 1 -
+ sound/usb/caiaq/audio.c | 3 ---
+ sound/usb/endpoint.c | 5 ++---
+ sound/usb/misc/ua101.c | 3 +--
+ sound/usb/usx2y/usb_stream.c | 1 -
+ sound/usb/usx2y/usbusx2yaudio.c | 1 -
+ sound/usb/usx2y/usx2yhwdeppcm.c | 1 -
+ 7 files changed, 3 insertions(+), 12 deletions(-)
+
+--- a/sound/usb/6fire/pcm.c
++++ b/sound/usb/6fire/pcm.c
+@@ -575,7 +575,6 @@ static void usb6fire_pcm_init_urb(struct
+ urb->instance.pipe = in ? usb_rcvisocpipe(chip->dev, ep)
+ : usb_sndisocpipe(chip->dev, ep);
+ urb->instance.interval = 1;
+- urb->instance.transfer_flags = URB_ISO_ASAP;
+ urb->instance.complete = handler;
+ urb->instance.context = urb;
+ urb->instance.number_of_packets = PCM_N_PACKETS_PER_URB;
+--- a/sound/usb/caiaq/audio.c
++++ b/sound/usb/caiaq/audio.c
+@@ -670,7 +670,6 @@ static void read_completed(struct urb *u
+
+ if (send_it) {
+ out->number_of_packets = outframe;
+- out->transfer_flags = URB_ISO_ASAP;
+ usb_submit_urb(out, GFP_ATOMIC);
+ } else {
+ struct snd_usb_caiaq_cb_info *oinfo = out->context;
+@@ -686,7 +685,6 @@ requeue:
+ }
+
+ urb->number_of_packets = FRAMES_PER_URB;
+- urb->transfer_flags = URB_ISO_ASAP;
+ usb_submit_urb(urb, GFP_ATOMIC);
+ }
+
+@@ -751,7 +749,6 @@ static struct urb **alloc_urbs(struct sn
+ * BYTES_PER_FRAME;
+ urbs[i]->context = &dev->data_cb_info[i];
+ urbs[i]->interval = 1;
+- urbs[i]->transfer_flags = URB_ISO_ASAP;
+ urbs[i]->number_of_packets = FRAMES_PER_URB;
+ urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ?
+ read_completed : write_completed;
+--- a/sound/usb/endpoint.c
++++ b/sound/usb/endpoint.c
+@@ -677,7 +677,7 @@ static int data_ep_set_params(struct snd
+ if (!u->urb->transfer_buffer)
+ goto out_of_memory;
+ u->urb->pipe = ep->pipe;
+- u->urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP;
++ u->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
+ u->urb->interval = 1 << ep->datainterval;
+ u->urb->context = u;
+ u->urb->complete = snd_complete_urb;
+@@ -716,8 +716,7 @@ static int sync_ep_set_params(struct snd
+ u->urb->transfer_dma = ep->sync_dma + i * 4;
+ u->urb->transfer_buffer_length = 4;
+ u->urb->pipe = ep->pipe;
+- u->urb->transfer_flags = URB_ISO_ASAP |
+- URB_NO_TRANSFER_DMA_MAP;
++ u->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
+ u->urb->number_of_packets = 1;
+ u->urb->interval = 1 << ep->syncinterval;
+ u->urb->context = u;
+--- a/sound/usb/misc/ua101.c
++++ b/sound/usb/misc/ua101.c
+@@ -1120,8 +1120,7 @@ static int alloc_stream_urbs(struct ua10
+ usb_init_urb(&urb->urb);
+ urb->urb.dev = ua->dev;
+ urb->urb.pipe = stream->usb_pipe;
+- urb->urb.transfer_flags = URB_ISO_ASAP |
+- URB_NO_TRANSFER_DMA_MAP;
++ urb->urb.transfer_flags = URB_NO_TRANSFER_DMA_MAP;
+ urb->urb.transfer_buffer = addr;
+ urb->urb.transfer_dma = dma;
+ urb->urb.transfer_buffer_length = max_packet_size;
+--- a/sound/usb/usx2y/usb_stream.c
++++ b/sound/usb/usx2y/usb_stream.c
+@@ -69,7 +69,6 @@ static void init_pipe_urbs(struct usb_st
+ ++u, transfer += transfer_length) {
+ struct urb *urb = urbs[u];
+ struct usb_iso_packet_descriptor *desc;
+- urb->transfer_flags = URB_ISO_ASAP;
+ urb->transfer_buffer = transfer;
+ urb->dev = dev;
+ urb->pipe = pipe;
+--- a/sound/usb/usx2y/usbusx2yaudio.c
++++ b/sound/usb/usx2y/usbusx2yaudio.c
+@@ -503,7 +503,6 @@ static int usX2Y_urbs_start(struct snd_u
+ if (0 == i)
+ atomic_set(&subs->state, state_STARTING3);
+ urb->dev = usX2Y->dev;
+- urb->transfer_flags = URB_ISO_ASAP;
+ for (pack = 0; pack < nr_of_packs(); pack++) {
+ urb->iso_frame_desc[pack].offset = subs->maxpacksize * pack;
+ urb->iso_frame_desc[pack].length = subs->maxpacksize;
+--- a/sound/usb/usx2y/usx2yhwdeppcm.c
++++ b/sound/usb/usx2y/usx2yhwdeppcm.c
+@@ -443,7 +443,6 @@ static int usX2Y_usbpcm_urbs_start(struc
+ if (0 == u)
+ atomic_set(&subs->state, state_STARTING3);
+ urb->dev = usX2Y->dev;
+- urb->transfer_flags = URB_ISO_ASAP;
+ for (pack = 0; pack < nr_of_packs(); pack++) {
+ urb->iso_frame_desc[pack].offset = subs->maxpacksize * (pack + u * nr_of_packs());
+ urb->iso_frame_desc[pack].length = subs->maxpacksize;
--- /dev/null
+From cbc200bca4b51a8e2406d4b654d978f8503d430b Mon Sep 17 00:00:00 2001
+From: Clemens Ladisch <clemens@ladisch.de>
+Date: Mon, 15 Apr 2013 15:59:51 +0200
+Subject: ALSA: usb-audio: disable autopm for MIDI devices
+
+From: Clemens Ladisch <clemens@ladisch.de>
+
+commit cbc200bca4b51a8e2406d4b654d978f8503d430b upstream.
+
+Commit 88a8516a2128 (ALSA: usbaudio: implement USB autosuspend)
+introduced autopm for all USB audio/MIDI devices. However, many MIDI
+devices, such as synthesizers, do not merely transmit MIDI messages but
+use their MIDI inputs to control other functions. With autopm, these
+devices would get powered down as soon as the last MIDI port device is
+closed on the host.
+
+Even some plain MIDI interfaces could get broken: they automatically
+send Active Sensing messages while powered up, but as soon as these
+messages cease, the receiving device would interpret this as an
+accidental disconnection.
+
+Commit f5f165418cab (ALSA: usb-audio: Fix missing autopm for MIDI input)
+introduced another regression: some devices (e.g. the Roland GAIA SH-01)
+are self-powered but do a reset whenever the USB interface's power state
+changes.
+
+To work around all this, just disable autopm for all USB MIDI devices.
+
+Reported-by: Laurens Holst
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/midi.c | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
+
+--- a/sound/usb/midi.c
++++ b/sound/usb/midi.c
+@@ -126,7 +126,6 @@ struct snd_usb_midi {
+ struct snd_usb_midi_in_endpoint *in;
+ } endpoints[MIDI_MAX_ENDPOINTS];
+ unsigned long input_triggered;
+- bool autopm_reference;
+ unsigned int opened[2];
+ unsigned char disconnected;
+ unsigned char input_running;
+@@ -1040,7 +1039,6 @@ static int substream_open(struct snd_raw
+ {
+ struct snd_usb_midi* umidi = substream->rmidi->private_data;
+ struct snd_kcontrol *ctl;
+- int err;
+
+ down_read(&umidi->disc_rwsem);
+ if (umidi->disconnected) {
+@@ -1051,13 +1049,6 @@ static int substream_open(struct snd_raw
+ mutex_lock(&umidi->mutex);
+ if (open) {
+ if (!umidi->opened[0] && !umidi->opened[1]) {
+- err = usb_autopm_get_interface(umidi->iface);
+- umidi->autopm_reference = err >= 0;
+- if (err < 0 && err != -EACCES) {
+- mutex_unlock(&umidi->mutex);
+- up_read(&umidi->disc_rwsem);
+- return -EIO;
+- }
+ if (umidi->roland_load_ctl) {
+ ctl = umidi->roland_load_ctl;
+ ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE;
+@@ -1080,8 +1071,6 @@ static int substream_open(struct snd_raw
+ snd_ctl_notify(umidi->card,
+ SNDRV_CTL_EVENT_MASK_INFO, &ctl->id);
+ }
+- if (umidi->autopm_reference)
+- usb_autopm_put_interface(umidi->iface);
+ }
+ }
+ mutex_unlock(&umidi->mutex);
+@@ -2256,6 +2245,8 @@ int snd_usbmidi_create(struct snd_card *
+ return err;
+ }
+
++ usb_autopm_get_interface_no_resume(umidi->iface);
++
+ list_add_tail(&umidi->list, midi_list);
+ return 0;
+ }
--- /dev/null
+From 60af3d037eb8c670dcce31401501d1271e7c5d95 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 25 Apr 2013 07:38:15 +0200
+Subject: ALSA: usb-audio: Fix autopm error during probing
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 60af3d037eb8c670dcce31401501d1271e7c5d95 upstream.
+
+We've got strange errors in get_ctl_value() in mixer.c during
+probing, e.g. on Hercules RMX2 DJ Controller:
+
+ ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4
+ ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xa00, type = 4
+ ....
+
+It turned out that the culprit is autopm: snd_usb_autoresume() returns
+-ENODEV when called during card->probing = 1.
+
+Since the call itself during card->probing = 1 is valid, let's fix the
+return value of snd_usb_autoresume() as success.
+
+Reported-and-tested-by: Daniel Schürmann <daschuer@mixxx.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/card.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/sound/usb/card.c
++++ b/sound/usb/card.c
+@@ -627,7 +627,9 @@ int snd_usb_autoresume(struct snd_usb_au
+ int err = -ENODEV;
+
+ down_read(&chip->shutdown_rwsem);
+- if (!chip->shutdown && !chip->probing)
++ if (chip->probing)
++ err = 0;
++ else if (!chip->shutdown)
+ err = usb_autopm_get_interface(chip->pm_intf);
+ up_read(&chip->shutdown_rwsem);
+
--- /dev/null
+From 6aaa189f8712471a250bfdf8fc8d08277258b8ab Mon Sep 17 00:00:00 2001
+From: Catalin Marinas <catalin.marinas@arm.com>
+Date: Tue, 23 Apr 2013 11:21:44 +0100
+Subject: ARM: 7702/1: Set the page table freeing ceiling to TASK_SIZE
+
+From: Catalin Marinas <catalin.marinas@arm.com>
+
+commit 6aaa189f8712471a250bfdf8fc8d08277258b8ab upstream.
+
+ARM processors with LPAE enabled use 3 levels of page tables, with an
+entry in the top level (pgd) covering 1GB of virtual space. Because of
+the branch relocation limitations on ARM, the loadable modules are
+mapped 16MB below PAGE_OFFSET, making the corresponding 1GB pgd shared
+between kernel modules and user space.
+
+If free_pgtables() is called with the default ceiling 0,
+free_pgd_range() (and subsequently called functions) also frees the page
+table shared between user space and kernel modules (which is normally
+handled by the ARM-specific pgd_free() function). This patch changes
+defines the ARM USER_PGTABLES_CEILING to TASK_SIZE when CONFIG_ARM_LPAE
+is enabled.
+
+Note that the pgd_free() function already checks the presence of the
+shared pmd page allocated by pgd_alloc() and frees it, though with
+ceiling 0 this wasn't necessary.
+
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Cc: Hugh Dickins <hughd@google.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/include/asm/pgtable.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/arch/arm/include/asm/pgtable.h
++++ b/arch/arm/include/asm/pgtable.h
+@@ -70,6 +70,15 @@ extern void __pgd_error(const char *file
+ #endif
+
+ /*
++ * Use TASK_SIZE as the ceiling argument for free_pgtables() and
++ * free_pgd_range() to avoid freeing the modules pmd when LPAE is enabled (pmd
++ * page shared between user and kernel).
++ */
++#ifdef CONFIG_ARM_LPAE
++#define USER_PGTABLES_CEILING TASK_SIZE
++#endif
++
++/*
+ * The pgprot_* and protection_map entries will be fixed up in runtime
+ * to include the cachable and bufferable bits based on memory policy,
+ * as well as any architecture dependent bits like global/ASID and SMP
fs-fscache-stats.c-fix-memory-leak.patch
mm-allow-arch-code-to-control-the-user-page-table-ceiling.patch
tpm-retry-savestate-command-in-suspend-path.patch
+alsa-emu10k1-fix-dock-firmware-loading.patch
+alsa-snd-usb-try-harder-to-find-usb_dt_cs_endpoint.patch
+alsa-usb-add-quirk-for-192khz-recording-on-e-mu-devices.patch
+alsa-usb-audio-disable-autopm-for-midi-devices.patch
+alsa-usb-audio-fix-autopm-error-during-probing.patch
+alsa-usb-adjust-for-changed-3.8-usb-api.patch
+alsa-hda-fix-aamix-activation-with-loopback-control-on-via-codecs.patch
+alsa-hda-add-the-support-for-alc286-codec.patch
+arm-7702-1-set-the-page-table-freeing-ceiling-to-task_size.patch