ALSA: hda - Make clear built-in driver optimization

Use unsigned int to make clear that the codes required only for
modules will be reduced by the compiler optimization.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Avoid unnecessary parameter read for EPSS

EPSS parameter should be static, so we can read it once and remember.
This also allows more easily to override the wrong EPSS capability
reported from a codec by changing the flag in the codec
initialization step.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Don't trust codec EPSS bit for IDT 92HD83xx & co

These codecs seem reporting EPSS but require longer delay for the
proper D3 transition.  For example, D3_STOP_CLOCK_OK bit won't be set
correctly even after D3.

In this patch, codec->epss flag is overridden for avoid the
misbehavior.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-linus' into for-next

Need to merge the fixes regarding EPSS.

Conflicts:
	sound/pci/hda/hda_codec.c
Merge branch 'for-next'
ALSA: emu8000: fix emu8000 DRAM sized 512 KiB too small

v2:  Fixed result still wrong in the case of 512 KiB DRAM.  Oops.

Applicable to 3.5.3 mainline.

In emu8000.c, size_dram determines the amount of memory on the sound card by
doing write/readback tests starting at 512 KiB and incrementing by 512 KiB.
On success, detected_size is updated to the successful address and testing
continues.  On failure, the loop is immediately exited.  The resulting
detected_size is 512 KiB too small except in two special cases:

1. If there is no memory, the initial 0 value of detected_size is used, which
   is correct.
2. If the address space wraps around, detected_size is updated before the
   bailout, so the result is correct.

The patch corrects all cases and was tested with an AWE64 Gold.  Before:
  EMU8000 [0x620]: 3584 Kb on-board memory detected
  asfxload 4GMGSMT.SF2 (4174814 B) fails.
After:
  EMU8000 [0x620]: 4096 Kb on-board memory detected
  asfxload 4GMGSMT.SF2 succeeds.

I do not have a card with 512 KiB to test with, but by forcibly enabling the
added conditional I verified on the AWE64 Gold that it detects 512 KiB
(successfully reading from the first memory location) and does not hang the
card.

C.f. Bug 46451 https://bugzilla.kernel.org/show_bug.cgi?id=46451

Signed-off-by: David Flater <dave@flaterco.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-next'
ALSA: usb-audio: Remove obsoleted fields in struct snd_usb_substream

The two entries are duplicated in struct snd_usb_endpoint.
Seems forgotten in the last clean-up.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-next'
ALSA: snd-usb: Fix URB cancellation at stream start

Commit e9ba389c5 ("ALSA: usb-audio: Fix scheduling-while-atomic bug in
PCM capture stream") fixed a scheduling-while-atomic bug that happened
when snd_usb_endpoint_start was called from the trigger callback, which
is an atmic context. However, the patch breaks the idea of the endpoints
reference counting, which is the reason why the driver has been
refactored lately.

Revert that commit and let snd_usb_endpoint_start() take care of the URB
cancellation again. As this function is called from both atomic and
non-atomic context, add a flag to denote whether the function may sleep.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: stable@kernel.org [3.5+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-linus'