History log of /linux-master/sound/soc/codecs/wm5102.c
Revision Date Author Comments
# 586685f1 08-Aug-2023 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: codecs/wm*: merge DAI call back functions into ops

ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

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


# a350c556 08-Aug-2023 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: codecs/wm*: merge DAI call back functions into ops

ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

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


# 25a4c269 15-Mar-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ASoC: codecs: wm5102: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-58-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>


# de71d756 10-Oct-2022 Zhang Qilong <zhangqilong3@huawei.com>

ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe"

This reverts commit fcbb60820cd3008bb44334a0395e5e57ccb77329.

The pm_runtime_disable is redundant when error returns in
wm5102_probe, we just revert the old patch to fix it.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221010114852.88127-2-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 96e4abbd 29-Sep-2022 Zhang Qilong <zhangqilong3@huawei.com>

ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by calling
pm_runtime_disable when error returns.

Fixes:93e8791dd34ca ("ASoC: wm5102: Initial driver")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220929150653.63845-4-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# fcbb6082 28-Sep-2022 Zhang Qilong <zhangqilong3@huawei.com>

ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of wm5102_probe.

Fixes:93e8791dd34ca ("ASoC: wm5102: Initial driver")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220928160116.125020-4-zhangqilong3@huawei.com
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>


# 71b5ab96 28-Jun-2022 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: wm5102: Fix event generation for output compensation

The output compensation controls always returns zero regardless of if
the control value was updated. This results in missing notifications
to user-space of the control change. Update the handling to return 1
when the value is changed.

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


# e1468202 13-Sep-2021 Simon Trimmer <simont@opensource.cirrus.com>

ASoC: wm_adsp: Split out struct cs_dsp from struct wm_adsp

In preparation for moving the generic DSP support out of ASoC split
struct wm_adsp into two parts, one will form the structure for the new
generic DSP code and embed that one into wm_adsp.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-15-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5beb8eea 13-Sep-2021 Simon Trimmer <simont@opensource.cirrus.com>

ASoC: wm_adsp: Rename generic DSP support

This rename is preparation for moving the generic DSP support out of
ASoC, generic code named wm_* will be renamed to cs_*.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-6-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# b6f5d62e 26-May-2021 Rikard Falkeborn <rikard.falkeborn@gmail.com>

ASoC: wm5102: Constify static struct snd_compress_ops

The snd_compress_ops structs are only stored in the compress_ops field
of a snd_soc_component_driver struct, so make it const to allow the
compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210526231013.46530-3-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 37dbabf1 07-Mar-2021 Hans de Goede <hdegoede@redhat.com>

ASoC: arizona: Make the wm5102, wm5110, wm8997 and wm8998 drivers use the new jack library

Make all arizona codec drivers for which drivers/mfd/arizona-core.c used
to instantiate a "arizona-extcon" child-device use the new arizona-jack.c
library for jack-detection.

This has been tested on a Lenovo Yoga Tablet 2 1051L with a WM5102 codec.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307151807.35201-13-hdegoede@redhat.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>


# 79405e3e 15-Oct-2020 Richard Fitzgerald <rf@opensource.cirrus.com>

ASoC: wm5102: Use get_unaligned_be16() for dac_comp_coeff

Replace the two-step copy-and-convert in
wm5102_out_comp_coeff_put() with get_unaligned_be16(). Apart from
looking nicer, it avoids this sparse warning:

wm5102.c:687:35: sparse: sparse: cast to restricted __be16

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20201015102703.24622-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3a5ccf25 20-Apr-2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: codec: wm_adsp: use snd_compress_ops

We can use snd_compress_ops.
Let's switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87tv1evdlu.wl-kuninori.morimoto.gx@renesas.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>


# 4e08d50d 19-Mar-2019 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: wm_adsp: Factor out DSP specific operations

In preparation for the addition of more types of DSP core refactor the
handling of DSP specific operations such as starting the memory or
enabling the core into a set of callbacks. This should make it easier to
add new core types and allow for more code reuse between them.

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


# b9070df4 19-Mar-2019 Richard Fitzgerald <rf@opensource.cirrus.com>

