aboutsummaryrefslogtreecommitdiff
path: root/include/sound/soc.h
AgeCommit message (Collapse)Author
2015-08-30Merge remote-tracking branches 'asoc/topic/mediatek', 'asoc/topic/mtk', ↵Mark Brown
'asoc/topic/nuc900', 'asoc/topic/of-name' and 'asoc/topic/omap' into asoc-next
2015-08-30Merge remote-tracking branches 'asoc/topic/davinci', ↵Mark Brown
'asoc/topic/davinci-vcif', 'asoc/topic/doc' and 'asoc/topic/dpcm' into asoc-next
2015-08-30Merge remote-tracking branches 'asoc/topic/88pm860x', 'asoc/topic/ac97', ↵Mark Brown
'asoc/topic/ak4542', 'asoc/topic/arizona' and 'asoc/topic/atmel' into asoc-next
2015-08-30Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-nextMark Brown
2015-08-28ASoC: Clean up docbook warningsJonathan Corbet
A number of functions and structures in the sound subsystem had incomplete and/or obsolete DocBook comments, leading to warnings when the docs were built. Correct those comments so that we can enjoy our audio in the absence of warning noise. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-23ASoC: ac97: Add support for resetting device before registrationLars-Peter Clausen
AC97 devices need to be initially reset before they can be used. Currently each driver does this on its own. Add support for resetting the device to core in snd_soc_new_ac97_codec(). If the caller supplies a device ID and device ID mask the function will reset the device and verify that it has the correct ID, if it does not a error is returned. This will allow to remove custom code with similar functionality from individual drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16ASoC: core: add snd_soc_of_parse_audio_prefix()Kuninori Morimoto
Current ASoC can add name_prefix for DAPM, and it is necessary for route settings. This patch adds snd_soc_of_parse_audio_prefix() for this purpose. It will be used with snd_soc_of_parse_audio_routing(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-08ASoC: Use card field to indicate whether a component is boundLars-Peter Clausen
Use the card field of a component to indicate whether it is bound or not. This makes a certain sense given that the field contains the card the component is bound to and a component can only be bound to one card at a time. And it also requires to unset the card field when the component is unbound from the card. This makes the probded flag redundant and it can be removed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07ASoC: Remove snd_soc_codec dapm fieldLars-Peter Clausen
There are no more direct users of the snd_soc_codec DAPM field left. So we can finally remove it and switch over to directly using the component DAPM context and remove the dapm_ptr indirection. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-05Merge remote-tracking branches 'asoc/topic/topology', 'asoc/topic/twl6040', ↵Mark Brown
'asoc/topic/wm5100', 'asoc/topic/wm8741' and 'asoc/topic/wm8960' into asoc-next
2015-06-05Merge remote-tracking branches 'asoc/topic/davinci' and 'asoc/topic/dpcm' ↵Mark Brown
into asoc-next
2015-06-05Merge remote-tracking branch 'asoc/topic/dapm' into asoc-nextMark Brown
2015-06-04ASoC: topology: Add topology coreLiam Girdwood
The topology core parses the FW topology file for known block types and instanciates any common ALSA/ASoC objects that it discovers. The core also passes any block that is does not understand to client component drivers for enumeration. The core exports some APIs to client drivers in order to load and unload firmware topology data as use case require. Currently the core deals with the following object types :- o kcontrols. This includes TLV, enumerated and bytes controls. o DAPM widgets. All types with any associated kcontrol. o DAPM graph. o FE PCM. FE PCM capabilities and configuration can be defined. o BE DAI Link. BE DAI link capabilities and configuration can be defined. o Codec <-> codec style links capabilities and configuration. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22ASoC: soc-pcm: DPCM cares BE formatKuninori Morimoto
Current DPCM is caring only FE format. but it will be no sound if FE/BE was below style, and user selects S24_LE format. FE: S16_LE/S24_LE BE: S16_LE DPCM can rewrite the format, so basically we don't want to constrain with the BE constraints. But sometimes it will be trouble. This patch adds new .dpcm_merged_format on struct snd_soc_dai_link. DPCM will use FE / BE merged format if .struct snd_soc_dai_link has it. We can have other .dpcm_merged_xxx in the future .dpcm_merged_foramt .dpcm_merged_rate .dpcm_merged_chan Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06ASoC: dapm: Add support for autodisable mux controlsCharles Keepax
Commit 57295073b6ac ("ASoC: dapm: Implement mixer input auto-disable") added support for autodisable controls, controls whose values are only written to the hardware when their respective widgets are powered up. But it only added support for controls based on the mixer abstraction. This patch add support for mux controls (DAPM controls based on the enum abstraction) to be auto-disabled as well. As each mux can only have a single control, there is no need to tie the autodisable widget to the inputs (as is done for the mixer controls) it can be tided directly to the mux widget itself. Note that it is assumed that the first entry in a autodisable mux control will always represent the off state for the mux and is what the mux will be set to whilst it is disabled. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-06ASoC: Correct typo in SOC_VALUE_ENUM_SINGLE macroCharles Keepax
xnitmes is clearly intended to be xnitems, but all other macros just refer to this as xitems, so change it to that. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-29Merge remote-tracking branches 'asoc/fix/email', 'asoc/fix/fsl-ssi', ↵Mark Brown
'asoc/fix/pm', 'asoc/fix/qcom' and 'asoc/fix/rcar' into asoc-linus
2015-04-27ASoC: Add helper functions bias level managementLars-Peter Clausen
Currently drivers are responsible for managing the bias_level field of their DAPM context. The DAPM state itself is managed by the DAPM core though and the core has certain expectations on how and when the bias_level field should be updated. If drivers don't adhere to these undefined behavior can occur. This patch adds a few helper functions for manipulating the DAPM context state, each function with a description on when it should be used and what its effects are. This will also help us to move more of the bias_level management from drivers to the DAPM core. For convenience also add snd_soc_codec_* wrappers around these helpers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27ASoC: Add helper function getting CODEC's DAPM contextLars-Peter Clausen
The DAPM context in the snd_soc_codec struct is redundant and scheduled to be replaced by the DAPM context in the snd_soc_component struct. This patch introduces a new helper function snd_soc_codec_get_dapm() which should be used for getting the DAPM context for a CODEC rather then directly accessing the dapm field. Once there are no more direct users of the dapm field left it is possible to transparently switch all drivers to the component DAPM context by updating snd_soc_codec_get_dapm() function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27ASoC: soc.h: tidyup struct snd_soc_dai_link definition orderKuninori Morimoto
Current struct snd_soc_dai_link has many members, but definition order was random. Especially, bool / bit field are defined randomly. This patch tidyups these definition order to calculate data alignment easy. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-19ASoC: add static inline funcs to fix a compiling issueJie Yang
When CONFIG_PM_SLEEP is not selected, calling funcs snd_soc_suspend and _resume will generate a compiling issue. Here add static inline stub functions to fix it. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-13Merge tag 'asoc-v4.1-2' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v4.1 More updates for v4.1, pretty much all drivers: - Lots of cleanups from Lars, mainly moving things from the CODEC level to the card level. - Continuing improvements to rcar from Morimoto-san, pcm512x from Howard and Peter, the Intel platforms from Vinod, Jie, Jin and Han, and to rt5670 from Bard. - Support for some non-DSP Qualcomm platforms, Google's Storm platform, Maxmim MAX98925 CODECs and the Ingenic JZ4780 SoC.
2015-04-12Merge remote-tracking branches 'asoc/topic/link-param', ↵Mark Brown
'asoc/topic/max98090', 'asoc/topic/max98925' and 'asoc/topic/nuc900' into asoc-next
2015-04-12Merge remote-tracking branch 'asoc/topic/dapm' into asoc-nextMark Brown
2015-03-17ASoC: dapm: add code to configure dai link parametersNikesh Oswal
dai-link params for codec-codec links were fixed. The fixed link between codec and another chip which may be another codec, baseband, bluetooth codec etc may require run time configuaration changes. This change provides an optional alsa control to select one of the params from a list of params. Signed-off-by: Nikesh Oswal <nikesh@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-16ASoC: Make snd_soc_dapm_kcontrol_codec() inlineLars-Peter Clausen
snd_soc_dapm_kcontrol_codec() is a extremely simple function and inlining it typically results in less code than necessary for calling the non-inlined version of the function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-06Merge tag 'asoc-v4.1' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Changes for v4.1 A selection of changes for v4.1 so far. The main things are: - Move of jack registration to the card where it belongs. - Support for DAPM routes specified by both the machine driver and DT.
2015-03-05Merge remote-tracking branches 'asoc/topic/jack', 'asoc/topic/max98357a', ↵Mark Brown
'asoc/topic/omap' and 'asoc/topic/rt286' into asoc-next
2015-03-05Merge remote-tracking branches 'asoc/topic/atmel', 'asoc/topic/davinci', ↵Mark Brown
'asoc/topic/gpiod' and 'asoc/topic/intel' into asoc-next
2015-03-04ASoC: Remove snd_soc_jack_new()Lars-Peter Clausen
There are no users of snd_soc_jack_new() left and new users should use snd_soc_card_jack_new() instead. So remove the function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-04ASoC: Allow to register jacks at the card levelLars-Peter Clausen
Jacks are typically card level elements, but are currently registered with a CODEC. When it was originally introduced snd_soc_jack_new() took a snd_soc_card as its parameter, but at that time DAPM was only implemented at the CODEC level and there was only one CODEC per card. This made it clear which CODEC to use for the jack DAPM operations. But the multi-component patchset added support for having multiple CODECs per card and with it the API was updated to register jacks with a specific CODEC instance instead. Subsequently DAPM support at the card level has been introduced, but the snd_soc_jack_new() API has so remained unchanged. This leaves us with the issue that the DAPM pins that are managed by the jack detection logic usually are part of the card DAPM context but are accessed through a CODEC DAPM context. Currently this works fine, but might break in the future if we take a more hierarchical approach to DAPM contexts. Furthermore with componentization progressing systems that do not register a snd_soc_codec might appear, while these system may still want to able to register a jack. This patch addresses these issues by adding a new function called snd_soc_card_jack_new() that can be used to register jacks with the card rather than a CODEC. This new function is mostly identical to snd_soc_jack_new() except that it additionally allows to directly specify the DAPM pins associated with the jack. This was done since most users of snd_soc_jack_new() typically call snd_soc_jack_add_pins() right after it, which is not necessary with the new API and allows to reduce the amount of boiler plate code. The old snd_soc_jack_new() is re-implemented as a wrapper around snd_soc_card_jack_new(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-04ALSA: Fix spelling typo in Documentation/DocBook/alsa-driver-api.xmlMasanari Iida
This patch fix spelling typo found in alsa-driver-api.xml. It is because this file is generated from comments in source files, I have to fix source files. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-24ASoC: core: Add extra dapm properties for Device TreeNicolin Chen
The current helper functions, snd_soc_of_parse_audio_simple_widgets() and snd_soc_of_parse_audio_routing(), set dapm_widgets and dapm_routes without caring if they are already set by using build-in widgets and routes in the card driver. So there could be one of them, build-in one or Device Tree one, overrided by the other depending on which one was assigned later. This patch adds an extra pair of dapm_widgets and dapm_routes for DT use only so as to prevent unexpected overriding. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-24ASoC: core: allow pcms to be registered as nonatomicVinod Koul
ALSA core with commit 257f8cce5d40 - "ALSA: pcm: Allow nonatomic trigger operations" allows trigger ops to implemented as nonatomic. For ASoC, we can specify this in dailinks and is updated while snd_pcm is created Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-09Merge remote-tracking branches 'asoc/topic/cs42l73', 'asoc/topic/dai' and ↵Mark Brown
'asoc/topic/davinci' into asoc-next
2015-02-04Merge remote-tracking branches 'asoc/topic/cs42l73', 'asoc/topic/dai' and ↵Mark Brown
'asoc/topic/davinci' into asoc-next
2015-01-26ASoC: Add support for allocating AC'97 device before registering itLars-Peter Clausen
In some cases it is necessary to before additional operations after the device has been initialized and before the device is registered. This can for example be resetting the device. This patch introduces a new function snd_soc_alloc_ac97_codec() which is similar to snd_soc_new_ac97_codec() except that it does not register the device. Any users of snd_soc_alloc_ac97_codec() are responsible for calling device_add() manually. Fixes: 6794f709b712 ("ASoC: ac97: Drop delayed device registration") Reported-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-01-07ASoC: Add helper function for changing the DAI link formatLars-Peter Clausen
For some setups it is necessary to change the DAI link format at runtime. This patch factors out the code that does the initial static DAI link format configuration into a separate helper function which can be used board drivers as well. This allows board drivers that have to change the DAI link format at runtime to reuse it instead of having to manually change the format on all DAIs. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-08Merge remote-tracking branches 'asoc/topic/multi-codec', ↵Mark Brown
'asoc/topic/mxs-saif', 'asoc/topic/mxs-sgtl5000', 'asoc/topic/omap' and 'asoc/topic/pxa' into asoc-next
2014-12-08Merge remote-tracking branches 'asoc/topic/codec-mutex', ↵Mark Brown
'asoc/topic/compress' and 'asoc/topic/cq93vc' into asoc-next
2014-12-08Merge remote-tracking branches 'asoc/topic/ac97', 'asoc/topic/ad193x', ↵Mark Brown
'asoc/topic/adau1373' and 'asoc/topic/adau17x1' into asoc-next
2014-12-08Merge remote-tracking branch 'asoc/topic/core' into asoc-nextMark Brown
2014-11-25ASoC: Remove 'const' from the device_node pointersJean-Francois Moine
As Russell King's explained it, there should not be pointers to struct device_node: "struct device_node is a ref-counted structure. That means if you store a reference to it, you should "get" it, and you should "put" it once you've done. The act of "put"ing the pointed-to structure involves writing to that structure, so it is totally unappropriate to store a device_node structure as a const pointer. It forces you to have to cast it back to a non-const pointer at various points in time to use various OF function calls." [This isn't quite the application here, we're not geting or putting the pointer though we did add some other users who call non-const OF functions -- broonie] Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-25ASoC: Disable regmap helpers if regmap is disabledLars-Peter Clausen
If regmap is disabled there will be no users of the ASoC regmap helpers. Furthermore regmap_exit() will no be defined causing the following compile error: sound/soc/soc-core.c: In function 'snd_soc_component_exit_regmap': sound/soc/soc-core.c:2645:2: error: implicit declaration of function 'regmap_exit' [-Werror=implicit-function-declaration] So disable the helpers if regmap is disabled. Reported-by: kbuild test robot <fengguang.wu@intel.com> Fixes: 20feb881988c ASoC: Add helper functions for deferred regmap setup") Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-25ASoC: core: add multi-codec support in DTJean-Francois Moine
This patch exports a core function which handles the DT description of multi-codec links (as: "sound-dai = <&hdmi 0>, <&spdif_codec>;") and creates a CODEC component array in the DAI link. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-19Merge branch 'topic/regmap' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-ac97
2014-11-19ASoC: Add helper functions for deferred regmap setupLars-Peter Clausen
Some drivers (most notably the AC'97 drivers) do not have access to their regmap struct when the component/codec is registered. For those drivers the automatic regmap setup will not work and needs to be done manually, typically from the component/CODEC drivers probe callback. This patch adds a set of helper function to handle deferred regmap initialization as well as early regmap tear-down. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-18ASoC: ac97: Push snd_ac97 pointer to the driver levelLars-Peter Clausen
Now that the ASoC core no longer needs a handle to the AC'97 device that is associated with a CODEC we can remove it from the snd_soc_codec struct and push it into the individual driver state structs like we do for other communication buses. Doing so creates a clean separation between the AC'97 bus support and the ASoC core. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-18ASoC: ac97: Drop delayed device registrationLars-Peter Clausen
We have all the information and dependencies we need to initialize and register the device available in snd_soc_new_ac97_codec(). So there is no need to delay the device registration until after the card itself as been registered. This makes the code significantly simpler and also makes it possible to use the AC'97 device in the CODECs probe function. The later will be required to be able to convert the AC'97 CODEC drivers to regmap. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-18ASoC: ac97: Drop support for setting platform data via the CPU DAILars-Peter Clausen
This has no users since commit f0fba2ad1b6b ("ASoC: multi-component - ASoC Multi-Component Support") which was almost 5 years ago. Given that this runs after CODEC probe functions have been run it also doesn't seem to be that useful. So drop it altogether to make the code simpler. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>