summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: codecs: jz4725b: Use C++ style comments in headerPaul Cercueil2019-02-071-5/+4Star
| | | | | | | | Change the header comment to use C++ style, so that it looks more consistent with the rest of ASoC. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: Kconfig: Show knob, and depend on MIPS || COMPILE_TESTPaul Cercueil2019-02-071-1/+8
| | | | | | | | | Show the knob to enable or disable the jz4740-codec driver, add a proper description, and add a dependency on MIPS || COMPILE_TEST, as this driver is only useful on MIPS. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: jz4740: Add support for devicetreePaul Cercueil2019-02-071-0/+9
| | | | | | | Add support for probing the driver from devicetree. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: jz4740: Use SPDX license notifierPaul Cercueil2019-02-071-12/+5Star
| | | | | | | | Add license information as a standard SPDX license notifier instead of custom text. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* dt-bindings: sound: Document jz4725b-codec bindingsPaul Cercueil2019-02-071-0/+20
| | | | | | | | Add documentation about how to probe the jz4725b-codec driver from devicetree. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* dt-bindings: sound: Document jz4740-codec bindingsPaul Cercueil2019-02-071-0/+20
| | | | | | | | Add documentation about how to probe the jz4740-codec driver from devicetree. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add Line Playback Volume, Line Boost Volume, Line Right, ↵Danny Milosavljevic2019-02-071-0/+27
| | | | | | | | | | | | | Line Left, Line Playback Switch Add Line Playback Volume for Allwinner A10 and Allwinner A20. Add Line Boost Volume for Allwinner A10 and Allwinner A20. Add Line Right, Line Left, Line Playback Switch for Allwinner A10 and Allwinner A20. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add FM Playback Volume, FM Left, FM Right, FM Playback SwitchDanny Milosavljevic2019-02-071-0/+18
| | | | | | | | | | Add FM Playback Volume for Allwinner A10 and Allwinner A20. Add FM Left, FM Right, FM Playback Switch for Allwinner A10 and Allwinner A20. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add Mic1 Playback Switch, Mic2 Playback SwitchDanny Milosavljevic2019-02-071-0/+14
| | | | | | | | | Add Mic1 Playback Switch and Mic2 Playback Switch for Allwinner A10 and Allwinner A20. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Merge sun4i_codec_left_mixer_controls and ↵Danny Milosavljevic2019-02-071-16/+16
| | | | | | | | | | | | | | sun4i_codec_right_mixer_controls into sun4i_codec_mixer_controls Since it's now possible to have a DAPM mixer control with multiple channels, use it to cut down the total number of controls. Keep "Left Mixer Left DAC Playback Switch" and "Right Mixer Right DAC Playback Switch" name & layout the same as before for compatibility. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add Mic1 Boost Volume, Mic2 Boost VolumeDanny Milosavljevic2019-02-071-0/+23
| | | | | | | | | | | | | Add Mic1 Boost Volume and Mic2 Boost Volume for Allwinner A10 and for Allwinner A20. Those controls are in different registers per chip model, so put the Allwinner A10 controls and the Allwinner A20 controls into the newly split sun4i_codec_controls and sun7i_codec_controls, respectively. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add sun7i_codec_controls, sun7i_codec_codecDanny Milosavljevic2019-02-071-1/+23
| | | | | | | | | | | | Introduce sun7i_codec_controls because some of the controls are different on Allwinner A20 compared to Allwinner A10. Also introduce sun7i_codec_codec in order to use sun7i_codec_controls and make sun7i_codec_quirks use sun7i_codec_codec. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add Mic Playback VolumeDanny Milosavljevic2019-02-071-0/+3
| | | | | | | | | Add a control "Mic Playback Volume" that allows the user to control the MIC gain stage (common for Mic1 and Mic2) leading to the output mixer. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-codec: Add MIC2 Pre-Amplifier, Mic2 inputDanny Milosavljevic2019-02-071-0/+12
| | | | | | | | | | | Add MIC2 Pre-Amplifier, Mic2 input for Allwinner A10 and Allwinner A20. Previously, there only the Mic1 input and MIC1 Pre-Amplifier was exposed. This exposes the Mic2 input and MIC2 Pre-Amplifier. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: jz4725b: fix spelling mistake "Deemphatize" -> "Deemphasize"Colin Ian King2019-02-071-1/+1
| | | | | | | There is a spelling mistake in the SOC_SINGLE control name. Fix this. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: wcd9335: fix semicolon.cocci warningskbuild test robot2019-02-071-3/+3
| | | | | | | | | | | | | | | sound/soc/codecs/wcd-clsh-v2.c:545:2-3: Unneeded semicolon sound/soc/codecs/wcd-clsh-v2.c:211:2-3: Unneeded semicolon sound/soc/codecs/wcd-clsh-v2.c:250:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: cc2e324d39b2 ("ASoC: wcd9335: add CLASS-H Controller support") CC: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: Add jz4725b-codec driverPaul Cercueil2019-02-063-0/+613
| | | | | | | | Add jz4725b-codec driver to support the internal CODEC found in the JZ4725B SoC from Ingenic. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: dapm: harden use of lookup tablesPierre-Louis Bossart2019-02-062-76/+85
| | | | | | | | | | | | | To detect potential errors, let's add: a) build-time warnings when the table size isn't aligned with the enum list b) run-time warnings when the values are not initialized. This requires an increase by one of all values to avoid the default 0. Suggested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'asoc-5.0' into asoc-5.1 for dapm tableMark Brown2019-02-067-10/+46
|\
| * ASoC: dapm: fix out-of-bounds accesses to DAPM lookup tablesPierre-Louis Bossart2019-02-061-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KASAN reports and additional traces point to out-of-bounds accesses to the dapm_up_seq and dapm_down_seq lookup tables. The indices used are larger than the array definition. Fix by adding missing entries for the new widget types in these two lookup tables, and align them with PGA values. Also the sequences for the following widgets were not defined. Since their values defaulted to zero, assign them explicitly snd_soc_dapm_input snd_soc_dapm_output snd_soc_dapm_vmid snd_soc_dapm_siggen snd_soc_dapm_sink Fixes: 8a70b4544ef4 ('ASoC: dapm: Add new widget type for constructing DAPM graphs on DSPs.'). Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: topology: fix oops/use-after-free case with dai driverGuennadi Liakhovetski2019-02-022-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rmmod/modprobe tests expose a kernel oops when accessing the dai driver pointer. This comes from the topology design which operates in multiple passes. Each object removal happens at a specific iteration, and the code checks for the iteration (order) number after the memory containing the order was freed. Fix this be clearing a reference to the dai driver and check its validity to avoid dereferences. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: rsnd: fixup MIX kctrl registrationKuninori Morimoto2019-02-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renesas sound device has many IPs and many situations. If platform/board uses MIXer, situation will be more complex. To avoid duplicate DVC kctrl registration when MIXer was used, it had original flags. But it was issue when sound card was re-binded, because no one can't cleanup this flags then. To solve this issue, commit 9c698e8481a15237a ("ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()") checks registered card->controls, because if card was re-binded, these were cleanuped automatically. This patch could solve re-binding issue. But, it start to avoid MIX kctrl. To solve these issues, we need below. To avoid card re-binding issue: check registered card->controls To avoid duplicate DVC registration: check registered rsnd_kctrl_cfg To allow multiple MIX registration: check registered rsnd_kctrl_cfg This patch do it. Fixes: 9c698e8481a15237a ("ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()") Reported-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-By: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: core: Allow soc_find_component lookups to match parent of_nodeCharles Keepax2019-01-251-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For devices implemented as a MFD it is common to only have a single node in devicetree representing the whole device. As such when looking up components in soc_find_components we should match against both the devices of_node and the devices parent's of_node, as is already done in the rest of the ASoC core. This causes regressions for some DAI links at the moment as soc_find_component was recently added as a check in soc_init_dai_link. Fixes: 8780cf1142a5 ("ASoC: soc-core: defer card probe until all component is added to list") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: rt5682: Correct the setting while select ASRC clk for AD/DA filterShuming Fan2019-01-221-0/+2
| | | | | | | | | | | | | | | | | | AD/DA ASRC function control two ASRC clock sources separately. Whether AD/DA filter select which clock source, we enable AD/DA ASRC function for all cases. Signed-off-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: MAINTAINERS: fsl: Change Fabio's email addressFabio Estevam2019-01-211-2/+2
| | | | | | | | | | | | | | I prefer to use my personal email address for kernel related work. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: hdmi-codec: fix oops on re-probeRussell King2019-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hdmi-codec oopses the kernel when it is unbound from a successfully bound audio subsystem, and is then rebound: Unable to handle kernel NULL pointer dereference at virtual address 0000001c pgd = ee3f0000 [0000001c] *pgd=3cc59831 Internal error: Oops: 817 [#1] PREEMPT ARM Modules linked in: ext2 snd_soc_spdif_tx vmeta dove_thermal snd_soc_kirkwood ofpart marvell_cesa m25p80 orion_wdt mtd spi_nor des_generic gpio_ir_recv snd_soc_kirkwood_spdif bmm_dmabuf auth_rpcgss nfsd autofs4 etnaviv thermal_sys hwmon gpu_sched tda9950 CPU: 0 PID: 1005 Comm: bash Not tainted 4.20.0+ #1762 Hardware name: Marvell Dove (Cubox) PC is at hdmi_dai_probe+0x68/0x80 LR is at find_held_lock+0x20/0x94 pc : [<c04c7de0>] lr : [<c0063bf4>] psr: 600f0013 sp : ee15bd28 ip : eebd8b1c fp : c093b488 r10: ee048000 r9 : eebdab18 r8 : ee048600 r7 : 00000001 r6 : 00000000 r5 : 00000000 r4 : ee82c100 r3 : 00000006 r2 : 00000001 r1 : c067e38c r0 : ee82c100 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none[ 297.318599] Control: 10c5387d Table: 2e3f0019 DAC: 00000051 Process bash (pid: 1005, stack limit = 0xee15a248) ... [<c04c7de0>] (hdmi_dai_probe) from [<c04b7060>] (soc_probe_dai.part.9+0x34/0x70) [<c04b7060>] (soc_probe_dai.part.9) from [<c04b81a8>] (snd_soc_instantiate_card+0x734/0xc9c) [<c04b81a8>] (snd_soc_instantiate_card) from [<c04b8b6c>] (snd_soc_add_component+0x29c/0x378) [<c04b8b6c>] (snd_soc_add_component) from [<c04b8c8c>] (snd_soc_register_component+0x44/0x54) [<c04b8c8c>] (snd_soc_register_component) from [<c04c64b4>] (devm_snd_soc_register_component+0x48/0x84) [<c04c64b4>] (devm_snd_soc_register_component) from [<c04c7be8>] (hdmi_codec_probe+0x150/0x260) [<c04c7be8>] (hdmi_codec_probe) from [<c0373124>] (platform_drv_probe+0x48/0x98) This happens because hdmi_dai_probe() attempts to access the HDMI codec private data, but this has not been assigned by hdmi_dai_probe() before it calls devm_snd_soc_register_component(). Move the call to dev_set_drvdata() before devm_snd_soc_register_component() to avoid this oops. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* | ASoC: ssm2602: switch to SPDX identifierMarco Felsch2019-02-061-27/+12Star
| | | | | | | | | | | | | | Drop old license header and switch to SPDX-License-Identifier. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: compress: Add helper functions for component trigger/set_paramsCharles Keepax2019-02-061-63/+54Star
| | | | | | | | | | | | | | | | | | The trigger and set_params callbacks are called from 3 and 2 separate loops respectively, tidy up the code a little by factoring these out into helper functions. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: compress: Clarify the intent of current compressed ops handlingCharles Keepax2019-02-061-58/+48Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For callbacks configuring the state of the components (trigger, set_params, ack and set_metadata) simplify the code a little and make intention clearer by aborting as soon as an error is encountered. The operation has already failed and there is nothing to be gained from processing the callbacks on additional components. The operations currently abort after the callbacks, so this simply shortens the error path. For callbacks returning information from the driver (copy, get_metadata, pointer, get_codec_caps, get_caps and get_params) only look for the first callback provided, currently the code will call every callback only returning the information provided by the last. Since we can only return one set of data, it makes no sense to request the data from every component. Again this just makes the currently supported feature set a little more clear. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: wcd9335: remove some unnecessary NULL checksDan Carpenter2019-02-061-12/+8Star
| | | | | | | | | | | | | | These are arrays, not pointers, and they can't be NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: ssm2602: Fix ADC powerup sequencingPhilipp Zabel2019-02-061-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the ssm2603 data sheet (control register sequencing), the digital core should be activated only after all necessary bits in the power register are enabled, and a delay determined by the decoupling capacitor on the VMID pin has passed. If the digital core is activated too early, or even before the ADC is powered up, audible artifacts appear at the beginning of the recorded signal. The digital core is also needed for playback, so when recording starts it may already be enabled. This means we cannot get the power sequence correct when we want to be able to start recording after playback. As a workaround put the MIC mute switch into the DAPM routes. This way we can keep the recording disabled until the MIC Bias has settled and thus get rid of audible artifacts. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> m.felsch@pengutronix.de: adapt commit message m.felsch@pengutronix.de: drop of configuration as mentioned by Mark: https://patchwork.kernel.org/patch/10407449/ Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: dapm: Check for NULL widget in dapm_update_dai_unlockedCharles Keepax2019-02-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | DAIs linked to the dummy will not have an associated playback/capture widget, so we need to skip the update in that case. Fixes: 078a85f2806f ("ASoC: dapm: Only power up active channels from a DAI") Reported-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Tested-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: ak4118: fix missing headerClément Péron2019-02-041-0/+1
| | | | | | | | | | | | | | | | This driver use the gpio consumer interface. Add the header as it's needed. Signed-off-by: Clément Péron <peron.clem@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: btcvsd: fix spelling mistake "offest" -> "offset"Colin Ian King2019-02-041-1/+1
| | | | | | | | | | | | | | There is a spelling mistake in a dev_warn message. Fix this. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: topology: unload physical dai link in removeBard liao2019-02-042-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | soc_tplg_link_config() will find the physical dai link and call soc_tplg_dai_link_load() to load the BE dai link. Currently remove_link() is only used to remove the FE dai link which is created by the topology. The BE dai link cannot however be unloaded in snd_soc_tplg_component _remove(), which is problematic if anything needs to be released or reinitialized. This patch aligns the definitions of dynamic types with the existing UAPI and adds a new remove_backend_link() routine to unload the the BE dai link when snd_soc_tplg_component_remove() is invoked. Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: soc-core: clear platform pointers on errorCurtis Malainey2019-02-041-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally snd_soc_init_platform was not cleaning up its pointers, this was fixed to always reallocate dynamic memory but created a memory leak when snd_soc_init_platform was called multiple times during the same probe attempt and also threw away any changes made to the struct between calls. In order to avoid reallocating memory that is still valid, the behaviour will be changed to clear the dynamically set pointers on a probe error and a unregister event and snd_soc_init_platform will go back to its original behaviour of only allocating null pointers so it will stop throwing away valid changes. Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: fsl-asoc-card: fix object reference leaks in fsl_asoc_card_probewen yang2019-02-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The of_find_device_by_node() takes a reference to the underlying device structure, we should release that reference. Signed-off-by: Wen Yang <yellowriver2010@hotmil.com> Cc: Timur Tabi <timur@kernel.org> Cc: Nicolin Chen <nicoleotsuka@gmail.com> Cc: Xiubo Li <Xiubo.Lee@gmail.com> Cc: Fabio Estevam <festevam@gmail.com> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: dapm: Add warnings for widget overwrite when adding routeZhiwei Jiang2019-02-021-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, in some complex cases, more than one widgets have same name and registed from differnt dapm context, and route add from another context too. When snd_soc_dapm_add_route, the previous registered widget will overwritten by the latest same name widget, will cause unexpect error. For Asoc framework we cant avoid this situation and we cant decide which widget that wanted with route. At least we can give users a notice. Signed-off-by: Zhiwei Jiang <qq282012236@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: dapm: Only power up active channels from a DAICharles Keepax2019-02-023-8/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently all widgets attached to a DAI link will be powered up when the DAI is active, however this may include routes that are not actually in use if there are unused channels available on the DAI. The macros for creating AIF widgets already include an entry for slot, it is proposed to change that to channel. The effective difference here being respresenting the logical channel index rather than the physical slot index. The CODECs currently using the slot entry on the DAPM_AIF macros are using it in a manner consistent with this, the CODECs not using it just have the field set to zero. A variable is added to snd_soc_dapm_widget to represent this channel index and then for each AIF widget attached to a DAI this is compared against the number of channels on the stream. Enabling the links for those which will be in use. This has the nice property that the CODECs which haven't used the slot/channel entry in the macro will function exactly as before due to all the AIF widgets having a channel of zero and a stream by definition having at least one channel. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: dapm: fix use-after-free issue with dailink snamePierre-Louis Bossart2019-02-021-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7620fe9161ce ("ASoC: topology: fix memory leak in soc_tplg_dapm_widget_create") fixed a memory leak issue, but additional tests and KASAN reports show a use-after-free in soc-dapm. The widgets are created with a kmemdup operating on a template. The "name" string is also duplicated, but the "sname" string is not. As a result, when the template is freed after widget creation, its sname string is still used. Fix by explicitly duplicating the "sname" string, and freeing it when required. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: add btcvsd driverKaiChieh Chuang2019-02-023-0/+1375
| | | | | | | | | | | | | | | | The driver function for transferring/receiving BT encoded data to/from BT firmware. Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: add documents for btcvsd driverKaiChieh Chuang2019-02-021-0/+24
| | | | | | | | | | | | | | document for btcvsd driver Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: arizona: Add channel numbers to AIFsCharles Keepax2019-02-025-158/+158
| | | | | | | | | | | | | | | | Set the channel number on each AIF widget to allow unused channels not to be powered up across AIFs. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rsnd: fixup TDM Split mode check for CTUKuninori Morimoto2019-02-021-13/+12Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renesas sound card need to judge that whether it is using "TDM Split mode". To judge it and for other purpose, it has rsnd_parse_connect_simple() and rsnd_parse_connect_graph(), but these are using different judgement policy for TDM Split mode. It is pointless and confusable. This patch add new rsnd_parse_tdm_split_mode() and use common judgement policy for simple-card/audio-graph. Without this patch, CTU will be judged as TDM Split mode on audio-graph card. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rsnd: synchronize connection check for simple-card/audio-graphKuninori Morimoto2019-02-021-8/+7Star
| | | | | | | | | | | | | | | | | | | | | | Current rsnd driver has below function to check connection rsnd_parse_connect_simple() rsnd_parse_connect_graph() But these have different parameters. This patch synchronize these for cleanup. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sprd: Add Spreadtrum audio DMA platfrom driverBaolin Wang2019-01-296-0/+589
| | | | | | | | | | | | | | | | | | The Spreadtrum DMA engine uses the link-list mode to support audio playback or capture, thus this patch adds audio DMA platform support for CPU DAI to trigger DMA link-list transfer. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | dt-bindings: ASoC: Add Spreadtrum DMA platform documentationBaolin Wang2019-01-291-0/+23
| | | | | | | | | | | | | | Add documentation for Spreadtrum DMA platform driver. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: topology: modify dapm route loading routine and add dapm route unloadingRanjani Sridharan2019-01-291-16/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct snd_soc_dapm_route has been modified to be a dynamic object so that it can be used to save driver specific data while parsing topology and clean up driver-specific data during driver unloading. This patch makes the following changes to accomplish the above: 1. Set the dobj member of snd_soc_dapm_route during the SOC_TPLG_PASS_GRAPH pass of topology parsing. 2. Add the remove_route() routine that will be called while removing all dynamic objects from the component driver. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: topology: add SND_SOC_DOBJ_GRAPH type for dapm routesRanjani Sridharan2019-01-292-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new dobj type SND_SOC_DOBJ_GRAPH for dapm routes and add snd_soc_dobj member to struct snd_soc_dapm_route. This enables device drivers to save driver specific data pertaining to dapm routes and also be able to clean up the data when the driver module is unloaded. Also, reorder the snd_soc_dobj_type types to align with matching topology header types. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: topology: fix memory leak in soc_tplg_dapm_widget_createBard liao2019-01-291-0/+3
| | | | | | | | | | | | | | | | | | template.sname and template.name are only freed when an error occur. They should be freed in the success return case, too. Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>