ASoC: wm_adsp: Move wm_adsp2_set_dspclk to CODEC drivers

The original wm_adsp2_early_event took an additional frequency
argument for clocking control so could not be used directly as a
DAPM callback. But this setup could equally be done by the codec
driver function wrapping wm_adsp2_early event. In preparation
for adding support for new core types wm_adsp2_set_dspclk has
been exported, and the freq argument removed so that it can
be used directly as a DAPM callback.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 909d74e3 31-Jan-2019 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: arizona: Add channel numbers to AIFs

Set the channel number on each AIF widget to allow unused channels not
to be powered up across AIFs.

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


# 0a047f07 08-Aug-2018 Richard Fitzgerald <rf@opensource.cirrus.com>

ASoC: wm_adsp: Declare firmware controls from codec driver

To allow for more flexibility in naming of DSP-type cores
move the creation of the firmware controls to the codec
drivers instead of having a hardcoded list in wm_adsp.

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


# 1b31de92 20-Jun-2018 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: arizona: Set compressed IRQ to a wake source

The current code is not setting the compressed IRQ as a wake
source. Normally this doesn't cause any issues as the CODEC
IRQ is set as a wake source by the jack detection code and the
CODEC only produces a single IRQ line. However if the system
is not using jack detection the compressed audio IRQ should
still function as a wake source, as such directly set the
compressed audio IRQ as a wake source.

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


# 7dd0f7ca 20-Feb-2018 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: arizona: Fixup some minor formatting issues

Repair any formatting/style issues that can be fixed without major
code refactoring.

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


# 0fe1daa6 12-Feb-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: arizona: replace codec to component

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

Because there are many drivers which are using arizona,
we need to update these all related drivers in same time.
Otherwise compile error/warning happen

Note:

cs47l24
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

wm5102
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

wm5110
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

wm8997
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

wm8998
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>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


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

ASoC: wm5102: replace platform to component

Now platform can be replaced to component, let's do it.
This patch merges wm5102_compr_platform into soc_codec_dev_wm5102

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 2d6e28c3 27-Nov-2017 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: use snd_soc_component_init_regmap() on wm5102

To setup regmap, ALSA SoC has snd_soc_component_init_regmap() and
.get_regmap. But these are duplicated feature.
Let's use snd_soc_component_init_regmap() and remove .get_regmap

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


# 85e7dd3f 04-Sep-2017 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: arizona: Add support for setting the output volume limits

The output volume limits allow signals to be limited to specific levels
appropriate for the hardware attached. As this is a property of the
hardware itself these will be configured through device tree.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0a229b15 04-Sep-2017 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: arizona: Add handling for audio related device tree entries

Currently all the audio related device tree entries are handled by the
MFD code, for most parts of the Arizona driver we group the device
tree handling with the component that uses it and should do so here as
well.

Add handling in the ASoC code for the audio device tree entries, a
later patch removes the MFD side handling but there is no harm in it
being duplicated temporarily.

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


# 9e3f9f36 04-Sep-2017 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: arizona: Add new common Arizona init function

Currently the driver has quite a few small initialisation functions, in
preparation for some refactoring add a new function arizona_init_common.
This will be used bus probe level initialisation that is common across
Arizona devices. For now just move the notifier chain initialisation in
there.

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


# 4dbcc5ff 16-Aug-2017 Bhumika Goyal <bhumirks@gmail.com>

ASoC: codecs: make snd_compr_ops const

Make these const as they are only stored in the compr_ops field of a
snd_soc_platform_driver structure, which is of type const.
Done using Coccinelle

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0ed6f157 14-Aug-2017 Bhumika Goyal <bhumirks@gmail.com>

ASoC: codecs: make snd_soc_platform_driver const

Make these const as they are either passed as the 2nd argument to the
function devm_snd_soc_register_platform or snd_soc_register_platform,
and the arguments are of type const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# acff07d0 18-Jan-2017 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Propagate errors from arizona_spk_init

arizona_spk_init uses snd_soc_dapm_new_control which since
commit 37e1df8c95e2 ("ASoC: dapm: handle probe deferrals") will
occasionally request a probe deferral. Which means we should propagate the
error out of our driver from it.

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


