History log of /linux-master/sound/soc/codecs/adau17x1.c
Revision Date Author Comments
# ef44ba21 20-May-2023 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

ASoC: adau1761: Use the devm_clk_get_optional() helper

Use devm_clk_get_optional() instead of hand writing it.
This saves some LoC and improves the semantic.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/ab0fe7e7ecf965df84b9516ba65428af9b3805c1.1684594081.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>


# 23dab2ec 12-Nov-2022 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

ASoC: codecs: Remove a useless include

<linux/gcd.h> is not needed for these drivers. Remove the corresponding
#include.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/875ca433849025edf8c23624cf29b0e2250bba50.1668287523.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>


# c7b92395 28-Apr-2022 Ricard Wanderlof <ricardw@axis.com>

ASoC: adau1761: Add ADAU1761-as-ADAU1361 compatibility mode

During probe, determine if the chip is in fact an ADAU1761
even though an ADAU1361 is specified, and perform additional
operations to enable the ADAU1761 to behave as an ADAU1361,
i.e. disregarding the DSP and setting up routing and PM
transparently.

This enables either chip to be mounted when an ADAU1361 is specified.

Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204281841290.5574@lnxricardw1.se.axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# a41a008f 16-Sep-2021 Mark Brown <broonie@kernel.org>

ASoC: adau17x1: Update to modern clocking terminology

As part of moving to remove the old style defines for the bus clocks update
the adau17x1 driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-4-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# a89f3a93 22-Apr-2021 Niklas Carlsson <niklasc@axis.com>

ASoC: adau17x1: Avoid overwriting CHPF

Configuring number of channels per LRCLK frame by using e.g.
snd_soc_dai_set_tdm_slot before configuring DAI format was being
overwritten by the latter due to a regmap_write which would write over
the whole register.

Signed-off-by: Niklas Carlsson <niklasc@axis.com>
Link: https://lore.kernel.org/r/20210422130226.15201-1-Niklas.Carlsson@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 554a1b00 08-Jan-2021 Xu Wang <vulab@iscas.ac.cn>

ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare

Because clk_disable_unprepare() already checked NULL clock parameter,
so the additional check is unnecessary, just remove it.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Link: https://lore.kernel.org/r/20210108084456.6603-1-vulab@iscas.ac.cn
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>


# 80503b23 23-May-2019 Thomas Gleixner <tglx@linutronix.de>

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

Based on 1 normalized pattern(s):

licensed under the gpl 2 or later

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

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

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190524100845.150836982@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dba508b5 13-Aug-2018 Robert Rosengren <robert.rosengren@axis.com>

ASoC: adau17x1: Unused exported functions changed to internal

adau17x1_setup_firmware and adau17x1_has_dsp is only used internally, so
making them static instead of exported.

Signed-off-by: Robert Rosengren <robertr@axis.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# b0f2d651 21-Aug-2018 Danny Smith <dannys@axis.com>

ASoC: adau17x1: Implemented safeload support

Safeload support has been implemented which is used
when updating for instance filter parameters using
alsa controls. Without safeload support audio can
become distorted during update.

Signed-off-by: Danny Smith <dannys@axis.com>
Signed-off-by: Robert Rosengren <robertr@axis.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5bea3279 06-Jul-2018 Lars-Peter Clausen <lars@metafoo.de>

ASoC: adau171x1: Connect playback DAI to the DSP

The playback DAI is connected to the DSP and the DSP might be sourcing
signals from the playback stream. Add a DAPM route between the two to make
sure that the playback DAI is powered up, when the DSP is active.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 728815e3 09-Apr-2018 Danny Smith <dannys@axis.com>

ASoC: adau17x1: Do not reload dsp-fw if samplerate has not changed

Reloading fw causes an audiable popping sound, we can avoid this
by not reloading if the samplerate is the same as before.

Signed-off-by: Danny Smith <dannys@axis.com>
Signed-off-by: Robert Rosengren <robert.rosengren@axis.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# d0f8b9c5 09-Apr-2018 Danny Smith <dannys@axis.com>

ASoC: adau17x1: Handling of DSP_RUN register during fw setup

DSP_RUN needs to be disabled during firmware write otherwise
we can end up with undefined behavior if writing to a dsp which
is already running firmware.

Signed-off-by: Danny Smith <dannys@axis.com>
Signed-off-by: Robert Rosengren <robert.rosengren@axis.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# c90ef8c7 14-Feb-2018 Fabio Estevam <fabio.estevam@nxp.com>

ASoC: adau17x1: Use empty struct initializer

{ 0 } only clears the first member of the structure.

The first member of the snd_soc_dapm_update struct is a pointer,
and writing 0 to a pointer results in a sparse warning.

Use the empty struct initializer that clears all the struct members
and fixes the sparse warning.

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


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

ASoC: adau17x1/adau1761/adau1781: replace codec to component

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

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

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

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

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


# 1e6f4fc0 07-Sep-2017 Ricard Wanderlof <ricard.wanderlof@axis.com>

ASoC: adau17x1: Workaround for noise bug in ADC

