summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8903.c
AgeCommit message (Collapse)Author
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-01-25ASoC: fix a memory-leak in wm8903Guennadi Liakhovetski
Remember to free the temporary register-cache. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
2009-12-09Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits) tree-wide: fix misspelling of "definition" in comments reiserfs: fix misspelling of "journaled" doc: Fix a typo in slub.txt. inotify: remove superfluous return code check hdlc: spelling fix in find_pvc() comment doc: fix regulator docs cut-and-pasteism mtd: Fix comment in Kconfig doc: Fix IRQ chip docs tree-wide: fix assorted typos all over the place drivers/ata/libata-sff.c: comment spelling fixes fix typos/grammos in Documentation/edac.txt sysctl: add missing comments fs/debugfs/inode.c: fix comment typos sgivwfb: Make use of ARRAY_SIZE. sky2: fix sky2_link_down copy/paste comment error tree-wide: fix typos "couter" -> "counter" tree-wide: fix typos "offest" -> "offset" fix kerneldoc for set_irq_msi() spidev: fix double "of of" in comment comment typo fix: sybsystem -> subsystem ...
2009-12-04tree-wide: fix assorted typos all over the placeAndré Goddard Rosa
That is "success", "unknown", "through", "performance", "[re|un]mapping" , "access", "default", "reasonable", "[con]currently", "temperature" , "channel", "[un]used", "application", "example","hierarchy", "therefore" , "[over|under]flow", "contiguous", "threshold", "enough" and others. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-12ASoC: Remove redundant snd_soc_dapm_new_widgets() callsMark Brown
The DAPM widgets are now insntantiated by the core when creating the card so there is no need for the individual CODEC drivers to do so. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-11-03ASoC: Factor out snd_soc_init_card()Mark Brown
snd_soc_init_card() is always called as the last part of the CODEC probe function so we can factor it out into the core card setup rather than have each CODEC replicate the code to do the initialiastation. This will be required to support multiple CODECs per card. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-15ASoC: Remove snd_soc_suspend_device()Mark Brown
The PM core will grow pm_link infrastructure in 2.6.33 which can be used to implement the intended functionality of the ASoC-specific device suspend and resume callbacks so drop them. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-03ASoC: Factor out I/O for Wolfson 8 bit data 16 bit register CODECsMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-25Merge branch 'for-2.6.31' into for-2.6.32Mark Brown
2009-06-13ASoC: Add suspend and resume callbacks to Wolfson CODEC driversMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-13ASoC: Automatically control WM8903 sloping stopband filterMark Brown
For best performance the DAC sloping stopband filter should be enabled below 24kHz and not enabled above that so remove the user visible control for this and do it autonomously in the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-12ASoC: Remove odd bit clock ratios for WM8903Mark Brown
These are not supported since performance can not be guaranteed when they are in use. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
2009-04-22ASoC: Implement WM8903 digital sidetone supportMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-04-22ASoC: Remove redundant rate constraint for WM8903Mark Brown
This is now handled by symmetric_rates. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-04-22ASoC: Actively manage the DC servo for WM8903Mark Brown
Save a little extra power by enabling the DC servo offset correction for the output channels only when the relevant channels are enabled. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-04-22ASoC: Optimise configuration of WM8903 DC servoMark Brown
Modify the default startup sequence in the chip to set the DC servo dither level for optimal performance. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-04-22ASoC: Support CLK_DSP in WM8903Mark Brown
CLK_DSP provides a master clock for the DAC and ADC related functionality on the device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-04-22ASoC: Use DAPM supply widget for WM8903 charge pumpMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-04-16ASoC: Request shared rates for WM8903Mark Brown
It has a shared LRCLK. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-03-04ASoC: make ops a pointer in 'struct snd_soc_dai'Eric Miao
Considering the fact that most cpu_dai or codec_dai are using a same 'snd_soc_dai_ops' for several similar interfaces, 'ops' would be better made a pointer instead, to make sharing easier and code a bit cleaner. The patch below is rather preliminary since the asoc tree is being actively developed, and this touches almost every piece of code, (and possibly many others in development need to be changed as well). Building of all codecs are OK, yet to every SoC, I didn't test that. Signed-off-by: Eric Miao <eric.miao@marvell.com> Acked-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-18ASoC: Add device init/exit annotations to new-style Wolfson CODEC driversMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27ASoC: Push the codec runtime storage into the card structureMark Brown
This is a further stage on the road to refactoring away the ASoC platform device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-09ASoC: cleanup duplicated code.Ian Molton
Many codec drivers were implementing cookie-cutter copies of the function that adds kcontrols to the codec. This patch moves this code to a common function snd_soc_add_controls() in soc-core.c and updates all drivers using copies of this function to use the new common version. [Edited to raise priority of error log message and document parameters. -- broonie] Signed-off-by: Ian Molton <ian@mnementh.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-10ASoC: Stop WM8903 SYSCLK when suspendingMark Brown
This will save some additional power. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-10ASoC: Convert WM8903 driver to register at I2C probe timeMark Brown
The driver now registers the codec and DAI when probed as an I2C device. Also convert the driver to use a single dynamic allocation to simplify error handling. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-10ASoC: Work around warnings from some build environmentsMark Brown
BUG() should be marked as not returning but for at least some configurations (including some widely deployed compilers) that's either not happening or being forgotten by the compiler. Add some extra return statements to the affected paths. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-10ALSA: ASoC - Fix wrong section typesTakashi Iwai
The module init entries should be __init instead of __devinit. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-09ASoC: Register non-AC97 codec DAIsMark Brown
Currently this is done at module probe time since ASoC ties in codec device probe to the instantiation of the entire ASoC device. Subsequent patches will refactor the codec drivers to handle probing separately. Note that the core does not yet use this information. AC97 is special since the codec is controlled over the AC97 link but we want to give the machine driver a chance to set up the system before trying to instantiate since it may need to do configuration before the AC97 link will operate Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-03ASoC: Fix WM8903 right mixer bypass pathMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-01ASoC: Rename snd_soc_register_card() to snd_soc_init_card()Mark Brown
Currently ASoC card initialisation is completed by a function called snd_soc_register_card(). As part of the work to allow independant registration of cards, codecs and machines in ASoC v2 a new function of the same name has been added so rename the existing function to facilitate the merge of v2. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-01Revert "ALSA: soc - Fix compile warnings in wm8903.c"Takashi Iwai
This reverts commit 9171e5e6a20a9cd4992ff9c7cbee13c6fdf7b0b1. I can't reproduce the compile warnings any more. The warnings might be some weird cross-compiling set up. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-01ALSA: soc - Fix compile warnings in wm8903.cTakashi Iwai
Hide annoying uninitialized warnings: sound/soc/codecs/wm8903.c:382: warning: ‘reg’ may be used uninitialized in this function sound/soc/codecs/wm8903.c:383: warning: ‘shift’ may be used uninitialized in this function Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-21ASoC: Merge snd_soc_ops into snd_soc_dai_opsMark Brown
Liam Girdwood's ASoC v2 work avoids having two different ops structures for DAIs by merging the members of struct snd_soc_ops into struct snd_soc_dai_ops, allowing per DAI configuration for everything. Backport this change. This paves the way for future work allowing any combination of DAIs to be connected rather than having fixed purpose CODEC and CPU DAIs and only allowing CODEC<->CPU interconnections. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-10-13ALSA: ASoC: Fix inverted input PGA mute bits in WM8903Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-08-29ALSA: ASoC: WM8903 I2C cleanupsMark Brown
Fix a few issues identified by Jean Delvare: - Add missing newline to error display. - Return an error when we fail to locate the I2C adaptor. - Remove the static wm8903_i2c_device Jean suggested, it's redundant. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-29ALSA: ASoC: Add WM8903 CODEC driverMark Brown
The WM8903 is a high performance ultra-low power stereo CODEC optimised for portable audio applications. Features include: * 5mW power consumption for DAC to headphone playback * Stereo DAC SNR 96dB typical, THD -86dB typical * Stereo ADC SNR 93dB typical, THD -80dB typical * Up to 3 single ended inputs per stereo channel * Up to 2 pseudo differential inputs per stereo channel * Up to 1 fully differential mic input per stereo channel * Digital Dynamic Range Controller (compressor/limiter) * Digital sidetone mixing Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>