# af813a6f 06-Jan-2017 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm_adsp: Add mechanism to preload firmware on a core

As requirements to bring up audio paths are continuous getting tighter
and the DSP download to most ADSP devices happens over an external bus
it can become an important factor in the path bring up time. As such
sometimes it is a reasonable trade off to download the firmware ahead of
when it will be required and take a small hit on power consumption for
keeping the core powered up.

This "preloading" adds an additional control for each DSP core "DSPx
Preload Switch" that when set to true will power up the DSP core and
download the firmware currently selected in the "DSPx Firmware" control.
Whilst the core is preloaded the current firmware can not be changed and
the CODEC will be kept powered up and SYSCLK held on. Although future
improvements may allow the SYSCLK to be powered down as well because
the hardware only requires SYSCLK whilst the download is actually taking
place, but this is not covered in this series.

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


# 35f4403e 29-Nov-2016 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: arizona: Use component pin control functions

We need to modify the state of some of our own pins and are currently
not taking account that the pin name may have a name_prefix applied
to it.

Replace the snd_soc_dapm_x_pin functions with the equivalent
snd_soc_component_x_pin functions so that any name_prefix will be
handled automatically.

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


# 88c18860 10-Nov-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Call arizona_init_notifiers for all CODECs

The call to arizona_init_notifiers was only added for CODECs that are
generating voice trigger events, however, this is somewhat annoying
for machine drivers that might be used with multiple CODECs as they
need to conditionally register for the notifier, depending on the
CODEC being attached.

As the cost of initialising the notifier is so minimal, and we may
well add other events in the future that apply to more CODECs, simply
do this for all Arizona CODECs.

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


# 1095e281 26-Oct-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Access driver data through platform from compressed ops

As the compressed ops run on the platform side of things we should
really access the driver data through the platform pointer rather than
the CODEC pointer. As the compressed DAIs in our systems always connect
our CODEC to our platform this has never been an issue, but should still
be corrected. Additionally it clears the way for future core refactoring
work.

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


# 0809492e 26-Oct-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Move request of DSP IRQ into bus probe

It is more idiomatic to request all resources in the bus level probe,
this patch moves the request of the DSP compressed data IRQ from the
ASoC level probe into the bus level probe.

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


# 31833ead 26-Oct-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Move request of speaker IRQs into bus probe

It is more idiomatic to request all resources in the bus level probe,
this patch moves the request of the speaker thermal event IRQs from the
ASoC level probe into the bus level probe.

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


# 7a4413d0 21-Oct-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Add gating for clock when used for direct MCLK

Whilst ultimately we would like to move all the clocking over to the
clock framework, as an intermediate step to get people going for now
gating the source clocks for SYSCLK/ASYNCCLK when they are configured
to come directly from an MCLK pin.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 3577357a 20-Sep-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Attach SYSCLK to DSP preloaders

Currently SYSCLK is attached to every compressed DAI as this follows the
pattern of attaching clocks to the chips inputs and outputs, however, it is
really the DSP that requires the clock here. As firmware download can be a
significant part of the path startup time for these devices occasionally it
would be desirable to download the firmware in advance of the path being
brought up.

To help facilitate this early firmware loading this patch attaches the
SYSCLK to the DSP preloader widget. This also saves us adding a new route
to SYSCLK every time a new compressed DAI is created.

Signed-off-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>


# 19c89192 11-Aug-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Connect ASRCs to both clock domains

The two clock domains are enabled based on each input and output of the
chip being connected to its respective clock domain. The ASRC however
can bridge the two domains and as such can function as an input/output
to either domain. The hardware also requires that both clocks are
enabled before the ASRC is. Ensure these constraints by linking the
ASRCs to both SYSCLK and ASYNCCLK.

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


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

ASoC: codec duplicated callback function goes to component on wm5102

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>


# 19edeb30 13-Jun-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Correct supported channels on trace compressed DAI

The audio trace firmware on wm5102 only supports 4 channels correct
the DAI driver structure to reflect this.

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


# 9fc772ec 13-May-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Tie SYSCLK to DRC signal activity widgets

