summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: core: Use consistent byte ordering in snd_soc_bytes_getCharles Keepax2013-11-291-2/+2
| | | | | | | | | | | | | snd_soc_bytes_put treats the data in the binary control as big endian words, however snd_soc_bytes_get uses the endian of the host machine. This causes the two functions to be inconsistant with how the mask is applied on little endian machines. This patch applies the big_endian format used in snd_soc_bytes_put to snd_soc_bytes_get. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'asoc/topic/core' into asoc-nextMark Brown2013-11-081-69/+62
|\
| * ASoC: Add pinctrl PM to components of active DAIsNicolin Chen2013-11-041-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's quite popular that more drivers are using pinctrl PM, for example: (Documentation/devicetree/bindings/arm/primecell.txt). Just like what runtime PM does, it would deactivate and activate pin group depending on whether it's being used or not. And this pinctrl PM might be also beneficial to cpu dai drivers because they might have actual pinctrl so as to sleep their pins and wake them up as needed. To achieve this goal, this patch sets pins to the default state during resume or startup; While during suspend and shutdown, it would set pins to the sleep state. As pinctrl PM would return zero if there is no such pinctrl sleep state settings, this patch would not break current ASoC subsystem directly. [ However, there is still an exception that the patch can not handle, that is, when cpu dai driver does not have pinctrl property but another device has it. (The AUDMUX <-> SSI on Freescale i.MX6 series for example. SSI as a cpu dai doesn't contain pinctrl property while AUDMUX, an Audio Multiplexer, has it). In this case, this kind of cpu dai driver needs to find a way to obtain the pinctrl property as its own, by moving property from AUDMUX to SSI, or creating a pins link/dependency between these two devices, or using a more decent way after we figure it out. ] Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: Use strlcpy() for copying in snd_soc_info_enum_double()Takashi Iwai2013-10-311-2/+3
| | | | | | | | | | | | | | | | The provided texts aren't guaranteed to be in the fixed size. Spotted by coverity CID 139318. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: add snd_soc_of_get_dai_name() default of_xlateKuninori Morimoto2013-10-181-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Current snd_soc_of_get_dai_name() needs .of_xlate_dai_name() callback on each component drivers. But required behavior on almost all these drivers is just returns its indexed driver's name. This patch adds this feature as default behavior. .of_xlate_dai_name() can overwrite it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * Merge remote-tracking branch 'asoc/topic/component' into asoc-coreMark Brown2013-09-171-90/+147
| |\ | | | | | | | | | | | | Conflicts: include/sound/soc.h
| * | ASoC: Remove infrastructure for supporting multiple cache typesLars-Peter Clausen2013-09-171-25/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only cache type left is the flat cache and new other cache types won't be added since new drivers are supposed to use regmap directly for IO and caching. This patch removes the snd_soc_cache_ops indirection that was added to support multiple cache types and modifies the code to always use the flat cache directly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: Remove 'reg_size' field from snd_soc_codec structLars-Peter Clausen2013-09-171-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reg_size field is calculated in snd_soc_register_codec() and then used exactly once in snd_soc_flat_cache_init(). Since it is calculated based on other fields from the codec struct just move the calculation to snd_soc_flat_cache_init() and remove the 'reg_size' field from the codec struct. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: Remove reg_def_copyLars-Peter Clausen2013-09-171-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reg_def_copy was introduced in commit 3335ddca ("ASoC: soc-cache: Use reg_def_copy instead of reg_cache_default") to keep a copy of the register defaults around in case the register defaults where placed in the __devinitdata section. With the __devinitdata section gone we effectivly keep the same data around twice. This patch removes reg_def_copy and uses reg_cache_default directly instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: Remove snd_soc_bulk_write_raw()Lars-Peter Clausen2013-09-171-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | No users of snd_soc_bulk_write_raw() are left and new drivers are going to use regmap directly for this, so the function can be removed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: Remove support for reg_access_defaultsLars-Peter Clausen2013-09-171-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | No users of reg_access_defaults are left and new drivers are going to use regmap for this, so support for it can be removed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | Merge remote-tracking branch 'asoc/topic/component' into asoc-nextMark Brown2013-11-081-90/+147
|\ \ \ | | |/ | |/|
| * | ASoC: add .of_xlate_dai_name on snd_soc_component_driverKuninori Morimoto2013-09-171-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASoC sound driver requires CPU/CODEC drivers for probing, and each CPU/CODEC has some DAI on it. Then, "dai name matching" have been used to identify CPU-CODEC DAI pair on ASoC. But, the "dai port number matching" is now required from DeviceTree. The solution of this issue is to replace the dai port number into dai name. Now, CPU/CODEC are based on struct snd_soc_component, and it can care above as common issue. This patch adds .of_xlate_dai_name callback interface on struct snd_soc_component_driver, and snd_soc_of_get_dai_name() which is using .of_xlate_dai_name. Then, #sound-dai-cells which enables DAI specifier is required on CPU/CODEC device tree properties. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: snd_soc_codec includes snd_soc_componentKuninori Morimoto2013-09-171-90/+112
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Codec includes component by this patch, and component moved to upside of codec to avoid extra declaration. Codec dai will be registered via component by this patch. Current component register function is used for cpu, and it is using dai/dais functions properly to keep existing cpu dai name. And now, it will be used from codec also. But codec driver had been used dais function only even though it was single dai. This patch adds new flag which can selects dai/dais function on component register function to keep existing codec dai name. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | Merge remote-tracking branch 'asoc/topic/bclk' into asoc-nextMark Brown2013-11-081-0/+16
|\ \
| * | ASoC: core: Add API for configuration of DAI BCLK ratioLiam Girdwood2013-09-171-0/+16
| |/ | | | | | | | | | | | | | | | | | | | | | | Some codec drivers when running in slave mode require that BCLK to sample rate ratio is explicitly set by the machine driver as it may not be exactly rate * frame size. Extend the DAI API by adding :- int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio); Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* / ASoC: core: Only add platform DAI widgets once.Liam Girdwood2013-09-131-1/+0
|/ | | | | | | | Currently platform CPU DAI widgets are created in soc_probe_platform and soc_probe_link_dais. Remove the extra call in soc_probe_link_dais(). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'asoc/topic/core' into tmpMark Brown2013-08-301-7/+2
|\
| * ASoC: Pass card instead of dapm context to snd_soc_dapm_new_widgets()Lars-Peter Clausen2013-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | snd_soc_dapm_new_widgets() works on the ASoC card as a whole not on a specific DAPM context. The DAPM context that is passed as the parameter is only used to look up the pointer to the card. This patch updates the signature of snd_soc_dapm_new_widgets() to take the card directly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * Merge remote-tracking branch 'asoc/topic/dmic' into asoc-coreMark Brown2013-08-271-3/+1
| |\
| * | ASoC: Move call to snd_soc_dapm_new_widgets() after ↵Lars-Peter Clausen2013-08-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_soc_dapm_auto_nc_codec_pins() Call snd_soc_dapm_new_widgets() before the auto non-connected pins have been marked as not connected will power the system under the assumption that those pins are connected. Once the pins have been marked as disconnected the system there will be an additional power run. This can cause unnecessary power transitions. Calling snd_soc_dapm_new_widgets() only after the pins have been marked as non-connected avoids this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: Call snd_soc_dapm_new_widgets() only once during card initializationLars-Peter Clausen2013-08-271-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each time snd_soc_dapm_new_widgets() is called it will instantiate all the widgets and routes that have been added so far and then power them. Doing this multiple times before the card is fully initialized and all widgets have been added can cause unnecessary and even invalid power state transitions which can result in extra register writes and and also might cause clicks and pops. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | Merge tag 'asoc-v3.12' of ↵Takashi Iwai2013-08-231-58/+182
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.12 - DAPM is now mandatory for CODEC drivers in order to avoid the repeated regressions in the special cases for non-DAPM CODECs and make it easier to integrate with other components on boards. All existing drivers have had some level of DAPM support added. - A lot of cleanups in DAPM plus support for maintaining controls in a specific state while a DAPM widget all contributed by Lars-Peter Clausen. - Core helpers for bitbanged AC'97 reset from Markus Pargmann. - New drivers and support for Analog Devices ADAU1702 and ADAU1401(a), Asahi Kasei Microdevices AK4554, Atmel AT91ASM9x5 and WM8904 based machines, Freescale S/PDIF and SSI AC'97, Renesas R-Car SoCs, Samsung Exynos5420 SoCs, Texas Instruments PCM1681 and PCM1792A and Wolfson Microelectronics WM8997. - Support for building drivers that can support it cross-platform for compile test.
| * | | Merge remote-tracking branch 'asoc/topic/core' into asoc-nextMark Brown2013-08-221-55/+12
| |\| |
| | * | ASoC: Use snd_soc_info_enum_double() for SOC_ENUM_EXT controlsLars-Peter Clausen2013-08-111-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_soc_info_enum_ext() and snd_soc_info_enum_double() are almost identical. The only difference is that snd_soc_info_enum_double() is also able to handle stereo controls. Using snd_soc_info_enum double() instead of snd_soc_info_enum_ext() for the SOC_ENUM_EXT control's info callback allows us to remove snd_soc_info_enum_ext(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * | ASoC: Remove unused snd_soc_info_volsw_ext()Lars-Peter Clausen2013-08-111-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SOC_SINGLE_EXT control has been using snd_soc_info_volsw() for its info callback since commit 1c433fb ("[ALSA] soc - 0.13 ASoC headers"). The snd_soc_info_volsw_ext() function has been unused ever since then, so remove it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * | ASoC: Remove unused soc_pm_waitqLars-Peter Clausen2013-08-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The soc_pm_waitq waitqueue has been around as long as the ASoC framework existed, but has never been used so far, so remove it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * | ASoC: core: init delayed_work for codec-codec linksRichard Fitzgerald2013-08-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We must init the delayed_work for codec-codec links otherwise shutting down the DAI chain will fault when calling flush_delayed_work_sync() on the linked DAI. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | Merge remote-tracking branch 'asoc/topic/adsp' into asoc-nextMark Brown2013-08-221-0/+16
| |\ \ \
| | * | | ASoC: core: Add snd_soc_card_get_kcontrol()Dimitris Papastamos2013-07-291-0/+16
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful for drivers who want to grab a pointer to snd_kcontrol outside of the kcontrol callbacks. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | / ASoC: core: Generic ac97 link reset functionsMarkus Pargmann2013-08-201-0/+153
| | |/ | |/| | | | | | | | | | | | | | | | | | | This patch adds generic ac97 reset functions using pincontrol and gpio parsed from devicetree. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: core: double free in snd_soc_add_platform()Dan Carpenter2013-07-221-3/+1
| |/ | | | | | | | | | | | | | | There are three callers for this function, and none of them want it to free platform for them. It leads to a double free. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* / ALSA: replace strict_strto*() with kstrto*()Jingoo Han2013-07-211-3/+5
|/ | | | | | | | | The usage of strict_strto*() is not preferred, because strict_strto*() is obsolete. Thus, kstrto*() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge tag 'asoc-v3.11-3' of ↵Takashi Iwai2013-07-011-0/+1
|\ | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Final updates for v3.11 A few final updates: - A couple of additional bug fixes for the AC'97 refactoring. - Some fixes for the ADAU1701 driver.
| * ASoC: ac97: fixup multi-platform AC'97 module build failureKevin Hilman2013-06-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | commit b047e1cc (ASoC: ac97: Support multi-platform AC'97) introduced some build failures for modules wanting to access the generic soc_ac97_ops. For example: ERROR: "soc_ac97_ops" [sound/soc/codecs/snd-soc-wm9712.ko] undefined! To fix, export soc_ac97_ops to modules. Cc: Mark Brown <broonie@linaro.org> Signed-off-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* | Merge tag 'asoc-v3.11-2' of ↵Takashi Iwai2013-06-281-0/+16
|\| | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: More updates for v3.11 Some more fixes and enhancements, and also a bunch of refectoring for AC'97 support which enables more than one AC'97 controller driver to be built in.
| * ASoC: ac97: Support multi-platform AC'97Mark Brown2013-06-271-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we can only have a single platform built in with AC'97 support due to the use of a global variable to provide the bus operations. Fix this by making that variable a pointer and having the bus drivers set the operations prior to registering. This is not a particularly good or nice approach but it avoids blocking multiplatform and a real fix involves fixing the fairly deep problems with AC'97 support - we should be converting it to a real bus. Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: core: Use kasprintf instead of opencoding itLars-Peter Clausen2013-05-141-5/+1
| | | | | | | | | | | | | | | | | | | | | | kasprintf calculates the size of the result string, allocates a buffer large enough to hold the string and then performs the format string operation. There are a couple of places in ASoC where these three steps are done by hand and where kasprintf can be used instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: core: Move snd_soc_set_runtime_hwparams() to soc-pcm.cLars-Peter Clausen2013-05-141-23/+0
| | | | | | | | | | | | | | | | | | | | snd_soc_set_runtime_hwparams() is the only PCM related function that lives in soc-core.c. All other PCM related functions live in soc-pcm.c, so move snd_soc_set_runtime_hwparams() over as well for a bit more consistency. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: fix kernel message grepabilityMichał Mirosław2013-05-121-34/+43
|/ | | | | Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge tag 'asoc-v3.10-2' of ↵Takashi Iwai2013-04-181-23/+62
|\ | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: More updates for v3.10 The main additional change here is Lars-Peter's DMA work plus the platform conversions which have been tested - getting this in mainline will make life easier for development after the merge window. These factor a large chunk of code out of the drivers for the platforms using dmaengine, greatly simplifying development.
| * Merge tag 'v3.9-rc7' into asoc-dmaMark Brown2013-04-171-5/+5
| |\ | | | | | | | | | Linux 3.9-rc7
| * | ASoC: Add snd_soc_{add, remove}_platformLars-Peter Clausen2013-04-171-23/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_soc_{add,remove}_platform are similar to snd_soc_register_platform and snd_soc_unregister_platform with the difference that they won't allocate and free the snd_soc_platform structure. Also add snd_soc_lookup_platform which looks up a platform by the device it has been registered for. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Stephen Warren <swarren@nvidia.com> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | Merge remote-tracking branch 'asoc/topic/core' into asoc-nextMark Brown2013-04-121-14/+15
|\| |
| * | ASoC: Constify the 'driver' field of snd_soc_platformLars-Peter Clausen2013-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The ASoC core does no not modify the driver of a platform. Making it const allows ASoC platform drivers to declare the snd_soc_platform_driver struct as const. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | ASoC: core: remove codec from list if registration failedKuninori Morimoto2013-03-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current snd_soc_register_codec() adds codec to list, and calls snd_soc_register_dais(). But, this listed codec should be removed if dais registration was failed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | ASoC: core: use snd_soc_register_dais() on codecKuninori Morimoto2013-03-041-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | snd_soc_register_dais() considers dai counts inside. snd_soc_register_codec() does not need to care for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * | ASoC: core: tidyup snd_soc_register_codec() fail caseKuninori Morimoto2013-03-041-4/+5
| | | | | | | | | | | | | | | | | | | | | kfree() on snd_soc_register_codec() was summarized to one place. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | Merge remote-tracking branch 'asoc/topic/component' into asoc-nextMark Brown2013-04-121-8/+91
|\ \ \ | |_|/ |/| |
| * | ASoC: export snd_soc_register_componentStephen Warren2013-03-261-0/+2
| | | | | | | | | | | | | | | | | | | | | Without this, modules will fail to link against those symbols. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>