aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2009-05-11ASoC: soc-core: fix crash when removing not instantiated cardMike Rapoport1-0/+3
If the card was not instantiated in snd_soc_instantiate_card, calling soc-remove will crash because some of codec, cpu_dai and card .remove methods are called twice. Fix this by returning from soc_remove immediately. Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-04-02ASoC: Set parent for AC97 devices we registerMark Brown1-1/+1
Ensure that any AC97 devices that bind to the CODEC are below the ASoC device in the device tree so the suspend and resume code can figure out what order to handle them in. Reported-by: Russell King <linux@arm.linux.org.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-04-02ASoC: Don't defer resume work for AC97 codecsMark Brown1-4/+14
AC97 devices may have other drivers hanging off them directly so need to have resumed when the resume function returns meaning that we can't defer the resume - complete it immediately for them. Non-AC97 devices should not have other drivers hanging directly off the ASoC devices. We only really need the deferral for non-AC97 devices - it's there since some I2C buses are very slow and non-AC97 codecs often have large numbers of registers to restore and require delays to bring the codec up cleanly leading to a substantial impact on overall resume time. Reported-by: Russell King <linux@arm.linux.org.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-03-17ASoC: Only deregister AC97 dev if it's name was not "AC97"Atsushi Nemoto1-1/+2
The commit 14fa43f53ff3a9c3d8b9662574b7369812a31a97 ("ASoC: Only register AC97 bus if it's not done already") added a condition for calling of soc_ac97_dev_register() but not added for calling of soc_ac97_dev_unregister(). This patch adds same condition for soc_ac97_dev_unregister(). Without this fix, kernel crashes when unloading an asoc driver. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-03-04ASoC: make ops a pointer in 'struct snd_soc_dai'Eric Miao1-48/+54
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-13Merge branch 'for-2.6.29' into for-2.6.30Mark Brown1-1/+4
2009-02-13ASoC: Only register AC97 bus if it's not done alreadyMark Brown1-1/+4
ASoC supports both explicit codec drivers for AC97 devices and a simple driver which uses the standard ALSA AC97 framework for codec support. When used with the generic AC97 codec support that will provide the ad hoc AC97 device for drivers like touchscreens to attach to so the core shouldn't do so. Reported-by: Manuel Lauss <mano@roarinelk.homelinux.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-28Merge branch 'topic/snd_card_new-err' into topic/asocTakashi Iwai1-4/+4
Conflicts: sound/soc/soc-core.c
2009-01-27ASoC: Push the codec runtime storage into the card structureMark Brown1-20/+17
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-12ALSA: Convert to snd_card_create() in other sound/*Takashi Iwai1-4/+4
Convert from snd_card_new() to the new snd_card_create() function in other sound subdirectories. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-09Merge branch 'for-2.6.29' into for-2.6.30Mark Brown1-35/+2
2009-01-09ASoC: cleanup duplicated code.Ian Molton1-0/+31
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>
2009-01-08ASoC: Merge the soc_value_enum to soc_enum structPeter Ujfalusi1-35/+2
Merge the recently introduced soc_value_enum structure to the soc_enum. The value based enums are still handled separately from the normal enum types, but with the merge some of the newly introduced functions can be removed. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-05ASoC: New enum type: value_enumPeter Ujfalusi1-0/+107
This patch introduces a new enum type. In this enum type each enumerated items referred with a value. This new enum type can handle enums encoded in bitfield, or any other weird ways. twl4030 codec has several mux selection register, where the input/output mux is coded in a bitfield. With the normal enum type this type of mux can not be handled in a clean way. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-01ASoC: Clean up kerneldoc warningsMark Brown1-22/+24
Almost all parameters that have been misnamed in the comments. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-10ASoC: Add codec registration APIMark Brown1-0/+43
Another part of the backporting of Liam's ASoC v2 work. Using this is more complicated than the other registration types since currently the codec is instantiated during the probe of the ASoC device so we can't currently readily wait for the codec to register. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-10ALSA: ASoC - Fix wrong section typesTakashi Iwai1-1/+1
The module init entries should be __init instead of __devinit. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-09ASoC: Wait for non-AC97 codec DAIs before instantiatingMark Brown1-1/+26
This will allow codec drivers to be refactored to allow them to be registered out of line with the ASoC device registration. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-09ASoC: Initial framework for dynamic card instantiationMark Brown1-20/+79
Use the lists of platforms, platform DAIs and cards to check to see that everything has registered. Since relationships are still specified by direct references to the structures in the drivers and the drivers all register everything at modprobe there should be no practical effect yet. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-09ASoC: Add platform registration APIMark Brown1-0/+38
ASoC v2 allows platform drivers to instantiate independantly of the overall ASoC card. This API allows drivers to notify the core when they are registered. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-09ASoC: Add DAI registration APIMark Brown1-0/+83
Add API calls to register and unregister DAIs with the core. Currently these APIs are ineffective. Since multiple DAIs for a given device are a common case bulk variants are provided. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-09ASoC: Add card registration APIMark Brown1-0/+62
ASoC v2 allows cards, codecs and platforms to instantiate separately, with the overall ASoC device only being instantiated once all the required components have registered. As part of backporting Liam's work introduce an initial version of the card registration functions. At present these do nothing active and are internal only, they will be exposed to machine drivers after further backporting. Adding this now allows the datastructures used for dynamic card instantiation to be built up gradually. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-03ASoC: Remove platform device from DAI suspend and resume operationsMark Brown1-4/+4
None of the DAIs use it except s3c2412-i2s which only uses it for dev_() printouts. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-03ASoC: Remove device from platform suspend and resume operationsMark Brown1-2/+2
None of the platforms are actually using the SoC device so remove it (only atmel actually has a suspend method). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-03ASoC: Push debugfs files out of the snd_soc_device structureMark Brown1-32/+41
This is in preparation for the removal of struct snd_soc_device. The pop time configuration should really be a property of the card not the codec but since DAPM currently uses the codec rather than the card using the codec is fine for now. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-02ASoC: Push platform registration down into the cardMark Brown1-19/+25
As part of the deprecation of snd_soc_device push the registration of the platform down into the card structure. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-02ASoC: Push workqueue data into snd_soc_cardMark Brown1-13/+20
ASoC v2 does not use the struct snd_soc_device at runtime, using struct snd_soc_card as the root of the card. Begin removing data from snd_soc_device by pushing the workqueue data into snd_soc_card, using a backpointer to the snd_soc_device to keep things going for the time being. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-01ASoC: Annotate core removal functionMark Brown1-1/+1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-01ASoC: Rename snd_soc_register_card() to snd_soc_init_card()Mark Brown1-3/+3
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-01Merge branch 'upstream' into topic/asocTakashi Iwai1-2/+2
2008-11-25ASoC: Clean up kernel-doc for snd_soc_dai_set_fmtQinghuang Feng1-1/+0
There is no argument named @clk_id in snd_soc_dai_set_fmt, remove its' comment. Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-11-24ASoC: Lower priority of resume work loggingMark Brown1-4/+4
Now that the ASoC resume has been punted to a workqueue for a release cycle without attracting bug reports it should be safe to make the log messages associated with it debug level, reducing noise and kernel size in production configurations. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-11-24ASoC: Remove DAI type informationMark Brown1-23/+8
DAI type information is only ever used within ASoC in order to special case AC97 and for diagnostic purposes. Since modern CPUs and codecs support multi function DAIs which can be configured for several modes it is more trouble than it's worth to maintain anything other than a flag identifying AC97 DAIs so remove the type field and replace it with an ac97_control flag. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-11-21ASoC: Merge snd_soc_ops into snd_soc_dai_opsMark Brown1-37/+37
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-11-21ASoC: Rename snd_soc_card to snd_soc_machineMark Brown1-45/+45
One of the issues with the ASoC v1 API which has been addressed in the ASoC v2 work that Liam Girdwood has done is that the ALSA card provided by ASoC is distributed around the ASoC structures. For example, machine wide data such as the struct snd_card are maintained as part of the CODEC data structure, preventing the use of multiple codecs. This has been addressed by refactoring the data structures so that all the data for the ALSA card is contained in a single structure snd_soc_card which replaces the existing snd_soc_machine and snd_soc_device. Begin the process of backporting this by renaming struct snd_soc_machine to struct snd_soc_card, better reflecting its function and bringing it closer to standard ALSA terminology. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-11-05ASoC: Remove core version numberMark Brown1-1/+0
Rather than try to remember to keep the core version number updated (which hasn't been happening) just remove it. It was much more useful when ASoC was out of tree. Signed-off-by: Mark brown <broonie@opensource.wolfsonmicro.com>
2008-11-03Merge branches 'topic/fix/misc' and 'topic/fix/hda' into for-linusTakashi Iwai1-2/+2
2008-11-03sound: struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers1-2/+2
[stripped sound/isa/* changes, replaced with the next patch -- tiwai] Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-31Merge branch 'topic/fix/asoc' into topic/asocTakashi Iwai1-1/+1
2008-10-30ASoC: Convert core to use standard debug print macrosMark Brown1-22/+14
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-10-30ASoC: Fix handling of DAPM suspend workMark Brown1-32/+23
Since we can query the playback stream power state directly we do not need to infer if it is powered up from the timer being scheduled. Doing this avoids problems that previously existed with streams being incorrectly determined to be powered up caused when the timer is scheduled when streams are closed after being partially set up. Reported-by: Nobin Mathew <nobin.mathew@gmail.com> Reported-by: Jukka Hynninen <ext-jukka.hynninen@vaisala.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-10-30ASoC: Allow setting codec register with debugfs filesystemTroy Kisky1-3/+113
i.e. echo 6 59 >/sys/kernel/debug/soc-audio.0/codec_reg will set register 0x06 to a value of 0x59. Also, pop_time debugfs interface setup is moved so that it is setup in the same function as codec_reg Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-10-30ALSA: ASoC: Fix mono controls after conversion to support full int masksMark Brown1-1/+1
When ASoC was converted to support full int width masks SOC_SINGLE_VALUE() omitted the assignment of rshift, causing the control operatins to report some mono controls as stereo. This happened to work some of the time due to a confusion between shift and min in snd_soc_info_volsw(). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-13ALSA: ASoC: update email address for Liam GirdwoodLiam Girdwood1-3/+2
Update the contact information for Liam Girdwood in ASoC core and drivers as my old email address is no longer valid. Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-09-09ALSA: ASoC: Use codec digital mute when stopping playbackMark Brown1-0/+6
Muting the DAC masks artefacts introduced as the digital stream shuts down, for example when the input stops being clocked. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-07-29ALSA: ASoC: convert use of uint to unsigned intJon Smirl1-24/+24
ASOC: convert use of uint to unsigned int Signed-off-by: Jon Smirl <jonsmirl@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-07-29ALSA: ASoC: Rename mask to max to reflect usageJon Smirl1-10/+10
Most of the ASoC controls refer to the maximum value that can be set for a control as mask but there is no actual requirement for all bits to be set at the highest possible value making the name mask misleading. Change the code to use max instead. Signed-off-by: Jon Smirl <jonsmirl@gmail.com> 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>
2008-07-29ALSA: ASoC: Convert bitfields in ASoC into full int widthJon Smirl1-34/+52
Convert bitfields in ASoC into full int width. This is a simple mechanical conversion. Two places in the DAPM code were fixed to properly use mask. Signed-off-by: Jon Smirl <jonsmirl@gmail.com> 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>
2008-07-29ALSA: ASoC: Allow codecs to override register displayMark Brown1-3/+23
Some codecs have unusual features in their register maps such as very large registers representing arrays of coefficients. Support these codecs in the register cache sysfs file by allowing them to provide a function register_display() overriding the default output for register contents. Also ensure that we don't overflow PAGE_SIZE while writing out the register dump. 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>
2008-07-10ALSA: asoc: core - add Digital Audio Interface (DAI) control functions.Liam Girdwood1-8/+132
This patch adds several functions for DAI control and config and replaces the current method of calling function pointers within the DAI struct. Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>