The intent is for SYSCLK to be tied to all input and output widgets such
that it turns on whenever the chip is in use. It is not tied to the DRC
signal activity detect virtual outputs, whilst in practice this is
unlikely to cause an issue (as an input will likely also be powered up)
best to correct.

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


# 401cf146 27-Apr-2016 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: arizona: call wm_adsp2_remove when codec driver is removed

Ensure that the wm_adsp driver cleans up when the codec driver
is removed.

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


# ab9f87c4 15-Apr-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Free compressed IRQ in CODEC remove

We request one of the DSP IRQs during CODEC probe, as such we should
free it during CODEC remove, this patch does so.

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


# 54dca701 15-Apr-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Free speaker thermal IRQs in CODEC remove

The thermal warning IRQs for the speaker are requested in CODEC probe
but never freed. This patch frees them in CODEC remove.

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


# d81221ff 04-Feb-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Add support for SNDRV_PCM_RATE_KNOT

The Arizona CODECs support several rates that do not have simple defines
in ALSA. This patch adds support for SNDRV_PCM_RATE_KNOT so that users
can open stream at these rates. As part of this we should always set
constraints in arizona_startup, currently we only set the constraints if
we already have a clock to limit rates to that family of sample rates.
This patch updates this to set a constraint of all rates supported by
the chip if we do not already know which family of rates to limit to.
Finally we also reduce the list of rates supported in the constraints to
only include those that are supported on current parts.

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


# 69fa8058 21-Jan-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Add support for the audio trace firmware

wm5102 also supports the audio trace firmware, this patch adds support
for this into the wm5102 driver.

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


# d82d767f 21-Jan-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm_adsp: Move setting of DSP speed into CODEC specific code

The ADSP code should be agnostic of which CODEC it runs upon, currently
there is only one remaining part of the implementation that doesn't
follow this. When the DSP is booted on ADSP2 we read
ARIZONA_SYSTEM_CLOCK_1 and use that to set the initial speed for the DSP
clock. This patch factors that out into CODEC specific code, leaving the
ADSP code entirely CODEC agnostic.

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


# d90c6cc2 10-Jul-2015 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Fix error path in codec probe

If we fail to add some DSPs or fail to add the controls we should call
wm_adsp2_codec_remove for all the cores we have already added. This
patch fixes this up on the wm5102 and wm5110.

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


# 5f8e671a 25-Jun-2015 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Implement stability check for LHPF coefficients

Specifying unstable coefficients for the low/high pass filters can have
a severe impact on the audio. This patchs adds a stability check on the
coefficients written to the low/high pass filter block to prevent this.

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


# c05d9a8c 25-Jun-2015 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Implement stability check for EQ coefficients

Specifying unstable coefficients for the EQ can have a severe impact on
the audio. This patchs adds a stability check on the coefficients
written to the EQ, for this it is necessary to merge the mode control
and the coefficients as some coefficients may only be unstable with a
certain mode setting so it is ideal if these are always updated in sync.

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


# 336d0442 18-Jun-2015 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: wm_adsp: Move DSP Rate controls into the codec

The rate controls are codec-specific, it's not possible to
generically say what the range or the meaning of each control
is (or even if they exist at all) - that depends on the
particular codec.

This is currently being handled for Arizona codecs by putting
an Arizona-specific table of controls inside the wm_adsp driver.
This creates a dependency between wm_adsp and arizona.c, and is an
awkward solution if the ADSP is used in another family of codecs

Fix this by moving the Arizona-specific rate controls into the
Arizona codec drivers.

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


# 218e5087 11-Jun-2015 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: wm_adsp: create ALSA controls from wm_adsp driver

Now that we have a codec_probe stage initialization in the wm_adsp
driver, we can make the wm_adsp driver create its own ALSA controls
instead of having that responsibility pushed to every codec driver.

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


# f5e2ce92 11-Jun-2015 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: wm_adsp: Add codec_probe and codec_remove stubs

Currently the only init function in wm_adsp is called by the
codec driver early in its probe before the codec has been
registered with SOC.

This patch adds stubs for the codec_probe and codec_remove stages
and calls them from WM5102 and WM5110 codec drivers. This allows us
to hang anything that needs setup during the codec probe stage off
these functions without further modification of the codec drivers.

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


