summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: Merge the soc_value_enum to soc_enum structPeter Ujfalusi2009-01-081-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>
* ASoC: New enum type: value_enumPeter Ujfalusi2009-01-051-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>
* ASoC: Clean up kerneldoc warningsMark Brown2009-01-011-22/+24
| | | | | | Almost all parameters that have been misnamed in the comments. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add codec registration APIMark Brown2008-12-101-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>
* ALSA: ASoC - Fix wrong section typesTakashi Iwai2008-12-101-1/+1
| | | | | | The module init entries should be __init instead of __devinit. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ASoC: Wait for non-AC97 codec DAIs before instantiatingMark Brown2008-12-091-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>
* ASoC: Initial framework for dynamic card instantiationMark Brown2008-12-091-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>
* ASoC: Add platform registration APIMark Brown2008-12-091-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>
* ASoC: Add DAI registration APIMark Brown2008-12-091-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>
* ASoC: Add card registration APIMark Brown2008-12-091-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>
* ASoC: Remove platform device from DAI suspend and resume operationsMark Brown2008-12-031-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>
* ASoC: Remove device from platform suspend and resume operationsMark Brown2008-12-031-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>
* ASoC: Push debugfs files out of the snd_soc_device structureMark Brown2008-12-031-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>
* ASoC: Push platform registration down into the cardMark Brown2008-12-021-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>
* ASoC: Push workqueue data into snd_soc_cardMark Brown2008-12-021-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>
* ASoC: Annotate core removal functionMark Brown2008-12-011-1/+1
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Rename snd_soc_register_card() to snd_soc_init_card()Mark Brown2008-12-011-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>
* Merge branch 'upstream' into topic/asocTakashi Iwai2008-12-011-2/+2
|\
| *-. Merge branches 'topic/fix/misc' and 'topic/fix/hda' into for-linusTakashi Iwai2008-11-031-2/+2
| |\ \
| | * | sound: struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers2008-11-031-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>
* | | | ASoC: Clean up kernel-doc for snd_soc_dai_set_fmtQinghuang Feng2008-11-251-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>
* | | | ASoC: Lower priority of resume work loggingMark Brown2008-11-241-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>
* | | | ASoC: Remove DAI type informationMark Brown2008-11-241-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>
* | | | ASoC: Merge snd_soc_ops into snd_soc_dai_opsMark Brown2008-11-211-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>
* | | | ASoC: Rename snd_soc_card to snd_soc_machineMark Brown2008-11-211-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>
* | | | ASoC: Remove core version numberMark Brown2008-11-051-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>
* | | | Merge branch 'topic/fix/asoc' into topic/asocTakashi Iwai2008-10-311-1/+1
|\ \ \ \ | |/ / /
| * | | ALSA: ASoC: Fix mono controls after conversion to support full int masksMark Brown2008-10-301-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>
* | | ASoC: Convert core to use standard debug print macrosMark Brown2008-10-301-22/+14
| | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | ASoC: Fix handling of DAPM suspend workMark Brown2008-10-301-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>
* | | ASoC: Allow setting codec register with debugfs filesystemTroy Kisky2008-10-301-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>
* | ALSA: ASoC: update email address for Liam GirdwoodLiam Girdwood2008-10-131-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>
* ALSA: ASoC: Use codec digital mute when stopping playbackMark Brown2008-09-091-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>
* ALSA: ASoC: convert use of uint to unsigned intJon Smirl2008-07-291-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>
* ALSA: ASoC: Rename mask to max to reflect usageJon Smirl2008-07-291-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>
* ALSA: ASoC: Convert bitfields in ASoC into full int widthJon Smirl2008-07-291-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>
* ALSA: ASoC: Allow codecs to override register displayMark Brown2008-07-291-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>
* ALSA: asoc: core - add Digital Audio Interface (DAI) control functions.Liam Girdwood2008-07-101-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>
* ALSA: asoc: core - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.Liam Girdwood2008-07-101-25/+25
| | | | | | | | | | | | | This patch series merges struct snd_soc_codec_dai and struct snd_soc_cpu_dai into struct snd_soc_dai in preparation for further ASoC v2 patches. This merger removes duplication in both DAI structures and simplifies the API for other users. 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>
* ALSA: ASoC: fix PM=n buildRandy Dunlap2008-06-181-0/+2
| | | | | | | | | | | | Fix sound/soc build failure when CONFIG_PM=n: linux-next-20080617/sound/soc/soc-core.c:829: error: 'soc_resume_deferred' undeclared (first use in this function) soc3.out:make[3]: *** [sound/soc/soc-core.o] Error 1 Signed-off-by: Randy Dunlap <randy.dunlap@oracle.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>
* ALSA: ASoC: Don't block system resumeAndy Green2008-06-161-3/+43
| | | | | | | | | | | | | | | | | On OpenMoko soc-audio resume is taking 700ms of the whole resume time of 1.3s, dominated by writes to the codec over I2C. This patch shunts the resume guts into a workqueue which then is done asynchronously. The "card" is locked using the ALSA power state APIs as suggested by Mark Brown. [Added fix for race with resume to suspend and fixed a couple of nits from checkpatch -- broonie.] Signed-off-by: Andy Green <andy@openmoko.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>
* ALSA: ASoC: Pass the DAI being configured into CPU DAI probe and removeMark Brown2008-06-131-3/+3
| | | | | | | | This allows per-DAI initialisation to be done by the CPU DAI drivers. 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>
* [ALSA] ASoC: Add SOC_DOUBLE_S8_TLV control typeMark Brown2008-05-291-0/+72
| | | | | | | | | The SOC_DOUBLE_S8_TLV control type was originally implemented in the UDA1380 driver by Philipp Zabel and was moved into the core by me. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] ASoC: core checkpatch cleanupsMark Brown2008-05-191-46/+54
| | | | | | 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>
* [ALSA] ASoC: Clarify API for bias configurationMark Brown2008-05-191-12/+13
| | | | | | | | | | | | | | | | | | | | | Currently the ASoC core configures the bias levels in the system using a callback on codecs and machines called 'dapm_event', passing it PCI style power levels as SNDRV_CTL_POWER_ constants. This is more obscure than it needs to be and has caused confusion to driver authors, especially given that DAPM is also performing power management. Address this by renaming the callback function to 'set_bias_level' and using constants explicitly representing the off, standby, pre-on and on states which DAPM transitions through. Also unexport the API for setting bias level: there are currently no in-tree users of this API other than the core itself and it is likely that the core would need to be extended to cater for any users. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Jarkko Nikula <jarkko.nikula@nokia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* [ALSA] ASoC: Remove in-code changelogsMark Brown2008-05-191-4/+0
| | | | | | | | | The overwhelming majority just say 'initial version' anyway. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* [ALSA] sound: fix platform driver hotplug/coldplugKay Sievers2008-04-241-0/+2
| | | | | | | | | | | | | Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable sound platform drivers, to re-enable auto loading. [dbrownell@users.sourceforge.net: more drivers, registration fixes] Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Fix lockdep warning in ASoC machine probeMark Brown2008-01-311-2/+5
| | | | | | | | | | Don't take the codec mutex during machine probe until we have registered with ALSA, fixing a lockdep warning reported by Dmitry Baryshkov. Cc: Dmitry Baryshkov <dbaryshkov@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>
* [ALSA] soc - Ensure PCMs are suspendedLiam Girdwood2008-01-311-0/+5
| | | | | | | | | This fixes a bug whereby PCMs were not being suspended when the rest of the audio subsystem was suspended. 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>
* [ALSA] soc - Add D1 power event to power down event sequenceLiam Girdwood2008-01-311-0/+8
| | | | | | 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>
OpenPOWER on IntegriCloud