aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8962.c
Commit message (Collapse)AuthorAge
* ASoC: wm8962: Enable SYSCLK provisonally before fetching generated DSPCLK_DIVNicolin Chen2014-04-16
| | | | | | | | | | | | | | | | | | DSPCLK_DIV can be only generated correctly after enabling SYSCLK. But if the current bias_level hasn't reached SND_SOC_BIAS_ON, DAPM won't enable SYSCLK, which would cause the calculation result from DSPCLK_DIV invalid since bit DSPCLK_DIV will be finally turned to its true value after DAPM enables SYSCLK while the driver won't calculate it again for the current instance. In this circumstance, a playback which needs non-zero DSPCLK_DIV would be distorted due to unexpected clock frequency resulted from an invalid DSPCLK_DIV value. So this patch provisionally enables the SYSCLK to get a valid DSPCLK_DIV for calculation and then disables it afterward. Signed-off-by: Nicolin Chen <b42378@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org> (cherry picked from commit 75704ecfbb4124139b78b71dd603f05d61abe689)
* ENGR00273838-10 ASoC: WM8962: Set default Volume for playback/captureNicolin Chen2014-04-16
| | | | | | | | Set default volume for playback(Headphone, Speaker) and Capture(ADC, input). This would let playback have a normal volume after system boot up. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00273838-9 ASoC: WM8962: Remove 64KHz sample rate supportNicolin Chen2014-04-16
| | | | | | | | | | 64KHz is not in the auto samplerate list of WM8962. When playing a 64KHz wave file, 'Unsupported rate 64000Hz' will be prompted. Thus remove to let alsa-lib handle it. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00273838-8 ASoC: WM8962: Let codec driver enable/disable its MCLKNicolin Chen2014-04-16
| | | | | | | | | WM8962 needs its MCLK when powerup -- wm8962_resume(). Thus it's better to control the MCLK in codec driver. Thus remove the clock enable in machine dirver accordingly. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ASoC: wm8962: Do not call configure_bclk() inside wm8962_set_dai_sysclk()Fabio Estevam2014-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently after playing any audio file, we get the following error message: $ aplay clarinet.wav Playing WAVE 'clarinet.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo $ wm8962 0-001a: Unsupported sysclk ratio 544 This error message appears about 5 seconds after the audio playback has finished. Quoting Mark Brown [1]: "The issue here is triggered by the machine switching from the FLL to direct MCLK usage where the MCLK isn't generating a useful ratio. I suspect we should just kill the configure_bclk() in set_sysclk(), that one isn't safe as we can't reconfigure a live SYSCLK and it's probably the one that generates your warnings." Confirmed that the "Unsupported sysclk ratio" error message comes from wm8962_set_dai_sysclk(), so get rid of wm8962_configure_bclk() inside this function. [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2013-July/064241.html Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: wm8962: Enable start-up and normal bias after reset in runtime resumeNicolin Chen2014-04-16
| | | | | | | | | | | | | | | | | | | | Commit f5055f93733730b61a8a69dedbb216e6b4dd84c5 upstream. This part of bias settings are essential for WM8962 to power up. Without it "wm8962 0-001a: DC servo timed out" might be prompted due to power-up failure that happens to FLL if being used. The driver's also bringing the bias down in the suspend path so it needs to be powered up in the resume path for symmetry. According to dapm_pre_sequence_async(), DAPM would call pm_runtime_get_sync() to let driver finish the bias settings in pm_runtime_resume() before the bias level being set to STANDBY. So no need to worry about disordered settings for VMID of WM8962. Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
* ASoC: wm8962: Restore device state after reset in runtime resumeMark Brown2014-04-16
| | | | | | | | | | | | Commit 9c24b1672283644adf871244771ebf387dd73f90 upstream. After the device has been reset we need to repeat the same initialisation we do on probe to make sure that the device is in a known state. Tested-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
* ASoC: wm8962: Add device tree bindingNicolin Chen2014-04-16
| | | | | | | | | | | | | Commit d74e9e7090aeb9b61e683e5abf7ca70fa18f846b upstream. Document the device tree binding for the WM8962 codec, and modify the driver to extract platform data from the device tree, if present. Based on work of WM8903 by Stephen Warren <swarren@nvidia.com> Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
* ASoC: WM8962: Create default platform data structureNicolin Chen2014-04-16
| | | | | | | | | | | Commit e75a52c6723a61a0d768ee53794e86b7edbe54f0 upstream. Embed a copy of struct wm8962_pdata in stuct wm8962_priv so that there's no need to check validity of pdata any more. Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
* ASoC: wm8962: Turn on regcache_cache_only before disabling regulatorNicolin Chen2013-12-04
| | | | | | | | | | | | | | | commit 50bfcf2df2fadf77e143d6099150e6fa7ef4d78c upstream. It's safer to turn on regcache_cache_only before disabling regulator since the driver will turn off the regcache_cache_only after enabling regulator. If we remain cache_only false, some command like 'amixer cset' would get failure if being run before wm8962_resume(). Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* ASoC: wm8962: Remove remaining direct register cache accessesNicolin Chen2013-08-04
| | | | | | | | | | | commit 2e7ee15ced914e109a1a5b6dfcd463d846a13bd5 upstream. Also fix return values for headphone switch updates. Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* ASoC: wm8962: Unconditionally wait for the FLL to lockMark Brown2012-12-24
| | | | | | | | If the FLL is being shut down we will exit early so there is no need to check here and in fact we're checking the wrong thing anyway. Reported-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Convert to devm_input_allocate_device()Mark Brown2012-12-24
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Add device tree supportFabio Estevam2012-12-24
| | | | | | | Add device tree support. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: codecs: remove __dev* attributesBill Pemberton2012-12-09
| | | | | | | | | | | 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: wm8962: Use devm_regmap_init_i2c()Sachin Kamat2012-12-01
| | | | | | | | devm_regmap_init_i2c() is device managed and makes error handling and code cleanup simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Use devm_regulator_bulk_getSachin Kamat2012-11-28
| | | | | | | | devm_regulator_bulk_get() is device managed and makes error handling and code cleanup simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Don't duplicate bias level management in resumeMark Brown2012-08-09
| | | | | | | The core will bring the bias level up for us since we use idle_bias_off, duplicating this may be harmful. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Allow VMID time to fully rampMark Brown2012-07-31
| | | | | | | Required for reliable power up from cold. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
* ASoC: wm8962: Redo early init of the part on resumeMark Brown2012-07-12
| | | | | | | | | Ensure robust startup of the part by going through the reset procedure prior to resyncing the full register cache, avoiding potential intermittent faults in some designs. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
* ASoC: wm8962: Log AIF configuration requested by hw_params()Mark Brown2012-07-03
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: codecs: Refresh copyrights for Wolfson driversMark Brown2012-06-03
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: codecs: Remove rtd->codec usage from CODEC driversMark Brown2012-04-04
| | | | | | | | | | 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: wm8962: Add HPF coefficient configuration supportMark Brown2012-04-01
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Add HD Bass and VSS coefficient configurationMark Brown2012-04-01
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Add Dynamic Range Control supportMark Brown2012-04-01
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Add Direct-Form 1 filter supportMark Brown2012-04-01
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Add 3D enhancement supportMark Brown2012-04-01
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Implement DSP2 configuration initialisationMark Brown2012-04-01
| | | | | | | We can simply use the register cache code to synchronise the current configuration down to the device when bringing up the DSP. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge branch 'topic/asoc' into for-linusTakashi Iwai2012-03-18
|\
| * ASoC: wm8962: Remove defaults for volatile registersMark Brown2012-03-05
| | | | | | | | | | | | Save a little RAM. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Remove unneeded pm_runtime_set_active()Mark Brown2012-03-05
| | | | | | | | | | | | The default pm_runtime status is enabled which is what we want. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Run the headphone in class G mode when sidetone is enabledMark Brown2012-03-02
| | | | | | | | | | | | Class W mode with sidetone is not fully supported. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Remove register default for PLL2Mark Brown2012-03-01
| | | | | | | | | | | | The initial value can be changed depending on system configuration. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Convert interrupt handler to direct regmap usageMark Brown2012-02-23
| | | | | | | | | | | | Avoids potential locking issues with anything that needs the CODEC lock. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Remove mistakenly committed debug loggingMark Brown2012-02-23
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Convert to module_i2c_driver()Mark Brown2012-02-17
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Convert to runtime PM for bias off managementMark Brown2012-02-17
| | | | | | | | | | | | | | This allows userspace control of final power off, allowing policy decisions for register configuration retention. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Don't automatically enable and disable FLLMark Brown2012-02-17
| | | | | | | | | | | | | | Only enable and disable the FLL when explicitly told to, supporting some additional use cases and making the driver behaviour more standard. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Clean up register dump cruftMark Brown2012-02-17
| | | | | | | | | | | | No longer needed with regmap. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Add new SYSCLK ratios for new device revisionsMark Brown2012-02-17
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Log the selected SYSCLK ratioMark Brown2012-02-17
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Only configure BCLK in hw_params when audio is activeMark Brown2012-02-17
| | | | | | | | | | | | Otherwise we might not have a sensible clocking setup ready. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Update the clocking when setting system clockMark Brown2012-02-17
| | | | | | | | | | | | | | Make sure we update for any changes in cases where we reconfigure while live (eg, for analogue bypass). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: Show device id in the debug messageAxel Lin2012-02-16
| | | | | | | | | | | | | | | | Show the id we read when the id mismatch is detected. This is useful for debugging. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * Merge tag 'v3.3-rc3' as we've got several bugfixes in there which areMark Brown2012-02-09
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | colliding annoyingly with development. Linux 3.3-rc3 .. the number of the half-beast? Conflicts: sound/soc/codecs/wm5100.c sound/soc/codecs/wm8994.c
| * | ASoC: wm8962: Support mono playback and recordMark Brown2012-02-08
| | | | | | | | | | | | | | | | | | | | | Make sure we generate enough BCLKs for I2S style modes by always having a minimum of two channels worth of clocks for the BCLK. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | ASoC: core: Add support for DAI and machine kcontrols.Liam Girdwood2012-02-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently ASoC can only add kcontrols using codec and platform component device handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for SoC card machine drivers too. This allows the kcontrol to have a direct handle to the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily get it's private data. This change makes snd_soc_add_controls() static and wraps it in the folowing calls (card and dai are new) :- snd_soc_add_card_controls() snd_soc_add_codec_controls() snd_soc_add_dai_controls() snd_soc_add_platform_controls() This patch also does a lot of small mechanical changes in individual codec drivers to replace snd_soc_add_controls() with snd_soc_add_codec_controls(). It also updates the McBSP DAI driver to use snd_soc_add_dai_controls(). Finally, it updates the existing machine drivers that register controls to either :- 1) Use snd_soc_add_card_controls() where no direct codec control is required. 2) Use snd_soc_add_codec_controls() where there is direct codec control. In the case of 1) above we also update the machine drivers to get the correct component data pointers from the kcontrol (rather than getting the machine pointer via the codec pointer). Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | ASoC: wm8962: Enable idle_bias_offMark Brown2012-01-27
| | | | | | | | | | | | | | | | | | | | | The WM8962 has ground referenced and class D outputs so can happily go down to BIAS_OFF without a large startup time. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | ASoC: wm8962: Optimise power consumption for IN4 DC measurement usageMark Brown2012-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the hardware is configured with one or both of the IN4 inputs used for DC measurement (with no DC blocking capacitor connected) then we can improve power consumption slightly in idle modes by applying a register write sequence. Provide platform data to enable this, implemented using a regmap patch. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>