# 81ac58b1 02-Jun-2015 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: wm_adsp: Move DVFS control into codec driver

In theory the ADSP driver should not need to know anything
about the codec it is part of. But the WM5102 needs DVFS
control based on ADSP clocking speed. This was being handled
by bundling part of the knowledge of this into the ADSP driver.

This change moves this handling out of the ADSP driver and
into the WM5102 driver.

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


# 346d9683 02-Jun-2015 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: arizona: Export functions to control subsystem DVFS

The WM5102 and WM8997 codecs have an internal dynamic clock booster.
When this booster is active, the DCVDD voltage must be increased.
If all the currently active audio paths can run with the root SYSCLK
we can disable the booster, allowing us to turn down DCVDD voltage
to save power.

Previously this was being done by having the booster enable bit set
as a side-effect of the LDO1 regulator driver, which is unexpected
behaviour of a regulator and not compatible with using an external
regulator. [Originally this was documented as a feature of the internal
LDO -- broonie]

This patch exports functions to handle the booster enable and
DCVDD voltage, with each relevant subsystem flagging whether it can
currently run without the booster. Note that these subsystems are
stateless and none of them are nestable, so there's no need for
reference counting, we only need a simple boolean for each subsystem
of whether their current condition could require the booster or will
allow us to turn the codec down to lower operating power.

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


# 0740135a 01-Jun-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm5102: 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
with snd_soc_codec_get_dapm().

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>


# 15575ed5 28-May-2015 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: arizona: Fix noise generator gain TLV

The Arizona codec drivers had an incorrect dB scaling for the
noise generator gain that started at 0dB and went upwards.
Actually the highest setting is 0dB.

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


# 158bf4ed 03-Apr-2015 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Remove set of volume update bits for output 3R

The earpiece on wm5102 is mono, thus there is no output 3R. Don't toggle
the volume update bits for this output, although worth noting that doing
so had no negative effects it is just redundant.

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


# e1ae5fba 20-Jan-2015 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Coalesce output power up delays

Save a bit of scheduling by coalescing all the output power up delays
into a single delay.

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


# 054e1b48 20-Jan-2015 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Add delay for output disable

Give the output disable sequence a chance to fully complete, otherwise
there is a danger we may remove the clock before it is finished
resulting in a pop noise. The delay for each output must be cumulative
and these are coalesced into a single delay.

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


# 42b7a197 13-Jan-2015 Lars-Peter Clausen <lars@metafoo.de>

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


# a6b3db2c 07-Jan-2015 Vaishali Thakkar <vthakkar1994@gmail.com>

ASoC: wm5102: Use put_unaligned_be16

This patch introduces the use of function put_unaligned_be16.

This is done using Coccinelle and semantic patch used is as follows:

@a@
typedef u16, __be16, uint16_t;
{u16,__be16,uint16_t} e16;
identifier tmp;
expression ptr;
expression y,e;
type T;
@@

- tmp = cpu_to_be16(y);

<+... when != tmp
(
- memcpy(ptr, (T)&tmp, \(2\|sizeof(u16)\|sizeof(__be16)\|sizeof(uint16_t)\|sizeof(e16)\));
+ put_unaligned_be16(y,ptr);
|
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_be16(y,ptr);
)
...+>
? tmp = e

@@ type T; identifier a.tmp; @@

- T tmp;
...when != tmp

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
--
Changes Since v2:
Make the patch compatible for current code

sound/soc/codecs/wm5102.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Signed-off-by: Mark Brown <broonie@kernel.org>


# 47370022 05-Dec-2014 Mark Brown <broonie@kernel.org>

ASoC: wm5102: Initialize dac_comp_lock mutex

Commit d74bcaaeb6682 (ASoC: wm5102: Move ultrasonic response settings
lock to the driver level) created a driver local mutex for protecting
the ultrasonic response settings but neglected to initialize that mutex,
causing loud complaints from lockep and potential runtime failures. Fix
this by initializing the mutex.

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


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

ASoC: wm5102: Move ultrasonic response settings lock to the driver level

