History log of /linux-master/sound/soc/codecs/wm8753.c
Revision Date Author Comments
# 340d79a1 06-Oct-2023 Rob Herring <robh@kernel.org>

ASoC: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> # for at91
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-1-13a4f0f7fee6@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3c884cb5 12-Jul-2023 Mark Brown <broonie@kernel.org>

ASoC: wm8753: Update to use maple tree register cache

The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the wm8753 driver to use the more modern data structure.

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-asoc-cirrus-maple-v1-25-a62651831735@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 9abcd240 25-Apr-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ASoC: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
Link: https://lore.kernel.org/r/20230425095716.331419-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org


# 02004449 23-Jun-2022 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: wm*: Remove now redundant non_legacy_dai_naming flag

The ASoC core has now been changed to default to the non-legacy DAI
naming, as such drivers using the new scheme no longer need to specify
the non_legacy_dai_naming flag.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623125250.2355471-66-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 97b0b6e3 05-Apr-2022 Stephen Kitt <steve@sk2.org>

ASoC: wm*: use simple i2c probe function

The i2c probe functions here don't use the id information provided in
their second argument, so the single-parameter i2c probe function
("probe_new") can be used instead.

wm8731.c is excluded and will be submitted separately.

This avoids scanning the identifier tables during probes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220405122411.2096387-1-steve@sk2.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 26d3c16e 08-Jul-2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: codecs: wm*: merge .digital_mute() into .mute_stream()

snd_soc_dai_digital_mute() is internally using both
mute_stream() (1) or digital_mute() (2), but the difference between
these 2 are only handling direction.
We can merge digital_mute() into mute_stream

