ASoC: cq93vc: Use table based control registration

Saves a little code.

Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: cq93vc: Use core I/O functions

Support future refactoring by using the core I/O functions rather than
calling the driver provided I/O functions directly.

Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: cq93vc: Use regmap for I/O

Avoid use of the ASoC-specific register I/O functions by converting to
use the MMIO regmap provided the core MFD.

Signed-off-by: Mark Brown <broonie@linaro.org>
Merge tag 'regmap-fields' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into asoc-rcar

regmap: Add support for repeated blocks of fields

Save duplication for devices using the regmap field APIs by allowing
repeated blocks to be described once and referred to with an index.
ASoC: rsnd: remove rsnd_priv_read/write/bset()

adg.c only used rsnd_priv_read/write/bset()
which is the only user of NULL mod.
but, it can be removed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: rsnd: use regmap instead of original register mapping method

Current Linux kernel is supporting regmap/regmap_field,
and, it is good match for Renesas Sound Gen1/Gen2 register mapping.
This patch uses regmap instead of original method for register access

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: tlv320aic23: Convert to direct regmap API usage

This moves us towards being able to remove the duplicated register I/O
code in ASoC.

Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: tlv320aic26: Convert to table based control init

Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: tlv320aic26: Use snd_soc_update_bits()

Use snd_soc_update_bits() rather than open coding. Since the register cache
is currently only used where update_bits() is used this means the current
register cache can be removed entirely.

Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: tlv320aic26: Convert to direct regmap API usage

This moves us towards being able to remove the duplicated register I/O
code in ASoC.

The datasheet and the driver document the device as having a register map
divided into pages but since the paging is actually done by sending the
page address and the register address with each transaction this is no
different to having a simple register address. The datasheet does also
document the low five bits of the 16 bit "command" as unused which we could
represent as padding but it seems simpler and less confusing to things
that use block transfers or autoincrement to represent these as part of
the register address.

Signed-off-by: Mark Brown <broonie@linaro.org>
mfd: mc13xxx: Don't require lock for simple register I/O

Since the conversion to regmap there has been no need for device level
locking for I/O as regmap provides locking so remove the locks.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function

Move the workaround for double sending AUDIO_CODEC and AUDIO_DAC writes
into the SPI core, aiding refactoring to eliminate the ASoC custom I/O
functions and avoiding the extra writes for I2C.

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
ASoC: mc13783: Use regmap directly from ASoC

As part of a push to remove the register I/O functionality from ASoC (since
it is now duplicated in the regmap API) convert the mc13783 driver to use
regmap directly.

Signed-off-by: Mark Brown <broonie@linaro.org>
ALSA: Fix assignment of 0/1 to bool variables

Convert 0 to false and 1 to true when assigning values to bool
variables. Inspired by commit 3db1cd5c05f35fb43eb134df6f321de4e63141f2.

The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):

@@
bool b;
@@
(
-b = 0
+b = false
|
-b = 1
+b = true
)

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-linus' into for-next

* for-linus:
  ALSA : hda - not use assigned converters for all unused pins
  ALSA: compress: Make sure we trigger STOP before closing the stream.
ALSA: improve buffer size computations for USB PCM audio

This patch changes the way URBs are allocated and their sizes are
determined for PCM playback in the snd-usb-audio driver.  Currently
the driver allocates too few URBs for endpoints that don't use
implicit sync, making underruns more likely to occur.  This may be a
holdover from before I/O delays could be measured accurately; in any
case, it is no longer necessary.

The patch allocates as many URBs as possible, subject to four
limitations:

	The total number of URBs for the endpoint is not allowed to
	exceed MAX_URBS (which the patch increases from 8 to 12).

	The total number of packets per URB is not allowed to exceed
	MAX_PACKS (or MAX_PACKS_HS for high-speed devices), which is
	decreased from 20 to 6.

	The total duration of queued data is not allowed to exceed
	MAX_QUEUE, which is decreased from 24 ms to 18 ms.

	The total number of ALSA frames in the output queue is not
	allowed to exceed the ALSA buffer size.

The last requirement is the hardest to implement.  Currently the
number of URBs needed to fill a buffer cannot be determined in
advance, because a buffer contains a fixed number of frames whereas
the number of frames in an URB varies to match shifts in the device's
clock rate.  To solve this problem, the patch changes the logic for
deciding how many packets an URB should contain.  Rather than using as
many as possible without exceeding an ALSA period boundary, now the
driver uses only as many packets as needed to transfer a predetermined
number of frames.  As a result, unless the device's clock has an
exceedingly variable rate, the number of URBs making up each period
(and hence each buffer) will remain constant.

The overall effect of the patch is that playback works better in
low-latency settings.  The user can still specify values for
frames/period and periods/buffer that exceed the capabilities of the
hardware, of course.  But for values that are within those
capabilities, the performance will be improved.  For example, testing
shows that a high-speed device can handle 32 frames/period and 3
periods/buffer at 48 KHz, whereas the current driver starts to get
glitchy at 64 frames/period and 2 periods/buffer.

A side effect of these changes is that the "nrpacks" module parameter
is no longer used.  The patch removes it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Clemens Ladisch <clemens@ladisch.de>
Tested-by: Daniel Mack <zonque@gmail.com>
Tested-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: firewire-lib: use inlune function to calculate frame bytes

Calculating frame bytes can be replaced with inline function in
include/sound/pcm.h.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ASoC: sn95031: Convert to regmap

This moves us towards being able to remove the duplicated register I/O
functionality in ASoC.

Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: tlv320aic32x4: Move GPIO acquisition to I2C probe

This is more idiomatic and interacts better with deferred probe.

Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: tlv320aic32x4: Convert to direct regmap API usage

This moves us towards being able to remove the duplicate register I/O
functionality in ASoC and saves some code.

Signed-off-by: Mark Brown <broonie@linaro.org>