History log of /linux-master/sound/soc/codecs/wm8962.c
Revision Date Author Comments
# 96e202f8 06-Mar-2024 Stuart Henderson <stuarth@opensource.cirrus.com>

ASoC: wm8962: Fix up incorrect error message in wm8962_set_fll

Use source instead of ret, which seems to be unrelated and will always
be zero.

Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com>
Link: https://msgid.link/r/20240306161439.1385643-5-stuarth@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6fa849e4 06-Mar-2024 Stuart Henderson <stuarth@opensource.cirrus.com>

ASoC: wm8962: Enable both SPKOUTR_ENA and SPKOUTL_ENA in mono mode

Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com>
Link: https://msgid.link/r/20240306161439.1385643-2-stuarth@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 03c78741 06-Mar-2024 Stuart Henderson <stuarth@opensource.cirrus.com>

ASoC: wm8962: Enable oscillator if selecting WM8962_FLL_OSC

Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com>
Link: https://msgid.link/r/20240306161439.1385643-1-stuarth@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# e54db882 23-Oct-2023 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

ASoC: codecs: wm8962: Handle component name prefix

Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names,
to include also the component's name prefix.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231023095428.166563-10-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>


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

ASoC: wm8962: 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 wm8962 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-34-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


# 3ca507bf 09-Nov-2022 Chancel Liu <chancel.liu@nxp.com>

ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register

DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate
correct frequency of LRCLK and BCLK. Sometimes the read-only value
can't be updated timely after enabling SYSCLK. This results in wrong
calculation values. Delay is introduced here to wait for newest value
from register. The time of the delay should be at least 500~1000us
according to test.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221109121354.123958-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# ee1aa2ae 10-Oct-2022 Xiaolei Wang <xiaolei.wang@windriver.com>

ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK

In wm8962 driver, the WM8962_ADDITIONAL_CONTROL_4 is used as a volatile
register, but this register mixes a bunch of volatile status bits and a
bunch of non-volatile control bits. The dapm widgets TEMP_HP and
TEMP_SPK leverages the control bits in this register. After the wm8962
probe, the regmap will bet set to cache only mode, then a read error
like below would be triggered when trying to read the initial power
state of the dapm widgets TEMP_HP and TEMP_SPK.
wm8962 0-001a: ASoC: error at soc_component_read_no_lock
on wm8962.0-001a: -16

In order to fix this issue, we add event handler to actually power
up/down these widgets. With this change, we also need to explicitly
power off these widgets in the wm8962 probe since they are enabled
by default.

Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Tested-by: Adam Ford <aford173@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221010092014.2229246-1-xiaolei.wang@windriver.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# ed5c2f5f 15-Aug-2022 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

i2c: Make remove callback return void

The value returned by an i2c driver's remove function is mostly ignored.
(Only an error message is printed if the value is non-zero that the
error is ignored.)

