ALSA: usb-audio: Fix the first PCM interface assignment

In the new PCM streaming logic, the interface number is assigned to
usb stream instance (subs->interface) after the format and rate setups
are succeeded, but some codes are still passing subs->interface as the
reference to helper functions.  This leads to initializing with an
invalid iface number (-1).

This patch replaces the wrong references with the ones from the target
fmt correctly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'fix/misc'
ALSA: snd-usb: move calls to usb_set_interface

The rework of the snd-usb endpoint logic moved the calls to
snd_usb_set_interface() into the snd_usb_endpoint implemenation. This
changed the order in which these calls are issued to the device, and
thereby caused regressions for some webcams.

Fix this by moving the calls back to pcm.c for now to make it work again
and use snd_usb_endpoint_activate() to really tear down all remaining
URBs in the flight, consequently fixing another regression caused by USB
packets on the wire after altsetting 0 has been selected.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-and-tested-by: Philipp Dreimann <philipp@dreimann.net>
Reported-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-linus'
ALSA: tlv: compute TLV_*_ITEM lengths automatically

Add helper macros with a little bit of preprocessor magic to
automatically compute the length of a TLV item.  This lets us avoid
having to compute this by hand, and will allow to use items that do
not use a fixed length.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: tlv: add DECLARE_TLV_CONTAINER()

Add the DECLARE_TLV_CONTAINER() macro to allow having static
TLVs containing more than one item.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: tlv: add DECLARE_TLV_DB_RANGE()

Add a DECLARE_TLV_DB_RANGE() macro so that dB range information
can be specified without having to count the items manually for
TLV_DB_RANGE_HEAD().

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: es1938: replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE

Instead of the hard-to-mantain TLV_DB_RANGE_HEAD macro, use
DECLARE_TLV_DB_RANGE, which computes its size automatically.

(Also make this data const on the way.)

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'topic/misc'
ALSA: wss_lib: fix suspend/resume

By setting SNDRV_PCM_INFO_RESUME, wss_lib claims that it can restore the card
state fully on resume. But in fact, it can't as DMA is not restored so any
playback/capture running during suspend will fail to continue after resume.

Remove SNDRV_PCM_INFO_RESUME flag from pcm info field to fix the problem.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: wss_lib: Fix resume on Yamaha OPL3-SAx

Yamaha OPL3-SAx chips don't resume properly when playback is running -
garbage is played after resume. Restoring the CS4231_PLAYBK_FORMAT register
last fixes the problem.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'topic/misc'
ALSA: hda - Add DeviceID for Haswell HDA

this patch add proper id for Haswell HDA Controller.

[Added AZX_DCAPS_POSFIX_COMBO flag by tiwai]

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - add Haswell HDMI codec id

0x80862807 is HDMI id for Haswell HDA.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'topic/hda'
ALSA: hda - Fix driver type of Haswell controller to AZX_DRIVER_SCH

According to Xingchao,
  This works for HDMI audio, otherwise there's blocking issue.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'topic/hda'
ALSA: hda - Add new GPU codec ID to snd-hda

Vendor ID 0x10de0051 is used by a yet-to-be-named GPU chip.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Acked-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Daniel Dadap <ddadap@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'topic/hda'