The ADC in the ADAU1361 (and possibly other Analog Devices codecs)
exhibits a cyclic variation in the noise floor (in our test setup between
-87 and -93 dB), a new value being attained within this range whenever a
new capture stream is started. The cycle repeats after about 10 or 11
restarts.

The workaround recommended by the manufacturer is to toggle the ADOSR bit
in the Converter Control 0 register each time a new capture stream is
started.

I have verified that the patch fixes this problem on the ADAU1361, and
according to the manufacturer toggling the bit in question in this manner
will at least have no detrimental effect on other chips served by this
driver.

Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org


# 1d007348 08-Dec-2016 Vinod Koul <vkoul@kernel.org>

ASoC: adau17x1: remove unused ‘ret’

In adau17x1_pll_event(), 'ret' is initialized as return value of
regmap_raw_write() but never checked, so remove this and assignement.

sound/soc/codecs/adau17x1.c: In function ‘adau17x1_pll_event’:
sound/soc/codecs/adau17x1.c:68:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
int ret;

Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# e411b0b5 02-Nov-2016 Chen-Yu Tsai <wens@csie.org>

ASoC: dapm: Support second register for DAPM control updates

To support double channel shared controls split across 2 registers, one
for each channel, we must be able to update both registers together.

Add a second set of register fields to struct snd_soc_dapm_update, and
update the DAPM control writeback (put) callbacks to support this.

For codecs that use custom events which call into DAPM to do updates,
also clear struct snd_soc_dapm_update before using it, so the second
set of fields remains clean.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5d76de61 15-Jun-2016 Lars-Peter Clausen <lars@metafoo.de>

ASoC: adau17x1: Add support for specifying the MCLK using the CCF

The devices from the ADAU17X1 family all have a MCLK clock input which
supplies the master clock for the device. The master clock is used as the
input clock for the PLL. Currently the MCLK rate as well as the desired PLL
output frequency need to be supplied by calling snd_soc_dai_set_pll() form
a machine driver.

Add support for specifying the MCLK using the common clock framework. In
addition to that also automatically configure the PLL to a suitable rate
if the master clock was provided using the CCW. This allows to use the
CODEC driver without any special configuration requirements from the
machine driver.

While the PLL output frequency can be configured over a (more or less)
continuous range the narrowness of the range and the other constraints of
the clocking tree usually only result in two output frequencies that will
actually be chosen. One for 44.1kHz based rates and one for 48kHz based
rates, these are the rates that the automatic PLL configuration will use.
For the rare case where a non-standard setup is required a machine driver
can disable the auto-configuration and configure a custom frequency using
the existing mechanisms.

If the common clock framework is not enabled clk_get() will return NULL and
the driver will function as before and the clock rate needs to be
configured manually.

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


# 0eadaa9c 09-Jun-2016 Lars-Peter Clausen <lars@metafoo.de>

ASoC: adau: Factor out shared PLL configuration code

Multiple devices from the ADAU family share the same PLL structure and
configuration register layout. Introduce a new helper module that can be
used to calculated the PLL configuration registers based on a specified
input frequency and the desired output frequency of the PLL.

The ADAU1761/ADAU1781 and ADAU1373 drivers are updated to make use of this
new helper module. But future drivers for additional devices from the ADAU
family are also expected to make use of it.

In anticipation of sharing more infrastructure code between different
devices from the ADAU family the new module is called adau-utils.

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


# 33c7b140 04-May-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: adau17x1: 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>
Signed-off-by: Mark Brown <broonie@kernel.org>


# dee9cec4 21-Nov-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: adau17x1: Mark DSP parameter memory as readable and precious

To be able to read back data from the DSP parameter memory the register
range needs to be marked as readable. At the same time we do not want them
to e.g. appear in debugfs output so mark them as precious as well.

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


# d48b088e 19-Nov-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: sigmadsp: Restructure in preparation for fw v2 support

The v2 file format of the SigmaDSP takes a more declarative style compared
to the imperative style of the v1 format. In addition some features that are
supported with v2 require the driver to keep state around for the firmware.
This requires a bit of restructuring of both the firmware loader itself and
the drivers making use of the firmware loader.

Instead of loading and executing the firmware in place when the DSP is
configured the firmware is now loaded at driver probe time. This is required
since the new firmware format will in addition to the firmware data itself
contain meta information describing the firmware and its requirements and
capabilities. Those will for example be used to restrict the supported
samplerates advertised by the driver to userspace to the list of samplerates
supported for the firmware.

This only does the restructuring required by the v2 format, but does not
yet add support for the new format itself.

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


# d69db7f7 17-Nov-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: adau17x1: Replace w->codec with 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>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0e0f9b96 04-Sep-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: adau17x1: Cleanup manual bias level transitions

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

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


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

ASoC: adau17x1: 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: Lars-Peter Clausen <lars@metafoo.de>


# 4101866c 27-May-2014 Lars-Peter Clausen <lars@metafoo.de>

ASoC: Add ADAU1X61 and ADAU1X81 CODECs common code

The ADAU1X61 and ADAU1X81 are very similar in the digital domain, but are quite
different in the analog domain. This patch adds support for the common parts of
the ADAU1X61 and ADAU1X81 CODECs.

The patch also restores some of the alphabetical order in the Makfile and
Kconfig.

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