summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/da7213.c
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge remote-tracking branches 'asoc/topic/cs35l30', 'asoc/topic/cs42l73', ↵Mark Brown2016-09-291-46/+84
|\ \ | | | | | | | | | 'asoc/topic/cs53l30' and 'asoc/topic/da7213' into asoc-next
| | * ASoC: da7213: Improve 32KHz mode PLL lockingAdam Thomson2016-08-081-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | To aid PLL in locking on to a 32KHz MCLK, some register mods are made during PLL configuration, and when enabling the DAI, to achieve the full range of sample rates. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: da7213: Refactor sysclk(), pll() functions to improve handlingAdam Thomson2016-08-081-36/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the handling of the PLL in the driver is a little clunky, and not ideal for all modes. This patch updates the code to make it cleaner and more sensible for the various PLL states. Key items of note are: - MCLK squaring is now handled directly as part of the sysclk() function, removing the need for a private flag to set this feature. - All PLL modes are defined as an enum, and are handled as a case statement in pll() function to clean up configuration. This also removes any need for a private flag for SRM. - For 32KHz mode, checks are made on codec master mode and correct MCLK rates, to avoid incorrect usage of PLL for this operation. - For 32KHz mode, SRM flag now correctly enabled and fout set to sensible value to achieve appropriate PLL dividers. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: da7213: Improve driver efficiency with regards to MCLK usageAdam Thomson2016-08-081-9/+11
| |/ | | | | | | | | | | | | | | | | | | | | Currently MCLK remains enabled during bias STANDBY state, and this is not necessary. This patch updates the code to handle enabling and disabling of MCLK, if provided, when moving between STANDBY and PREPARE states, therefore saving power when no active streams present. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
*-. \ Merge remote-tracking branches 'asoc/topic/ac97', 'asoc/topic/ak4104', ↵Mark Brown2016-09-291-7/+8
|\ \ \ | | |/ | |/| | | | 'asoc/topic/arizona', 'asoc/topic/atmel' and 'asoc/topic/codec-component' into asoc-next
| | * ASoC: codec duplicated callback function goes to component on da7213Kuninori Morimoto2016-08-081-7/+8
| |/ | | | | | | | | | | | | | | | | | | 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>
* | ASoC: da7213: Default to 64 BCLKs per WCLK to support all formatsAdam Thomson2016-08-041-2/+2
|/ | | | | | | | | Previously code defaulted to 32 BCLKS per WCLK which meant 24 and 32 bit DAI formats would not work properly. This patch fixes the issue by defaulting to 64 BCLKs per WCLK. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7213: Allow PLL disable/bypass when using 32KHz sysclkAdam Thomson2016-05-101-1/+1
| | | | | | | | | | Current checking for PLL 32KHz mode fails in driver code when bypassing the PLL. This is due to an incorrect check of PLL source type when 32KHz clock is provided. Removal of this check resolves the issue. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7213: Update PLL ranges to improve locking at frequency boundaryAdam Thomson2016-05-101-13/+13
| | | | | | | | | This update changes the dividers used for ranges of input MCLK frequencies, to improve PLL locking for a corner case when at edge of MCLK frequency input divider range. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7213: Default PC counter to free-running when DAI disabledAdam Thomson2016-05-101-0/+13
| | | | | | | | | | Currently PC counter is always synchronised to DAI which means that when the DAI is disabled, features such as ALC calibration cannot be executed successfully. This patch makes sure that when the DAI is disabled, PC counter is set to free-running. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7213: Add checking of SRM lock status before enabling DAIAdam Thomson2016-05-101-0/+23
| | | | | | | | | | | When the codec is DAI clk slave, and the SRM feature of the PLL is being used, the enabling of the DAI should occur only after the PLL has locked to the incoming WCLK. This update adds checking to the the DAI widget event, so it waits for SRM to lock. There is also a timeout if that lock doesn't occur within a given time. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7213: Add DAI DAPM event to control DAI clocksAdam Thomson2016-05-101-3/+32
| | | | | | | | | | Currently, when Codec is I2S master DAI clocks are continuously generated even if all audio streams have stopped. To improve efficiency, control of the DAI clocks for master mode have been moved to a DAPM widget event so they're only enabled as required. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7213: Add support to handle mclk data provided to driverAdam Thomson2015-10-071-11/+56
| | | | | | | | | | Driver now can make use of mclk data, if provided, to set, enable and disable the clock source. As part of this, the choice to enable clock squaring is dealt with as part of dai_sysclk() call rather than as platform data. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7213: Add DT support to codec driverAdam Thomson2015-10-071-5/+118
| | | | | | | | | This patch adds support for DT bindings in the codec driver. As part of this support, the mclk data can now be provided and used to control the mclk during codec operation. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5086', ↵Mark Brown2015-08-301-9/+6
|\ \ | | | | | | | | | 'asoc/topic/tegra', 'asoc/topic/tlv' and 'asoc/topic/topology' into asoc-next
| | * ASoC: da7213: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGELars-Peter Clausen2015-08-051-9/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD() that it automatically calculates the number of items in the TLV and is hence less prone to manual error. Generate using the following coccinelle script // <smpl> @@ declarer name DECLARE_TLV_DB_RANGE; identifier tlv; constant x; @@ -unsigned int tlv[] = { - TLV_DB_RANGE_HEAD(x), +DECLARE_TLV_DB_RANGE(tlv, ... -}; +); // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge branches 'topic/owner' and 'topic/reg-default' of ↵Mark Brown2015-07-161-1/+1
|\ \ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-max9877
| * | ASoC: Constify reg_default tablesAxel Lin2015-07-071-1/+1
| |/ | | | | | | | | | | | | | | 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>
* | ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski2015-07-151-1/+0
|/ | | | | | | | i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7213: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen2015-05-181-1/+1
| | | | | | | | | 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>
* 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: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen2014-04-141-2/+2
| | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'asoc/topic/io' into asoc-nextMark Brown2014-03-131-8/+0
|\
| * ASoC: codec: Simplify ASoC probe code.Xiubo Li2014-03-111-8/+0
| | | | | | | | | | | | | | | | 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>
* | ASoC: da7213: Use SOC_ENUM_SINGLE_DECL()Takashi Iwai2014-02-201-71/+80
|/ | | | | | | | | Just replace with the helper macro. No functional change at all. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: da7213: Use params_width() rather than memory formatMark Brown2014-01-131-5/+5
| | | | Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: da7213: Fix setting dmic_samplephase and dmic_clk_rateAxel Lin2013-05-091-4/+4
| | | | | | | | | When set dmic_samplephase and dmic_clk_rate bits for dmic_cfg, current code checks pdata->dmic_data_sel which is wrong. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
* ASoC: codecs: Add da7213 codecAdam Thomson2013-02-141-0/+1599
This patch adds support for the Dialog DA7213 audio codec. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
OpenPOWER on IntegriCloud