ALSA: hda/realtek - Add missing CD-input pin for MSI-7350 mobo

Reported-by: Philipp Matthias Hahn <pmhahn@pmhahn.de>
Cc: <stable@kernel.org> [v3.3+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hdsp - Provide ioctl_compat

snd_hdsp uses its own ioctls to acquire config- and status information.
Expose the corresponding ioctl handler via ioctl_compat, so that 32bit applications can use it on 64bit kernels.

Signed-off-by: Andre Schramm <andre.schramm@iosono-sound.com>
Reviewed-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'fix/misc'
ALSA: hdsp - Provide ioctl_compat

snd_hdsp uses its own ioctls to acquire config- and status information.
Expose the corresponding ioctl handler via ioctl_compat, so that 32bit applications can use it on 64bit kernels.

Signed-off-by: Andre Schramm <andre.schramm@iosono-sound.com>
Reviewed-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda/realtek - Call alc_auto_parse_customize_define() always after fixup

The call for alc_auto_parse_customize_define() must be done after the
fixup pre-probe initialization.  Otherwise SKU_IGNORE fixup won't work
properly (e.g. HP RP5800 with ALC662 codec).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'fix/hda'
Revert "ALSA: hda - Set codec to D3 forcibly even if not used"

This reverts commit 785f857d1cb0856b612b46a0545b74aa2596e44a.

The commit causes a problem with the wrong D3 state after suspend
because the call of hda_set_power_state() involves with the power-up
sequence, which changes the power_count, and this confuses the resume
sequence that checks the power_count as well.

Originally, this go-to-D3 sequence should be a simple task without the
power-up sequence.  But, it'd need some proper sanity checks in the
case of power-saved state, so it's not too easy to write now in the
3.4-rc cycle.

In short, the safest option now is to revert this affecting commit.

Of course, we need to clean up and robustify the power-saving code
better for 3.5 kernel.

Reported-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'fix/hda'
Merge branch 'fix/hda' into topic/hda
ALSA: hda/realtek - Call a common helper for alc_spec initialization

Just a clean up by calling the same helper function.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix possible access to uninitialized work struct

The work struct must be initialized before the possible call in the
destructor.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: Fix the card number limit of OSS-emulation

There are left-over codes from the ancient days with the static device
number limitation of 8.  Actaully OSS can support up to 16 cards.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound: allow the unit search until 256 in sound_core.c

The upper limit of the available minors isn't necessarily 128 + unit,
but it's rather up to 256.  Fixing this allows more than 8 devices.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'topic/misc'
ALSA: hda - Always resume the codec immediately

This is a fix for the problem in commit 785f857d1c, the pop noise
issue on some machines with ALC269.  The problem was the uninitialized
state after the resume due to the delayed resume of the codec chips.
In that commit, we tried to fix by forcibly putting the codec to D3 at
suspend.  But, this still also leaves the uninitialized state after
resume, and it _might_ be still problematic with some BIOS.  Since the
commit turned out to regress another issues, we reverted it in the
end.

Now, in this fix, try to fix by turning on the codec immediately at
the resume path.  We need to take care of the power-saving in this
case.  When the device is woken up at the power-saved state, it should
go power-saving again after the resume.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Clear the power-saving states properly at reset

Some power-saving states have been left unchanged in
snd_hda_codec_reset(), and this is a potential danger because the
function may be called in various situations including the continuous
operation after that call.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Protect the power-saving count with spinlock

To avoid some races.  Still not perfect, but now a bit safer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Move up the fixup helper functions to the library module

Move the fixup helper functions in patch_realtek.c to hda_auto_parser.c
so that they can be used in other codec drivers like patch_conexant.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Move BIOS pin-parser code to hda_auto_parser.c

Just code shuffles.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'topic/hda'