summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/adau1701.c
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge remote-tracking branches 'asoc/topic/ac97', 'asoc/topic/ad1836', ↵Mark Brown2015-06-051-15/+110
|\ \ | | | | | | | | | 'asoc/topic/ada1977', 'asoc/topic/adau1701' and 'asoc/topic/adau17x1' into asoc-next
| | * ASoC: adau1701: add regulator consumer supportPascal Huerst2015-04-271-15/+110
| |/ | | | | | | | | | | | | | | | | The adau1701 has two power domains, DVDD and AVDD. Enable them both as long as the codec is in use. Signed-off-by: Pascal Huerst <pascal.huerst@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Move bias level update to the coreLars-Peter Clausen2015-04-271-1/+0
|/ | | | | | | | | 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>
* ASoC: adau1701: Implement sigmadsp safeloadLars-Peter Clausen2014-11-201-2/+55
| | | | | | | | | The safeload feature allows to load up to 5 parameter memory registers atomically. This is helpful for switching between e.g. filter settings without causing any glitches. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sigmadsp: Restructure in preparation for fw v2 supportLars-Peter Clausen2014-11-201-5/+28
| | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: adau1701: fix adau1701_reg_read()Daniel Mack2014-07-031-2/+4
| | | | | | | | | | | Fix a long standing bug in the read register routing of adau1701. The bytes arrive in the buffer in big-endian, so the result has to be shifted before and-ing the bytes in the loop. Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
*-. Merge remote-tracking branches 'asoc/topic/adsp', 'asoc/topic/atmel', ↵Mark Brown2014-01-161-18/+16
|\ \ | | | | | | | | | '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
| | * ASoC: adau1701: Use params_width() rather than memory formatMark Brown2014-01-091-18/+16
| |/ | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
* | ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constantLars-Peter Clausen2014-01-081-1/+1
|/ | | | | | | | | | The driver defines ADAU1701_SEROCTL_WORD_LEN_16 as 0x10 while it should be b10, so 0x2. This patch fixes it. Reported-by: Magnus Reftel <magnus.reftel@lockless.no> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
* ASoC: adau1701: Use gpio_set_value_cansleep()Mark Brown2013-08-121-10/+10
| | | | | | | | | The GPIO manipulation done by this driver is never in atomic context so we can use gpio_set_value_cansleep() and support GPIOs that can't be set from atomic context. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
* ASoC: adau1701: type bug with ADAU1707_CLKDIV_UNSETDan Carpenter2013-07-261-1/+1
| | | | | | | | ADAU1707_CLKDIV_UNSET is always compared against an unsigned int and not an unsigned long. The current tests are always false. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: adau1701: Add adau1702 and adau1401(a) device idsLars-Peter Clausen2013-07-231-0/+3
| | | | | | | | Both the adau1702 and the adau1401(a) are register compatible to the adau1701, so add them to adau1701 driver's device id table. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: adau1701: remove control_data assignmentDaniel Mack2013-06-301-2/+0
| | | | | | | | | | | codec->control_data has to be left unset to make the ASoC core access the regmap properly. That bug slipped in during a rebase session of the driver refactoring. Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: adau1701: more direct regmap usageDaniel Mack2013-06-301-7/+12
| | | | | | | | Replace calls to snd_soc_update_bits() with regmap_update_bits(). Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: adau1701: add support for pin muxingDaniel Mack2013-06-251-2/+30
| | | | | | | | | The ADAU1701 has 12 pins that can be configured depending on the system configuration. Allow settting the corresponding registers from DT. Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: adau1701: switch to direct regmap API usageDaniel Mack2013-06-251-33/+85
| | | | | | | | | The hardware I/O has to be open-coded due to registers of unequal sizes. Other than that, the transition is straight forward. Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: adau1701: allow configuration of PLL mode pinsDaniel Mack2013-06-251-7/+98
| | | | | | | | | | | | | | | | | | | The ADAU1701 has 2 hardware pins to configure the PLL mode in accordance to the MCLK-to-LRCLK ratio. These pins have to be stable before the chip is released from reset, and a full reset cycle, including a new firmware download is needed whenever they change. This patch adds GPIO properties to the DT bindings of the Codec, and implements makes the set_sysclk memorize the configured sysclk. Because the run-time parameters are unknown at probe time, the first firmware download is postponed to the first hw_params call, when the driver can determine the mclk/lrclk divider. Subsequent downloads are only issued when the divider configuration changes. Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: adau1701: move firmware download to adau1701_reset()Daniel Mack2013-06-251-20/+12
| | | | | | | | | The chip needs a new download after each reset, so the code to do that needs to live in adau1701_reset(). Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: codecs: adau1701: factor out firmware resetDaniel Mack2013-06-121-13/+36
| | | | | | | | | | | | | | Some runtime-determined constraints might need to be satisfied prior to firmware loading, so the actual download and releasing the device from reset has to be postponed. Factor it out first, so we have everything at one place. This also changes the behaviour in a way that adau1701_i2c_probe() will assert the reset line, and wait for the codec probe to release it. Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: codecs: adau1701: add DT bindingsDaniel Mack2013-05-251-1/+34
| | | | | | | | | Apart from pure matching, the bindings also support setting the the reset gpio line. Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: adau1701: refactor firmware loading functionDaniel Mack2013-05-231-4/+5
| | | | | | | | | Pass a struct i2c_client * to adau1701_load_firmware directly to make the code more readable. Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: codecs: remove __dev* attributesBill Pemberton2012-12-101-4/+4
| | | | | | | | | | | 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>
* ASoC: adau1701: Use module_i2c_driverSachin Kamat2012-08-061-11/+1
| | | | | | | | module_i2c_driver makes the code simpler by eliminating module_init and module_exit calls. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: codecs: Remove rtd->codec usage from CODEC driversMark Brown2012-04-041-2/+1
| | | | | | | | | | In order to support CODEC<->CODEC links remove the assumption that there is only a single CODEC on a DAI link by removing the use of the CODEC pointer in the rtd from the CODEC drivers. They are already being passed their DAI whenever they are passed an rtd and can get the CODEC from there. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Set idle_bias_off flag in snd_soc_codec_driverAxel Lin2012-01-271-1/+1
| | | | | | | | | Since commit 33c5f969 "ASoC: Allow idle_bias_off to be specified in CODEC drivers", now we can set idle_bias_off flag in struct snd_soc_codec_driver for devices can unconditionally support idle_bias_off. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Convert adau1701 to devm_kzalloc()Axel Lin2011-12-281-5/+1
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Move SigmaDSP firmware loader to ASoCLars-Peter Clausen2011-11-291-1/+1
| | | | | | | | | | | | | It has been pointed out previously, that the firmware subsystem is not the right place for the SigmaDSP firmware loader. Furthermore the SigmaDSP is currently only used in audio products and we are aiming for better integration into the ASoC framework in the future, with support for ALSA controls for firmware parameters and support dynamic power management as well. So the natural choice for the SigmaDSP firmware loader is the ASoC subsystem. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Cleanup duplicated constLars-Peter Clausen2011-11-231-1/+1
| | | | | | | | 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>
* ASoC: Constify snd_soc_dai_ops structsLars-Peter Clausen2011-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: adau1701: Fix prototype for adau1701_set_sysclkAxel Lin2011-09-281-1/+1
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: adau1701: Initialize codec->control_data before using itAxel Lin2011-09-281-0/+1
| | | | | | | | | Currently codec->control_data is not initialized before calling process_sigma_firmware(codec->control_data, ADAU1701_FIRMWARE). 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>
* ASoC: adau1701: signedness bug in adau1701_write()Dan Carpenter2011-06-201-1/+2
| | | | | | | | | | | "ret" is supposed to be signed here. The current code will only return -EIO on error, instead of a more appropriate error code such as -EAGAIN etc. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add ADAU1701 codec driverLars-Peter Clausen2011-06-161-0/+548
This patch adds support for the Analog Devices ADAU1701 SigmaDSP. 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>
OpenPOWER on IntegriCloud