summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/da7219.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge remote-tracking branches 'asoc/fix/da7219-pops' and 'asoc/fix/qcom' ↵Mark Brown2016-12-121-18/+121
|\ \ | | | | | | | | | into asoc-linus
| * | ASoC: da7219: Improve pop/click performance for sensitive HPsAdam Thomson2016-10-051-18/+121
| |/ | | | | | | | | | | | | | | | | | | | | Currently on some headsets slight pops can be heard during DAPM power-up/down. This can also be witnessed during the HP detect procedure. This patch addresses the issue by adjusting DAPM power sequencing slightly, the introduction of delays and use of minimum HP gain to avoid such noise artefacts. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* / ASoC: da7219: Connect output enable register to DAIOUTStephen Barber2016-10-281-1/+2
|/ | | | | | | | | | da7219 output (for headset capture) should be set to high-impedance when not in use, since it will otherwise interfere with output from other codecs attached to the same DAI. Signed-off-by: Stephen Barber <smbarber@chromium.org> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/da7218', 'asoc/topic/da7219' and ↵Mark Brown2016-09-291-22/+54
|\ \ | | | | | | | | | 'asoc/topic/dpcm' into asoc-next
| | * ASoC: da7219: fix inappropriate condition statementTakashi Sakamoto2016-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sparse reports a below warning. sound/soc/codecs/da7219.c:804:57: warning: dubious: x & !y The line includes a condition statement; '(a < b) & !c'. Practically, the evaluated value of this statement equals to the value of '(a < b) && !c'. Although, it's not an usual way to use bitwise operations as logical operations to several conditions. This commit fixes the bug. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: da7219: Disable AAD if codec is not a wake-up sourceAdam Thomson2016-09-261-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if AAD is enabled in the device, during system suspend the feature remains, regardless of whether the codec is a wake-up source or not. This means some additional power is being used which is unnecessary, and can causes issues with some platforms' IRQ handlers where state changes during system suspend aren't captured. This patch updates the driver to disable AAD during suspend, if we're not a wake-up source, and then re-enables this on resume. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: da7219: Reset codec gracefully, if still activeAdam Thomson2016-09-261-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the reset code in i2c_probe only resets the AAD part of the device and not the entire codec. This patch updates the driver to resolve this and ensures that if the codec is still active from a previous boot then the audio paths are powered down prior to reset. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * Merge branch 'fix/da7219' of ↵Mark Brown2016-09-261-0/+8
| | |\ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-da7219
| | * | ASoC: da7219: Make more efficient use of MCLK within driverAdam Thomson2016-08-081-7/+11
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if the driver has control of MCLK then it remains enabled as long as the codec is in STANDBY or above. The MCLK is only really required in STANDBY when a 3-pole jack is inserted and the HP detect procedure is required to run. This patch updates the code to enable/disable the MCLK when moving between the STANDBY and PREPARE bias level, and when a 3-pole jack is inserted and HP detection is required, thus saving power at all other times. 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 da7219Kuninori 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: da7219: software reset codec at probeHsin-Yu Chao2016-09-141-0/+8
|/ | | | | | | | | | | Da7219 does not trigger interrupt to report jack status when system boots from warm reset because its power remains on during warm reset. Doing software reset at probe to handle this. Signed-off-by: Hsin-Yu Chao <hychao@chromium.org> Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Convert driver to use generic device/fwnode functionsAdam Thomson2016-06-261-17/+17
| | | | | | | | | | This change converts the driver from using the of_* functions to using the device_* and fwnode_* functions for accssing FW related data. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Acked-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7129: Add missing include of acpi.hMark Brown2016-05-061-0/+1
| | | | | Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Add initial ACPI id for deviceAdam Thomson2016-05-051-0/+7
| | | | | | | | This adds "DLGS7219" ACPI id for the codec. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Tested-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Disallow unsupported 32KHz clock setting in set_dai_sysclk()Adam Thomson2016-04-191-1/+1
| | | | | | | | | | The PLL function was updated to disallow 32KHz in commit 501f72e9c520 ("ASoC: da7219: Remove support for 32KHz PLL mode"), but set_dai_sysclk() was missed and still permits it. This patch resolves that discrepancy. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Update PLL ranges and dividers to improve lockingAdam Thomson2016-04-191-14/+14
| | | | | | | | | The expected MCLK frequency ranges and the associated dividers are updated to improve PLL locking in a corner scenario, with low MCLK frequency near an input divider change boundary. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Correct BCLK inversion for DSP DAI format modeAdam Thomson2016-01-051-11/+37
| | | | | | | | | | By default the device latches data on the falling edge of the BCLK in DSP mode, whereas the expectation for normal BCLK is to latch on the rising edge. This updates the driver to invert the BCLK configuration for DSP mode, to align with expected behaviour. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Add regmap patch to support old siliconAdam Thomson2015-12-241-1/+25
| | | | | | | | Initial silicon did not have master bias enabled by default, unlike later HW, so use regmap patch to align with newer defaults. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Remove support for 32KHz PLL modeAdam Thomson2015-12-231-8/+2
| | | | | | | | PLL mode based on 32KHz master clock not supported in AB silicon so remove support from the driver. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Add support for 1.6V micbias levelAdam Thomson2015-12-231-0/+3
| | | | | | | | | | HW can provide 1.6V micbias level as well the existing levels already provided in the driver. This patch adds support for 1.6V to the DT binding. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Remove internal LDO features of codecAdam Thomson2015-12-231-48/+2
| | | | | | | | | | In AB silicon, the internal LDO is not supported so remove DT and driver references to this (digital voltage direct from 'VDD' supply) Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Update REFERENCES reg default, in-line with HWAdam Thomson2015-12-231-1/+1
| | | | | | | | | In current AB silicon, BIAS_EN field is enabled by default in the REFERENCES register, so the regmap default value should reflect this. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Disable regulators on probe() failureAdam Thomson2015-12-231-4/+15
| | | | | | | | | If codec probe() function fails after supplies have been enabled it should really tidy up and disable them again. This patch updates the probe function to do just that. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Fix Sidetone to work regardless of DAI captureAdam Thomson2015-12-231-1/+2
| | | | | | | | | | Previously Sidetone would operate only when capture to DAI was in progress, due to DAPM path configuration. There is no reason why this should not operate without DAI capture, so this patch updates the DAPM path accordingly. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Use logical instead of bitwise OR for boolean expressionAxel Lin2015-11-161-1/+1
| | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Fix da7219->alc_en state when enabling ALCAxel Lin2015-10-211-1/+1
| | | | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* ASoC: da7219: Improve error checking of mclk enable/disableAdam Thomson2015-10-071-2/+11
| | | | | | | | | Should only try to enable/disable the provided mclk, during bias level changes, if it's not NULL. Also return value of clk_prepare_enable() should be checked and dealt with accordingly. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Use of_match_ptr() when assigning match tableAdam Thomson2015-10-071-1/+1
| | | | | | | | Use of_match_ptr() to handle non-DT kernel scenario where match table should be NULL. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Improve error handling for regulator suppliesAdam Thomson2015-10-051-2/+8
| | | | | | | | | | | | Currently if bulk_enable() of supplies fails, the code still goes on to try and put the device into active state, and set expected IO voltage of the device. This doesn't really make sense so code now returns on bulk_enable() failure, with an error message. Also, to help with debug, failure to get supplies also provides an error message. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: Add da7219 codec driverAdam Thomson2015-10-021-0/+1940
This adds support for the DA7219 audio codec with built-in advanced accessory detect features. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>