Commit 85e7652("ASoC: Constify snd_soc_dai_ops structs") accidentally
introduced a few duplicated consts. This patch cleans it up.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Just checking the code in cs42l51_fill_cache():
The cache pointer points to codec->reg_cache + 1.
I think it is because CS42L51_FIRSTREG is 0x01,
so codec->reg_cache[0] is not used here.
Then we read CS42L51_NUMREGS bytes to cache.
So we need reg_cache_size to be CS42L51_NUMREGS + 1.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>
Replace the manual register restore mechanism in cs4270.c and call the
generic snd_soc_cache_sync() handler instead.
This factors code out in favour of core facilities and also fixes a
bus confusion that is most probably caused by intermixing i2c-regmap
functions and i2c_smbus_* accessors.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-and-tested-by: Sven Neumann <s.neumann@raumfeld.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
In the case of ((max9877_regs[reg] >> shift) & mask) != val
but ((max9877_regs[reg2] >> shift) & mask) == val2,
current code does not update the registers.
Fix the logic to update registers if either val or val2 is changed.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
According to the datasheet:
The BIT[5:4] of ADC Control Register 2 is to control the word width.
00 = 25 Bits
01 = 20 Bits
10 = 16 Bits
11 = Invalid
Thus, the AD1836_ADC_WORD_OFFSET should be defined as 4.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
Fix below smatch warning:
sound/soc/codecs/cs42l73.c +1030 cs42l73_set_dai_fmt(53) error: inv is never equal to 1024 (wrong type 0 - 255).
sound/soc/codecs/cs42l73.c +1032 cs42l73_set_dai_fmt(55) error: inv is never equal to 768 (wrong type 0 - 255).
sound/soc/codecs/cs42l73.c +1036 cs42l73_set_dai_fmt(59) error: inv is never equal to 1024 (wrong type 0 - 255).
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Current code defines some bits with left shift to the proper bit defined in
datasheet, but some don't.
Unify the definition with proper left shift and adjust the code accordingly.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The driver only supports I2C so doesn't need to do things conditionally.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
They're all volatile so shouldn't have defaults and as we've got pages
into the DSP memory the registers themselves aren't that useful - a
further patch adding support for the DSPs will provide direct diagnostic
access to the DSP memories.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
It's done in cs42l73_set_bias_level when the dapm.bias_level is switching
from SND_SOC_BIAS_OFF to SND_SOC_BIAS_STANDBY.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Return -ENODEV instead of 0 if device id mismatch.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Alexander Sverdlin <subaparts@yandex.ru>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the array.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
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>
Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the array.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
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>
Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the array.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
the last entry from being omitted.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the array.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
There is no need to provide defaults for the volatile
registers and doing so might cause confusion.
Signed-off-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch makes it possible to set DAI mode to its currently applied
value even if codec is active. This is necessary to allow
aplay -t raw -r 44100 -f S16_LE -c 2 < /dev/urandom &
alsactl store -f backup.state
alsactl restore -f backup.state
to work without returning errors. This patch is based on a patch sent
by Klaus Kurzmann <mok@fluxnetz.de>.
Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
There are two undocumented registers in use in alc5632_i2c_probe
function. It must be added to support future rewrite of this
function to use regmap API completely.
Signed-off-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch adds support for the Cirrus Logic CS42L73 low power stereo
codec.
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Georgi Vlaev <joe@nucleusys.com>
Acked-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Andrey Danin <danindrey@mail.ru>
Signed-off-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-off-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sta32x resets and loses all configuration during ESD test.
Work around by polling the CONFA register once a second
and restore all coeffcients and registers when CONFA
changes unexpectedly.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Add a structure for platform specific configuration and use it,
thereby removing a few FIXMEs which marked hard-coded values.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>