ASoC: pxa-ssp: atomically set stream active masks

PXA's SSP engine fails to take its current channel phase into account
when enabling a stream while the engine is already running. This
results in randomly swapped left/right channels on either the record
or the playback side, depending on which one was enabled first.

The following patch fixes this by factoring out the bit field
modifications in question to a separate function that pauses the
engine temporarily, modifies the bits and kicks it off again
afterwards. Appearantly, a transition of SSCR0_SSE syncs both
directions properly.

The patch has been rolled out to quite a number of devices over the
last weeks and seems to fix the issue reliably.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-and-tested-by: Sven Neumann <s.neumann@raumfeld.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
ASoC: wm_hubs: Don't actively manage LINEOUT_VMID_BUF

It can just be enabled all the time with no impact.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: wm8994: Add missing break in resume

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: wm8994: Provide VMID mode control and fix default sequence

The optimal management of VMID depends on a number of factors which vary
dynamically at runtime, for example the connection to a system docking
station. In some circumstances it is desirable to keep VMID enabled all
the time, in others it is desirable to aggressively power it up and down.

Provide a callback allowing machine driver to configure either the normal
power up/down mode (WM8994_VMID_MODE_NORMAL) or to maintain VMID even
when idle (WM8994_VMID_MODE_FORCE). This callback, wm8994_vmid_mode(),
should be called with the CODEC lock.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Merge tag 'asoc-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

Last minute ASoC updates for 3.4

There's a couple of small features here that were added late on but have
been in -next in my tree and some bug fixes.  The wm_hubs stuff is
actually bug fixes - the stuff that's currently in 3.4 is a half way
house between the two solutions that the latest change allows the
machine to select between.
ALSA: hda/realtek - Fix ADC assignment with a shared HP/Mic pin

The recent Realtek driver tries to assign an extra input via the
headphone plug when only a single input source is found.  The code
worked on Samsung Q1, but it broke ASUS 1015 where the mic is a
digital-mic and only a specific ADC works.

This patch fixes the assignment of ADC in the shared mic/hp case.
Instead of assuming the single ADC at first, reduce the ADCs after
trying to assign both mic and HP pins.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42973

Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: asihpi - fix return type of hpios_locked_mem_alloc()

This function returns zero or -ENOMEM, but because it's type is u16, the
-ENOMEM gets changed to 65524.  None of the callers care, but lets fix
it anyway as a cleanup.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>