summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm2000.c
AgeCommit message (Collapse)Author
2015-07-15ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski
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>
2015-03-10ASoC: wm2000: Fix wrong value references for boolean kctlTakashi Iwai
The correct values referred by a boolean control are value.integer.value[], not value.enumerated.item[]. The former is long while the latter is int, so it's even incompatible on 64bit architectures. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org>
2015-01-14ASoC: wm2000: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen
The codec field of the snd_soc_widget struct is eventually going to be removed, use snd_soc_dapm_to_codec(w->dapm) instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-06-27ASoC: wm2000: Remove redundant OOM messageSachin Kamat
Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14ASoC: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen
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>
2014-03-11ASoC: codec: Simplify ASoC probe code.Xiubo Li
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>
2013-11-06ASoC: wm2000: Use WARN_ON() instead of BUG_ON()Takashi Iwai
Use WARN_ON() and handle the error cases accordingly. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-03-29ASoC: wm2000: Expose some more registers for diagnosticsMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-11Merge remote-tracking branch 'asoc/topic/wm2000' into asoc-nextMark Brown
2013-01-31ASoC: wm2000: Expose ANC gain adjustmentMark Brown
No TLV information since it's not actually a direct gain control. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-31ASoC: wm2000: Lock state machine updatesMark Brown
Need to ensure we don't get confused by simultaneous updates. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-24ASoC: wm2000: Expose some additional registersMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-04ASoC: wm2000: Fix sense of speech clarity enableMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-12-24ASoC: wm2000: Use clock API integration to configure MCLK divisorMark Brown
Since we are now using the clock API integration to manage MCLK we can now use clk_get_rate() to determine if we need to divide MCLK without relying on platform data. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-24ASoC: wm2000: Integrate with clock APIMark Brown
Request MCLK as a clock and then enable it when carrying out a state transtion and while ANC is active, minimising system power consumption in idle modes. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10ASoC: codecs: remove __dev* attributesBill Pemberton
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>
2012-11-27ASoC: wm2000: Get the CODEC pointer from the widgetMark Brown
Don't rely on the kcontrol for robustness reasons, the widget mechanism is what the framework uses. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-09Merge tag 'sound-3.7' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "This contains pretty many small commits covering fairly large range of files in sound/ directory. Partly because of additional API support and partly because of constantly developed ASoC and ARM stuff. Some highlights: - Introduced the helper function and documentation for exposing the channel map via control API, as discussed in Plumbers; most of PCI drivers are covered, will follow more drivers later - Most of drivers have been replaced with the new PM callbacks (if the bus is supported) - HD-audio controller got the support of runtime PM and the support of D3 clock-stop. Also changing the power_save option in sysfs kicks off immediately to enable / disable the power-save mode. - Another significant code change in HD-audio is the rewrite of firmware loading code. Other than that, most of changes in HD-audio are continued cleanups and standardization for the generic auto parser and bug fixes (HBR, device-specific fixups), in addition to the support of channel-map API. - Addition of ASoC bindings for the compressed API, used by the mid-x86 drivers. - Lots of cleanups and API refreshes for ASoC codec drivers and DaVinci. - Conversion of OMAP to dmaengine. - New machine driver for Wolfson Microelectronics Bells. - New CODEC driver for Wolfson Microelectronics WM0010. - Enhancements to the ux500 and wm2000 drivers - A new driver for DA9055 and the support for regulator bypass mode." Fix up various arm soc header file reorg conflicts. * tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (339 commits) ALSA: hda - Add new codec ALC283 ALC290 support ALSA: hda - avoid unneccesary indices on "Headphone Jack" controls ALSA: hda - fix indices on boost volume on Conexant ALSA: aloop - add locking to timer access ALSA: hda - Fix hang caused by race during suspend. sound: Remove unnecessary semicolon ALSA: hda/realtek - Fix detection of ALC271X codec ALSA: hda - Add inverted internal mic quirk for Lenovo IdeaPad U310 ALSA: hda - make Realtek/Sigmatel/Conexant use the generic unsol event ALSA: hda - make a generic unsol event handler ASoC: codecs: Add DA9055 codec driver ASoC: eukrea-tlv320: Convert it to platform driver ALSA: ASoC: add DT bindings for CS4271 ASoC: wm_hubs: Ensure volume updates are handled during class W startup ASoC: wm5110: Adding missing volume update bits ASoC: wm5110: Add OUT3R support ASoC: wm5110: Add AEC loopback support ASoC: wm5110: Rename EPOUT to HPOUT3 ASoC: arizona: Add more clock rates ASoC: arizona: Add more DSP options for mixer input muxes ...
2012-09-26ASoC: wm2000: Correct register sizeMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-09-22ASoC: wm2000: Add regulator supportMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-22ASoC: wm2000: Convert to devm_regmap_init_i2c()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-06ASoC: wm2000: Use module_i2c_driverSachin Kamat
module_i2c_driver makes the code simpler by eliminating module_init and module_exit calls. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25Merge tag 'v3.5-rc4' into for-3.6Mark Brown
Linux 3.5-rc4 contains some bug fixes which overlap with new features.
2012-06-08ASoC: wm2000: Always use a 4s timeout for the firmwareMark Brown
Rather than having varying timeouts depending on the transition always use a 4s timeout. This provides better diagnostics for clocking errors and ensures compatibility with current calibration firmwares. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03ASoC: wm2000: Add register readability informationMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03ASoC: codecs: Refresh copyrights for Wolfson driversMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-24ASoC: wm2000: Fix use-after-free - don't release_firmware() twice on errorJesper Juhl
In wm2000_i2c_probe(), if we take the true branch in " ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm2000, NULL, 0); if (ret != 0) goto err_fw; " then we'll release_firmware(fw) at the 'err_fw' label. But we've already done that just a few lines above. That's a use-after-free bug. This patch restructures the code so that we always call release_firmware(fw) before leaving the function, but only ever call it once. This means that we have to initialize 'fw' to NULL since some paths may now end up calling it without having called request_firmware(), but since request_firmware() deals gracefully with NULL pointers, we are fine if we just NULL initialize it. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03ASoC: Convert WM2000 into a standard CODEC driverMark Brown
We've been able to handle external amps for a while now. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03ASoC: Convert wm2000 to use regmap APIMark Brown
The driver wasn't even using the ASoC common code. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03ASoC: Convert WM2000 to devm_kzalloc()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-27ASoC: Remove unneeded platform_device.h inclusions from CODECsMark Brown
They've not been needed for a long time if they were ever required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-25ASoC: Move WM2000 to dev_pm_opsMark Brown
There's a general move to use dev_pm_ops rather than bus specific functions in order to facilitate work on the PM core. Do this conversion to WM2000. The driver ought to be updated to work better in a multi-component model but the mechanical conversion ensures that we avoid blocking PM core work until that happens. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-22ASoC: Do not include soc-dapm.hJarkko Nikula
There is no need to include soc-dapm.h since soc.h includes it. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-06ASoC: Decouple DAPM from CODECsLiam Girdwood
Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths. This patch decouples DAPM related variables from struct snd_soc_codec and moves them to new struct snd_soc_dapm_context that is used to encapsulate DAPM context of a device. ASoC core and API of DAPM functions are modified to use DAPM context instead of codec. This patch does not change current functionality and a large part of changes come because of structure and internal API changes. Core implementation is from Liam Girdwood <lrg@slimlogic.co.uk> with some minor core changes, codecs and machine driver conversions from Jarkko Nikula <jhnikula@gmail.com>. Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Manuel Lauss <manuel.lauss@googlemail.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Cc: Cliff Cai <cliff.cai@analog.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Ryan Mallon <ryan@bluewatersys.com> Cc: Timur Tabi <timur@freescale.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Jassi Brar <jassi.brar@samsung.com> Cc: Daniel Gloeckner <dg@emlix.com> Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-06-15ASoC: Default WM2000 ANC and speaker to enabledMark Brown
The most useful configuration for the WM2000 is to enable the ANC so turn that on by default, and since we're not reflecting chip default state also enable the speaker output by default. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-16Merge branch 'fix/asoc' into for-linusTakashi Iwai
2010-04-08ASoC: wm2000: remove unused #include <linux/version.h>Huang Weiyi
Remove unused #include <linux/version.h>('s) in sound/soc/codecs/wm2000.c Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo
implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-02-12ASoC: Add WM2000 driverMark Brown
The WM2000 is a low power, high quality handset receiver speaker driver with Wolfson myZone™ Ambient Noise Cancellation (ANC). It provides enhanced voice communication quality in a noisy environment if the handset acoustics are designed appropriately. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>