summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: Add DAPM widget power decision debugfs filesMark Brown2009-08-211-0/+8
| | | | | | | | | | | | | | | | | | | | Currently when built with DEBUG DAPM will dump information about the power state decisions it is taking for each widget to dmesg. This isn't an ideal way of getting the information - it requires a kernel build to turn it on and off and for large hub CODECs the volume of information is so large as to be illegible. When the output goes to the console it can also cause a noticable impact on performance simply to print it out. Improve the situation by adding a dapm directory to our debugfs tree containing a file per widget with the same information in it. This still requires a decision to build with debugfs support but is easier to navigate and much less intrusive. In addition to the previously displayed information active streams are also shown in these files. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: change set_tdm_slot api to allow slot_width override.Daniel Ribeiro2009-08-061-3/+6
| | | | | | | | | | | | | | | | Extend set_tdm_slot to allow the user to arbitrarily set the frame width and active TX/RX slots. Updates magician.c and wm9081.c for the new set_tdm_slot(). wm9081.c still doesn't handle the slot_width override. While being there, correct an incorrect use of SlotsPerFrm(7) use in bitmask on pxa-ssp.c (SSCR0_SlotsPerFrm(x) is (((x) - 1) << 24)) ). (this series is meant for Mark's for-2.6.32 branch) Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Allow CODECs to flag invalid registersMark Brown2009-07-311-0/+3
| | | | | | | This helps CODECs with sparse register maps work better with the register cache display interface. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ALSA: Allow passing platform_data to devices attached to AC97 busMarek Vasut2009-07-231-1/+5
| | | | | | | | This patch allows passing platform_data to devices attached to AC97 bus (like touchscreens, battery measurement chips ...). Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add CODEC volatile register operationMark Brown2009-07-051-0/+17
| | | | | | | | Add a volatile_register() operation to the CODEC structure providing a standard operation to query if a register is volatile. This will be used to factor out the register cache I/O operations for the CODECs. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Convert to dev_pm_opsMark Brown2009-06-301-11/+19
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge branch 'for-2.6.31' into for-2.6.32Mark Brown2009-06-251-0/+3
|\
| * ASoC: Instantiate any forgotten DAPM widgetsMark Brown2009-06-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | With the recent changes to the DAPM power checks it has become important to explicitly instantiate all widgets but some drivers were forgetting to do that. Since everything needs to do it add a call to instantiate them immediately before the card registration - it does no harm when it is called repeatedly and saves work in drivers. Tested-by: pHilipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Add a shutdown callbackMark Brown2009-06-231-0/+16
| | | | | | | | | | | | | | | | | | | | | | Ensure that the audio subsystem is powered down cleanly when the system shuts down by providing a shutdown operation. This ensures that all the components have been returned to an off state cleanly which should avoid audio issues from partially charged capacitors or noise on digital inputs if the system is restarted quickly. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Ben Dooks <ben-linux@fluff.org>
* | ASoC: Add stub suspend and resume calls for ASoC subdevicesMark Brown2009-06-131-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that ASoC subdevices can be regular devices they can have normal suspend and resume calls from their buses. However, suspending them individually is not desirable since this can lead to problems such as pops and clicks from devices being suspended with their signals being amplified or clocks being stopped suddenly. This will be resolved by having the normal device model suspend and resume calls call into ASoC which will suspend the entire card while any of its components are suspended. At present this is not yet implemented but in order to aid the transition of drivers to the standard device model this patch adds API calls for the notifications. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Allow 32 bit registers for DAPMDaniel Ribeiro2009-06-081-14/+14
|/ | | | | | | | Replace the remaining unsigned shorts with unsigned ints. Tested with pcap2 codec (25 bits registers). Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: fix NULL pointer dereference in soc_suspend()Daniel Mack2009-06-041-0/+6
| | | | | | | | | | | | | | In case the initalization of an soc_device failed, there is no codec associated with it. soc_suspend() will still dereference the pointer and cause an Ooops when entering the sleep mode. This happens on our board with a multi-target kernel image when booted on a machine without audio circuits. This patch makes the code bail out very early in this special case. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Integrate bias management with DAPM power managementMark Brown2009-05-181-51/+10
| | | | | | | | | | Rather than managing the bias level of the system based on if there is an active audio stream manage it based on there being an active DAPM widget. This simplifies the code a little, moving the power handling into one place, and improves audio performance for bypass paths when no playbacks or captures are active. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge branch 'for-2.6.30' into for-2.6.31Mark Brown2009-05-121-0/+3
|\
| * ASoC: soc-core: fix crash when removing not instantiated cardMike Rapoport2009-05-111-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>
* | ASoC: Fix up CODEC DAI formats for big endian CPUsMark Brown2009-05-091-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASoC uses the standard ALSA data format definitions to specify the wire format used between the CPU and CODEC. Since the ALSA data formats all include the endianess of the data but this information is not relevant by the time the data has been encoded onto the serial link to the CODEC this means that either all the CODEC drivers need to declare both big and little endian variants or the core needs to fix up the format constraints specified by CODEC drivers. For now take the latter approach - this will need to be revisited if any CODECs are endianness dependant. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Volume controls are never of boolean typeMark Brown2009-04-161-3/+3
| | | | | | | | | | | | | | | | | | Some limited volume controls (mostly simple attenuations) have only two settings so the ASoC info functions misreport them as booleans. Since we currently have no better information check for " Volume" in the control name and always report any controls matching as being integer. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Check we have DAI ops when calling via accessor functionsMark Brown2009-04-161-7/+7
| | | | | | | | | | | | Also make sure we're checking for the right operation while we're here. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Provide core support for symmetric sample ratesMark Brown2009-04-071-0/+38
|/ | | | | | | | | | | | | | | Many devices require symmetric configurations of capture and playback data formats, often due to shared clocking but sometimes also due to other shared playback and record configuration in the device. Start providing core support for this by allowing the DAIs or the machine to specify that the sample rates used should be kept symmetric. A flag symmetric_rates is provided in the snd_soc_dai and snd_soc_dai_link structures. If this is set in either of the DAIs or in the machine then a constraint will be applied when a stream is already open preventing any changes in sample rate. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Set parent for AC97 devices we registerMark Brown2009-04-021-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>
* ASoC: Don't defer resume work for AC97 codecsMark Brown2009-04-021-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>
* ASoC: Only deregister AC97 dev if it's name was not "AC97"Atsushi Nemoto2009-03-171-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>
* ASoC: make ops a pointer in 'struct snd_soc_dai'Eric Miao2009-03-041-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>
* Merge branch 'for-2.6.29' into for-2.6.30Mark Brown2009-02-131-1/+4
|\
| * ASoC: Only register AC97 bus if it's not done alreadyMark Brown2009-02-131-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>
* | Merge branch 'topic/snd_card_new-err' into topic/asocTakashi Iwai2009-01-281-4/+4
|\ \ | | | | | | | | | | | | Conflicts: sound/soc/soc-core.c
| * | ALSA: Convert to snd_card_create() in other sound/*Takashi Iwai2009-01-121-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>
* | | ASoC: Push the codec runtime storage into the card structureMark Brown2009-01-271-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>
* | | Merge branch 'for-2.6.29' into for-2.6.30Mark Brown2009-01-091-35/+2
|\ \ \ | | |/ | |/|
| * | 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: cleanup duplicated code.Ian Molton2009-01-091-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>
* 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>
OpenPOWER on IntegriCloud