The wm5102 driver currently uses the snd_soc_codec mutex to protect its
ultrasonic response settings from concurrent access. This patch moves this
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>


# c756e83d 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

ASoC: codecs: drop owner assignment from platform_drivers

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

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 11ecf2b9 22-Jul-2014 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: wm5102: Set symmetric samplebits on AIFs

Different playback and capture bits-per-sample
are not supported on the AIFs

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


# 5c3fc7a7 10-Jun-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Convert snd_kcontrol_chip to snd_soc_kcontrol_codec

Controls for shaping the ultrasonic frequency response were introduced
in this commit:

commit 720630c002ffc7b0fa2ed5b3f4bfb36fd8f87ca6
ASoC: wm5102: Add controls to allow shaping of ultrasonic response

However, they mistakenly used snd_kcontrol_chip instead of
snd_soc_kcontrol_codec, which has replaced it now the framework is
moving to componentisation. This patch fixes this.

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


# cc9e9243 06-Jun-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Add controls to allow shaping of ultrasonic response

Add controls to allow custom shaping of the ultrasonic response. This
custom shaping can be turned on/off at runtime, although, it should be
noted that settings will not affect a currently open audio stream,
they will be applied when the next audio stream is started.

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


# 0a822c1e 14-Apr-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm5102: Replace usage deprecated SOC_VALUE_ENUM macro

SOC_VALUE_ENUM is deprecated and merely an alias for SOC_EMUM. Replace the
deprecated macros so we can eventually remove their definition.

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


# 6b2cab02 14-Apr-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm5102: Replace usage deprecated MUX/ENUM macros

SND_SOC_DAPM_VALUE_MUX and SOC_DAPM_VALUE_ENUM are deprecated and merely an
alias for SND_SOC_DAPM_MUX and SOC_DAPM_ENUM. Replace the deprecated macros so
we can eventually remove their definition.

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


# 7a34b1c1 02-Apr-2014 Xiubo Li <Li.Xiubo@freescale.com>

ASoC: codec: fix the sparse check warnings.

Some thing Likes:

reproduce: make C=1 CF=-D__CHECK_ENDIAN__

sparse warnings: (new ones prefixed by >>)

>> sound/soc/codecs/wm8997.c:1084:15: sparse: symbol \
'wm8997_get_regmap' was not declared. Should it be static?

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


# c8b02acd 25-Mar-2014 Xiubo Li <Li.Xiubo@freescale.com>

ASoC: wm5102: Remove the set_cache_io() entirely from ASoC probe.

As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.

And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.

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


# 092eba93 10-Mar-2014 Xiubo Li <Li.Xiubo@freescale.com>

ASoC: io: New signature for snd_soc_codec_set_cache_io()

Now that all users have been converted to regmap and the config.reg_bits
and config.val_bits can be setted by each user through regmap core API.
So these two params are redundant here.

Since the only control type that left is SND_SOC_REGMAP, so remove it. Drop
the control params and add struct regmap *regmap to simplify the code.

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


# 055bbe2d 01-Mar-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: wm{5102, 5110, 8997}: Replace codec->control_data with arizona->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 wm5192, wm5110 and wm8997
drivers for this by using arizona->regmap instead of accessing the CODEC's
control_data field.

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>


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

ASoC: wm5102: Use ARRAY_SIZE() for SOC_VALUE_ENUM_SINGLE()

... to make clear the meaning of the argument.

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>


# 13711057 23-Jan-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Correct typo in EQ coefficient sizes

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


# 2a67e796 21-Jan-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Improve EQ coefficient controls

The EQ coefficient binary controls overlapped with the volume controls
for the B4 and B5 volumes, which were controllable from either the
coefficient control or the volume control itself.

This patch adds controls for the mode and moves the coefficient control
to only cover the coefficients.

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


# bd489349 11-Dec-2013 Mark Brown <broonie@linaro.org>

ASoC: wm5102: Use async writes

When writing the patch write to the device asynchronously, allowing better
performance when used with a bus like SPI which supports this by
minimising the need to context switch back to the driver to get the
next bit of data.

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


# 12850b8d 13-Nov-2013 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

