aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/haswell (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-10-08ASoC: intel: sst-haswell-pcm: remove snd_pcm_opsKuninori Morimoto1-27/+35
snd_pcm_ops is no longer needed. Let's use component driver callback. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87pnjfaf2u.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-13ASoC: Intel: hsw: remove i386 build warning w/ size_t argumentPierre-Louis Bossart1-2/+2
Recent changes in the common IPC code introduced a build warning with size_t fields, use the correct %zu format. include/linux/dynamic_debug.h:82:16: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' [-Wformat=] Fixes: abf31feea26c0 ('ASoC: Intel: Update request-reply IPC model') Reported-by: kbuild test robot <lkp@intel.com> Cc: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-By: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20190812140305.17570-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-07ASoC: Intel: Update request-reply IPC modelCezary Rojewski1-76/+88
struct ipc_message contains fields: header, tx_data and tx_size which represent TX i.e. request while RX is represented by rx_data and rx_size with reply's header equivalent missing. Reply header may contain some vital information including, but not limited to, received payload size. Some IPCs have entire payload found within RX header instead. Content and value of said header is context dependent and may vary between firmware versions and target platform. Current model does not allow such IPCs to function at all. Rather than appending yet another parameter to an already long list of such for sst_ipc_tx_message_XXXs, declare message container in form of struct sst_ipc_message and add them to parent's ipc_message declaration. Align haswell, baytrail and skylake with updated request-reply model and modify their reply processing functions to save RX header within message container. Despite the range of changes, status quo is achieved. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20190723144341.21339-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174Thomas Gleixner4-40/+4
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner1-0/+1
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-19ASoC: Intel: Haswell: Remove set but not used variable 'stage_type'YueHaibing1-7/+1
Fixes gcc '-Wunused-but-set-variable' warning: sound/soc/intel/haswell/sst-haswell-ipc.c: In function 'hsw_stream_message': sound/soc/intel/haswell/sst-haswell-ipc.c:669:29: warning: variable 'stage_type' set but not used [-Wunused-but-set-variable] It is never used since introduction in commit ba57f68235cf ("ASoC: Intel: create haswell folder and move haswell platform files in") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08Merge tag 'asoc-v5.1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-nextTakashi Iwai2-3/+3
ASoC: Updates for v5.1 Lots and lots of new drivers so far, a highlight being the MediaTek BTCVSD which is a driver for a Bluetooth radio chip - the first such driver we've had upstream. Hopefully we will soon also see a baseband with an upstream driver! - Support for only powering up channels that are actively being used. - Quite a few improvements to simplify the generic card drivers, especially the merge of the SCU cards into the main generic drivers. - Lots of fixes for probing on Intel systems, trying to rationalize things to look more standard from a framework point of view. - New drivers for Asahi Kasei Microdevices AK4497, Cirrus Logic CS4341, Google ChromeOS embedded controllers, Ingenic JZ4725B, MediaTek BTCVSD, MT8183 and MT6358, NXP MICFIL, Rockchip RK3328, Spreadtrum DMA controllers, Qualcomm WCD9335, Xilinx S/PDIF and PCM formatters.
2019-02-06ASoC: intel: Drop superfluous PCM preallocation error checksTakashi Iwai1-8/+2
snd_pcm_lib_preallocate_pages() and co always succeed, so the error check is simply redundant. Drop it. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-01-03ASoC: Intel: Haswell: assign booleans to true/falsePierre-Louis Bossart2-2/+2
Detected with Coccinelle Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: Intel: Haswell: remove unneeded semicolonPierre-Louis Bossart1-1/+1
Detected with Coccinelle Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-25ASoC: Intel: Haswell: fix endianness handlingPierre-Louis Bossart1-24/+29
Make all Sparse warnings go away by using le16/32_to_cpu. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12ASoC: intel: haswell: replace platform to componentKuninori Morimoto2-66/+54
Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-14ASoC: Intel: make snd_soc_platform_driver constBhumika Goyal1-1/+1
Make these const as they are only passed as the 2nd argument to the function snd_soc_register_platform, which is of type const. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-27ASoC: intel: remove unused variable data and associated codeColin Ian King1-6/+0
The variable 'data' is assigned null and never re-assigned. There is also a redundant check for data being non-null which is always false, so remove this and the variable data and dma_addr as they are not used once the dead code has been removed. Detected with CoverityScan, CID#1324015 ("'Constant' variable gaurds dead code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-30ASoC: intel: Replace kthread with workTakashi Iwai1-2/+1
The usage pattern of kthread worker in Intel SST drivers can be replaced gracefully with the normal workqueue, which is more light- weight and easier to manage in general. Let's do it. While in the replacement, move the schedule_work() call inside the spinlock for excluding the race, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Tested-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-11kthread: kthread worker API cleanupPetr Mladek1-1/+1
A good practice is to prefix the names of functions by the name of the subsystem. The kthread worker API is a mix of classic kthreads and workqueues. Each worker has a dedicated kthread. It runs a generic function that process queued works. It is implemented as part of the kthread subsystem. This patch renames the existing kthread worker API to use the corresponding name from the workqueues API prefixed by kthread_: __init_kthread_worker() -> __kthread_init_worker() init_kthread_worker() -> kthread_init_worker() init_kthread_work() -> kthread_init_work() insert_kthread_work() -> kthread_insert_work() queue_kthread_work() -> kthread_queue_work() flush_kthread_work() -> kthread_flush_work() flush_kthread_worker() -> kthread_flush_worker() Note that the names of DEFINE_KTHREAD_WORK*() macros stay as they are. It is common that the "DEFINE_" prefix has precedence over the subsystem names. Note that INIT() macros and init() functions use different naming scheme. There is no good solution. There are several reasons for this solution: + "init" in the function names stands for the verb "initialize" aka "initialize worker". While "INIT" in the macro names stands for the noun "INITIALIZER" aka "worker initializer". + INIT() macros are used only in DEFINE() macros + init() functions are used close to the other kthread() functions. It looks much better if all the functions use the same scheme. + There will be also kthread_destroy_worker() that will be used close to kthread_cancel_work(). It is related to the init() function. Again it looks better if all functions use the same naming scheme. + there are several precedents for such init() function names, e.g. amd_iommu_init_device(), free_area_init_node(), jump_label_init_type(), regmap_init_mmio_clk(), + It is not an argument but it was inconsistent even before. [arnd@arndb.de: fix linux-next merge conflict] Link: http://lkml.kernel.org/r/20160908135724.1311726-1-arnd@arndb.de Link: http://lkml.kernel.org/r/1470754545-17632-3-git-send-email-pmladek@suse.com Suggested-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Petr Mladek <pmladek@suse.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Borislav Petkov <bp@suse.de> Cc: Michal Hocko <mhocko@suse.cz> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-09-12ASoC: constify snd_pcm_ops structuresJulia Lawall1-1/+1
Check for snd_pcm_ops structures that are only stored in the ops field of a snd_soc_platform_driver structure or passed as the third argument to snd_pcm_set_ops. The corresponding field or parameter is declared const, so snd_pcm_ops structures that have this property can be declared as const also. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct snd_pcm_ops i@p = { ... }; @ok1@ identifier r.i; struct snd_soc_platform_driver e; position p; @@ e.ops = &i@p; @ok2@ identifier r.i; expression e1, e2; position p; @@ snd_pcm_set_ops(e1, e2, &i@p) @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; struct snd_pcm_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct snd_pcm_ops i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-14ASoC: Intel: Fix conflicting pcm dev drvdata on haswellBen Zhang1-1/+0
soc-core sets the snd_soc_pcm_runtime->dev drvdata to snd_soc_pcm_runtime in soc_post_component_init, and access it in places like codec_reg_show. hsw_pcm_open overwrites the drvdata to point to hsw_pcm_data, confusing soc-core, and causing crashes when cat /sys/devices/pci0000:00/INT3438:00/.../System PCM/codec_reg This patch removes the set in hsw_pcm_open since it's no longer used. commit 7ff9d6714a5c ("ASoC: Intel: Split hsw_pcm_data for playback and capture") already removed all calls to snd_soc_pcm_get_drvdata(rtd). Signed-off-by: Ben Zhang <benzh@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-11ASoC: Intel: Fix printk formattingJoonas Lahtinen1-1/+1
Format number after 0x in hex. Cc: Jie Yang <yang.jie@linux.intel.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> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-06ASoC: Intel: sst: fix a loop timeout in sst_hsw_stream_reset()Dan Carpenter1-1/+1
In the original code we ended the loop with tries set to -1 instead of zero. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-14ASoC: Intel: sst: fix the IRQ locked issueLiam Girdwood1-18/+13
If driver received a message that it can't handle, it won't clear the corresponding bit and unmask interrupt, this may lock the IRQ and DSP can't send message anymore. To fix the issue, we should Always update IMRX after IPC. Here we always clear the DONE/BUSY bit and unmask the IRQ source, even when IPC failures have occurred previously. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Modified-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-16ASoC: Intel: constify sst_block_ops structuresJulia Lawall1-1/+1
The sst_block_ops structure is never modified, and is thus declared as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-23Merge remote-tracking branches 'asoc/fix/davinci', 'asoc/fix/doc', 'asoc/fix/fsl-card', 'asoc/fix/fsl-ssi', 'asoc/fix/intel' and 'asoc/fix/maintainers' into asoc-linusMark Brown1-8/+12
2015-09-09ASoC: intel: Fix SSP port configuration after RTD3 resume.Liam Girdwood1-8/+12
Currently the SSP port settings are being clobbered as part of the DSP RTD3 restore logic. make sure we save the correct params and restore them at resume. The FW sadly does not save SSP settings as part of the PM context. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-29ASoC: Intel: haswell: fix initialize 'NULL device *' issueJie Yang1-0/+2
Add initialization for sst_hsw.dev at init stage, which fix the 'NULL device *' warning issues. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-08ASoC: intel: Remove unused variable hswTakashi Iwai1-1/+0
The recent fix left a variable declaration without usage. sound/soc/intel/haswell/sst-haswell-pcm.c:1349:18: warning: unused variable ‘hsw’ [-Wunused-variable] Fixes: edd8ed496b98 ('ASoC: Intel: handle haswell pcm suspend including runtime modules freeing') Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-02ASoC: Intel: handle haswell pcm suspend including runtime modules freeingJie Yang1-6/+16
It needs free pcm runtime modules before unloading firmware, here add hsw_pcm_suspend() to handle this procedure: suspends firmware ==> frees runtime modules ==> unloads firmware. This fixes the broadwell module unload failed issue. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02ASoC: Intel: check and clear runtime module pointerJie Yang1-2/+7
Add check runtime module pointers before freeing them, and clear them to NULL after freed. With this implemented, we can avoid NULL pointer dereference or double free errors. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02ASoC: intel: Revert "ASoC: Intel: fix broadwell module removing failed issue"Jie Yang1-3/+1
This reverts commit 01f202c7b4b40025f3ea4721c52e7f78545e3b07. We shouldn't leave the device as suspended state after module freed, it is not good to do runtime suspend at driver free, here revert this fixing, and replace it with the procedure: suspends firmware ==> frees runtime modules ==> unloads firmware. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-02ASoC: intel: Revert "ASoC: Intel: remove unused function hsw_pcm_free_modules()"Jie Yang1-0/+15
This reverts commit 506c148ee5e1bfb836116353305927ca4c21a23e. We still need this hsw_pcm_free_modules(), we plan to remove the runtime modules at both fw_unload(D0->D3) and snd_soc_sst_haswell_pcm module removing. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-28ASoC: Intel: fix broadwell module removing failed issueLiam Girdwood1-1/+3
In haswell-pcm module unloading, we can't free runtime modules directly, for they may be already freed in runtime suspend. Here add executing suspend call to unload runtime modules, only for status not equal to RPM_SUSPEND, to fix broadwell module removing failed issue. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-28ASoC: Intel: remove unused function hsw_pcm_free_modules()Jie Yang1-15/+0
Remove the unused function hsw_pcm_free_modules() to fix the compling warning: sound/soc/intel/haswell/sst-haswell-pcm.c:923:13: warning: 'sw_pcm_free_modules' defined but not used [-Wunused-function] static void hsw_pcm_free_modules(struct hsw_priv_data *pdata) Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22ASoC: Intel: Initialize max mailbox size for haswellSubhransu S. Prusty1-0/+3
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-22ASoC: Intel: Move the busy check to ops for HSWSubhransu S. Prusty1-0/+9
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27ASoC: Intel: Remove invalid kfree of devm allocated dataJin Yao1-1/+0
kbuild robot reports following warning: "sound/soc/intel/haswell/sst-haswell-ipc.c:2204:1-6: WARNING: invalid free of devm_ allocated data" As julia explains to me, the memory allocated with devm_kalloc is freed automatically on failure of a probe function. So this kfree should be removed otherwise the double free will be got in error handler path. Signed-off-by: Jin Yao <yao.jin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-12ASoC: Intel: fix array_size.cocci warningskbuild test robot1-1/+1
sound/soc/intel/haswell/sst-haswell-ipc.c:646:28-29: WARNING: Use ARRAY_SIZE Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element Semantic patch information: This makes an effort to find cases where ARRAY_SIZE can be used such as where there is a division of sizeof the array by the sizeof its first element or by any indexed element or the element type. It replaces the division of the two sizeofs by ARRAY_SIZE. Generated by: scripts/coccinelle/misc/array_size.cocci CC: Jie Yang <yang.jie@intel.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-10ASoC: Intel: Use the generic IPC/mailbox APIs in BroadwellJin Yao1-295/+87
Use the generic IPC/mailbox APIs to replace the original processing code for Broadwell platform. Signed-off-by: Jin Yao <yao.jin@linux.intel.com> Acked-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-08ASoC: Intel: Fix a buffer overflow issueJie Yang1-1/+1
0day robot reported a buffer overflow issue: ... sound/soc/intel/haswell/sst-haswell-pcm.c:1107 hsw_pcm_probe() error: buffer\ overflow 'hsw_dais' 4 <= 4 sound/soc/intel/haswell/sst-haswell-pcm.c:1109 hsw_pcm_probe() error: buffer\ overflow 'hsw_dais' 4 <= 4 ... Fix it by initializing the index(i) to correct value. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-06ASoC: Intel: create haswell folder and move haswell platform files inJie Yang5-0/+5080
Restructure the sound/soc/intel/ directory: create haswell folder, and move haswell platform files here. Signed-off-by: Jie Yang <yang.jie@intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>