So change the prototype of the remove function to return no value. This
way driver authors are not tempted to assume that passing an error to
the upper layer is a good idea. All drivers are adapted accordingly.
There is no intended change of behaviour, all callbacks were prepared to
return 0 before.

Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com>
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omnia
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_power
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/*
Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2s
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5
Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccg
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iio
Acked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860
Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912b
Reviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxes
Acked-by: Corey Minyard <cminyard@mvista.com> # for IPMI
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/power
Acked-by: Krzysztof Hałasa <khalasa@piap.pl>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa@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>


# d1f5272c 26-May-2022 Adam Ford <aford173@gmail.com>

ASoC: wm8962: Fix suspend while playing music

If the audio CODEC is playing sound when the system is suspended,
it can be left in a state which throws the following error:

wm8962 3-001a: ASoC: error at soc_component_read_no_lock on wm8962.3-001a: -16

Once this error has occurred, the audio will not work again until rebooted.

Fix this by configuring SET_SYSTEM_SLEEP_PM_OPS.

Signed-off-by: Adam Ford <aford173@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220526182129.538472-1-aford173@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# e65f2fce 18-Apr-2022 Minghao Chi <chi.minghao@zte.com.cn>

ASoC: codecs: wm8962: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220418110259.2559144-1-chi.minghao@zte.com.cn
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>


# b5083c0c 02-Feb-2022 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: wm8962: Allow switching between analog and digital inputs

When the DMIC_ENA bit is set the analogue inputs are disconnected from
the digital core of the chip, in favour of the digital microphones.
Currently the driver will always enable DMIC_ENA whilst the GPIOs are
configured for the DMIC function, this means the user can't currently
use both the analog inputs and the digital inputs in one system.

Add an additional DAPM mutex that allows switching between analog and
digital inputs into the digital core.

Reported-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reported-and-tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Link: https://lore.kernel.org/r/20220202164545.30457-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 044c1140 18-Oct-2021 Geert Uytterhoeven <geert+renesas@glider.be>

ASoC: wm8962: Convert to devm_clk_get_optional()

Use the existing devm_clk_get_optional() helper instead of building a
similar construct on top of devm_clk_get() that fails to handle all
errors but -EPROBE_DEFER.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/c2a8a1a628804a4439732d02847e25c227083690.1634565564.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>


# d0426039 24-May-2021 YueHaibing <yuehaibing@huawei.com>

ASoC: wm8962: Use DEVICE_ATTR_WO macro

Use DEVICE_ATTR_WO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Message-Id: <20210524114753.39544-1-yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# aa4890f6 07-Mar-2021 Shengjiu Wang <shengjiu.wang@nxp.com>

ASoC: wm8962: Relax bit clock divider searching

With S20_3LE format case, the sysclk = rate * 384,
the bclk = rate * 20 * 2, there is no proper bclk divider
for 384 / 40, because current condition needs exact match.
So driver fails to configure the clocking:

wm8962 3-001a: Unsupported BCLK ratio 9

Fix this by relaxing bitclk divider searching, so that when
no exact value can be derived from sysclk pick the closest
value greater than expected bitclk.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1615170877-25918-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 07695752 14-Jan-2021 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: wm*: sync parameter naming (rate/sample_bits)

This patch syncs naming rule.

- xxx_rates;
+ xxx_rate;

- xxx_samplebits;
+ xxx_sample_bits;

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


# 3371c6f9 19-Nov-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

ASoC: codecs: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple break statements instead of just
letting the code fall through, and also add fallthrough pseudo-keywords
in places where the code is intended to fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/d17b4d8300dbb6aff0d055b06b487c96ca264757.1605896059.git.gustavoars@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 89383a27 15-Aug-2020 Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>

ASoC: wm8962: Export DAC/ADC monomix switches

This allows solutions like ALSA UCM to utilize hardware mono downmix
for cases where mono output to a single speaker is desired only in
specific situations (like on a mobile phone).

Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/3662154.EqNIRYjrc8@pliszka
Signed-off-by: Mark Brown <broonie@kernel.org>


# b023666e 03-Aug-2020 Fabio Estevam <festevam@gmail.com>

ASoC: wm8962: Do not remove ADDITIONAL_CONTROL_4 from readable register list

Removing ADDITIONAL_CONTROL_4 from the list of readable registers cause
audio distortion.

This change was sent as a comment below the --- line when submitting
commit 658bb297e393 ("ASoC: wm8962: Do not access WM8962_GPIO_BASE"), so
it was not supposed to get merged.

Keep WM8962_ADDITIONAL_CONTROL_4 inside wm8962_readable_register() to
fix the regression.

Fixes: 658bb297e393 ("ASoC: wm8962: Do not access WM8962_GPIO_BASE")
Reported-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20200803115233.19034-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 658bb297 17-Jul-2020 Fabio Estevam <festevam@gmail.com>

ASoC: wm8962: Do not access WM8962_GPIO_BASE

According to the WM8962 datasheet, there is no register at address 0x200.

WM8962_GPIO_BASE is just a base address for the GPIO registers and not a
real register, so remove it from wm8962_readable_register().

Also, Register 515 (WM8962_GPIO_BASE + 3) does not exist, so skip
its access.

This fixes the following errors:

wm8962 0-001a: ASoC: error at soc_component_read_no_lock on wm8962.0-001a: -16
wm8962 0-001a: ASoC: error at soc_component_read_no_lock on wm8962.0-001a: -16

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200717135959.19212-1-festevam@gmail.com
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>


# 920bef64 26-May-2020 Dinghao Liu <dinghao.liu@zju.edu.cn>

ASoC: wm8962: Fix runtime PM imbalance on error

pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200527024625.9937-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>


# 65e412a0 12-May-2020 Shengjiu Wang <shengjiu.wang@nxp.com>

ASoC: wm8962: Use force clear for WM8962_SYSCLK_ENA after reset

When CLOCKING2 is non-volatile register, we need force clear
the WM8962_SYSCLK_ENA bit after reset, for the value in cache
maybe 0 but in hardware it is 1. Otherwise there will issue
as below statement in driver.

/* SYSCLK defaults to on; make sure it is off so we can safely
* write to registers if the device is declocked.

Fixes: c38b608504aa ("ASoC: wm8962: set CLOCKING2 as non-volatile register")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1589347835-20554-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# c38b6085 23-Apr-2020 Shengjiu Wang <shengjiu.wang@nxp.com>

ASoC: wm8962: set CLOCKING2 as non-volatile register

Previously CLOCKING2 is set as a volatile register, but cause
issue at suspend & resume, that some bits of CLOCKING2 is not
restored at resume, for example SYSCLK_SRC bits, then the output
clock is wrong.

The volatile property is caused by CLASSD_CLK_DIV bits,
which are controlled by the chip itself. But the datasheet
claims these are read only and protected by the security key,
and they are not read by the driver at all.

So it should be safe to change CLOCKING2 to be non-volatile.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/6d25d5b36d4b9aeb8655b5e947dad52214e34177.1587693523.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 556672d7 11-Dec-2019 Shengjiu Wang <shengjiu.wang@nxp.com>

ASoC: wm8962: fix lambda value

According to user manual, it is required that FLL_LAMBDA > 0
in all cases (Integer and Franctional modes).

Fixes: 9a76f1ff6e29 ("ASoC: Add initial WM8962 CODEC driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1576065442-19763-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

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

Based on 2 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 version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

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

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


# 0bb423f2 08-Feb-2019 Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>

ASoC: regulator notifier registration should be managed

Regulator notifiers, that were registered during codec driver probing,
must be unregistered during driver release, or device managed versions
have to be used. This patch fixes codec drivers, that weren't explicitly
unregistering notifiers and simplifies those, that did that manually.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# a9531ab1 01-Aug-2018 Gustavo A. R. Silva <gustavo@embeddedor.com>

ASoC: wm8962: Mark expected switch fall-through

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

Addresses-Coverity-ID: 115043 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


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

ASoC: wm8962: 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 = 1 -> .idle_bias_on = 0
.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>


# c59b24f8 11-Sep-2016 Julia Lawall <Julia.Lawall@lip6.fr>

ASoC: constify gpio_chip structures

These structures are only used to copy into other structures, so declare
them as const.

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 gpio_chip i@p = { ... };

@ok@
identifier r.i;
expression e;
position p;
@@
e = i@p;

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

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

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>


# ab387b40 26-Aug-2016 Colin Ian King <colin.king@canonical.com>

ASoC: wm8962: fix spelling mistake "mesurement" -> "measurement"

Trivial fix to spelling mistake in dev_err message.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
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>


# f42b6f58 08-Dec-2015 Linus Walleij <linus.walleij@linaro.org>

ASoC: wm8962: use gpiochip data pointer

This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# 33362c69 28-Mar-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm8962: Correct typo when setting DSPCLK rate

The variable dspclk holds the rate of the DSPCLK, but the variable
sysclk holds an identifier for the clock. Currently if read a
non-sensical value from the DSPCLK_DIV register we assign sysclk to
dspclk, clearly this was intended to be sysclk_rate.

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


# 8bfa934e 28-Mar-2016 Fabio Estevam <fabio.estevam@nxp.com>

ASoC: wm8962: Fit error message into a single line

The error message fits well into a single line.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 65147846 28-Mar-2016 Fabio Estevam <fabio.estevam@nxp.com>

ASoC: wm8962: Disable clock if wm8962_runtime_resume() fails

When regulator_bulk_enable() fails inside wm8962_runtime_resume(),
we should disable the previously enabled clock.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 58383c78 04-Nov-2015 Linus Walleij <linus.walleij@linaro.org>

gpio: change member .dev to .parent

The name .dev in a struct is normally reserved for a struct device
that is let us say a superclass to the thing described by the struct.
struct gpio_chip stands out by confusingly using a struct device *dev
to point to the parent device (such as a platform_device) that
represents the hardware. As we want to give gpio_chip:s real devices,
this is not working. We need to rename this member to parent.

This was done by two coccinelle scripts, I guess it is possible to
combine them into one, but I don't know such stuff. They look like
this:

@@
struct gpio_chip *var;
@@
-var->dev
+var->parent

and:

@@
struct gpio_chip var;
@@
-var.dev
+var.parent

and:

@@
struct bgpio_chip *var;
@@
-var->gc.dev
+var->gc.parent

Plus a few instances of bgpio that I couldn't figure out how
to teach Coccinelle to rewrite.

This patch hits all over the place, but I *strongly* prefer this
solution to any piecemal approaches that just exercise patch
mechanics all over the place. It mainly hits drivers/gpio and
drivers/pinctrl which is my own backyard anyway.

Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Rafał Miłecki <zajec5@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Alek Du <alek.du@intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# e9f96bc5 10-Nov-2015 Sachin Pandhare <sachinpandhare@gmail.com>

ASoC: wm8962: correct addresses for HPF_C_0/1

From datasheet:
R17408 (4400h) HPF_C_1
R17409 (4401h) HPF_C_0
17048 -> 17408 (0x4400)
17049 -> 17409 (0x4401)

Signed-off-by: Sachin Pandhare <sachinpandhare@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org


# 0b170f7a 22-Oct-2015 Jiada Wang <jiada_wang@mentor.com>

ASoC: wm8962: set ALC2 as non-volatile register

Previously ALC2 register is set as a volatile register, declare
it as one of ALC Coefficients register together with other non-volatile
registers will cause issue, in case wm8962 has enter suspend mode,
and cache_only flag is set, any attempt to read from ALC2 will fail.

Because the 5 status bits in ALC2 aren't used anywhere nor are useful
to end user, so this patch removes ALC2 register from volatile
register list to make ALC2 be possible to be accessed when cache_only
flag is set.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 4eb0f7ab 19-Oct-2015 Jiada Wang <jiada_wang@mentor.com>

ASoC: wm8962: mark cache_dirty flag after software reset in pm_resume

By doing software reset of wm8962 in pm_resume, all registers which
have already been set will be reset to default value without regmap
interface be involved, thus driver need to mark cache_dirty flag,
to let regcache can be updated by regcache_sync().

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 57622aef 29-Sep-2015 Jiada Wang <jiada_wang@mentor.com>

ASoC: wm8962: balance pm_runtime_enable

pm_runtime_enable is called in probe to enable runtime PM
for wm8962 codec, but pm_runtime_disable isn't called in remove
callback, nor is called in error path if probe fails after runtime
PM is enabled, this causes unbalanced pm_runtime_enable.

This patch Adds pm_runtime_disable in remove callback and error path,
to balance pm_runtime_enable.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# ee92cfb0 18-Sep-2015 Zidan Wang <zidan.wang@freescale.com>

ASoC: wm8962: remove 64k sample rate support

wm8962 can't support 64k sample rate. When playing a 64KHz wave file,
'Unsupported rate 64000Hz' will be prompted.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


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

ASoC: wm8962: 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>


# 42d1b8ce 16-Jul-2015 Axel Lin <axel.lin@ingics.com>

ASoC: Constify dev_pm_ops variables

The dev_pm_ops variables are not modified after initialization in these
drivers, so make them const.

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


# 8019ff6c 16-Jul-2015 Nariman Poushin <nariman@opensource.wolfsonmicro.com>

regmap: Use reg_sequence for multi_reg_write / register_patch

Separate the functionality using sequences of register writes from the
functions that take register defaults. This change renames the arguments
in order to support the extension of reg_sequence to take an optional
delay to be applied after any given register in a sequence is written.
This avoids adding an int to all register defaults, which could
substantially increase memory usage for regmaps with large default tables.

This also updates all the clients of multi_reg_write/register_patch.

Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
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>


# c418a84a 05-Jul-2015 Axel Lin <axel.lin@ingics.com>

ASoC: Constify reg_default tables

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Peter Rosin <peda@axentia.se>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 57ef7fa7 01-Jun-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm8962: 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() and replace all
other manual access to codec->dapm with snd_soc_codec_get_dapm().

Also drop the unnecessary comparison in the set_bias_level() callback that
checks if the device is already at the target level. The core already takes
care of this and will not call the callback if the device is already at the
target 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>


# 6374b19d 13-Jan-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm8962: Replace w->codec snd_soc_dapm_to_codec(w->dapm)

The codec field of the snd_soc_widget struct is eventually going to be
removed, use snd_soc_dapm_to_codec(w->dapm) 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>


# 641d334b 12-Dec-2014 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

sound / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
depending on CONFIG_PM_RUNTIME may now be changed to depend on
CONFIG_PM.

Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under sound/.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>


# 3e4199ef 09-Nov-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm8962: Move DSP enable lock to the driver level

The wm8962 uses the snd_soc_codec mutex to protect the wm8962_dsp2_ena_put()
function from concurrent execution. This patch moves that lock to the driver
level. This will allow us to eventually remove the snd_soc_codec mutex.

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>


# 54ec2d5f 24-Oct-2014 Fabio Estevam <fabio.estevam@freescale.com>

ASoC: wm8962: Use the preferred form for passing a size of a struct

According to Documentation/CodingStyle - Chapter 14:

"The preferred form for passing a size of a struct is the following:

p = kmalloc(sizeof(*p), ...);

The alternative form where struct name is spelled out hurts readability and
introduces an opportunity for a bug when the pointer variable type is changed
but the corresponding sizeof that is passed to a memory allocator is not."

So do it as recommeded.

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


# 88d5e520 12-Jul-2014 abdoulaye berthe <berthe.ab@gmail.com>

driver:gpio remove all usage of gpio_remove retval in driver

this remove all reference to gpio_remove retval in all driver
except pinctrl and gpio. the same thing is done for gpio and
pinctrl in two different patches.

Signed-off-by: Abdoulaye Berthe <berthe.ab@gmail.com>
Acked-by: Michael Büsch <m@bues.ch>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# 5d5e63af 17-Sep-2014 Axel Lin <axel.lin@ingics.com>

ASoC: Remove return value checking for gpiochip_remove()

gpiochip_remove() will return void eventually.
Thus this patch removes return value checking for gpiochip_remove().

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


# d7821953 29-Jul-2014 Nicolin Chen <nicoleotsuka@gmail.com>

ASoC: wm8962: Let CODEC driver enable and disable its own MCLK

snd_soc_open() will trigger pm_runtime resume() which will then enable
the regulator and initialization. So we should make sure the MCLK is
enabled before this resume().

Previously we let the machine driver get the clock and enable it in
its probe(). However, considering about power saving, it'll be better
to enable it when it's going to be used and disable it after using.

So this patch just simply adds clk_get() and clk_enable() to WM8962
driver. Meanwhile, it marks clock pointer to NULL if no clock assigned
to it so it will not break any current function.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


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

ASoC: wm8962: 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>


# 44330ab5 13-May-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile

The register CLASS_D_CONTROL_1 is marked as volatile because it contains
a bit, DAC_MUTE, which is also mirrored in the ADC_DAC_CONTROL_1
register. This causes problems for the "Speaker Switch" control, which
will report an error if the CODEC is suspended because it relies on a
volatile register.

To resolve this issue mark CLASS_D_CONTROL_1 as non-volatile and
manually keep the register cache in sync by updating both bits when
changing the mute status.

Reported-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org


# c894e394 02-May-2014 Brian Austin <brian.austin@cirrus.com>

ASoC: Remove IS_ENABLED for INPUT in CS42L52 and WM8962

Now that INPUT is required for the CS42L52 and WM8962 we can remove the
IS_ENABLED(INPUT) check in the drivers.

Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 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>


# d7f31d3c 22-Feb-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm8962: Replace codec->control_data with wm8962->regmap

With the ongoing component-ization of the ASoC framework and the continuing
migration to using regmap for IO the control_data field of the snd_soc_codec
struct will eventually be removed. Prepare the wm8962 driver for this by using
wm8962->regmap instead of accessing the CODEC's control_data field.

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


# da6ebf83 18-Feb-2014 Takashi Iwai <tiwai@suse.de>

ASoC: wm8962: Use SOC_ENUM_SINGLE_DECL()

Just replace with the helper macro. No functional change at all.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>


# f1a3b8d9 18-Feb-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm8962: Update locking around use of DAPM pin API

The pin updates in this driver look like they are intended to be done
atomically, update to do so.

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


# 9d7433b0 30-Jan-2014 Mark Brown <broonie@linaro.org>

ASoC: wm8962: Reinitialise the IRQ completion rather than just trying it

This is better practice.

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


# d6f95e54 30-Jan-2014 Mark Brown <broonie@linaro.org>

ASoC: wm8962: Clean up error handling for failed FLL start

Don't record the FLL as having started and leave the hardware disabled
ensuring we are in a better state if this does happen to be a transient
error and making debugging easier.

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


# df6ab65f 30-Jan-2014 Mark Brown <broonie@linaro.org>

ASoC: wm8962: Check if we runtime resume the device when starting FLL

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


# 7e9614eb 30-Jan-2014 Mark Brown <broonie@linaro.org>

ASoC: wm8962: Hold a runtime PM reference while handling interrupts

If the device is runtime suspended then we can't interact with it as it
may have been powered off and the register map will be in cache only
mode.

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


# 75704ecf 04-Dec-2013 Nicolin Chen <b42378@freescale.com>

ASoC: wm8962: Enable SYSCLK provisonally before fetching generated DSPCLK_DIV

DSPCLK_DIV can be only generated correctly after enabling SYSCLK. But if the
current bias_level hasn't reached SND_SOC_BIAS_ON, DAPM won't enable SYSCLK,
which would cause the calculation result from DSPCLK_DIV invalid since bit
DSPCLK_DIV will be finally turned to its true value after DAPM enables SYSCLK
while the driver won't calculate it again for the current instance. In this
circumstance, a playback which needs non-zero DSPCLK_DIV would be distorted
due to unexpected clock frequency resulted from an invalid DSPCLK_DIV value.

So this patch provisionally enables the SYSCLK to get a valid DSPCLK_DIV for
calculation and then disables it afterward.

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


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

ASoC: wm8962: 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>


# 50bfcf2d 13-Nov-2013 Nicolin Chen <b42378@freescale.com>

ASoC: wm8962: Turn on regcache_cache_only before disabling regulator

It's safer to turn on regcache_cache_only before disabling regulator since
the driver will turn off the regcache_cache_only after enabling regulator.

If we remain cache_only false, some command like 'amixer cset' would get
failure if being run before wm8962_resume().

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org


# 69134367 06-Nov-2013 Takashi Iwai <tiwai@suse.de>

ASoC: wm8962: Replace BUG() with WARN()

BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation. For that
purpose, it'd be more convenient to use WARN() instead with more
error information.

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


# ae2ff9f6 01-Nov-2013 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: wm8962: Add EQ coefficient support

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# dea0c74f 01-Nov-2013 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: wm8962: Add ALC coefficient support

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# b5ef3f2a 29-Oct-2013 Nicolin Chen <b42378@freescale.com>

ASoC: wm8962: Fix null pointer pdata access in I2C probe()

When using DT binding to pass private data, there would be Kernel panic
occuring due to NULL pointer access in wm8962_i2c_probe(). Thus fix it.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 78b78f5c 17-Oct-2013 Mark Brown <broonie@linaro.org>

ASoC: wm8962: Move register initialisation to I2C probe()

This is more idiomatic and is required for robust operation since we must
ensure that the clocking configuration is valid as rapidly as possible.

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


# ca50410b 17-Oct-2013 Mark Brown <broonie@linaro.org>

ASoC: wm8962: Move interrupt initalisation to probe()

This is more idiomatic and fixes bugs in the error handling paths.

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


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

ASoC: wm8962: Use power efficient workqueue

The accessory detect debounce work 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>


# b785a492 19-Jul-2013 Jingoo Han <jg1.han@samsung.com>

ALSA: replace strict_strto*() with kstrto*()

The usage of strict_strto*() is not preferred, because
strict_strto*() is obsolete. Thus, kstrto*() should be
used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 444fc4b3 19-Jul-2013 Fabio Estevam <fabio.estevam@freescale.com>

ASoC: wm8962: Do not call configure_bclk() inside wm8962_set_dai_sysclk()

Currently after playing any audio file, we get the following error message:

$ aplay clarinet.wav
Playing WAVE 'clarinet.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
$ wm8962 0-001a: Unsupported sysclk ratio 544

This error message appears about 5 seconds after the audio playback has
finished.

Quoting Mark Brown [1]:

"The issue here is triggered by the machine
switching from the FLL to direct MCLK usage where the MCLK isn't
generating a useful ratio.

I suspect we should just kill the configure_bclk() in set_sysclk(), that
one isn't safe as we can't reconfigure a live SYSCLK and it's probably
the one that generates your warnings."

Confirmed that the "Unsupported sysclk ratio" error message comes from
wm8962_set_dai_sysclk(), so get rid of wm8962_configure_bclk() inside this
function.

[1] http://mailman.alsa-project.org/pipermail/alsa-devel/2013-July/064241.html

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


# 4642aabd 04-Jul-2013 Shawn Guo <shawn.guo@linaro.org>

ASoC: wm8962: fix NULL pdata pointer

There is an error in merge commit 384b834 on conflict resolution which
causes the following NULL pdata pointer bug.

wm8962 0-001a: customer id 0 revision D
Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = 80004000
[00000004] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0+ #1
task: bf870000 ti: bf874000 task.ti: bf874000
PC is at wm8962_probe+0x134/0x6c8
LR is at regmap_unlock_mutex+0x10/0x14
pc : [<80452100>] lr : [<80304cf4>] psr: a0000113
sp : bf875c98 ip : 00000000 fp : bf875cd4
r10: 00000000 r9 : bfb1830c r8 : 80779bc4
r7 : 00000000 r6 : 00000001 r5 : bfbac010 r4 : bfb33e00
r3 : 80304ce4 r2 : 00000000 r1 : 00000001 r0 : fffffffb
Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 10c53c7d Table: 1000404a DAC: 00000017
Process swapper/0 (pid: 1, stack limit = 0xbf874238)
Stack: (0xbf875c98 to 0xbf876000)
...

Fix the error by assigning pdata a correct pointer.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>


# f5055f93 14-Jun-2013 Nicolin Chen <b42378@freescale.com>

ASoC: wm8962: Enable start-up and normal bias after reset in runtime resume

This part of bias settings are essential for WM8962 to power up. Without it
"wm8962 0-001a: DC servo timed out" might be prompted due to power-up failure
that happens to FLL if being used.

The driver's also bringing the bias down in the suspend path so it needs to be
powered up in the resume path for symmetry.

According to dapm_pre_sequence_async(), DAPM would call pm_runtime_get_sync()
to let driver finish the bias settings in pm_runtime_resume() before the bias
level being set to STANDBY. So no need to worry about disordered settings for
VMID of WM8962.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 2e7ee15c 13-Jun-2013 Nicolin Chen <b42378@freescale.com>

ASoC: wm8962: Remove remaining direct register cache accesses

Also fix return values for headphone switch updates.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org


# 9c24b167 07-Jun-2013 Mark Brown <broonie@linaro.org>

ASoC: wm8962: Restore device state after reset in runtime resume

After the device has been reset we need to repeat the same
initialisation we do on probe to make sure that the device is in
a known state.

Tested-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# d74e9e70 06-Jun-2013 Nicolin Chen <b42378@freescale.com>

ASoC: wm8962: Add device tree binding

Document the device tree binding for the WM8962 codec, and modify the
driver to extract platform data from the device tree, if present.

Based on work of WM8903 by Stephen Warren <swarren@nvidia.com>

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# e75a52c6 06-Jun-2013 Nicolin Chen <b42378@freescale.com>

ASoC: WM8962: Create default platform data structure

Embed a copy of struct wm8962_pdata in stuct wm8962_priv
so that there's no need to check validity of pdata any more.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 346f1d40 11-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Unconditionally wait for the FLL to lock

If the FLL is being shut down we will exit early so there is no need to
check here and in fact we're checking the wrong thing anyway.

Reported-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a2ce6475 20-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Convert to devm_input_allocate_device()

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


# 5ce56832 12-Dec-2012 Fabio Estevam <fabio.estevam@freescale.com>

ASoC: wm8962: Add device tree support

Add device tree support.

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


# 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>


# b439c6d0 26-Nov-2012 Sachin Kamat <sachin.kamat@linaro.org>

ASoC: wm8962: Use devm_regmap_init_i2c()

devm_regmap_init_i2c() is device managed and makes error
handling and code cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 92437cbb 26-Nov-2012 Sachin Kamat <sachin.kamat@linaro.org>

ASoC: wm8962: Use devm_regulator_bulk_get

devm_regulator_bulk_get() is device managed and makes error
handling and code cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 52c0eee3 30-Jul-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Don't duplicate bias level management in resume

The core will bring the bias level up for us since we use idle_bias_off,
duplicating this may be harmful.

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


# 9d40e558 30-Jul-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Allow VMID time to fully ramp

Required for reliable power up from cold.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org


# e4dd7678 11-Jul-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Redo early init of the part on resume

Ensure robust startup of the part by going through the reset procedure
prior to resyncing the full register cache, avoiding potential intermittent
faults in some designs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org


# 081413f2 02-Jul-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Log AIF configuration requested by hw_params()

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.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>


# 93a86bea 05-Mar-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Add HPF coefficient configuration support

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


# 5462fccd 21-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Add HD Bass and VSS coefficient configuration

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


# fd0ca45b 21-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Add Dynamic Range Control support

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


# acf31d43 21-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Add Direct-Form 1 filter support

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


# 69e5a39f 21-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Add 3D enhancement support

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


# 26b427a7 23-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Implement DSP2 configuration initialisation

We can simply use the register cache code to synchronise the current
configuration down to the device when bringing up the DSP.

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


# ba106ce3 05-Mar-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Remove defaults for volatile registers

Save a little RAM.

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


# fbe4ff79 23-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Remove unneeded pm_runtime_set_active()

The default pm_runtime status is enabled which is what we want.

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


# 1355ab14 01-Mar-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Run the headphone in class G mode when sidetone is enabled

Class W mode with sidetone is not fully supported.

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


# df0c016d 29-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Remove register default for PLL2

The initial value can be changed depending on system configuration.

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


# 0512615d 23-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Convert interrupt handler to direct regmap usage

Avoids potential locking issues with anything that needs the CODEC lock.

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


# d690516c 22-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Remove mistakenly committed debug logging

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


# 9d50a764 16-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Convert to module_i2c_driver()

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


# d23031a4 31-Jan-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Convert to runtime PM for bias off management

This allows userspace control of final power off, allowing policy decisions
for register configuration retention.

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


# a968d9db 27-Jan-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Don't automatically enable and disable FLL

Only enable and disable the FLL when explicitly told to, supporting some
additional use cases and making the driver behaviour more standard.

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


# 5aa9b858 16-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Clean up register dump cruft

No longer needed with regmap.

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


# 07fabd1b 16-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Add new SYSCLK ratios for new device revisions

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


# eeba1f8b 16-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Log the selected SYSCLK ratio

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


# 1993502d 16-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Only configure BCLK in hw_params when audio is active

Otherwise we might not have a sensible clocking setup ready.

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


# 71de4d27 16-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Update the clocking when setting system clock

Make sure we update for any changes in cases where we reconfigure while
live (eg, for analogue bypass).

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


# 905b4195 15-Feb-2012 Axel Lin <axel.lin@gmail.com>

ASoC: Show device id in the debug message

Show the id we read when the id mismatch is detected.
This is useful for debugging.

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


# 31794bc3 13-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Fix sidetone enumeration texts

The sidetone enumeration texts have left and right swapped.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org


# 4c6c0b5e 08-Feb-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Support mono playback and record

Make sure we generate enough BCLKs for I2S style modes by always having
a minimum of two channels worth of clocks for the BCLK.

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


# 022658be 03-Feb-2012 Liam Girdwood <lrg@ti.com>

ASoC: core: Add support for DAI and machine kcontrols.

Currently ASoC can only add kcontrols using codec and platform component device
handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for
SoC card machine drivers too. This allows the kcontrol to have a direct handle to
the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily
get it's private data.

This change makes snd_soc_add_controls() static and wraps it in the folowing
calls (card and dai are new) :-

snd_soc_add_card_controls()
snd_soc_add_codec_controls()
snd_soc_add_dai_controls()
snd_soc_add_platform_controls()

This patch also does a lot of small mechanical changes in individual codec drivers
to replace snd_soc_add_controls() with snd_soc_add_codec_controls().

It also updates the McBSP DAI driver to use snd_soc_add_dai_controls().

Finally, it updates the existing machine drivers that register controls to either :-

1) Use snd_soc_add_card_controls() where no direct codec control is required.
2) Use snd_soc_add_codec_controls() where there is direct codec control.

In the case of 1) above we also update the machine drivers to get the correct
component data pointers from the kcontrol (rather than getting the machine pointer
via the codec pointer).

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


# 2b6712b1 30-Jan-2012 Susan Gao <sgao@opensource.wolfsonmicro.com>

ASoC: wm8962: Fix word length configuration

Signed-off-by: Susan Gao <sgao@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org


# 2693efd6 27-Jan-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Enable idle_bias_off

The WM8962 has ground referenced and class D outputs so can happily go
down to BIAS_OFF without a large startup time.

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


# 5539a102 25-Jan-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Mark register cache as dirty when regulators are disabled

Otherwise we won't resync later.

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


# 182c51ce 24-Jan-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm8962: Optimise power consumption for IN4 DC measurement usage

When the hardware is configured with one or both of the IN4 inputs used
for DC measurement (with no DC blocking capacitor connected) then we can
improve power consumption slightly in idle modes by applying a register
write sequence. Provide platform data to enable this, implemented using
a regmap patch.

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


# 5f52ee48 11-Jan-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add WM8962 DAC and ADC L/R swap support

Simple switches since there's no per-channel control.

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


# cef6d1d4 11-Jan-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Convert WM8962 register access map to modern style

Much more compact, both in terms of source and especially in terms of
RAM used at runtime.

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


# 291d64be 10-Jan-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Make WM8962 I2C usage unconditional

We only support I2C so no need to ifdef.

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


# fe75fe0e 30-Dec-2011 Axel Lin <axel.lin@gmail.com>

ASoC: Fix return value of wm8962_gpio_direction_out()

We can't just pass back the return value of snd_soc_update_bits() as it
will be 1 if a bit changed rather than zero.

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


# 1b39bf34 28-Dec-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Enable ASoC register map dump for some regmap CODECs

It's still useful to be able to poke around in the register map at
runtime.

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


# 36c6b54c 27-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Make WM8962 beep a signal generator

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


# be086aa8 27-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Convert WM8962 to devm_kzalloc()

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>


# 43e9dc7b 20-Nov-2011 Clemens Ladisch <clemens@ladisch.de>

ASoC: wm8962: fix DB_RANGE size

Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the arrays.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>


# 0469e7b9 08-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Disable debounce on some WM8962 interrupts

Allow them to work when the device is unclocked.

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


# 7b16f560 01-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Convert WM8962 to direct regmap usage

This initial conversion just moves the register init, regulator acquisition
and device verification out to the I2C probe(). Movement of other parts of
the driver like the GPIO and beep generation code will follow.

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


# 94b88e64 04-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Manage thermal shutdown for WM8962

Disable the thermal shutdown circuits for headphone and speaker when the
relevant outputs are not enabled in order to save current in idle modes.

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


# 00ae3b86 01-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Disable MICBIAS and SYSCLK when stopping WM8962 accessory detection

They aren't needed any more. If machines need them for other purposes then
further changes will be required.

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


# a5ef9884 01-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: WM8962 accessory detection requires MICBIAS

Force MICBIAS on as well as SYSCLK as the WM8962 accessory detection can't
function without both. No point in making machine drivers manually enable
it.

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


# db0e5543 01-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Enable SYSCLK last when enabling WM8962 mic detection

Ensure everything is set up before we start detecting.

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


# 2a761cde 01-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Start WM8962 FLL if SYSCLK is enabled

Since we have code to automatically manage the start and stop of the FLL
based on the SYSCLK widget if SYSCLK is already enabled and the FLL is
configured then we need to start it up.

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


# 0b7dd6ad 01-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Ensure we always delay for WM8962 FLL when starting from SYSCLK

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org


# 2af8de8c 01-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Ensure the WM8962 oscillator and PLLs start up disabled

Since there is no current software control for these they would otherwise
be left enabled, consuming power.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org


# 4f4488ab 01-Nov-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Ensure WM8962 PLL registers are reset

The WM8962 has a separate software reset for the PLL registers. Ensure that
these are reset also on startup.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org


# 38f3f31a 23-Sep-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove direct register cache accesses from WM8962 driver

Also fix return values for speaker switch updates.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org


# fbc7c62a 29-Sep-2011 Susan Gao <sgao@opensource.wolfsonmicro.com>

ASoC: Fix a bug in WM8962 DSP_A and DSP_B settings

Signed-off-by: Susan Gao <sgao@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmico.com>
Cc: stable@kernel.org


# 086d7f80 23-Sep-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Convert WM8962 MICBIAS to a supply widget

A supply widget is generally clearer than a MICBIAS widget and a mic bias
is just a type of supply so use a supply widget for the MICBIAS. This also
avoids confusion with the routing when connected to multiple inputs.

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


# 3f7d55a1 23-Sep-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Rename WM8962 DMIC widget to DMIC_ENA

Matches the register name and avoids confusion with board widgets.

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


# f93dc4b6 19-Sep-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Remove bitrotted wm8962_resume()

This functionality is now subsumed within the bias management, using the
standard cache management functionality, without assuming the cache type.

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


# fbf04076 21-Aug-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Provide more detail on WM8962 thermal shutdown status

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


# 4df0cb2f 21-Aug-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Clear any outstanding WM8962 FLL lock completions before waiting

Ensure that we don't spuriously trigger early.

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


# e6ef5870 21-Aug-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Report IRQ_NONE when we don't see an interrupt from WM8962

This should never happen with level triggered IRQs.

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


# 6f88a4e5 16-Aug-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Initial WM8962 DSP2 support

The WM8962 features a DSP providing a number of signal processing
features including HD Bass and Virtual Surround Sound (VSS). Enable
initial support for this, allowing users to enable and disable the
algorithms using the default coefficient sets. Further patches will
add support for runtime configuration of the DSP coefficients.

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


# 1ab63da7 21-Aug-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add basic WM8962 capture low/high pass filter control

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


# a115c728 03-Aug-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Move WM8962 CLKREG_OVD earlier

When the clocking registers are not overriden some of the registers are
not writable.

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


# 3198b9eb 20-Jul-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Acknowledge WM8962 interrupts before acting on them

This closes the small race between a status being read in response to an
interrupt and clearing the interrupt, meaning that if the status changes
between those periods we might not get a reassertion of the interrupt.

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


# 417ceff9 08-Jun-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Defer all WM8962 clocking configuration until power up

Don't require an audio rate SYSCLK in hw_params() in order to better
support microphone detection use cases.

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


# 8f63aaa88 07-Jun-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Implement base 5 band EQ control for WM8962

ReTune Mobile modes are not currently supported.

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


# 649a1a0e 07-Jun-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Report errors when we have a WM8962 IRQ and don't get FLL lock

We really should be getting the interrupt - if we don't get one it's very
likely that the configuration is incorrect and audio will fail. Also
increase the timeout substantially in this case for safety.

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


# c7356da9 07-Jun-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Factor out I2C usage in WM8962 driver

The chip can actually support SPI so we shouldn't assume we've got an I2C
device even though that's the most common configuration.

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


# 0f82bdf5 07-Jun-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Fix WM8962 headphone volume update for use of advanced caches

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


# 6be449e5 26-Apr-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Implement WM8962 ADC high pass filter configuration

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


# 5357e8f5 25-Apr-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Don't warn if the WM8962 SYSCLK FLL setting doesn't match reality

When bringing up audio low power modes boards may configure SYSCLK before
they actually start the FLL as we do much of the clocking setup prior to
the power up sequence.

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


# e47ac37c 25-Apr-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Implement WM8962 DMIC support

DMIC support is automatically disabled when none of the GPIOs are set up
to bring out the DMICCLK and DMICDAT pins at startup.

Note that there's no support for controlling DMIC routing except the power
control so the board DAPM configuration will need to manage DMIC enable and
disable if analogue mics (eg, a headset) also exist.

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


# 92a4352c 25-Apr-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Move WM8962 FLL configuration to CODEC

There's only one DAI anyway.

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


# 3b8a6d80 25-Apr-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Support FLL lock interrupt on WM8962

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>


# d71bb810 31-Jan-2011 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Accept any logical value for WM8962 GPIO set()

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


# a1b3b5ee 24-Dec-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Avoid direct register cache access when setting defaults

Directly accessing the register cache means that we can't use anything
except a flat register cache so use snd_soc_update_bits().

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


# d4754ec9 12-Jan-2011 Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

ASoC: Update users of readable_register()/volatile_register()

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>


# 7f87e30e 28-Dec-2010 Lars-Peter Clausen <lars@metafoo.de>

ASoC: codecs: wm8962: 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 wm8962 driver still uses its own register cache for its
private functions, while functions from the ASoC core use the generic cache.
Thus we end up with two from each other incoherent caches, which can lead to
undefined behaviour.
This patch fixes the issue by changing the wm8962 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>
Cc: stable@kernel.org (for 2.6.37 only)


# 6dc47e97 27-Dec-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: One more x86 typo fix

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


# 3f1c6326 27-Dec-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Fix typo in x86 workaround

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


# 1435b940 22-Dec-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: ifdef out trace points from modules for x86

No idea why this works on ARM but not x86.

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


# 2bbb5d66 04-Dec-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Trace Wolfson jack detection IRQs

Add jack detection interrupt trace to Wolfson CODEC drivers.

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


# 2a7b1a00 07-Dec-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Correct WM8962 interrupt mask register read

Fix mismerge from the out of tree BSP where this support was developed.

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


# 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>


# ce0df3d7 16-Nov-2010 Axel Lin <axel.lin@gmail.com>

ASoC: Fix incorrect kfree in wm8962_probe error path

We allocated memory for wm8962 in wm8962_i2c_probe,
and will free the memory in either wm8962_i2c_probe error path
or wm8962_i2c_remove.

Thus we should not call kfree(wm8962) in wm8962_probe, otherwise
we have double free of wm8962.

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


# cb2b3cf1 11-Nov-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Reset WM8962 with default ID value

The value makes no odds and it makes life easier with caches.

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


# 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>


# 11e16eb3 03-Nov-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Use pm_wakeup_event() in WM8962 jack detection

Ensure that the system does not suspend while we process a WM8962 jack
event by using pm_wakeup_event() to block the suspend while we're waiting
for the jack to settle. Use a slightly longer timeout than the jack waits
to allow for other stuff to take over and delays in scheduling.

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


# 74a557e2 03-Nov-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Check return value of strict_strtoul() in WM8962

strict_strtoul() has been made __must_check so do so.

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


# 821f4206 21-Sep-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add WM8962 microphone bias control

We unconditionally require SYSCLK since while only microphone detection
specifically requires SYSCLK any actual use case would enable it via
some other means but microphone detection may have nothing active other
than the bias itself.

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


# c969f19f 07-Oct-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Compress WM8962 register access map

Reduce the source code size still futher by only specifying non-zero
rows in the WM8962 access map.

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


# f57f6c04 07-Oct-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Shrink code size for WM8962 register defaults table

Dramatically reduce the code size for the WM8962 register defaults table
by switching to explicitly initialise only defined registers, relying on
static defaulting to zero for the overwelming bulk of the register map.

Similar treatement for the register access table will come later and will
produce a similarly dramatic code size shrink.

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


# 8ca2aa9c 01-Oct-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Put WM8962 GPIO2/3 into GPIO mode when configuring platform data too

GPIO2 and GPIO3 on the WM8962 are MFPs and need to be put into GPIO mode
before the GPIO block can be used to control them. We're already doing
this when used via gpiolib, factor out the code for use when setting static
configurations via platform data as well.

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


# 7711308a 30-Sep-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Implement interrupt based jack detection

Allow microphone detection on WM8962 to be performed using the interrupt
signal, allowing the detection of both microphone presence and button
presses with a signal singal from the CODEC to CPU. Currently a 250ms
debounce time is applied to both short circuit and presence detection,
this has not been optimised.

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


# 3367b8d4 20-Sep-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add support for WM8962 GPIO outputs

The WM8962 features five GPIOs, add support for controlling their output
state via gpiolib.

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


# d330a080 30-Sep-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Relax restrictions on WM8962 BCLK configuration

The restrictions on configuring BCLK are overly cautious, other constraints
in the system should ensure that reconfiguration is not possible when the
device is sufficiently active to be unable to support reclocking.

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


# a4f28c00 29-Sep-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Provide microphone bias configuration for WM8962

Add the widget for MICBIAS power control and allow configuration of the
microphone bias setup via the platform data for the WM8962. When
microphone status signals are brought out to GPIO this should be
sufficient to enable microphone detection.

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


# 45e65504 28-Sep-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Initial WM8962 IRQ support

Provide an initial hookup for interrupts on the WM8962. Currently we simply
report error status via log messages if an IRQ is provided for the device.

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


# ea738bad 20-Sep-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Lowercase WM8962 CODEC name

For consistency.

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


# 61371126 27-Sep-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Fix masking of WM8962 FLL1 register

When configuring the FLL we preserve the FLL enable configuration in order
to allow us to reenable the FLL after configuration but we do not clear
the other bits in the register, causing old configuration to be preserved.

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


# 13f808cf 20-Sep-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Fix merge issue with WM8962 control addition

Let's not add the core controls twice.

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


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

ASoC: Fix off-by-one bug in WM8962 register cache size configuration

This is a simple off-by-one bug, the size of the register cache is
incorrectly set to the maximum register index. Fix it by adding one.

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>


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

ASoC: Update WM8962 to build with multi-component

No notable changes, currently build tested only.

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


# 9a76f1ff 05-Aug-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: Add initial WM8962 CODEC driver

The WM8962 is a low power, high performance stereo CODEC designed for
portable digital audio applications.

This initial driver release supports the key audio paths of the WM8962.
Extended functionality, such as microphone detection, digital microphones
and the advanced DSP signal enhancements provided by the device are not
yet supported.

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