ASoC: arizona: Fix typo in name of EQ coefficient controls

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


# 3efd8a6f 12-Aug-2013 Mark Brown <broonie@linaro.org>

ASoC: wm5102: Add inputs for noise and mic mixers

The noise and mic mixer inputs were not connected, do so.

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


# e7edb273 12-Aug-2013 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Add widget<->mux route into mux route macro

The routes linking the widget and the input mux were being added
manually, rather than by the ARIZONA_MUX_ROUTES macro. This patchs adds
the routes to the macro.

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


# b63144e6 04-Jul-2013 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Add signal activity output for DRC

When doing signal activity detection, the only output from the DRC will
often be a GPIO pin. This patch adds a signal activity output that is
activated when a GPIO is configured to output the DRC signal activity
detection.

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


# 7c470373 12-Jun-2013 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Expose controls for DRE

Certain use cases may require specific DRE settings so expose control
of these.

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


# 6dc6a3f8 05-Jun-2013 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Hookup SYSCLK to inputs and noise generators

All sources and sinks should enable SYSCLK.

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


# ee4b7c7f 05-Jun-2013 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Correct AEC loopback enable

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


# 1804aff6 17-May-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Stub hookup for Slimbus interface

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


# a64cbb94 16-May-2013 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Correct OSR control name for EPOUT

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


# f6f629f8 05-Apr-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Correct lookup of arizona struct in SYSCLK event

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


# b6ed61cf 29-Mar-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm_adsp: Split ADSP1 and ADSP2 firmware controls

Now that we have regular register mapped controls we should be splitting
the control sets for ADSP1 and ADSP2 as the register maps are not
identical. Do that.

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


# a96f5e93 27-Mar-2013 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Correctly use SOC_VALUE_ENUM for ISRC FSL controls

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


# 658e6101 25-Mar-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Implement OSR support

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


# f607e31c 22-Feb-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: arizona: Fix interaction between headphone outputs and identification

Running HPDET while the headphone outputs are enabled can disrupt the
operation of HPDET. In order to avoid this HPDET needs to disable the
headphone outputs and ASoC needs to not enable them while HPDET is
running.

Do the ASoC side of this by storing the enable state in the core driver
structure and only writing to the device if a flag indicating that the
accessory detection side is in a state where it can have the headphone
output stage enabled.

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


# dc91428a 18-Feb-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: arizona: Basic support for ISRC rate selection

Since ASoC does not yet really have the framework features needed to
support propagating sample rates through the device well yet implement
basic support for the ISRCs equivalent to that we currently have for the
ASRCs. The user can opt for 8kHz or 16kHz as the rate for the DSP blocks
in addition to the main audio rate, these being the primary use cases.

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


# 56447e13 10-Jan-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: arizona: Factor out speaker widgets from CODEC drivers

Some system designs have been identified which repurpose portions of the
speaker driver circuits for other functions which will require that they
not be managed using DAPM. Prepare for this by factoring out the creation
of the speaker widgets into the core driver, the widgets will be replaced
by dummy ones when the additional functions are enabled.

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


# 82968b7e 05-Mar-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Apply a SYSCLK patch for later revs

Evaluation has identified some performance improvements to the device.

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


# ddbce97c 15-Feb-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: arizona: Only allow input volume updates when inputs are enabled

Since we are automatically managing the mutes we may as well also manage
the volume update bits, disabling volume updates while none of the inputs
are active. Since we are doing this we may as well allow the volumes to
ramp together so only enable volume updates once at the end of power up.

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


# ee929a97 20-Feb-2013 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: arizona: Add support for directly setting the FLL REFCLK

This patch allows the REFCLK to be set directly allowing much greater
flexibility in how the FLLs are configured.

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


# c9b56690 15-Feb-2013 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Correct OUT2 volume and switch names

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


# 43cd8bf1 06-Feb-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: arizona: Automatically manage input mutes

For optimal performance the inputs should be kept muted until after power
up. Since there are few use cases for muting inputs during capture move
the mutes to automatic control.

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


# e5ddd303 11-Jan-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Add controls for firmware selection

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


# 55e7276e 10-Jan-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Provide MICSUPP widget for regulator driver

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


