aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-08-05ALSA: hda: Add dma stop delay variableMohan Kumar1-0/+3
A variable dma_stop_delay is added as a new member in hdac_bus structure to avoid memory decode error incase DMA RUN bit is not disabled in the given timeout from snd_hdac_stream_sync function and followed by stream reset which results in memory decode error between reset set and clear operation. Signed-off-by: Mohan Kumar <mkumard@nvidia.com> Link: https://lore.kernel.org/r/20200805095221.5476-3-mkumard@nvidia.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-08-03Merge tag 'asoc-v5.9' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai10-73/+83
ASoC: Updates for v5.9 The biggest changes here one again come from Mormioto-san who has continued his dilligent work cleaning up long standing issues in the APIs, it's particularly nice to see the transition from digital_mute() to mute_stream() finally completed. There's also been a lot of work on the x86 code again, this time a big focus has been on cleaning up some issues identified by various static tests, and on the Freescale systems. Otherwise the biggest thing has been a lot of driver additions: - Convert users of digital_mute() to mute_stream(). - Simplify I/O helper functions. - Add a helper for getting the RTD from a substream. - Many, many fixes and cleanups to the x86 code. - New drivers for Freescale MQS and i.MX6sx, Intel KeemBay I2S, Maxim MAX98360A and MAX98373 Soundwire, several Mediatek boards, nVidia Tegra 186 and 210, RealTek RL6231, Samsung Midas and Aries boards (some of the first phones I worked on!) and TI J721e EVM.
2020-08-03Merge branch 'for-next' into for-linusTakashi Iwai6-26/+38
2020-07-31Merge remote-tracking branch 'asoc/for-5.9' into asoc-nextMark Brown10-73/+83
2020-07-31ASoC: core: Two step component registrationCezary Rojewski1-5/+3
Modify snd_soc_add_component so it calls snd_soc_component_initialize no longer and thus providing true two-step registration. Drivers may choose to change component's fields before actually adding it to ASoC subsystem. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20200731144146.6678-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-31ASoC: core: Simplify snd_soc_component_initialize declarationCezary Rojewski1-1/+1
Move 'name' field initialization responsibility back to snd_soc_component_initialize to prepare snd_soc_add_component function for being called separatelly as a second registration step. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20200731144146.6678-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-31ASoC: core: Relocate and expose snd_soc_component_initializeCezary Rojewski2-3/+3
To allow for two-step component registration, expose snd_soc_component_initialize function and move it back to soc-core.c. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20200731144146.6678-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23ASoC: soc-xxx: add asoc_substream_to_rtd()Kuninori Morimoto1-0/+2
Current soc-xxx are getting rtd from substream by rtd = substream->private_data; But, getting data from "private_data" is very unclear. This patch adds asoc_substream_to_rtd() macro which is easy to understand that rtd from substream. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wo2z0yve.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-20Merge series "ASoC: Intel: machine driver updates for 5.9" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:Mark Brown1-0/+1
Small patchset to harden the SoundWire machine driver, change bad HIDs, update PLL settings and avoid memory leaks. Given that the SoundWire core parts are not upstream it's probably not necessary to provide the patches to stable branches. Bard Liao (1): ASoC: Intel: sof_sdw_rt711: remove hard-coded codec name Kai Vehmanen (2): ASoC: Intel: sof_sdw: add support for systems without i915 audio ASoC: Intel: sof_sdw: avoid crash if invalid DSP topology loaded Libin Yang (1): ASoC: Intel: common: change match table ehl-rt5660 Pierre-Louis Bossart (1): ASoC: Intel: sof_sdw_rt711: remove properties in card remove Yong Zhi (1): ASoC: intel: board: sof_rt5682: Update rt1015 pll input clk freq sound/soc/intel/boards/sof_rt5682.c | 9 +++++- sound/soc/intel/boards/sof_sdw.c | 31 +++++++++++++------ sound/soc/intel/boards/sof_sdw_common.h | 2 ++ sound/soc/intel/boards/sof_sdw_hdmi.c | 6 ++++ sound/soc/intel/boards/sof_sdw_rt711.c | 17 +++++++++- .../intel/common/soc-acpi-intel-ehl-match.c | 2 +- 6 files changed, 54 insertions(+), 13 deletions(-) base-commit: 22e9b54307987787efa0ee534aa9e31982ec1161 -- 2.25.1
2020-07-20ASoC: soc-dai.h: drop a duplicated wordRandy Dunlap1-1/+1
Drop the repeated word "be" in a comment. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: alsa-devel@alsa-project.org Link: https://lore.kernel.org/r/20200719003307.21403-1-rdunlap@infradead.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-20ASoC: soc-dai: remove .digital_muteKuninori Morimoto1-1/+0
All drivers are now using .mute_stream. Let's remove .digital_mute. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/87h7u72dqz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-20ALSA: Replace the word "slave" in vmaster APITakashi Iwai2-23/+24
Follow the recent inclusive terminology guidelines and replace the word "slave" in vmaster API. I chose the word "follower" at this time since it seems fitting for the purpose. Note that the word "master" is kept in API, since it refers rather to audio master volume control. Also, while we're at it, a typo in comments is corrected, too. Link: https://lore.kernel.org/r/20200717154517.27599-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-07-19ALSA: Replace HTTP links with HTTPS onesAlexander A. Klimov2-2/+2
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Link: https://lore.kernel.org/r/20200719151705.59624-1-grandmaster@al2klimov.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-07-17Merge tag 'asoc-fix-v5.8-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai3-0/+4
ASoC: Fixes for v5.8 An awful lot of mostly small fixes here, mainly for x86 based platforms and the CODEC drivers mainly used on them. For the most part this is either minor device specific stuff which seems to come from detailed testing or robustness against errors which comes from people having done some fuzzing runs aginst the topology code.
2020-07-17ASoC: soc-dai.h: don't use discriminatory terms for commentKuninori Morimoto1-4/+4
soc-dai is using discriminatory terms for comment. This patch renames "slave" to "secondary", thus we can keep M/S initials. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875zam3bmk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16Merge series "ALSA: hda: export snd_hda_codec_cleanup()" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:Mark Brown1-0/+2
Hi, this small series is preparation for a set of bugfix ASoC patches addressing a memleak at module unload for the HDA codec wrapper. Instead of duplicating HDA code in ASoC tree, I chose to export more functionality from hda_codec.c so it can be (re)used in ASoC's hdac_hda.c. Full series: https://github.com/thesofproject/linux/pull/2252 Takashi and Mark, feedback is welcome on how to best handle this kind of series where I have dependent patches both in sound/pci/hda and in ASoC. For this series, I'm sending the patches separately and when/if first set is merged by Takashi, I'll route the ASoC patches via our usually SOF set to Mark. Kai Vehmanen (2): ALSA: hda: export snd_hda_codec_cleanup_for_unbind() ALSA: hda: fix snd_hda_codec_cleanup() documentation include/sound/hda_codec.h | 2 ++ sound/pci/hda/hda_codec.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) -- 2.27.0
2020-07-16Merge series "ASoC: fsl-asoc-card: Support hp and mic detection" from Shengjiu Wang <shengjiu.wang@nxp.com>:Mark Brown1-3/+3
Support hp and mic detection. Add a parameter for asoc_simple_init_jack. Shengjiu Wang (3): ASoC: simple-card-utils: Support configure pin_name for asoc_simple_init_jack ASoC: bindings: fsl-asoc-card: Support hp-det-gpio and mic-det-gpio ASoC: fsl-asoc-card: Support Headphone and Microphone Jack detection changes in v2: - Add more comments in third commit - Add Acked-by Nicolin. .../bindings/sound/fsl-asoc-card.txt | 3 + include/sound/simple_card_utils.h | 6 +- sound/soc/fsl/Kconfig | 1 + sound/soc/fsl/fsl-asoc-card.c | 77 ++++++++++++++++++- sound/soc/generic/simple-card-utils.c | 7 +- 5 files changed, 86 insertions(+), 8 deletions(-) -- 2.27.0
2020-07-16ASoC: simple-card-utils: Support configure pin_name for asoc_simple_init_jackShengjiu Wang1-3/+3
Currently the pin_name is fixed in asoc_simple_init_jack, but some driver may use a different pin_name. So add a new parameter in asoc_simple_init_jack for configuring pin_name. If this parameter is NULL, then the default pin_name is used. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1594822179-1849-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16ASoC: hdmi-codec: merge .digital_mute() into .mute_stream()Kuninori Morimoto1-1/+5
snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } For hdmi-codec, we need to update struct hdmi_codec_ops, and all its users in the same time. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/87d055xxj2.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16ASoC: soc-dai.c: add .no_capture_mute supportKuninori Morimoto1-0/+3
snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling "direction". We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } To prepare merging mute_stream()/digital_mute(), this patch adds .no_capture_mute support to emulate .digital_mute(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87eeplxxj7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16ALSA: hda: export snd_hda_codec_cleanup_for_unbind()Kai Vehmanen1-0/+2
To avoid duplicated code for cleanup, and match the already exported snd_hda_codec_pcm_new(), also export snd_hda_codec_cleanup_for_unbind(). Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200715174551.3730165-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08Merge series "ASoC: topology: fix error handling flow" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:Mark Brown1-0/+2
While experimenting and introducing errors in Baytrail topology files until I got them right, I encountered multiple kernel oopses and memory leaks. This is a first batch to harden the code, but we should probably think of a tool to fuzz the topology... Pierre-Louis Bossart (5): ASoC: topology: fix kernel oops on route addition error ASoC: topology: fix tlvs in error handling for widget_dmixer ASoC: topology: use break on errors, not continue ASoC: topology: factor kfree(se) in error handling ASoC: topology: add more logs when topology load fails. sound/soc/soc-topology.c | 97 ++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 39 deletions(-) base-commit: a5911ac5790acaf98c929b826b3f7b4a438f9759 -- 2.25.1
2020-07-08ASoC: soc-dai: set dai_link dpcm_ flags with a helperPierre-Louis Bossart1-0/+1
Add a helper to walk through all the DAIs and set dpcm_playback and dpcm_capture flags based on the DAIs capabilities, and use this helper to avoid setting these flags arbitrarily in generic cards. The commit referenced in the Fixes tag did not introduce the configuration issue but will prevent the card from probing when detecting invalid configurations. Fixes: b73287f0b0745 ('ASoC: soc-pcm: dpcm: fix playback/capture checks') Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Link: https://lore.kernel.org/r/20200707210439.115300-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07ASoC: core: Remove only the registered component in devm functionsMaxime Ripard1-0/+2
The ASoC devm_ functions that register a component (devm_snd_soc_register_component and devm_snd_dmaengine_pcm_register) will clean their component by running snd_soc_unregister_component. snd_soc_unregister_component will then remove all the components for the device that was used to register the component in the first place. However, some drivers register several components (such as a DAI and a dmaengine PCM) on the same device, and if the dmaengine PCM is registered first, then the DAI will be cleaned up first and snd_dmaengine_pcm_unregister will be called next. snd_dmaengine_pcm_unregister will then lookup the dmaengine PCM component on the device, and if there's one unregister that component and release its dmaengine channels. That doesn't happen in practice though since the first call to snd_soc_unregister_component removed all the components, so we never get the chance to release the dmaengine channels. In order to fix this, instead of removing all the components for a given device, we can simply remove the component that was registered in the first place. We should have the same number of component registration than we have components, so it should work just fine. Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://lore.kernel.org/r/20200707074237.287171-1-maxime@cerno.tech Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07ALSA: isa/gus: remove -Wmissing-prototypes warningsPierre-Louis Bossart1-0/+4
Fix W=1 warnings by adding prototypes to header file sound/isa/gus/gus_timer.c:141:6: warning: no previous prototype for ‘snd_gf1_timers_init’ [-Wmissing-prototypes] 141 | void snd_gf1_timers_init(struct snd_gus_card * gus) | ^~~~~~~~~~~~~~~~~~~ sound/isa/gus/gus_timer.c:177:6: warning: no previous prototype for ‘snd_gf1_timers_done’ [-Wmissing-prototypes] 177 | void snd_gf1_timers_done(struct snd_gus_card * gus) | ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200702193604.169059-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-07-07ALSA: compress: fix partial_drain completion stateVinod Koul1-1/+9
On partial_drain completion we should be in SNDRV_PCM_STATE_RUNNING state, so set that for partially draining streams in snd_compr_drain_notify() and use a flag for partially draining streams While at it, add locks for stream state change in snd_compr_drain_notify() as well. Fixes: f44f2a5417b2 ("ALSA: compress: fix drain calls blocking other compress functions (v6)") Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20200629134737.105993-4-vkoul@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-07-03ASoC: rt5670: Remove struct rt5670_platform_dataHans de Goede1-26/+0
platform_data is an obsolete concept, instead device_properties, set through e.g. device-tree, should be used. struct rt5670_platform_data is only used internally by the rt5670 codec driver, so lets remove it before someone starts relying on it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200703100823.258033-2-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29Merge branch 'for-5.8' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.9Mark Brown1-0/+1
2020-06-29ASoC: rt5670: Add new gpio1_is_ext_spk_en quirk and enable it on the Lenovo Miix 2 10Hans de Goede1-0/+1
The Lenovo Miix 2 10 has a keyboard dock with extra speakers in the dock. Rather then the ACL5672's GPIO1 pin being used as IRQ to the CPU, it is actually used to enable the amplifier for these speakers (the IRQ to the CPU comes directly from the jack-detect switch). Add a quirk for having an ext speaker-amplifier enable pin on GPIO1 and replace the Lenovo Miix 2 10's dmi_system_id table entry's wrong GPIO_DEV quirk (which needs to be renamed to GPIO1_IS_IRQ) with the new RT5670_GPIO1_IS_EXT_SPK_EN quirk, so that we enable the external speaker-amplifier as necessary. Also update the ident field for the dmi_system_id table entry, the Miix models are not Thinkpads. Fixes: 67e03ff3f32f ("ASoC: codecs: rt5670: add Thinkpad Tablet 10 quirk") Signed-off-by: Hans de Goede <hdegoede@redhat.com> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786723 Link: https://lore.kernel.org/r/20200628155231.71089-4-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25ASoC: dapm: declare missing structure prototypesTzung-Bi Shih1-0/+2
To fix compilation warnings: - struct 'snd_soc_pcm_runtime' declared inside parameter list will not be visible outside of this definition or declaration - struct 'soc_enum' declared inside parameter list will not be visible outside of this definition or declaration Declares the missing structure prototypes. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200625153543.85039-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25ASoC: core: move definition of enum snd_soc_bias_levelTzung-Bi Shih2-18/+18
To fix compilation error: - error: field 'XXX' has incomplete type Moves definition of enum snd_soc_bias_level from soc.h to soc-dapm.h. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200625153543.85039-2-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23ASoC: soc-link: introduce exit() callbackPierre-Louis Bossart2-0/+4
Some machine drivers allocate or request resources with snd_soc_link_init() phase of the card probe. These resources need to be properly released when removing a card, and this patch suggests a dual exit() callback. The exit() is invoked in soc_remove_pcm_runtime(), which is not completely symmetric with the init() invoked in soc_init_pcm_runtime(). Alternate solutions were considered, e.g. adding a .remove() callback for the platform driver, but that's not symmetrical at all and would be difficult to handle if there are more than one dailink implementing an .init(). We looked also into using .remove_dai_link() callback, but that would also be imbalanced. Note that because of the error handling in snd_soc_bind_card(), which jumps to probe_end, there is no way to guarantee the exit() is invoked with resources allocated in the init(). Prior to releasing those resources, implementations of the exit() callback shall check the resources are valid. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Curtis Malainey <curtis@malainey.com> Link: https://lore.kernel.org/r/20200622154241.29053-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22ASoC: remove snd_soc_component_read32()Kuninori Morimoto1-1/+0
No driver is using snd_soc_component_read32() anymore. This patch removes it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/877dw74mbv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32()Kuninori Morimoto1-3/+2
We had read/write function for Codec, Platform, etc, but these has been merged into snd_soc_component_read/write(). Internally, it is using regmap or driver function. In read case, each styles are like below regmap ret = regmap_read(..., reg, &val); driver function val = xxx->read(..., reg); Because of this kind of different style, to keep same read style, when we merged each read function into snd_soc_component_read(), we created snd_soc_component_read32(), like below. commit 738b49efe6c6 ("ASoC: add snd_soc_component_read32") (1) val = snd_soc_component_read32(component, reg); (2) ret = snd_soc_component_read(component, reg, &val); Many drivers are using snd_soc_component_read32(), and some drivers are using snd_soc_component_read() today. In generally, we don't check read function successes, because, we will have many other issues at initial timing if read function didn't work. Now we can use soc_component_err() when error case. This means, it is easy to notice if error occurred. This patch aggressively merge snd_soc_component_read() and _read32(), and makes snd_soc_component_read/write() as generally style. This patch do 1) merge snd_soc_component_read() and snd_soc_component_read32() 2) it uses soc_component_err() when error case (easy to notice) 3) keeps read32 for now by #define 4) update snd_soc_component_read() for all drivers Because _read() user drivers are not too many, this patch changes all user drivers. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/87sgev4mfl.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22Merge tag 'asoc-fix-v5.8-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linusTakashi Iwai2-0/+17
ASoC: Fixes for v5.8 This is a collection of mostly small fixes, mostly fixing fallout from some of the DPCM changes that went in last time around which shook out some issues on i.MX and Qualcomm platforms. The addition of a managed version of snd_soc_register_dai() is to fix resource leaks. There's also a few new device IDs for x86 systems.
2020-06-15Merge series "ASoC: soc-component: collect component functions" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:Mark Brown1-11/+18
Hi Mark We have soc-component.c now, but still many component related functions are implemented many place. This patch-set collect these into soc-component.c. v1 -> v2 - remove soc-compress.c exchange (But I have plan to repost it) - fixup loop break issue on some functions - direct return on some functions Link: https://lore.kernel.org/r/87a71nzhy2.wl-kuninori.morimoto.gx@renesas.com Kuninori Morimoto (12): ASoC: soc-component: add soc_component_pin() and share code ASoC: soc-component: move snd_soc_component_xxx_regmap() to soc-component ASoC: soc-component: move snd_soc_component_initialize() to soc-component.c ASoC: soc-component: add soc_component_err() ASoC: soc-component: add snd_soc_pcm_component_prepare() ASoC: soc-component: add snd_soc_pcm_component_hw_params() ASoC: soc-component: add snd_soc_pcm_component_hw_free() ASoC: soc-component: add snd_soc_pcm_component_trigger() ASoC: soc-component: add snd_soc_component_init() ASoC: soc-component: merge soc-io.c into soc-component.c ASoC: soc-component: merge soc_pcm_trigger_start/stop() ASoC: soc-component: tidyup Copyright include/sound/soc-component.h | 29 +- sound/soc/Makefile | 2 +- sound/soc/soc-component.c | 666 ++++++++++++++++++++++++---------- sound/soc/soc-core.c | 102 +----- sound/soc/soc-io.c | 202 ----------- sound/soc/soc-pcm.c | 114 ++---- 6 files changed, 531 insertions(+), 584 deletions(-) delete mode 100644 sound/soc/soc-io.c -- 2.17.1
2020-06-15ASoC: wm8960: Support headphone jack detection functionShengjiu Wang1-0/+17
Add two platform variables for headphone jack detection. "hp_cfg" is for configuration of heaphone jack detection. "gpio_cfg" is for configuration of gpio, the gpio is used for plug & unplug interrupt on SoC. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1591180013-12416-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: soc-component: tidyup CopyrightKuninori Morimoto1-1/+2
This patch add missing company copyright Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87eeqvw8w8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: soc-component: add snd_soc_component_init()Kuninori Morimoto1-0/+3
we wantn't to directly access to component related parameter as much as possible to keep encapsulation. This patch adds snd_soc_component_init() for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87img7w8x2.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: soc-component: add snd_soc_pcm_component_trigger()Kuninori Morimoto1-3/+2
We have 2 type of component functions snd_soc_component_xxx() is focusing to component itself, snd_soc_pcm_component_xxx() is focusing to rtd related component. Now we can update snd_soc_component_trigger() to snd_soc_pcm_component_trigger(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87k10nw8xf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: soc-component: add snd_soc_pcm_component_hw_free()Kuninori Morimoto1-2/+2
We have 2 type of component functions snd_soc_component_xxx() is focusing to component itself, snd_soc_pcm_component_xxx() is focusing to rtd related component. Now we can update snd_soc_component_hw_free() to snd_soc_pcm_component_hw_free(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87lfl3w8xv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: soc-component: add snd_soc_pcm_component_hw_params()Kuninori Morimoto1-3/+3
We have 2 type of component functions snd_soc_component_xxx() is focusing to component itself, snd_soc_pcm_component_xxx() is focusing to rtd related component. Now we can update snd_soc_component_hw_params() to snd_soc_pcm_component_hw_params(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87mu5jw8y8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: soc-component: add snd_soc_pcm_component_prepare()Kuninori Morimoto1-2/+1
We have 2 type of component functions snd_soc_component_xxx() is focusing to component itself, snd_soc_pcm_component_xxx() is focusing to rtd related component. Now we can update snd_soc_component_prepare() to snd_soc_pcm_component_prepare(). This patch do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87o8pzw8yl.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: soc-component: move snd_soc_component_initialize() to soc-component.cKuninori Morimoto1-0/+4
snd_soc_component_xxx() should be implemented at soc-component.c Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87r1uvw8zb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: soc-component: move snd_soc_component_xxx_regmap() to soc-componentKuninori Morimoto1-0/+1
soc-component is handling snd_soc_component_xxx(). Move snd_soc_component_xxx_regmap() to it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87sgfbw8zl.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ALSA: memalloc: Make SG-buffer helper usable for continuous buffer, tooTakashi Iwai1-1/+8
We have a few helper functions for making the access to the buffer address easier on SG-buffer. Those are specific to the buffer that is allocated with SG-buffer type, and it makes hard to use both SG and non-SG buffers in the same code. This patch adds a few simple checks and lets the helpers to deal with both SG- and continuous buffers gracefully. It's a preliminary step for the upcoming patch that mimics the buffer type on the fly. Link: https://lore.kernel.org/r/20200615160045.2703-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-06-15Merge existing fixes from asoc/for-5.8Mark Brown2-0/+17
2020-06-15ASoC: soc-devres: add devm_snd_soc_register_dai()Pierre-Louis Bossart1-0/+4
The registration of DAIs may be done at two distinct times, once during a component registration and later when loading a topology. Since devm_ managed resources are freed in the reverse order they were allocated, when a component starts unregistering DAIs by walking through the DAI list, the memory allocated for the topology-registered DAIs was freed already, which leads to 100% reproducible KASAN use-after-free reports. This patch suggests a new devm_ function to force the DAI list to be updated prior to freeing the memory chunks referenced by the list pointers. Suggested-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> BugLink: https://github.com/thesofproject/linux/issues/2186 Link: https://lore.kernel.org/r/20200612205938.26415-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-12ASoC: dmaengine_pcm: export soc_component_to_pcmShengjiu Wang1-0/+11
In DPCM case, Front-End needs to get the dma chan which has been requested by Back-End and reuse it. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/429c6ae1f3c5b47eb893f475d531d71cdcfe34c0.1591947428.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-12ASoC: soc-card: export snd_soc_lookup_component_nolockedShengjiu Wang1-0/+2
snd_soc_lookup_component_nolocked can be used for the DPCM case that Front-End needs to get the unused platform component but added by Back-End cpu dai driver. If the component is gotten, then we can get the dma chan created by Back-End component and reused it in Front-End. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/55f6e0d76f67a517b9a44136d790ff2a06b5caa8.1591947428.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>