summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/da7213.h
AgeCommit message (Collapse)AuthorFilesLines
2020-07-07ASoC: da7213: add default clock handlingSebastian Reichel1-0/+2
This adds default clock/PLL configuration to the driver for usage with generic drivers like simple-card for usage with a fixed rate clock. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Link: https://lore.kernel.org/r/20200626164623.87894-1-sebastian.reichel@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: da7213: Add regulator supportSebastian Reichel1-0/+9
This adds support for most regulators of da7212 for improved power management. The only thing skipped was the speaker supply, which has some undocumented dependencies. It's supposed to be either always-enabled or always-disabled. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Link: https://lore.kernel.org/r/20200511132544.82364-3-sebastian.reichel@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-02ASoC: da7213: fix DAI_CLK_EN register bit overwriteLogesh1-0/+2
If the da7213 codec is configured as Master with the DAPM power down delay time set, 'snd_soc_component_write' function overwrites the DAI_CLK_EN bit of DAI_CLK_MODE register which leads to audio play only once until it re-initialize after codec power up. Signed-off-by: Logesh <logesh.kolandavel@timesys.com> Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-09ASoC: da7213: add support for DSP modesPierre-Louis Bossart1-0/+1
DSP modes are documented in the data sheet but not enabled in the driver. The work-around already implemented for DA7218/9 is also required to make sure the bit clock handling in DSP modes follows ASoC conventions. Tested with ARD-AUDIO-DA7212 and Minnowmax Turbot boards Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: da7213: Refactor sysclk(), pll() functions to improve handlingAdam Thomson1-4/+8
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>
2016-05-10ASoC: da7213: Update PLL ranges to improve locking at frequency boundaryAdam Thomson1-14/+14
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>
2016-05-10ASoC: da7213: Default PC counter to free-running when DAI disabledAdam Thomson1-0/+3
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>
2016-05-10ASoC: da7213: Add checking of SRM lock status before enabling DAIAdam Thomson1-0/+4
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>
2016-05-10ASoC: da7213: Add DAI DAPM event to control DAI clocksAdam Thomson1-2/+0
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>
2015-10-07ASoC: da7213: Add support to handle mclk data provided to driverAdam Thomson1-2/+6
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>
2013-02-14ASoC: codecs: Add da7213 codecAdam Thomson1-0/+523
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>