# 7f39bb9e 11-Jan-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Correct AEC loopback mask

The generated defines in the header are pre-shifted.

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


# 91660bd6 05-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Implement routing and power management for ISRCs

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


# 1b8d52e6 03-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Improve speaker enable performance

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


# 50571263 18-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Add noise gate control

The references used for the noise gates and parameters for their triggering
are configurable, expose that to users.

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


# c63f650c 13-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Split input PGA controls

Though the controls are named as stereo controls in the part the main use
case for the analogue inputs to the WM5102 is mono. Reflect this in the
controls exposed to userspace, providing a series of mono controls rather
than stereo ones.

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>


# dfc075cb 08-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Enable volume ramp control

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


# 2aeffd40 04-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Make EQ coefficents configurable

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


# f055c8f0 02-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Add support for configuring LHPF coefficients

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


# e436cadd 01-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Correct base address for Y region

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


# cac27cff 28-Nov-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Enable DVFS support for the DSP

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


# 3f41e3d2 26-Nov-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Implement haptics support

Provide a haptics widget for use by the haptics driver and expose the DAPM
context for it.

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


# ba6b047a 27-Nov-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Add missing routes for ASRC inputs

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


# 4cbc3655 20-Nov-2012 Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

ASoC: wm5102: Register DSP1 Aux widgets

It seems WM_ADSP2("DSP1", 0) is added twice to the widgets list, remove
that and in place use ARIZONA_DSP_WIDGETS(DSP1, "DSP1").

We need to make sure that the DSP1 Aux widgets are provided otherwise
we'll see errors such as "Failed to add route DSP1 Aux 1 -> DSP1" etc.

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


# 9ce6565f 14-Nov-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Remove output OSR and PGA volume control

These are managed automatically in current revisions.

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


# 0f3ec6a9 13-Nov-2012 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Remove mixer widgets on the ASRC

There is no mixer attached to the ASRC on the wm5102 only a multiplexer
to select the source for the single input line. This change correctly
defines this in the wm5102 CODEC driver.

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


# fe81ad1c 08-Oct-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Write register value corrections after SYSCLK is enabled

Evalation of the WM5102 has identified a number of register values which
should be written after SYSCLK is enabled on revision A in order to
improve performance.

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


# 804f5ba7 25-Aug-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Hook up DSP1

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


# 2a0db307 25-Oct-2012 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

ASoC: wm5102: Correct micbias DAPM supplies

ARIZONA_MICB1_ENA_SHIFT was used for micbias 2 and 3. This change
correctly uses the ARIZONA_MICBX_ENA_SHIFT for each corresponding DAPM
supply. This should not have caused any problems as the micbias enables
are in the same place in each register.

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


# bb09d978 06-Sep-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Enable bypass mode for MICVDD

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


# 822b4b8d 06-Sep-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: dapm: Add flags to regulator supplies

This will be used to enable additional control of the regulators.

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


# 939d5044 16-Aug-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Remove DRC2

It will be removed from future device revisions.

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


# a3150f09 16-Aug-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Add AEC routing control

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


# 14ebd8a8 10-Aug-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Add missing input PGA routes

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


# c665d1a8 08-Aug-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Enable output clocks

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


# 2b4d39fc 10-Jul-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: arizona: Support variable FLL VCO multipliers

Some Arizona chips have a higher frequency for the FLL VCO, support this
in the common code.

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


# bc9dce58 09-Jul-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Fix cut'n'paste for digital volume registers

The analogue PGA shifts were used; this makes no practical difference as
the values are the same.

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


# 9498822d 04-Jul-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Allow routing through the ASRCs

This enables common telephony use cases.

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


# 5b2eec3f 04-Jul-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: arizona: Implement AIF clock configuration

Allow the user to select which of the system clocks each AIF is referenced
to and constran the DAI to the set of frequencies which can be generated
from that clock.

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


# 3dba1c26 27-Jun-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Remove unused platform data header

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


# 93e8791d 19-Jun-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

ASoC: wm5102: Initial driver

The WM5102 is a highly-integrated low-power audio system for smartphones,
tablets and other portable audio devices based on the Arizona platform.

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