summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: Support turning off bias when the CODEC is idleMark Brown2010-01-211-1/+24
| | | | | | | | | | | | | | | | | | | | Currently ASoC always maintains the bias of the CODEC while the system is active. With older mobile CODECs this is required since the outputs are referenced to a non-zero voltage and enabling or disabling this voltage without audible pops or clicks in the output takes too long to do when starting or stopping audio. As a result of features such as ground referenced outputs and class D speaker drivers current generation devices are able to power on and off much more quickly without these system level issues so provide a new flag idle_bias_off in snd_soc_codec which will cause the core to turn off the CODEC bias. The distinction between STANDBY and OFF is still maintained. This is partly for consistency but also allows for potential future extensions such as per-machine overrides or deferring the bias removal. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Remove console DAPM debug codeMark Brown2010-01-211-77/+3Star
| | | | | | | | | The same information is now visible via debugfs and with large modern devices dumping everything to the console can be very resource intensive, causing more harm than good. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Sort DAPM sequences by CODEC as wellMark Brown2009-12-161-0/+2
| | | | | | | In preparation for multiple device support. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Push registers out of mixer power decisionMark Brown2009-12-161-12/+14
| | | | | | | | No need for the mixers to know about this, and it allows for virtual controls. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Display the power register in DAPM widget debugfsMark Brown2009-12-041-1/+8
| | | | | | | | | Make it a bit easier to tie DAPM widgets in with the register map without referring to the source by including the register location controlled by the widget. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* Merge branch 'for-2.6.32' into for-2.6.33Mark Brown2009-11-231-3/+17
|\
| * ASoC: Fix suspend with active audio streamsMark Brown2009-11-231-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When we get a stream suspend event force the power down since otherwise the stream would remain marked as active. In future we'll probably want to make this stream-specific and add an interface to make the power down of other widgets optional in order to support leaving bypass paths active while suspending the processor. Cc: stable@kernel.org Reported-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | Merge branch 'for-2.6.32' into for-2.6.33Mark Brown2009-10-151-1/+1
|\|
| * ASoC: Serialize access to dapm_power_widgets()Eero Nurkkala2009-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Access to damp_power_widgets() is assumed to be single-threaded. Concurrent accesses to dapm_power_widgets() may result in unpredictable behavior. Calls from: close_delayed_work() soc_codec_close() soc_pcm_prepare() soc_suspend() soc_resume_deferred() to snd_soc_dapm_stream_event() do not have the codec->mutex taken to cover the call to dapm_power_widgets(). Thus, take the mutex in these paths also to assure single-threaded use of dapm_power_widgets(). Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Add virtual enumeration support for DAPM muxesMark Brown2009-10-061-0/+48
| | | | | | | | | | | | | | | | | | Sometimes it is desirable to have a mux which does not reflect any direct register configuration but which will instead only have an effect implicitly (for example, as a result of changing which parts of the device are powered up). Provide a virtual mux for this purpose. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Push DAPM enumeration register change test outMark Brown2009-10-061-7/+9
| | | | | | | | | | | | | | Don't assume that enumerations are backed by registers when updating mux power. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Simplify code for DAPM widget updatesMark Brown2009-10-061-26/+26
| | | | | | | | | | | | | | We don't need to check for an event callback since we also check for an appropriate event flag when applying mux status changes. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | Merge branch 'for-2.6.32' into for-2.6.33Mark Brown2009-10-051-2/+3
|\|
| * ASoC: Fix SND_SOC_DAPM_LINE handlingPeter Ujfalusi2009-10-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the SND_SOC_DAPM_LINE can be input or output, additional check is needed in order to determine if the widget is connected as input or output. When checking for connected outputs, if the widget is line, than check if the sources list is not empty (line is connected as output) For input endpoint check, when the widget is line, also check if the sinks list is not empty (line is connected as input). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | Merge branch 'for-2.6.32' into for-2.6.33Mark Brown2009-09-181-3/+4
|\|
| * ASoC: Fix display of stream name in DAPM debugfsMark Brown2009-09-141-3/+4
| | | | | | | | | | | | Also display streams all the time while we're here. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Allow per-route connectedness checks for suppliesMark Brown2009-09-081-3/+16
|/ | | | | | | | | | | | | | | | Some chips with complex internal supply (particularly clocking) arragements may have multiple options for some of the supply connections. Since these don't affect user-visible audio routing the expectation would be that they would be managed automatically by one of the drivers. Support these users by allowing routes to have a connected function which is queried before the connectedness of the path is checked as normal. Currently this is only done for supplies, other widgets could be supported but are not currently since the expectation for them is that audio routing will be under the control of userspace. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge branch 'topic/digital-mixing' into for-2.6.32Mark Brown2009-08-241-17/+41
|\
| * ASoC: Add input and output AIF widgetsMark Brown2009-08-181-17/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently DAPM interfaces with the audio streams to and from the processor at the DAC and ADC widgets. As the digital capabilities of parts increases this is becoming a less and less able to meet the needs of parts. To meet the needs of these devices create new widgets interfacing with the TDM bus but not integrated into any other functionality. Audio can then be routed to and from these widgets using existing routing widgets. A slot number is provided in the definition but this is currently not used yet. This is intended to support devices which can use more than one TDM slot on a single interface. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: add missing inclusion of debugfs.hTakashi Iwai2009-08-241-0/+1
| | | | | | | | | | | | To fix compile errors. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ASoC: Add DAPM widget power decision debugfs filesMark Brown2009-08-211-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Provide default set_bias_level() implementationMark Brown2009-08-191-2/+6
|/ | | | | | | | If the CODEC does not provide a set_bias_level() then update the bias_level variable for it since other parts of the system expect that to be maintained. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Power speakers and headphones simultaneouslyMark Brown2009-08-171-3/+3
| | | | | | | Speaker and headphone outputs do not need to be handled separately since they can't be part of the same path. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Fix handling of bias levels for non-DAPM codecsMark Brown2009-08-171-0/+16
| | | | | | | If the system doesn't have any DAPM widgets then we can't use their state to check if the bias level for the codec should be up. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: fix checking for external widgets bugRongrong Cao2009-07-141-2/+2
| | | | | | | | | In SOC DAPM layer of SOUND subsystem, when add signal route (in the function snd_soc_dapm_add_route() ), the original code has wrong logic when dapm layer check each widget whether an external one. Signed-off-by: Rongrong Cao <rrcao@ambarella.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add pop delay debug at end of DAPM sequencingMark Brown2009-07-081-0/+3
| | | | | | | | Provide an interval after the end of DAPM sequencing so that we can distinguish between a pop in the final step of the sequence and a pop generated from some other source outside DAPM. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Fix widget powerdown on shutdownMark Brown2009-06-261-0/+1
| | | | | | We need to set the widget power state we want to implement. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add a shutdown callbackMark Brown2009-06-241-0/+29
| | | | | | | | | | | 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>
* Merge branch 'dapm' into for-2.6.32Mark Brown2009-06-111-75/+227
|\
| * ASoC: Make DAPM power sequence lists local variablesMark Brown2009-06-081-11/+8Star
| | | | | | | | | | | | | | They are now only accessed within dapm_power_widgets() so can be local to that function. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: Coalesce power updates for PGAsMark Brown2009-06-081-2/+8
| | | | | | | | | | | | | | | | | | Handle gain ramping for PGAs so we can coalesce their power updates too. This is not ideal since we can't cope properly with gain ramping for stereo paths but that was the case without coalescing and gain ramping is relatively infrequently used so the effects are limited. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: Coalesce power updates for DAPM widgets with eventsMark Brown2009-06-081-16/+60
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: Sort specialised mixers and muxes togetherMark Brown2009-06-081-17/+17
| | | | | | | | | | | | | | | | | | The more flexible value muxes and named mixers don't need to be sorted differently from a power management point of view, they are different only in terms of the control interface and not in terms of seqencing behaviour. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: Coalesce register writes for DAPM sequencesMark Brown2009-06-081-32/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce the number of register writes we need to set the power state for a CODEC by coalescing updates to widgets with the same sequence order and same register into a single write. This can be a noticable performance improvement with slow or heavily contended control buses, such as I2C controllers with a low clock frequency, and is particularly noticable when resuming. It can also reduce the noticability of and pops and clicks by ensuring that left and right channels are powered simultaneously if they are in the same register. Currently widgets that have events are not coalesced, including PGAs which may use the volume ramping control. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: Factor out DAPM sequence executionMark Brown2009-06-071-61/+61
| | | | | | | | | | | | | | | | Lump the list walk into a single function, and pull in the power application too so we can do some further refactoring. Pure code motion. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: Sort DAPM power sequences while building listsMark Brown2009-06-071-38/+71
| | | | | | | | | | | | | | | | | | | | | | | | In the past the DAPM power sequencing was done by iterating over the list of widgets once for each widget type and powering widgets of that type. Instead of doing that do the sorting at the time we insert the widgets into the lists of widgets to apply power changes to. This reduces the amount of computation required for seqencing still further, though the costs are generally dwarfed by the costs of the register writes implementing them. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Allow 32 bit registers for DAPMDaniel Ribeiro2009-06-081-8/+8
|/ | | | | | | | 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: Apostrophe patrolMark Brown2009-06-061-5/+5
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add debug trace for bias level transitionsMark Brown2009-05-181-0/+18
| | | | | | A standard way of making sure we know when the bias level changes. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Integrate bias management with DAPM power managementMark Brown2009-05-181-24/+54
| | | | | | | | | | 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>
* ASoC: Make DAPM sysfs entries non-optionalMark Brown2009-05-181-9/+1Star
| | | | | | sysfs is so standard these days there's no point. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Split DAPM power checks from sequencing of power changesMark Brown2009-05-181-25/+56
| | | | | | | | | | | | | | | | | | DAPM has always applied any changes to the power state of widgets as soon as it has determined that they are required. Instead of doing this store all the changes that are required on lists of widgets to power up and down, then iterate over those lists and apply the changes. This changes the sequence in which changes are implemented, doing all power downs before power ups and always using the up/down sequences (previously they were only used when changes were due to DAC/ADC power events). The error handling is also changed so that we continue attempting to power widgets if some changes fail. The main benefit of this is to allow future changes to do optimisations over the whole power sequence and to reduce the number of walks of the widget graph required to check the power status of widgets. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add power supply widget to DAPMMark Brown2009-04-221-5/+39
| | | | | | | | | | | | | | | | | | Many modern CODECs have shared resources on chip which must be enabled for portions of the chip to work but which can be disabled at other times in order to achieve power savings. Examples of such resources include power supplies and some internal clocks. Since these widgets are dependencies for the audio path but do not carry audio signals they require slightly different handling to most widgets - they do not contribute to the audio path and so should not be counted as either inputs or outputs during path walks. Cases where one supply provides a supply for another will require additional work. There is also room for more optimisation of the graph walking to avoid repeated checks for the same thing. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Make the DAPM power check an operation on the widgetMark Brown2009-04-201-14/+13Star
| | | | | | | | Rather than having switch statements at point of use make the DAPM power check a member of the widget structure and set it when we instantiate the widget. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Factor out DAPM power checks for DACs and ADCsMark Brown2009-04-201-33/+48
| | | | | | | This also switches us to using a switch statement for the widget type in dapm_power_widget(). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Factor out generic widget power checksMark Brown2009-04-201-5/+14
| | | | | | | | This will form a basis for further power check refactoring: the overall goal of these changes is to allow us to check power separately to applying it, allowing improvements in the power sequencing algorithms. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Support DAPM events for DACs and ADCsMark Brown2009-04-131-6/+10
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Factor out application of power for generic widgetsMark Brown2009-04-131-50/+60
| | | | | | | | This is simple code motion, intended to support future refactoring of the DAPM algorithms and (more immediately) the additon of events for DACs and ADCs. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Display return code when failing to add a DAPM kcontrolMark Brown2009-04-071-2/+3
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Fix memory allocation for snd_soc_dapm_switch namesMark Brown2009-03-061-4/+3Star
| | | | | | | | | | | snd_soc_dapm_switch ends up ends up in dapm_new_mixer() (since a switch is a special case of a mixer with only one input) but this wasn't correctly handled in the code. Also fix the coding style for the switch below while we're here. Reported-by: Joonyoung Shim <dofmind@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>