summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/adav80x.c
AgeCommit message (Collapse)Author
2021-09-27ASoC: adav80x: Update to modern clocking terminologyMark Brown
As part of moving to remove the old style defines for the bus clocks update the adav80x driver to use more modern terminology for clocking. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210916151806.20756-6-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-20ASoC: codecs: Fix fall-through warnings for ClangGustavo A. R. Silva
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>
2020-07-09ASoC: codecs: Use fallthrough pseudo-keywordGustavo A. R. Silva
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>
2020-05-18ASoC: codecs: use snd_soc_xxx_active()Kuninori Morimoto
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87wo5e58j4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 149Thomas Gleixner
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>
2018-08-09ASoC: adav80x: mark expected switch fall-throughGustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1056531 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12ASoC: adav80x: replace codec to componentKuninori Morimoto
Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-10ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal
Declare snd_soc_codec_driver structures as const as they are only passed as an argument to the function snd_soc_register_codec. This argument is of type const, so declare the structures with this property as const. In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in a copy operation along with getting passed to snd_soc_register_codec. So, it can be made const too. Done using Coccinelle: @match disable optional_qualifier@ identifier s; position p; @@ static struct snd_soc_codec_driver s@p={...}; @good1@ identifier match.s; position p; @@ snd_soc_register_codec(...,&s@p,...) @bad@ identifier match.s; position p!={match.p,good1.p}; @@ s@p @depends on !bad disable optional_qualifier@ identifier match.s; @@ static +const struct snd_soc_codec_driver s={...}; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: codec duplicated callback function goes to component on adav80xKuninori Morimoto
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>
2015-10-21ASoC: adav80x: Use snd_pcm_hw_constraint_single()Lars-Peter Clausen
Use the new snd_pcm_hw_constraint_single() helper function instead of calling snd_pcm_hw_constraint_minmax() with the same value for min and max to install a constraint that limits the possible configuration values to a single value. Using snd_pcm_hw_constraint_single() makes the indented result clearer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-08-30Merge remote-tracking branches 'asoc/topic/max98090', 'asoc/topic/max98095', ↵Mark Brown
'asoc/topic/max98357a', 'asoc/topic/max9877' and 'asoc/topic/max98925' into asoc-next
2015-08-14ASoC: adav80x: Remove .read_flag_mask setting from adav80x_regmap_configAxel Lin
Don't set .read_flag_mask for adav803, it's for adav801 only. Fixes: 0c2d69645628 ("ASoC: adav80x: Split SPI and I2C code into different modules") Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-07-07ASoC: Constify reg_default tablesAxel Lin
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>
2015-06-05Merge remote-tracking branches 'asoc/topic/adau1977', 'asoc/topic/adav80x', ↵Mark Brown
'asoc/topic/arizona' and 'asoc/topic/atmel' into asoc-next
2015-05-04ASoC: adav80x: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen
The dapm field of the snd_soc_codec struct is eventually going to be removed, in preparation for this replace all manual access to codec->dapm.bias_level with snd_soc_codec_get_bias_level(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27ASoC: Move bias level update to the coreLars-Peter Clausen
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>
2015-03-10ASoC: adav80x: Fix wrong value references for boolean kctlTakashi Iwai
The correct values referred by a boolean control are value.integer.value[], not value.enumerated.item[]. The former is long while the latter is int, so it's even incompatible on 64bit architectures. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org>
2014-11-17ASoC: adav80x: Replace w->codec with snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen
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>
2014-09-04ASoC: adav80x: Cleanup manual bias level transitionsLars-Peter Clausen
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. While we are at it also remove the regcache_cache_only() calls from suspend/resume as there shouldn't be any IO between suspend and resume. Since the ASoC core now takes care of setting the bias level to SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually anymore either. The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe() can also be removed as the core will automatically do this after the CODEC has been probed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-05-22Merge remote-tracking branch 'asoc/topic/enum' into asoc-nextMark Brown
2014-04-14ASoC: adav80x: Replace usage deprecated MUX/ENUM macrosLars-Peter Clausen
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>
2014-04-14ASoC: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen
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>
2014-03-13Merge remote-tracking branch 'asoc/topic/io' into asoc-nextMark Brown
2014-03-12Merge remote-tracking branches 'asoc/topic/88pm860x', 'asoc/topic/ad1836', ↵Mark Brown
'asoc/topic/ad193x', 'asoc/topic/adau1977', 'asoc/topic/ak4104', 'asoc/topic/ak4641', 'asoc/topic/ak4671' and 'asoc/topic/alc5623' into asoc-next
2014-03-12Merge remote-tracking branch 'asoc/topic/dapm' into asoc-nextMark Brown
2014-03-11ASoC: codec: Simplify ASoC probe code.Xiubo Li
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>
2014-03-06ASoC: Add helper function to check whether a CODEC is activeLars-Peter Clausen
Instead of directly checking the 'active' field of the CODEC struct add a new helper function that will return either true or false depending on whether the CODEC is active. This will make the migration to the component level easier. The patch also updates all CODEC drivers that check the active attribute to use the new helper function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-20ASoC: adav80x: Update locking around use of DAPM pin APICharles Keepax
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> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-18ASoC: adav80x: Split SPI and I2C code into different modulesLars-Peter Clausen
There are a few known (minor) problems with having the support code for both I2C and SPI in the same module: * We need to be extra careful to make sure to not build the driver into the kernel if one of the subsystems is build as a module (Currently only I2C can be build as a module). * The module init path error handling is rather ugly. E.g. what should be done if either the SPI or the I2C driver fails to register. Most drivers that implement SPI and I2C in the same module currently fallback to undefined behavior in that case. Splitting the the driver into two modules, one for each bus, allows the registration of the other bus drive to continue without problems if one of them fails. This patch splits the ADAV80X driver into 3 modules. One core module that implements the device logic, but is independent of the bus method used. And one module for SPI and I2C each that registers the drivers and sets up the regmap struct for the bus. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-18ASoC: adav80x: Use devm_kzalloc()Lars-Peter Clausen
Use devm_kzalloc() to allocate the device state struct. Saves use from having to free it manually on the error path and in the remove callback. Now that the adav80x_bus_probe() function is only a call to snd_soc_unregister_codec() also inline that. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-16Merge remote-tracking branches 'asoc/topic/adsp', 'asoc/topic/atmel', ↵Mark Brown
'asoc/topic/bcm2835', 'asoc/topic/docs', 'asoc/topic/fsl', 'asoc/topic/generic', 'asoc/topic/kirkwood', 'asoc/topic/mc13783', 'asoc/topic/mxs', 'asoc/topic/nuc900', 'asoc/topic/sai', 'asoc/topic/sh', 'asoc/topic/ssm2602', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl4030', 'asoc/topic/ux500', 'asoc/topic/width' and 'asoc/topic/x86' into for-tiwai
2014-01-09ASoC: adav80x: Use params_width() rather than memory formatMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2013-11-24ASoC: adav80x: Use IS_ENABLED() macroFabio Estevam
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>
2013-09-27ASoC: adav80x: Convert to direct regmap usageLars-Peter Clausen
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-15ASoC: adav80x: Add module device table for adav801Axel Lin
This driver can be built as module, thus add module device table for adav801 to support module auto loading. To make the naming consistent, also rename adav80x_id to adav80x_i2c_id. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2012-12-10ASoC: codecs: remove __dev* attributesBill Pemberton
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>
2011-12-02ASoC: Drop unused state parameter from CODEC suspend callbackLars-Peter Clausen
The existence of this parameter is purely historical. None of the CODEC drivers uses it and we always pass in the same value anyway, so it should be safe to remove it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-23ASoC: Cleanup duplicated constLars-Peter Clausen
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>
2011-11-23ASoC: Constify snd_soc_dai_ops structsLars-Peter Clausen
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>
2011-08-31ASoC: Allow source specification for CODEC level sysclkMark Brown
Similarly to PLLs/FLLs some modern CODECs provide selectable system clock sources. When the clock is the clock for a DAI we do not usually need to identify which clock is being configured so can use clk_id for the source clock but with CODEC wide system clocks we will need to specify both the clock being configured and the source. Add a source argument to the CODEC driver set_sysclk() operation to reflect this. As this operation is not as widely used as the DAI set_sysclk() operation the change is not very invasive. We probably ought to go and make the same alternation for DAIs at some point. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-17ASoC: Report an error for unknown adav80x formatsMark Brown
Not only fixes error handling but also some uninitialized variable warnings. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2011-06-28ASoC: Add ADAV80x codec driverLars-Peter Clausen
This patch adds support for the Analog Devices ADAV801 and ADAV803 audio codec. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>