summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8962.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
*---. Merge remote-tracking branches 'asoc/topic/ad1836', 'asoc/topic/ad193x', ↵Mark Brown2014-01-021-2/+2
|\ \ \ | | | | | | | | | | | | 'asoc/topic/adav80x', 'asoc/topic/adsp', 'asoc/topic/ak4641', 'asoc/topic/ak4642', 'asoc/topic/arizona', 'asoc/topic/atmel', 'asoc/topic/au1x', 'asoc/topic/axi', 'asoc/topic/bcm2835', 'asoc/topic/blackfin', 'asoc/topic/cs4271', 'asoc/topic/cs42l52', 'asoc/topic/da7210', 'asoc/topic/davinci', 'asoc/topic/ep93xx', 'asoc/topic/fsl', 'asoc/topic/fsl-mxs', 'asoc/topic/generic', 'asoc/topic/hdmi', 'asoc/topic/jack', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/mxs', 'asoc/topic/omap', 'asoc/topic/pxa', 'asoc/topic/rcar', 'asoc/topic/s6000', 'asoc/topic/sai', 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/spear', 'asoc/topic/ssm2518', 'asoc/topic/ssm2602', 'asoc/topic/tegra', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl6040', 'asoc/topic/txx9', 'asoc/topic/uda1380', 'asoc/topic/width', 'asoc/topic/wm8510', 'asoc/topic/wm8523', 'asoc/topic/wm8580', 'asoc/topic/wm8711', 'asoc/topic/wm8728', 'asoc/topic/wm8731', 'asoc/topic/wm8741', 'asoc/topic/wm8750', 'asoc/topic/wm8753', 'asoc/topic/wm8776', 'asoc/topic/wm8804', 'asoc/topic/wm8900', 'asoc/topic/wm8901', 'asoc/topic/wm8940', 'asoc/topic/wm8962', 'asoc/topic/wm8974', 'asoc/topic/wm8985', 'asoc/topic/wm8988', 'asoc/topic/wm8990', 'asoc/topic/wm8991', 'asoc/topic/wm8994', 'asoc/topic/wm8995', 'asoc/topic/wm9081' and 'asoc/topic/x86' into asoc-next
| | | * ASoC: wm8962: Use IS_ENABLED() macroFabio Estevam2013-11-241-2/+2
| | |/ | |/| | | | | | | | | | | | | | | | Using the IS_ENABLED() macro can make the code shorter and simpler. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* / | ASoC: wm8962: Enable SYSCLK provisonally before fetching generated DSPCLK_DIVNicolin Chen2013-12-051-0/+13
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge tag 'asoc-v3.13-4' of ↵Takashi Iwai2013-11-161-0/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v3.13 A few fixes in drivers, the i.MX and wm8962 fixes are for a pretty nasty issues for users of those drivers if they run into them.
| * \ Merge remote-tracking branch 'asoc/fix/wm8962' into asoc-linusMark Brown2013-11-151-0/+2
| |\ \
| | * | ASoC: wm8962: Turn on regcache_cache_only before disabling regulatorNicolin Chen2013-11-141-0/+2
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> Cc: stable@vger.kernel.org
* | | Merge remote-tracking branch 'asoc/topic/wm8962' into asoc-nextMark Brown2013-11-081-110/+116
|\| |
| * | ASoC: wm8962: Add EQ coefficient supportRichard Fitzgerald2013-11-011-0/+3
| | | | | | | | | | | | | | | Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: wm8962: Add ALC coefficient supportRichard Fitzgerald2013-11-011-0/+5
| | | | | | | | | | | | | | | Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: wm8962: Fix null pointer pdata access in I2C probe()Nicolin Chen2013-10-291-7/+7
| |/ | | | | | | | | | | | | | | When using DT binding to pass private data, there would be Kernel panic occuring due to NULL pointer access in wm8962_i2c_probe(). Thus fix it. Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: wm8962: Move register initialisation to I2C probe()Mark Brown2013-10-181-75/+75
| | | | | | | | | | | | | | This is more idiomatic and is required for robust operation since we must ensure that the clocking configuration is valid as rapidly as possible. Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: wm8962: Move interrupt initalisation to probe()Mark Brown2013-10-181-35/+33
| | | | | | | | | | | | This is more idiomatic and fixes bugs in the error handling paths. Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: wm8962: Replace BUG() with WARN()Takashi Iwai2013-11-071-5/+5
|/ | | | | | | | | | | BUG() used in the driver is just to spit the stack trace on buggy points, not really needed to stop the whole operation. For that purpose, it'd be more convenient to use WARN() instead with more error information. Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge tag 'asoc-v3.12' of ↵Takashi Iwai2013-08-231-4/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.12 - DAPM is now mandatory for CODEC drivers in order to avoid the repeated regressions in the special cases for non-DAPM CODECs and make it easier to integrate with other components on boards. All existing drivers have had some level of DAPM support added. - A lot of cleanups in DAPM plus support for maintaining controls in a specific state while a DAPM widget all contributed by Lars-Peter Clausen. - Core helpers for bitbanged AC'97 reset from Markus Pargmann. - New drivers and support for Analog Devices ADAU1702 and ADAU1401(a), Asahi Kasei Microdevices AK4554, Atmel AT91ASM9x5 and WM8904 based machines, Freescale S/PDIF and SSI AC'97, Renesas R-Car SoCs, Samsung Exynos5420 SoCs, Texas Instruments PCM1681 and PCM1792A and Wolfson Microelectronics WM8997. - Support for building drivers that can support it cross-platform for compile test.
| * ASoC: wm8962: Use power efficient workqueueMark Brown2013-07-221-2/+3
| | | | | | | | | | | | | | | | | | The accessory detect debounce work is not performance sensitive so let the scheduler run it wherever is most efficient rather than in a per CPU workqueue by using the system power efficient workqueue. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
| * ASoC: wm8962: Do not call configure_bclk() inside wm8962_set_dai_sysclk()Fabio Estevam2013-07-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ALSA: replace strict_strto*() with kstrto*()Jingoo Han2013-07-211-1/+1
|/ | | | | | | | | The usage of strict_strto*() is not preferred, because strict_strto*() is obsolete. Thus, kstrto*() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: wm8962: fix NULL pdata pointerShawn Guo2013-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an error in merge commit 384b834 on conflict resolution which causes the following NULL pdata pointer bug. wm8962 0-001a: customer id 0 revision D Unable to handle kernel NULL pointer dereference at virtual address 00000004 pgd = 80004000 [00000004] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0+ #1 task: bf870000 ti: bf874000 task.ti: bf874000 PC is at wm8962_probe+0x134/0x6c8 LR is at regmap_unlock_mutex+0x10/0x14 pc : [<80452100>] lr : [<80304cf4>] psr: a0000113 sp : bf875c98 ip : 00000000 fp : bf875cd4 r10: 00000000 r9 : bfb1830c r8 : 80779bc4 r7 : 00000000 r6 : 00000001 r5 : bfbac010 r4 : bfb33e00 r3 : 80304ce4 r2 : 00000000 r1 : 00000001 r0 : fffffffb Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c53c7d Table: 1000404a DAC: 00000017 Process swapper/0 (pid: 1, stack limit = 0xbf874238) Stack: (0xbf875c98 to 0xbf876000) ... Fix the error by assigning pdata a correct pointer. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'asoc/topic/wm8962' into asoc-nextMark Brown2013-06-171-30/+82
|\
| * Merge branch 'fix/wm8962' of ↵Mark Brown2013-06-141-12/+14
| |\ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-wm8962 Conflicts: sound/soc/codecs/wm8962.c
| * | ASoC: wm8962: Restore device state after reset in runtime resumeMark Brown2013-06-101-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ASoC: wm8962: Add device tree bindingNicolin Chen2013-06-071-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ASoC: WM8962: Create default platform data structureNicolin Chen2013-06-061-32/+36
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | ASoC: wm8962: Enable start-up and normal bias after reset in runtime resumeNicolin Chen2013-06-141-0/+11
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: wm8962: Remove remaining direct register cache accessesNicolin Chen2013-06-141-11/+13
|/ | | | | | | | Also fix return values for headphone switch updates. Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
* ASoC: wm8962: Unconditionally wait for the FLL to lockMark Brown2012-12-241-14/+12
| | | | | | | | 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-241-3/+1
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Add device tree supportFabio Estevam2012-12-241-0/+7
| | | | | | | 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-091-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: wm8962: Use devm_regmap_init_i2c()Sachin Kamat2012-12-021-11/+6
| | | | | | | | 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-281-5/+2
| | | | | | | | 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-091-15/+0
| | | | | | | 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-311-0/+3
| | | | | | | 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-121-0/+3
| | | | | | | | | 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-031-0/+3
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: codecs: Refresh copyrights for Wolfson driversMark Brown2012-06-031-1/+1
| | | | 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: wm8962: Add HPF coefficient configuration supportMark Brown2012-04-011-0/+1
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Add HD Bass and VSS coefficient configurationMark Brown2012-04-011-0/+2
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Add Dynamic Range Control supportMark Brown2012-04-011-0/+3
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Add Direct-Form 1 filter supportMark Brown2012-04-011-0/+3
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Add 3D enhancement supportMark Brown2012-04-011-0/+3
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: wm8962: Implement DSP2 configuration initialisationMark Brown2012-04-011-1/+2
| | | | | | | 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-181-1338/+803
|\
| * ASoC: wm8962: Remove defaults for volatile registersMark Brown2012-03-061-14/+3
| | | | | | | | | | | | Save a little RAM. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8962: Remove unneeded pm_runtime_set_active()Mark Brown2012-03-061-1/+0
| | | | | | | | | | | | 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-021-0/+2
| | | | | | | | | | | | 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-011-2/+0
| | | | | | | | | | | | 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-231-20/+39
| | | | | | | | | | | | 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-231-4/+0
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>