int snd_soc_dai_digital_mute(xxx, int direction)
{
...
else if (dai->driver->ops->mute_stream)
(1) return dai->driver->ops->mute_stream(xxx, direction);
else if (direction == SNDRV_PCM_STREAM_PLAYBACK &&
dai->driver->ops->digital_mute)
(2) return dai->driver->ops->digital_mute(xxx);
...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87v9ixwiwr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3e146b55 08-Jul-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

ASoC: codecs: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200709010359.GA18971@embeddedor
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6d75dfc3 15-Jun-2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: codecs: wm*: rename to snd_soc_component_read()

We need to use snd_soc_component_read()
instead of snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eeqf4mcl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5e518edd 14-May-2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: codecs: use snd_soc_xxx_active()

We have snd_soc_dai/dai_stream/component_active() macro
This patch uses it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87wo5e58j4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 22d15fc5 28-Jan-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: wm8753: replace codec to component

Now we can replace Codec to Component. Let's do it.

Note:
xxx_codec_xxx() -> xxx_component_xxx()
.idle_bias_off = 0 -> .idle_bias_on = 1
.ignore_pmdown_time = 0 -> .use_pmdown_time = 1
- -> .endianness = 1
- -> .non_legacy_dai_naming = 1

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# b0e92b51 08-Nov-2017 Gustavo A. R. Silva <garsilva@embeddedor.com>

ASoC: wm8753: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 146568
Addresses-Coverity-ID: 146569
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# af4b654f 13-Dec-2016 Alexander Shiyan <shc_work@mail.ru>

ASoC: wm8753: Add control to allow swapping HiFi DAC channels

This patch adds a control to allow swapping HiFi DAC Left/Right channels.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f802d6c0 31-Aug-2016 Julia Lawall <Julia.Lawall@lip6.fr>

ASoC: constify snd_soc_codec_driver structures

Check for snd_soc_codec_driver structures that are only passed to
snd_soc_register_codec or memcpy (2nd arg), for which the corresponding
parameters are declared const. Declare as const snd_soc_codec_driver
structures that have these properties.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct snd_soc_codec_driver i@p = { ... };

@ok@
identifier r.i;
expression e1,e2,e3;
position p;
@@
(
snd_soc_register_codec(e1,&i@p,e2,e3)
|
memcpy(e1,&i@p,e2)
)

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct snd_soc_codec_driver i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 73238401 08-Aug-2016 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: codec duplicated callback function goes to component on wm8753

codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# eb87f9e2 24-Jun-2016 Alexander Shiyan <shc_work@mail.ru>

ASoC: wm8753: Replace magic number

Use SND_SOC_NOPM constant, instead of -1.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 34c5cdbc 24-Jun-2016 Amitoj Kaur Chawla <amitoj1606@gmail.com>

ASoC: wm8753: Remove unneeded header file

Drop redundant include of moduleparam.h

The Coccinelle semantic patch used to make this change is as follows:
@ includesmodule @
@@

@ depends on includesmodule @
@@

- #include <linux/moduleparam.h>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0cad1053 29-Feb-2016 Takashi Iwai <tiwai@suse.de>

ASoC: wm8753: Fix enum ctl accesses in a wrong type

"DAI Mode" ctl in wm8753 codec driver is enum, while the current
driver accesses wrongly via value.integer.value[]. They have to be
via value.enumerated.item[] instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3821a065 23-Oct-2015 Andrew F. Davis <afd@ti.com>

spi: Drop owner assignment from spi_drivers

An spi_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# b9704998 31-Jul-2015 Axel Lin <axel.lin@ingics.com>

ASoC: wm8753: Drop wm8753_writeable function

When .max_register is set and .writeable_reg is not implement, registers
between 0 and .max_register are writeable. This is the same as current
implementation of wm8753_writeable(), so just drop implementation for
.writeable_reg callback.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 11c3727c 02-Aug-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm8753: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE

DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD()
that it automatically calculates the number of items in the TLV and is
hence less prone to manual error.

Generate using the following coccinelle script

// <smpl>
@@
declarer name DECLARE_TLV_DB_RANGE;
identifier tlv;
constant x;
@@
-unsigned int tlv[] = {
- TLV_DB_RANGE_HEAD(x),
+DECLARE_TLV_DB_RANGE(tlv,
...
-};
+);
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1c07a4de 14-Jul-2015 Krzysztof Kozlowski <krzk@kernel.org>

ASoC: drivers: Drop owner assignment from i2c_driver

i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6093e926 01-Jun-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm8753: Replace direct snd_soc_codec dapm field access

The dapm field of the snd_soc_codec struct is eventually going to be
removed, in preparation for this replace all manual access to
codec->dapm.bias_level with snd_soc_codec_get_bias_level().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f4bf8d77 27-Apr-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Move bias level update to the core

All drivers have the same line at the end of the set_bias_level callback to
update the bias_level state. Move this update into
snd_soc_dapm_force_bias_level() and remove them from the drivers.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# a1f0b967 30-Mar-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm8753: Cleanup manual bias level transitions

Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.

The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 35afd922 30-Mar-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm8753: Integrate capacitor charging into the DAPM sequence

When being powered on, either initially on probe or when resuming from
suspend, the wm8971 configures the device for quick output capacitor
charging. Since the charging can take a rather long time (up to multiple
seconds) it is done asynchronously without blocking. A delayed work item is
run once the charging is finished and the device is switched to the target
bias level.

This all done asynchronously to the regular DAPM sequence accessing the same
data structures and registers without any looking, which can lead to race
conditions. Furthermore this potentially delays the start of stream on the
CODEC while the rest of the system is already up and running, meaning the
first bytes of audio are lost. It also does no comply with the assumption of
the DAPM core that if set_bias_level() returned successfully the device will
be at the requested bias level.

This patch slightly refactors things and makes sure that the caps charging
is properly integrated into the DAPM sequence. When transitioning from
SND_SOC_BIAS_OFF to SND_SOC_BIAS_STANDBY the part will be put into fast
charging mode and a work item will be scheduled that puts it back into
standby charging once the charging period has elapsed. If a playback or
capture stream is started while charging is in progress the driver will now
wait in SND_SOC_BIAS_PREPARE until the charging is done. This makes sure
that charging is done asynchronously in the background when the chip is
idle, but at the same time makes sure that playback/capture is not started
before the charging is done.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 9cca023e 29-Sep-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm8{350,753,971}: Use snd_soc_dapm_to_codec() instead of dapm->codec

The CODEC struct in the snd_soc_dapm_context struct is deprecated and
scheduled for removal. Use the snd_soc_dapm_to_codec() function instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f21b6604 30-Jul-2014 Mark Brown <broonie@linaro.org>

ASoC: wm8753: Convert to params_width()

The CODEC doesn't care how data is laid out in memory.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>


# ea53bf77 18-Mar-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Add snd_soc_kcontrol_codec() helper function

For CODEC controls snd_kcontrol_chip() currently returns a pointer to the
CODEC that registered the control. With the upcoming consolidation of
platform and CODEC controls this will change. Prepare for this by introducing
the snd_soc_kcontrol_codec() helper function that will hide the implementation
details of how the CODEC for a control can be obtained. This will allow us to
change this easily in the future.

The patch also updates all CODEC drivers to use the new helper function.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 5d6be5aa 10-Mar-2014 Xiubo Li <Li.Xiubo@freescale.com>

ASoC: codec: Simplify ASoC probe code.

For some CODEC drivers like who act as the MFDs children are ignored
by this patch.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 5c898e74 05-Mar-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Add helper function to check whether a CODEC is active

Instead of directly checking the 'active' field of the CODEC struct add a new
helper function that will return either true or false depending on whether the
CODEC is active. This will make the migration to the component level easier.

The patch also updates all CODEC drivers that check the active attribute to use
the new helper function.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 48b5e1fb 01-Mar-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm8753: Remove superfluous 'codec->cache_sync = 1'

The wm8763 driver uses regmap for IO which means that codec->cache_sync is not
used. The line was added in commit d3398ff ('ASoC: Convert WM8753 to direct
regmap API usage'). Presumably this was meant to be regcache_mark_dirty(), but
since we already call regcache_mark_dirty() in the core when suspending the
CODEC it is safe to just remove the line.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 2c486433 20-Nov-2013 Fabio Estevam <fabio.estevam@freescale.com>

ASoC: wm8753: Use IS_ENABLED() macro

Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# ec1d648d 18-Jul-2013 Mark Brown <broonie@linaro.org>

ASoC: wm8753: Use power efficient workqueue

The work used to allow the capcitors to ramp is not performance sensitive
so let the scheduler run it wherever is most efficient rather than in a
per CPU workqueue by using the system power efficient workqueue.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>


# 7a79e94e 07-Dec-2012 Bill Pemberton <wfp5p@virginia.edu>

ASoC: codecs: remove __dev* attributes

CONFIG_HOTPLUG is going away as an option. As result the __dev*
markings will be going away.

Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
and __devexit.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# eb781f78 21-Nov-2012 Tushar Behera <tushar.behera@linaro.org>

ASoC: wm8753: Convert to use devm_regmap_init_{spi,i2c}()

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ada7efe2 21-Nov-2012 Tushar Behera <tushar.behera@linaro.org>

ASoC: wm8753: remove invalid free of devm_ allocated data

Fixes following warning.
sound/soc/codecs/wm8753.c:1594:1-6: WARNING: invalid free of devm_ allocated data

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 43829731 20-Aug-2012 Tejun Heo <tj@kernel.org>

workqueue: deprecate flush[_delayed]_work_sync()

flush[_delayed]_work_sync() are now spurious. Mark them deprecated
and convert all users to flush[_delayed]_work().

If you're cc'd and wondering what's going on: Now all workqueues are
non-reentrant and the regular flushes guarantee that the work item is
not pending or running on any CPU on return, so there's no reason to
use the sync flushes at all and they're going away.

This patch doesn't make any functional difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Mattia Dongili <malattia@linux.it>
Cc: Kent Yoder <key@linux.vnet.ibm.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Bryan Wu <bryan.wu@canonical.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-wireless@vger.kernel.org
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: Sangbeom Kim <sbkim73@samsung.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Petr Vandrovec <petr@vandrovec.name>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Avi Kivity <avi@redhat.com>


# 656baaeb 22-May-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: codecs: Refresh copyrights for Wolfson drivers

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# e6968a17 04-Apr-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: codecs: Remove rtd->codec usage from CODEC drivers

In order to support CODEC<->CODEC links remove the assumption that there
is only a single CODEC on a DAI link by removing the use of the CODEC
pointer in the rtd from the CODEC drivers. They are already being passed
their DAI whenever they are passed an rtd and can get the CODEC from
there.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ad20ff92 26-Feb-2012 Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>

ASoC: wm8753: fix initialization

Without that fix the wm8753 SPI initialization fails, and then produces
a kernel panic during boot with the following call trace:
Unable to handle kernel paging request at virtual address 37386d9b
[<c01ccafc>] (regmap_get_val_bytes+0x0/0x14) from [<c0243dfc>] (snd_soc_codec_set_cache_io+0x9c/0xcc)
[<c0243dfc>] (snd_soc_codec_set_cache_io+0x9c/0xcc) from [<c0244a4c>] (wm8753_probe+0x5c/0x1c4)
[<c0244a4c>] (wm8753_probe+0x5c/0x1c4) from [<c023bb24>] (soc_probe_codec+0x174/0x284)
[<c023bb24>] (soc_probe_codec+0x174/0x284) from [<c023c2c0>] (snd_soc_instantiate_cards+0x68c/0xe28)
[<c023c2c0>] (snd_soc_instantiate_cards+0x68c/0xe28) from [<c023d278>] (snd_soc_register_card+0x240/0x2d4)
[<c023d278>] (snd_soc_register_card+0x240/0x2d4) from [<c023d330>] (soc_probe+0x24/0x40)
[<c023d330>] (soc_probe+0x24/0x40) from [<c01c3900>] (platform_drv_probe+0x14/0x18)
[...]

The commit d3398ff05907167f463e119421b053ce043741d1
( ASoC: Convert WM8753 to direct regmap API usage ) introduced
the problem.

Thanks to Lars-Peter Clausen for helping me a bit during the debugging.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 2c823d14 27-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8753: Convert to devm_kzalloc()

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d3398ff0 21-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Convert WM8753 to direct regmap API usage

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 84b315ee 02-Dec-2011 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Drop unused state parameter from CODEC suspend callback

The existence of this parameter is purely historical. None of the CODEC drivers
uses it and we always pass in the same value anyway, so it should be safe to
remove it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 997c2ea9 26-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove unneeded platform_device.h inclusions from CODECs

They've not been needed for a long time if they were ever required.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 85e7652d 23-Nov-2011 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Constify snd_soc_dai_ops structs

Commit 1ee46ebd("ASoC: Make the DAI ops constant in the DAI structure")
introduced the possibility to have constant DAI ops structures, yet this is
barley used in both existing drivers and also new drivers being submitted,
although none of them modifies its DAI ops structure. The later is not
surprising since existing drivers are often used as templates for new drivers.
So this patch just constifies all existing snd_soc_dai_ops structs to eliminate
the issue altogether.

The patch was generated with the following coccinelle semantic patch:
// <smpl>
@@
identifier ops;
@@
-struct snd_soc_dai_ops ops =
+const struct snd_soc_dai_ops ops =
{ ... };
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 56a926dd 21-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Convert WM8753 to table based DAPM and control init

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 2391a0e0 16-Nov-2011 Timo Juhani Lindfors <timo.lindfors@iki.fi>

ASoC: wm8753: Skip noop reconfiguration of DAI mode

This patch makes it possible to set DAI mode to its currently applied
value even if codec is active. This is necessary to allow

aplay -t raw -r 44100 -f S16_LE -c 2 < /dev/urandom &
alsactl store -f backup.state
alsactl restore -f backup.state

to work without returning errors. This patch is based on a patch sent
by Klaus Kurzmann <mok@fluxnetz.de>.

Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org


# 21d17dd2 02-Oct-2011 Axel Lin <axel.lin@gmail.com>

ASoC: Fix setting update bits for WM8753_LADC and WM8753_RADC

Current code set update bits for WM8753_LDAC and WM8753_RDAC twice,
but missed setting update bits for WM8753_LADC and WM8753_RADC.

I think it is a copy-paste bug in commit 776065
"ASoC: codecs: wm8753: Fix register cache incoherency".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org


# 70e14122 07-Aug-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add device tree binding for WM8753

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>


# 63010634 07-Aug-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove unneeded -codec from WM8753 driver name

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# 338ee253 06-Feb-2011 Lars-Peter Clausen <lars@metafoo.de>

ASoC: codecs: wm8753: Fix DAI mode switching

The wm8753 codec supports switching between different DAI modes.
The current drivers tries to implement this by changing the DAI driver at
runtime. But to properly work this would require support from the ASoC core.

So this patch takes a different approch on how the DAI mode switching is
implemented.

The only difference, from a driver point of view, between the different DAI modes
is how to program the DAI format to the hardware. So what this patch is, it
stores the current format for each DAI in the drivers private struct and when
the DAI mode is changed the format gets simply reprogrammed according to the
new DAI mode.

Futhermore this patch restricts the changing of the DAI format to when the
codec is inactive.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 776065e3 28-Dec-2010 Lars-Peter Clausen <lars@metafoo.de>

ASoC: codecs: wm8753: Fix register cache incoherency

The multi-component patch(commit f0fba2ad1) moved the allocation of the
register cache from the driver to the ASoC core. Most drivers where adjusted to
this, but the wm8753 driver still uses its own register cache for its
private functions, while functions from the ASoC core use the generic cache.
Furthermore the generic cache uses zero-based numbering while the wm8753 cache
uses one-based numbering.
Thus we end up with two from each other incoherent caches, which leads to undefined
behaviour and crashes.
This patch fixes the issue by changing the wm8753 driver to use the generic
register cache in its private functions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# fdea0571 12-Dec-2010 Takashi Iwai <tiwai@suse.de>

ASoC: Fix merge errors with flush_scheduled_work() removal

delayed_work was moved to dapm in the commit
ce6120cca2589ede530200c7cfe11ac9f144333c
ASoC: Decouple DAPM from CODECs

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 5b84ba26 11-Dec-2010 Tejun Heo <tj@kernel.org>

sound: don't use flush_scheduled_work()

flush_scheduled_work() is deprecated and scheduled to be removed.

* cancel[_delayed]_work() + flush_scheduled_work() ->
cancel[_delayed]_work_sync().

* wm8350, wm8753 and soc-core use custom code to cancel a delayed
work, execute it immediately if it was pending and wait for its
completion. This is equivalent to flush_delayed_work_sync(). Use
it instead.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 505fb824 21-Nov-2010 Jarkko Nikula <jhnikula@gmail.com>

ASoC: Do not include soc-dapm.h

There is no need to include soc-dapm.h since soc.h includes it.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ce6120cc 05-Nov-2010 Liam Girdwood <lrg@slimlogic.co.uk>

ASoC: Decouple DAPM from CODECs

Decoupling Dynamic Audio Power Management (DAPM) from codec devices is
required when developing ASoC further. Such as for other ASoC components to
have DAPM widgets or when extending DAPM to handle cross-device paths.

This patch decouples DAPM related variables from struct snd_soc_codec and
moves them to new struct snd_soc_dapm_context that is used to encapsulate
DAPM context of a device. ASoC core and API of DAPM functions are modified
to use DAPM context instead of codec.

This patch does not change current functionality and a large part of changes
come because of structure and internal API changes.

Core implementation is from Liam Girdwood <lrg@slimlogic.co.uk> with some
minor core changes, codecs and machine driver conversions from
Jarkko Nikula <jhnikula@gmail.com>.

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Manuel Lauss <manuel.lauss@googlemail.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Cc: Cliff Cai <cliff.cai@analog.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Ryan Mallon <ryan@bluewatersys.com>
Cc: Timur Tabi <timur@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Jassi Brar <jassi.brar@samsung.com>
Cc: Daniel Gloeckner <dg@emlix.com>
Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 6b90b55c 29-Sep-2010 Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

ASoC: Remove unneeded use of spi_bus_type

No need to explicitly set the bus type, spi_register_driver does
that for us.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# c6d5cca0 14-Sep-2010 Jarkko Nikula <jhnikula@gmail.com>

ASoC: Remove needless codec->bias_level assignment to SND_SOC_BIAS_OFF

This assignment is done by the snd_soc_register_codec so there is no need
to redo it in probe function of a codec driver.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# e5eec34c 10-Sep-2010 Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

ASoC: Fix incorrect register cache size configuration

The reg_cache_size is the number of elements in the register cache,
not the size of the cache itself. This is not a problem if the size
of each element of the cache is 1 byte but it matters in any other
case.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# e6929378 04-Sep-2010 Jiri Slaby <jirislaby@kernel.org>

ASoC: wm8753, remove dead code

There is adangling code in wm8753_probe which is never executed.
Remove it.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# af3751a0 12-Aug-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove unneeded control_data management from Wolfson drivers

Now soc-cache.c can figure out the I2C and SPI control data from the
device for the CODEC we don't need to manually assign it in drivers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# f0fba2ad 17-Mar-2010 Liam Girdwood <lrg@slimlogic.co.uk>

ASoC: multi-component - ASoC Multi-Component Support

This patch extends the ASoC API to allow sound cards to have more than one
CODEC and more than one platform DMA controller. This is achieved by dividing
some current ASoC structures that contain both driver data and device data into
structures that only either contain device data or driver data. i.e.

struct snd_soc_codec ---> struct snd_soc_codec (device data)
+-> struct snd_soc_codec_driver (driver data)

struct snd_soc_platform ---> struct snd_soc_platform (device data)
+-> struct snd_soc_platform_driver (driver data)

struct snd_soc_dai ---> struct snd_soc_dai (device data)
+-> struct snd_soc_dai_driver (driver data)

struct snd_soc_device ---> deleted

This now allows ASoC to be more tightly aligned with the Linux driver model and
also means that every ASoC codec, platform and (platform) DAI is a kernel
device. ASoC component private data is now stored as device private data.

The ASoC sound card struct snd_soc_card has also been updated to store lists
of it's components rather than a pointer to a codec and platform. The PCM
runtime struct soc_pcm_runtime now has pointers to all its components.

This patch adds DAPM support for ASoC multi-component and removes struct
snd_soc_socdev from DAPM core. All DAPM calls are now made on a card, codec
or runtime PCM level basis rather than using snd_soc_socdev.

Other notable multi-component changes:-

* Stream operations now de-reference less structures.
* close_delayed work() now runs on a DAI basis rather than looping all DAIs
in a card.
* PM suspend()/resume() operations can now handle N CODECs and Platforms
per sound card.
* Added soc_bind_dai_link() to bind the component devices to the sound card.
* Added soc_dai_link_probe() and soc_dai_link_remove() to probe and remove
DAI link components.
* sysfs entries can now be registered per component per card.
* snd_soc_new_pcms() functionailty rolled into dai_link_probe().
* snd_soc_register_codec() now does all the codec list and mutex init.

This patch changes the probe() and remove() of the CODEC drivers as follows:-

o Make CODEC driver a platform driver
o Moved all struct snd_soc_codec list, mutex, etc initialiasation to core.
o Removed all static codec pointers (drivers now support > 1 codec dev)
o snd_soc_register_pcms() now done by core.
o snd_soc_register_dai() folded into snd_soc_register_codec().

CS4270 portions:
Acked-by: Timur Tabi <timur@freescale.com>

Some TLV320aic23 and Cirrus platform fixes.
Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>

TI CODEC and OMAP fixes
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>

Samsung platform and misc fixes :-
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>

MPC8610 and PPC fixes.
Signed-off-by: Timur Tabi <timur@freescale.com>

i.MX fixes and some core fixes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

J4740 platform fixes:-
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

CC: Tony Lindgren <tony@atomide.com>
CC: Nicolas Ferre <nicolas.ferre@atmel.com>
CC: Kevin Hilman <khilman@deeprootsystems.com>
CC: Sascha Hauer <s.hauer@pengutronix.de>
CC: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC: Kuninori Morimoto <morimoto.kuninori@renesas.com>
CC: Daniel Gloeckner <dg@emlix.com>
CC: Manuel Lauss <mano@roarinelk.homelinux.net>
CC: Mike Frysinger <vapier.adi@gmail.com>
CC: Arnaud Patard <apatard@mandriva.com>
CC: Wan ZongShun <mcuos.com@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# b2c812e2 14-Apr-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add indirection for CODEC private data

One of the features of the multi CODEC work is that it embeds a struct
device in the CODEC to provide diagnostics via a sysfs class rather than
via the device tree, at which point it's much better to use the struct
device private data rather than having two places to store it. Provide
an accessor function to allow this change to be made more easily, and
update all the CODEC drivers are updated.

To ensure use of the accessor the private data structure member is
renamed, meaning that if code developed with older an older core that
still uses private_data is merged it will fail to build.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 5a0e3ad6 24-Mar-2010 Tejun Heo <tj@kernel.org>

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>


# 633154d3 24-Dec-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove unneeded suspend checks from CODEC drivers

Better integration of the core with the device model means that we now
no longer get the ASoC suspend and resume callbacks without the card
having been set up.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 0a3f5e35 12-Nov-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove redundant snd_soc_dapm_new_widgets() calls

The DAPM widgets are now insntantiated by the core when creating the card
so there is no need for the individual CODEC drivers to do so.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# fe3e78e0 03-Nov-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Factor out snd_soc_init_card()

snd_soc_init_card() is always called as the last part of the CODEC probe
function so we can factor it out into the core card setup rather than
have each CODEC replicate the code to do the initialiastation. This will
be required to support multiple CODECs per card.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d2058b0c 13-Oct-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove snd_soc_suspend_device()

The PM core will grow pm_link infrastructure in 2.6.33 which can be
used to implement the intended functionality of the ASoC-specific
device suspend and resume callbacks so drop them.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 877ae707 21-Sep-2009 Phil Vandry <vandry@TZoNE.ORG>

ASoC: wm8753: fix mapping when MONOMIX is set to Stereo

When MONOMIX is set to Stereo, Left PGA was not powered on but should be.
Add a mapping from Capture Left Mux to Capture Left Mixer to fix the issue.

Signed-off-by: Phil Vandry <vandry@TZoNE.ORG>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 85488037 05-Sep-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add source argument to PLL configuration

More and more devices feature PLLs and FLLs with the ability to select
between multiple input clocks. In order to better support these devices
a new argument, source, has been added to the set_pll() configuration
API. Using set_clkdiv() is often difficult due to the need to stop the
PLL/FLL before any reconfiguration can be done.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 637a935a 02-Jul-2009 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Fix wm8753 register cache size and initialization

Register cache space was not being allocated for the final register,
causing bugs when it was used. Allocate space for it.

Also ensure that the final register is displayed in sysfs.

[Commit message rewritten to document actual issue. -- broonie]

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 1df892cb 03-Jul-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Fix register cache initialisation for WM8753

The wrong register cache variable was being used to provide the size for
the memcpy(), resulting in a copy of only a void * of data.

Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org


# b3b50b3f 13-Jun-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add suspend and resume callbacks to Wolfson CODEC drivers

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 449bd54d 27-May-2009 Roel Kluin <roel.kluin@gmail.com>

ASoC: correct print specifiers for unsigneds

Unsigned variables should use `%u' rather than `%d'.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# ae31c1fb 04-May-2009 Greg Kroah-Hartman <gregkh@suse.de>

sound: remove driver_data direct access of struct device

In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device. Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used. These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 31cb31f7 11-May-2009 Roel Kluin <roel.kluin@gmail.com>

ASoC: remove driver_data direct access of struct device

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 055a49b0 08-Mar-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove unneeded forward reference to WM8753 SPI implementation

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 6335d055 02-Mar-2009 Eric Miao <eric.y.miao@gmail.com>

ASoC: make ops a pointer in 'struct snd_soc_dai'

Considering the fact that most cpu_dai or codec_dai are using a same
'snd_soc_dai_ops' for several similar interfaces, 'ops' would be better
made a pointer instead, to make sharing easier and code a bit cleaner.

The patch below is rather preliminary since the asoc tree is being
actively developed, and this touches almost every piece of code,
(and possibly many others in development need to be changed as
well). Building of all codecs are OK, yet to every SoC, I didn't test
that.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 6d564345 26-Feb-2009 Takashi Iwai <tiwai@suse.de>

ASoC: wm8753 - Fix build error

sound/soc/codecs/wm8753.c: In function 'wm8753_probe':
sound/soc/codecs/wm8753.c:1577: error: implicit declaration of function 'wm8753_add_controls'

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# e611bd82 22-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Only write back non-default registers when resuming WM8753

This will reduce the number of writes done on resume, allowing that to
complete faster (especially on systems with very slow I2C like the
current Samsung driver).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# c2bac160 24-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Convert WM8753 to register via normal device probe

The base support for the only in-tree user, the GTA01, is out of tree
and will be updated separately.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 69e169da 22-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Shuffle WM8753 device registration code

This patch should be pure code motion, separating that out from the
functional changes to move to new style device registration.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 93e051d2 22-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Only unregister drivers we registered for WM8753

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# eeb1080b 22-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Report I/O errors from WM8753 reset

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 59544d33 18-Feb-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove version display from the WM8753 driver

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 31b59cf9 15-Feb-2009 Paul Fertser <fercerpav@gmail.com>

ASoC: Fix WM8753 DAIs unregistering

WM8753 uses a tricky way to switch DAIs "on the fly", for that it
registers 2 dummy DAIs and substitutes them depending on mixer control.

List element of registered dummy DAIs should be preserved to allow
unregistering of DAIs on module unload.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 9e70c1f0 29-Jan-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Fix null string usage with WM8753 DAIs

The WM8753 driver multiplexes the DAI structures it exposes to the
outside world, leaving them uninitialised until the codec probes. Since
the DAI name is used during the registration and setup process provide a
dummy name.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 6627a653 23-Jan-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Push the codec runtime storage into the card structure

This is a further stage on the road to refactoring away the ASoC
platform device.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 91432e97 17-Jan-2009 Ian Molton <ian@mnementh.co.uk>

ASoC: fixes to caching implementations

This patch takes fixes a number of bugs in the caching code used by
several ASoC codec drivers. Mostly off-by-one fixes.

Signed-off-by: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 3e8e1952 08-Jan-2009 Ian Molton <ian@mnementh.co.uk>

ASoC: cleanup duplicated code.

Many codec drivers were implementing cookie-cutter copies of the function
that adds kcontrols to the codec.

This patch moves this code to a common function snd_soc_add_controls() in
soc-core.c and updates all drivers using copies of this function to use the
new common version.

[Edited to raise priority of error log message and document parameters.
-- broonie]

Signed-off-by: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# c9b3a40f 09-Dec-2008 Takashi Iwai <tiwai@suse.de>

ALSA: ASoC - Fix wrong section types

The module init entries should be __init instead of __devinit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 64089b84 08-Dec-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Register non-AC97 codec DAIs

Currently this is done at module probe time since ASoC ties in codec
device probe to the instantiation of the entire ASoC device. Subsequent
patches will refactor the codec drivers to handle probing separately.
Note that the core does not yet use this information.

AC97 is special since the codec is controlled over the AC97 link but
we want to give the machine driver a chance to set up the system before
trying to instantiate since it may need to do configuration before the
AC97 link will operate

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 968a6025 28-Nov-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Rename snd_soc_register_card() to snd_soc_init_card()

Currently ASoC card initialisation is completed by a function called
snd_soc_register_card(). As part of the work to allow independant
registration of cards, codecs and machines in ASoC v2 a new function of
the same name has been added so rename the existing function to
facilitate the merge of v2.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# dee89c4d 18-Nov-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Merge snd_soc_ops into snd_soc_dai_ops

Liam Girdwood's ASoC v2 work avoids having two different ops structures
for DAIs by merging the members of struct snd_soc_ops into struct
snd_soc_dai_ops, allowing per DAI configuration for everything.
Backport this change.

This paves the way for future work allowing any combination of DAIs to
be connected rather than having fixed purpose CODEC and CPU DAIs and
only allowing CODEC<->CPU interconnections.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# d331124d 12-Oct-2008 Liam Girdwood <lrg@slimlogic.co.uk>

ALSA: ASoC: update email address for Liam Girdwood

Update the contact information for Liam Girdwood in ASoC core and
drivers as my old email address is no longer valid.

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 3ab57fbe 07-Oct-2008 Jarkko Nikula <jarkko.nikula@nokia.com>

ALSA: ASoC: Remove unused AUDIO_NAME define from codec drivers

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# dd0c0c80 06-Oct-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

ALSA: ASoC: Add WM8753 SPI support

Implement SPI support for WM8753, cut'n'pasting from the support for
WM8731 contributed by Cliff Cai and Alan Horstmann since the wire format
is the same for both codecs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 4037314a 01-Oct-2008 Rob Sims <openmoko-z@robsims.com>

ASoC: Set correct name for WM8753 rec mixer output

Rob Sims wrote:

"I can't seem to turn on register 0x17, bit 3 in the sound chip, except
by codec_reg_write; the mixer lacks direct or indirect control. It
seems there are two names for the output of the rec mixer:
Capture ST Mixer
Playback Mixer

Would the following do the trick?"

I confirm that this solves the audio problems I was having.

Signed-off-by: Jonas Bonn <jonas.bonn@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# ad4503d8 01-Sep-2008 Jean Delvare <khali@linux-fr.org>

sound: ASoC: Convert wm8753 to a new-style i2c driver

Convert the wm8753 codec driver to the new (standard) i2c device
driver binding model.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ville Syrjala <syrjala@sci.fi>
Cc: Frank Mandarino <fmandarino@endrelia.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 3051e41a 25-Aug-2008 Jean Delvare <khali@linux-fr.org>

ALSA: ASoC: Fix double free and memory leak in many codec drivers

Many SoC audio codec drivers have improper freeing of memory in error
paths.

* codec is allocated in the platform device probe function, but is not
freed there in case of error. Instead it is freed in the i2c device
probe function's error path. However the success or failure of both
functions is not linked, so this could result in a double free (if
the platform device is successfully probed, the i2c device probing
fails and then the platform driver is unregistered.)

* codec->private_data is allocated in many platform device probe
functions but not freed in their error paths.

This patch hopefully solves all these problems.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 7a8fc9b2 17-Aug-2008 Adrian Bunk <bunk@kernel.org>

removed unused #include <linux/version.h>'s

This patch lets the files using linux/version.h match the files that
#include it.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# e550e17f 07-Jul-2008 Liam Girdwood <lg@opensource.wolfsonmicro.com>

ALSA: asoc: codecs - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.

This patch merges struct snd_soc_codec_dai and struct
snd_soc_cpu_dai into struct snd_soc_dai for the codec drivers.

Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# a5c95e90 23-Jun-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

ALSA: ASoC: Replace custom debug macros with pr_ equivalents

Several ASoC codec drivers use custom macros equivalent to the standard
pr_ macros, most of which are not actually used. Replace these custom
macros with the standard ones.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 2cc8c609 11-Jun-2008 Mike Montour <mail@mmontour.net>

ALSA: ASoC: Add TLV information to remaining WM8753 controls

Signed-off-by: Mike Montour <mail@mmontour.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# d751b233 11-Jun-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

ALSA: ASoC: Fix register cache sizes for Wolfson codecs

The register cache size is used by the codec_reg sysfs file which works in
terms of the register cache access functions rather than in terms of raw
access to the cache so the size specified needs to be in terms of the
number of elements.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# a65f0568 13-May-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

[ALSA] soc - Convert Wolfson codec drivers to use bulk DAPM registration

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 0be9898a 18-May-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

[ALSA] ASoC: Clarify API for bias configuration

Currently the ASoC core configures the bias levels in the system using
a callback on codecs and machines called 'dapm_event', passing it PCI
style power levels as SNDRV_CTL_POWER_ constants. This is more obscure
than it needs to be and has caused confusion to driver authors,
especially given that DAPM is also performing power management.

Address this by renaming the callback function to 'set_bias_level' and
using constants explicitly representing the off, standby, pre-on and on
states which DAPM transitions through.

Also unexport the API for setting bias level: there are currently no
in-tree users of this API other than the core itself and it is likely
that the core would need to be extended to cater for any users.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 60fc684a 30-Apr-2008 Mark Brown <broonie@opensource.wolfsonmicro.com>

[ALSA] soc - wm8753 - Clean up checkpatch warnings

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# ae092c9e 03-Mar-2008 Graeme Gregory <graeme@openmoko.org>

[ALSA] soc - Add Invert Switch for ROUT2

GTA02 device has a speaker between LOUT2 & ROUT2 and in this mode ROUT2
needs to be inverted. This patch adds a mixer control for this.

Signed-off-by: Graeme Gregory <graeme@openmoko.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 10264608 01-Feb-2008 Mike Montour <mail@mmontour.net>

[ALSA] soc - Mono voice playback volume for WM8753

Voice playback volume is in register bits 0:2, not 4:6.

From: Mike Montour <mail@mmontour.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Werner Almesberger <werner@openmoko.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 2d6a4ac9 10-Jan-2008 Liam Girdwood <lg@opensource.wolfsonmicro.com>

[ALSA] soc - Initial WM8753 TLV support for capture mixer


Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 9004acc7 08-Jan-2008 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove sound/driver.h

This header file exists only for some hacks to adapt alsa-driver
tree. It's useless for building in the kernel. Let's move a few
lines in it to sound/core.h and remove it.
With this patch, sound/driver.h isn't removed but has just a single
compile warning to include it. This should be really killed in
future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 1f53aee0 16-Apr-2007 Liam Girdwood <lg@opensource.wolfsonmicro.com>

[ALSA] SoC WM8753 codec support

This patch series adds support for the WM8753 codec as found on the
OpenMoko Neo 1973 (other Neo 1973 and Samsung S3C24xx patches to follow
today) as well other new devices.
Features:-
o HiFi and Voice DAI supported (inc runtime switching of DAI mode)
o DAPM
o All mixers
o PLL calculator
o 16,20 and 24bit samples.
o WM8753 I2C ID added to include/linux/i2c-id.h
From: Liam Girdwood <lg@opensource.wolfsonmicro.com>

Signed-off-by: Harald Welte <laforge@openmoko.org>
Signed-off-by: Graeme Gregory <gg@opensource.wolfsonmicro.com>
Signed-off-by: Seth Forshee <seth.forshee@gmail.com>
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>