aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-05-16ASoC: don't flip master of DT-instantiated DAI linksStephen Warren1-1/+2
Commit 4924082 "ASoC: core: Flip master for CODECs in the CPU slot of a CODEC<->CODEC link" added code that was conditional on there being no PCM/DMA driver for the link. However, it failed to cover the case where the link was instantiated from device tree, and hence was specified by DT node rather than name. This prevents the following error on Toshiba AC100: aplay: pcm_write:1603: write error: Input/output error Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-13Merge tag 'v3.4-rc7' into for-3.5Mark Brown1-3/+4
Linux 3.4-rc7 Conflicts): drivers/base/regmap/regmap.c (overlap with bug fixes) sound/soc/blackfin/bf5xx-ssm2602.c (overlap with bug fixes)
2012-05-05Merge tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/soundLinus Torvalds1-3/+3
Pull sound sound fixes from Takashi Iwai: "As good as nothing exciting here; just a few trivial fixes for various ASoC stuff." * tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: omap-pcm: Free dma buffers in case of error. ASoC: s3c2412-i2s: Fix dai registration ASoC: wm8350: Don't use locally allocated codec struct ASoC: tlv312aic23: unbreak resume ASoC: bf5xx-ssm2602: Set DAI format ASoC: core: check of_property_count_strings failure ASoC: dt: sgtl5000.txt: Add description for 'reg' field ASoC: wm_hubs: Make sure we don't disable differential line outputs
2012-04-30ASoC: core: Fix dai_link dereference.Liam Girdwood1-1/+1
We should check dailess before dereferencing. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26Merge tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/soundLinus Torvalds1-0/+1
Pull sound fixes from Takashi Iwai: "A workaround for an ASUS laptop and a few ASoC changes; most of the commits are tagged for stable, too." * tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: wm8994: Improve sequencing of AIF channel enables ALSA: HDA: Add external mic quirk for Asus Zenbook UX31E ASoC: fsi: update for dmaengine prep_slave_sg fallout. ASoC: core: Fix card RTD count for deferred probe. ASoC: cs42l73: don't use negative array index ASoC: dapm: Ensure power gets managed for line widgets
2012-04-26ASoC: dpcm: Add API for DAI link substream and runtime lookupLiam Girdwood1-0/+29
Some component drivers will need to be able to look up their DAI link substream and RTD data. Provide a mechanism for this. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26ASoC: dpcm: Add debugFS support for DPCMLiam Girdwood1-0/+11
Add debugFS files for DPCM link management information. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26ASoC: dpcm: Add Dynamic PCM core operations.Liam Girdwood1-0/+5
The Dynamic PCM core allows digital audio data to be dynamically routed between different ALSA PCMs and DAI links on SoC CPUs with on chip DSP devices. e.g. audio data could be played on pcm:0,0 and routed to any (or all) SoC DAI links. Dynamic PCM introduces the concept of Front End (FE) PCMs and Back End (BE) PCMs. The FE PCMs are normal ALSA PCM devices except that they can dynamically route digital audio data to any supported BE PCM. A BE PCM has no ALSA device, but represents a DAI link and it's substream and audio HW parameters. e.g. pcm:0,0 routing digital data to 2 external codecs. FE pcm:0,0 ----> BE (McBSP.0) ----> CODEC 0 +--> BE (McPDM.0) ----> CODEC 1 e.g. pcm:0,0 and pcm:0,1 routing digital data to 1 external codec. FE pcm:0,0 --- +--> BE (McBSP.0) ----> CODEC FE pcm:0,1 --- The digital audio routing is controlled by the usual ALSA method of mixer kcontrols. Dynamic PCM uses a DAPM graph to work out the routing based upon the mixer settings and configures the BE PCMs based on routing and the FE HW params. DPCM is designed so that most ASoC component drivers will need no modification at all. It's intended that existing CODEC, DAI and platform drivers can be used in DPCM based audio devices without any changes. However, there will be some cases where minor changes are required (e.g. for very tightly coupled HW) and there are helpers to support this too. Somethimes the HW params of a FE and BE do not match or are incompatible, so in these cases the machine driver can reconfigure any hw_params and make any DSP perform sample rate / format conversion. This patch adds the core DPCM code and contains :- o The FE and BE PCM operations. o FE and BE DAI link support. o FE and BE PCM creation. o BE support API. o BE and FE link management. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26ASoC: core: Remove unused variable 'min'Fabio Estevam1-1/+0
commit 4183eed2 (ASoC: core: Add signed multi register control) introduced the variable 'min',but it is not used. Remove it to fix the following build warning: sound/soc/soc-core.c: In function 'snd_soc_put_xr_sx': sound/soc/soc-core.c:2990: warning: unused variable 'min' Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-24ASoC: core: check of_property_count_strings failureRichard Zhao1-3/+3
Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-04-23ASoC: core: Add strobe controlKristoffer KARLSSON1-0/+63
Added support for a control that strobes a bit in a register to high then back to low (or the inverse). This is typically useful for hardware that requires strobing a singe bit to trigger some functionality and where exposing the bit in a normal single control would require the user to first manually set then again unset the bit again for the strobe to trigger. Added convenience macro. SOC_SINGLE_STROBE Added accessor implementations. snd_soc_get_strobe snd_soc_put_strobe Signed-off-by: Kristoffer KARLSSON <kristoffer.karlsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-23ASoC: core: Add signed multi register controlKristoffer KARLSSON1-0/+118
Added control type that can span multiple consecutive codec registers forming a single signed value in a MSB/LSB manner. The control dynamically adjusts to the register word size configured in driver. Added convenience macro. SOC_SINGLE_XR_SX Added accessor implementations. snd_soc_info_xr_sx snd_soc_get_xr_sx snd_soc_put_xr_sx Signed-off-by: Kristoffer KARLSSON <kristoffer.karlsson@stericsson.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-17ASoC: core: Fix card RTD count for deferred probe.Liam Girdwood1-0/+1
Currently we increment the number of RTD's per card during the DAI link bind. This can cause an incorrect RTD count when we cannot find a component and defer the probe (and hence perform the DAI link bind for the card again). Fix the count so that it is cleared before every card registration and bind attempt. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-16ASoC: Merge tag 'v3.4-rc3' into for-3.5Mark Brown1-0/+2
Linux 3.4-rc3 contains a bunch of Tegra changes which are conflicting annoyingly with the new development that's going on for Tegra so merge it up to resolve those conflicts. Conflicts: sound/soc/soc-core.c sound/soc/tegra/tegra_i2s.c sound/soc/tegra/tegra_spdif.c
2012-04-16ASoC: core: Support transparent CODEC<->CODEC DAI linksMark Brown1-7/+36
Rather than having the user half start a stream but avoid any DMA to trigger data flow on links which don't pass through the CPU create a DAPM route between the two DAI widgets using a hw_params configuration provided by the machine driver with the new 'params' member of the dai_link struct. If no configuration is provided in the dai_link then use the old style even for CODEC<->CODEC links to avoid breaking systems. This greatly simplifies the userspace usage of such links, making them as simple as analogue connections with the stream configuration being completely transparent to them. This is achieved by defining a new dai_link widget type which is created when CODECs are linked and triggering the configuration of the link via the normal PCM operations from there. It is expected that the bias level callbacks will be used for clock configuration. Currently only the DAI format, rate and channel count can be configured and currently the only DAI operations which can be called are hw_params and digital_mute(). This corresponds well to the majority of CODEC drivers which only use other callbacks for constraint setting but there is obviously much room for extension here. We can't simply call hw_params() on startup as things like the system clocking configuration may change at runtime and in future it will be desirable to offer some configurability of the link parameters. At present we are also restricted to a single DAPM link for the entire DAI. Once we have better support for channel mapping it would also be desirable to extend this feature so that we can propagate per-channel power state over the link. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-04-16ASoC: core: Bind DAIs to CODECs at registration timeMark Brown1-6/+30
We should always have a CODEC already there when registering a CODEC DAI and for CODEC<->CODEC links a dai_link will have two CODECs so it's much simpler to do things at registration time. This results in a slight change in the error handling for failed CODEC DAI registrations but practically speaking these are never supposed to fail so there shouldn't be much issue. The change is that we don't fail the overall CODEC registration if the DAI registration fails; this seems more robust anyway as we may not need to use a given DAI in a particular system. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-16ASoC: core: Flip master for CODECs in the CPU slot of a CODEC<->CODEC linkMark Brown1-4/+33
When two CODEC DAIs are linked directly to each other then if we give the same master mode settings to both devices things won't work as either neither will drive or they'll drive against each other. Flip the settings for the DAI in the CPU slot of the DAI link. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-16ASoC: core: Return -ENOTSUPP instead of -EINVAL if mute is not supportedMark Brown1-1/+1
This helps us ignore errors in callers if the operation failed due to not being available as opposed to an error. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-04-11Merge tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/soundLinus Torvalds1-0/+2
Pull sound fixes from Takashi Iwai: - A series of fixes for Conexant 20549 HD-audio codec chip - A workaround for HDMI hotplug debug prints that annoyed people - A fix for the new support of platform DAPM contexts - Many driver-specific minor fixes * tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - hide HDMI/ELD printks unless snd.debug=2 ALSA: sound/isa/sscape.c: add missing resource-release code sound: sound/oss/msnd_pinnacle.c: add vfrees ALSA: hda - clean up CX20549 test mixer setup ALSA: hda - CX20549 doesn't need pin_amp_workaround. ALSA: hda - Remove CD control from model=benq for CX20549 ALSA: hda - fix record volume controls of CX20459 ("Venice") ALSA: hda - Rename capture sources of CX20549 to match common conventions ALSA: hda - Fix proc output for ADC amp values of CX20549 ASoC: tegra: fix i2s compilation when !CONFIG_DEBUG_FS ASoC: set idle_bias_off=1 for all platform DAPM contexts ASoC: imx-audmux: Check for NULL pointer ASoC: imx-audmux: Fix ssi port numbers in sysfs ASoC: ak4642: fixup: mute needs +1 step MAINTAINERS: Don't list everyone working on Wolfson drivers MAINTAINERS: Add missing ASoC OMAP co-maintainer ASoC: pxa: pxa2xx-i2s: add io.h for IOMEM macro ASoC: tegra: ensure clocks are enabled when touching registers ASoC: sgtl5000: Enable VAG when DAC/ADC up ALSA: asihpi - fix return value of hpios_locked_mem_alloc()
2012-04-09Merge tag 'v3.4-rc2' into for-3.5Mark Brown1-7/+1
Linux 3.4-rc2 contains some bug fixes we need, including the addition of an export for regcache_sync_region().
2012-04-05simple_open: automatically convert to simple_open()Stephen Boyd1-7/+1
Many users of debugfs copy the implementation of default_open() when they want to support a custom read/write function op. This leads to a proliferation of the default_open() implementation across the entire tree. Now that the common implementation has been consolidated into libfs we can replace all the users of this function with simple_open(). This replacement was done with the following semantic patch: <smpl> @ open @ identifier open_f != simple_open; identifier i, f; @@ -int open_f(struct inode *i, struct file *f) -{ ( -if (i->i_private) -f->private_data = i->i_private; | -f->private_data = i->i_private; ) -return 0; -} @ has_open depends on open @ identifier fops; identifier open.open_f; @@ struct file_operations fops = { ... -.open = open_f, +.open = simple_open, ... }; </smpl> [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-05ASoC: set idle_bias_off=1 for all platform DAPM contextsStephen Warren1-0/+2
The ASoC core currently defaults to using STANDBY rather than OFF for idle ASoC platform devices, which causes a permanent pm_runtime_get() on them. This keeps the device active unnecessarily. This can be especially problematic when the ASoC platform device and DAI device are the same device. The distinction between OFF and STANDBY is likely not relevant for ASoC platform drivers, since they aren't analog devices. So, solve this issue by hard-coding idle_bias_off = 1 for all ASoC platform devices. If this turns out to be a problem, this value could be sourced from the snd_soc_platform_driver, similarly to soc_probe_codec(). Note: Prior to this change, this caused a large (10) runtime_active count for the Tegra I2S controller even when not in use, and a leak in that value as streams were started and stopped. This change probably hides a bug. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-03ASoC: core: Initialize err for snd_soc_put_volsw_sxBrian Austin1-1/+1
sound/soc/soc-core.c: In function ‘snd_soc_put_volsw_sx’: sound/soc/soc-core.c:2600: warning: ‘err’ may be used uninitialized in this function Signed-off-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-03ASoC: core: Rework SOC_DOUBLE_R_SX_TLV add SOC_SINGLE_SX_TLVBrian Austin1-93/+81
Some codecs namely Cirrus Logic Codecs have a way of wrapping the dB scale around 0dB without 0dB being in the middle. Rework of SOC_DOUBLE_R_SX_TLV to be more consistent with other asoc tlv macros. Add single register macro : SOC_SINGLE_SX_TLV. Use snd_soc_info_volsw for .info Use snd_soc_get_volsw_sx, snd_soc_put_volsw_sx for single and double. kcontrols for CS42L51 and CS42L73 are adjusted to these new TLV Macros. The max value is determined by: (number of steps) +1 for 0dB +max from codec datasheet. Signed-off-by: Brian Austin <brian.austin@cirrus.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-01ASoC: core: Use driver core probe deferralMark Brown1-85/+62
In version 3.4 the driver core acquired probe deferral which is a core way of doing essentially the same thing as ASoC has been doing since forever to make sure that all the devices needed to make up the card are present without needing open coding in the subsystem. Make basic use of this probe deferral mechanism for the cards, removing the need to handle partially instantiated cards. We should be able to remove even more code than this, though some of the checks we're currently doing should stay since they're about things like suppressing unneeded DAPM runs rather than deferring probes. In order to avoid robustness issues with our teardown paths (which do need quite a bit of TLC) add a check for aux_devs prior to attempting to set things up, this means that we've got a reasonable idea that everything will be there before we start. As with the removal of partial instantiation support more work will be needed to make this work neatly. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-04-01ASoC: dapm: Add platform stream event supportLiam Girdwood1-6/+2
Currently stream events are only perfomed on codec stream widgets only. There is now a need to be able to perform stream events on platform widgets too. e.g. we have the ABE platform driver with several DAI links to dummy codecs. We need to be able to perform stream events on any of the dummy codec DAI links. This patch also removes the snd_soc_dai * parameter since it's already contained within the rtd * parameter. Finally makle stream event return void since no one checks it anyway. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-01ASoC: core: Add platform DAI widget mappingLiam Girdwood1-0/+14
Add platform driver support for CPU DAI DAPM widgets. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-01ASoC: dapm: Use DAPM mutex for DAPM ops instead of codec mutexLiam Girdwood1-0/+1
It has now become necessary to use a DAPM mutex instead of the codec mutex to lock the DAPM operations. This is due to the recent multi component support and forth coming Dynamic PCM updates. Currently we lock DAPM operations with the codec mutex of the calling RTD context. However, DAPM operations can span the whole card context and all components. This patch updates the DAPM operations that use the codec mutex to now use the DAPM mutex PCM subclass for all DAPM ops. We also add a mutex subclass for DAPM init and PCM operations. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-01ASoC: core: Add card mutex locking subclassesLiam Girdwood1-1/+1
This is the first part of a change that is intended to improve ASoC locking protection for DAPM and PCM operations. This part of the series adds a mutex class for the soc_card mutex. The SND_SOC_CARD_CLASS_INIT class is used for card initialisation only whilst the SND_SOC_CARD_CLASS_PCM class is used for the forth coming Dynamic PCM operations. The new mutex classes are required otherwise we will see a false positive mutex deadlock warning between the card initialisation and the PCM operations (something that would never deadlock in real life). Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-15ASoC: core: Fix obscure leak of runtime arrayMark Brown1-4/+4
We're currently not freeing card->rtd in cases where the card is unregistered before being instantiated - convert it to devm_kzalloc() to make sure that happens. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-03-08ASoC: core: missing set_fmt should not be complaintShawn Guo1-5/+6
Not having a DAI link set_fmt operation is perfectly normal and should not be complaint. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-06ASoC: core: Add platform component mutexLiam Girdwood1-0/+1
Add mutex support for platform IO operations. e.g. can be used for platform DAPM widget IO ops. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-02ASoC: core: Log a warning when machines use soc-audioMark Brown1-0/+4
snd_soc_register_card() has been available and strongly preferred since 2.6.38 but we're still seeing new drivers using it and the conversion rate for older machines has been low. Help address both issues by logging a warning when the soc-audio device probes. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-03-02ASoC: core: cleanup platform debugfs on probe failure.Liam Girdwood1-0/+1
Make sure we cleanup the platform debugfs when probe fails. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-24ASoC: core: Don't overwrite .poweroff in snd_soc_pm_opsViresh Kumar1-1/+5
SET_SYSTEM_SLEEP_PM_OPS writes .poweroff = *_resume once. Then we overwrite it again explicitly as .poweroff = snd_soc_poweroff. Even though it works, as the second one overwrites the first one, this is not the correct way. Fix this by expanding SET_SYSTEM_SLEEP_PM_OPS in our structure. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-21ASoC: core: Add support for masking out parts of coefficient blocksMark Brown1-7/+67
Chip designers frequently include things like the enable and disable controls for algorithms in the register blocks which also hold the coefficients. Since it's desirable to split out the enable/disable control from userspace the plain SND_SOC_BYTES() isn't optimal for these devices. Add a SND_SOC_BYTES_MASK() which allows a bitmask from the first word of the block to be excluded from the control. This supports the needs of devices I've looked at and lets us have a reasonably simple API. Further controls can be added in future if that's needed. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-02-21ASoC: core: Add SND_SOC_BYTES control for coefficient blocksMark Brown1-0/+49
Allow devices to export blocks of registers to the application layer, intended for use for reading and writing coefficient data which can't usefully be worked with by the kernel at runtime (for example, due to requiring complex and expensive calculations or being the results of callibration procedures). Currently drivers are using platform data to provide configurations for coefficient blocks which isn't at all convenient for runtime management or configuration development. Currently only devices using regmap are supported, an error will be generated for any attempt to work with a byte control on a non-regmap device. There's no fundamental block to other devices so support could be added if required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-02-17ASoC: soc-core: Show the returned values on error messagesFabio Estevam1-17/+22
Showing the returned values on error messages is useful information. While at it, use pr_err/pr_warn whenever possible. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-17ASoC: dapm: Implement and instantiate DAI widgetsMark Brown1-0/+11
In order to allow us to do smarter things with DAI links create DAPM widgets which directly represent the DAIs in the DAPM graph. These are automatically created from the DAIs as we probe the card with references held in both directions between the widget and the DAI. The widgets are not made available for direct instantiation by drivers, they are created automatically from the DAIs. Drivers should be updated to create stream routes using DAPM maps rather than by annotating AIF and DAC widgets with streams. In order to ease transition to this model from existing drivers we automatically create DAPM routes between the DAI widgets and the existing stream widgets which are started and stopped by the DAI widgets, though the old stream handling mechanism is still in place. This also has the nice effect of removing non-DAPM devices as any device with a DAI acquires a widget automatically which will allow future simplifications to the core DAPM logic. The intention is that in future the AIF and DAI widgets will gain the ability to interact such that we are able to manage activity on individual channels independantly rather than powering up and down the entire AIF as we do currently. Currently we only generate these for CODECs, mostly as I have no systems with non-CODEC DAPM to integrate with. It should be a simple matter of programming to add the additional hookup for these. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-02-17ASoC: dapm: Constify lots of names that are never modifiedMark Brown1-1/+1
Neater and avoids warnings when used in other places where const strings are desired. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-02-17ASoC: dapm: Supply the DAI and substream when calling stream eventsMark Brown1-14/+16
In order to allow us to do something smarter than iterate through widgets doing strcmp() to work out what to power up for stream events change the interface used to generate them to be based on the combination of a DAI and a stream direction rather than just a simple string identifying the stream. At some point we'll probably want a set of channels too. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-02-15ASoC: core: add platform DAPM debugfs supportSebastien Guiriec1-0/+32
Allow platform widgets to be visible in debugfs like codec widgets. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-15ASoC: core: Convert CODEC debugfs init to use dev_warn()Liam Girdwood1-4/+2
Update the codec debugfs initialisation to use dev_warn() instead of printk(KERN_WARNING). Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-09Merge tag 'v3.3-rc3' as we've got several bugfixes in there which areMark Brown1-0/+11
colliding annoyingly with development. Linux 3.3-rc3 .. the number of the half-beast? Conflicts: sound/soc/codecs/wm5100.c sound/soc/codecs/wm8994.c
2012-02-09ASoC: core: Allow CODECs to set ignore_pmdown_time in the driver structMark Brown1-0/+1
This is usually not a use case dependant flag anyway. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-02-04ASoC: core: Add support for DAI and machine kcontrols.Liam Girdwood1-38/+70
Currently ASoC can only add kcontrols using codec and platform component device handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for SoC card machine drivers too. This allows the kcontrol to have a direct handle to the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily get it's private data. This change makes snd_soc_add_controls() static and wraps it in the folowing calls (card and dai are new) :- snd_soc_add_card_controls() snd_soc_add_codec_controls() snd_soc_add_dai_controls() snd_soc_add_platform_controls() This patch also does a lot of small mechanical changes in individual codec drivers to replace snd_soc_add_controls() with snd_soc_add_codec_controls(). It also updates the McBSP DAI driver to use snd_soc_add_dai_controls(). Finally, it updates the existing machine drivers that register controls to either :- 1) Use snd_soc_add_card_controls() where no direct codec control is required. 2) Use snd_soc_add_codec_controls() where there is direct codec control. In the case of 1) above we also update the machine drivers to get the correct component data pointers from the kcontrol (rather than getting the machine pointer via the codec pointer). Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-31ASoC: core: Support suspend to diskMark Brown1-2/+1
Use the same pm_ops for all system suspend and resume paths. This isn't ideal for suspend to disk with older CODECs as we'll suspend and then resume the CODEC before powering off all of which takes a long time due to VMID ramps but it's very simple to implement and for modern CODECs the overhead should be minimal. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-01-31ASoC: core: Better support for idle_bias_off suspend ignoresMark Brown1-0/+11
If an idle_bias_off device is in any state other than off then it is still active for some reason (typically a low power function such as accessory detection). This wasn't an issue when the feature was implemented as we always went to _ON for any active function, subsequent power improvements have changed things. With the modern way of doing things we should overhaul the infrastructure to allow devices to explicitly take references for these functions but that's a much more invasive change and will require driver updates to deploy, this will bring the framework into line with the existing driver set before we do that work. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-01-21ASoC: Use regmap update bits operation for drivers using regmapMark Brown1-10/+15
If a driver is using regmap directly ensure that we're coherent with non-ASoC register updates by using the regmap API directly to do our read/modify/write cycles. This will bypass the ASoC cache but drivers using regmap directly should not be using the ASoC cache. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20ASoC: core - Improve card registration error messaging for large DAI links.Liam Girdwood1-3/+5
Print out the offending DAI link entry when a naming error occurs. Makes thing easier to debug for machines with a large number of DAI links. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>