summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/atom
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: intel: Fix crash at suspend/resume after failed codec registrationGuenter Roeck2019-03-251-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If codec registration fails after the ASoC Intel SST driver has been probed, the kernel will Oops and crash at suspend/resume. general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 1 PID: 2811 Comm: cat Tainted: G W 4.19.30 #15 Hardware name: GOOGLE Clapper, BIOS Google_Clapper.5216.199.7 08/22/2014 RIP: 0010:snd_soc_suspend+0x5a/0xd21 Code: 03 80 3c 10 00 49 89 d7 74 0b 48 89 df e8 71 72 c4 fe 4c 89 fa 48 8b 03 48 89 45 d0 48 8d 98 a0 01 00 00 48 89 d8 48 c1 e8 03 <8a> 04 10 84 c0 0f 85 85 0c 00 00 80 3b 00 0f 84 6b 0c 00 00 48 8b RSP: 0018:ffff888035407750 EFLAGS: 00010202 RAX: 0000000000000034 RBX: 00000000000001a0 RCX: 0000000000000000 RDX: dffffc0000000000 RSI: 0000000000000008 RDI: ffff88805c417098 RBP: ffff8880354077b0 R08: dffffc0000000000 R09: ffffed100b975718 R10: 0000000000000001 R11: ffffffff949ea4a3 R12: 1ffff1100b975746 R13: dffffc0000000000 R14: ffff88805cba4588 R15: dffffc0000000000 FS: 0000794a78e91b80(0000) GS:ffff888068d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007bd5283ccf58 CR3: 000000004b7aa000 CR4: 00000000001006e0 Call Trace: ? dpm_complete+0x67b/0x67b ? i915_gem_suspend+0x14d/0x1ad sst_soc_prepare+0x91/0x1dd ? sst_be_hw_params+0x7e/0x7e dpm_prepare+0x39a/0x88b dpm_suspend_start+0x13/0x9d suspend_devices_and_enter+0x18f/0xbd7 ? arch_suspend_enable_irqs+0x11/0x11 ? printk+0xd9/0x12d ? lock_release+0x95f/0x95f ? log_buf_vmcoreinfo_setup+0x131/0x131 ? rcu_read_lock_sched_held+0x140/0x22a ? __bpf_trace_rcu_utilization+0xa/0xa ? __pm_pr_dbg+0x186/0x190 ? pm_notifier_call_chain+0x39/0x39 ? suspend_test+0x9d/0x9d pm_suspend+0x2f4/0x728 ? trace_suspend_resume+0x3da/0x3da ? lock_release+0x95f/0x95f ? kernfs_fop_write+0x19f/0x32d state_store+0xd8/0x147 ? sysfs_kf_read+0x155/0x155 kernfs_fop_write+0x23e/0x32d __vfs_write+0x108/0x608 ? vfs_read+0x2e9/0x2e9 ? rcu_read_lock_sched_held+0x140/0x22a ? __bpf_trace_rcu_utilization+0xa/0xa ? debug_smp_processor_id+0x10/0x10 ? selinux_file_permission+0x1c5/0x3c8 ? rcu_sync_lockdep_assert+0x6a/0xad ? __sb_start_write+0x129/0x2ac vfs_write+0x1aa/0x434 ksys_write+0xfe/0x1be ? __ia32_sys_read+0x82/0x82 do_syscall_64+0xcd/0x120 entry_SYSCALL_64_after_hwframe+0x49/0xbe In the observed situation, the problem is seen because the codec driver failed to probe due to a hardware problem. max98090 i2c-193C9890:00: Failed to read device revision: -1 max98090 i2c-193C9890:00: ASoC: failed to probe component -1 cht-bsw-max98090 cht-bsw-max98090: ASoC: failed to instantiate card -1 cht-bsw-max98090 cht-bsw-max98090: snd_soc_register_card failed -1 cht-bsw-max98090: probe of cht-bsw-max98090 failed with error -1 The problem is similar to the problem solved with commit 2fc995a87f2e ("ASoC: intel: Fix crash at suspend/resume without card registration"), but codec registration fails at a later point. At that time, the pointer checked with the above mentioned commit is already set, but it is not cleared if the device is subsequently removed. Adding a remove function to clear the pointer fixes the problem. Cc: stable@vger.kernel.org Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com> Cc: Curtis Malainey <cujomalainey@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'asoc-v5.1' of ↵Takashi Iwai2019-02-085-23/+30
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next 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.
| * Merge tag 'asoc-fix-v5.0-rc2' into asoc-5.1Mark Brown2019-01-181-1/+7
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASoC: Fixes for v5.0 Quite a big batch of fixes here. There's a couple of things going on, the main one is that we found some issues with not deferring probe when we should, causing us to skip some driver initialization. The fixes for this then in turn exposed some issues with how we were searching for components which had previously gone unnoticed due to the original issue. There's also been the normal driver specific stuff and there's been what looks like several batches of automated scanning for issues which have generated quite a large set of smaller fixes for potential crashes and missed error handling.
| * | ASoC: Intel: sst: Fallback to BYT-CR if IRQ 5 is missingStephan Gerhold2019-01-041-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices detected as BYT-T by the PMIC-type based detection have only a single IRQ listed in the 80860F28 ACPI device. This causes -ENXIO later when attempting to get the IRQ at index 5. It turns out these devices behave more like BYT-CR devices, and using the IRQ at index 0 makes sound work correctly. This patch adds a fallback for these devices to is_byt_cr(): If there is no IRQ resource at index 5, treating the device as BYT-T is guaranteed to fail later, so we can safely treat these devices as BYT-CR without breaking any working device. Link: http://mailman.alsa-project.org/pipermail/alsa-devel/2018-December/143176.html Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: Intel: sst: Simplify is_byt_cr()Stephan Gerhold2019-01-041-19/+14Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is_byt_cr() and its usage can be simplified by returning the bool directly, instead of through a pointer. This works because the return value is just treated as bytcr = false and is not used otherwise. This patch also removes the extra check of IS_ENABLED(CONFIG_IOSF_MBI) in favor of checking iosf_mbi_available() directly. The header already takes care of returning false if the config option is not enabled. No functional change. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: Intel: Atom: simplify boolean testsPierre-Louis Bossart2019-01-035-5/+5
| | | | | | | | | | | | | | | | | | | | | Detected with Coccinelle Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: intel: Drop superfluous PCM preallocation error checksTakashi Iwai2019-02-061-7/+2Star
| |/ |/| | | | | | | | | | | | | | | 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>
* | ASoC: atom: fix a missing check of snd_pcm_lib_malloc_pagesKangjie Lu2019-01-071-1/+7
|/ | | | | | | | | | snd_pcm_lib_malloc_pages() may fail, so let's check its status and return its error code upstream. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* ASoC: Intel: remove GFP_ATOMIC, use GFP_KERNELPierre-Louis Bossart2018-11-061-2/+2
| | | | | | | | | | | | GFP_ATOMIC is not required on any Intel drivers, use GFP_KERNEL instead. A first cleanup was merged in April but missed a number occurrences and new ones were added by copy/paste inertia. While we are at it, make checkpatch happy with a sizeof(*msg) Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: use standard interface for Atom machine driversPierre-Louis Bossart2018-11-061-0/+4
| | | | | | | | | | | Don't rely on internal Atom/SST-specific data structures, use generic interface to let other drivers use the same machine drivers as is, e.g. SOF to support BYT-CR devices Tested-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: mrfld: fix uninitialized variable accessArnd Bergmann2018-11-051-4/+4
| | | | | | | | | | | | | | | | | | | Randconfig testing revealed a very old bug, with gcc-8: sound/soc/intel/atom/sst/sst_loader.c: In function 'sst_load_fw': sound/soc/intel/atom/sst/sst_loader.c:357:5: error: 'fw' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (fw == NULL) { ^ sound/soc/intel/atom/sst/sst_loader.c:354:25: note: 'fw' was declared here const struct firmware *fw; We must check the return code of request_firmware() before we look at the pointer result that may be uninitialized when the function fails. Fixes: 9012c9544eea ("ASoC: Intel: mrfld - Add DSP load and management") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: add for_each_card_rtds() macroKuninori Morimoto2018-09-201-2/+2
| | | | | | | | To be more readable code, this patch adds new for_each_card_rtds() macro, and replace existing code to it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: Atom: fix inversion between __iowrite32 and __ioread32Pierre-Louis Bossart2018-07-251-3/+3
| | | | | | | | | | | This looks like a copy/paste issue, but clearly there is an inversion that is obvious when checking the arguments. Detected with Sparse - now that we have fewer warnings this one was easy to find. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: Atom: simplify iomem address and castsPierre-Louis Bossart2018-07-251-14/+15
| | | | | | | Simplify code and add relevant casts to make Sparse warnings go away Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'topic/component-platform' of ↵Mark Brown2018-03-014-44/+32Star
|\ | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel
| * ASoC: intel: atom: replace platform to componentKuninori Morimoto2018-02-124-44/+32Star
| | | | | | | | | | | | | | | | Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: "Kp, Jeeja" <jeeja.kp@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: sst: Free streams on suspend, re-alloc on resumeHans de Goede2018-03-014-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Bay Trail SST-DSP firmware version looses track of all streams over a suspend/resume, failing any attempts to resume and/or free streams, with a SST_ERR_INVALID_STREAM_ID error. This commit adds support for free-ing the streams on suspend and re-allocating them on resume, fixing suspend/resume issues on devices using this firmware version. This new behavior gets triggered by a new flag in sst_platform_info which only gets set on Bay Trail platforms. This has been tested on the following devices: -Asus T100TA, Bay Trail + ALC5642 codec -Ployer MOMO7W, Bay Trail CR + ALC5652 codec Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: sst: Add sst_realloc_stream() functionHans de Goede2018-03-012-35/+56
| | | | | | | | | | | | | | | | | | | | | | | | Move the struct snd_sst_alloc_mrfld alloc parameters from the stack into struct stream_info and add a new sst_realloc_stream() function which can re-alloc a stream with the same parameters as before. This is a preparation patch for fixing suspend/resume issues with some SST / DSP firmware versions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: sst: Remove unused STREAM_DECODE and STREAM_RESET statesHans de Goede2018-03-012-22/+1Star
| | | | | | | | | | | | | | | | STREAM_DECODE is completely unused, status == STREAM_RESET was checked for, but never set, remove both. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: sst: Remove unnecessary sst_init_stream() functionHans de Goede2018-03-013-12/+2Star
| | | | | | | | | | | | | | | | sst_init_stream() has only one caller and all its function arguments are unused. Inline it on the one call site and remove it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: sst: Remove 2 unused members from stream_info structHans de Goede2018-03-012-8/+0Star
| | | | | | | | | | | | | | | | | | | | Remove the unused ops and str_id members from the stream_info struct. While at it also remove some kernel-doc comments for members which have already been removed in the past. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: sst: Fix error-code check in sst_pause_stream()Hans de Goede2018-03-011-1/+1
|/ | | | | | | | | The value returned by sst_prepare_and_post_msg() is a negated SST_ERR_* value, so we must check for -SST_ERR_INVALID_STREAM_ID. Note that sst_pause_resume() already has the correct check. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: sst: Fix some styleChristophe JAILLET2018-01-081-3/+3
| | | | | | | | | | This patch fixes 3 small issues: - missing 2nd '*' at the beginning of a doxygen comment - extra space after a '\n' in a dev_dbg message - extra tab before a 'return" statement Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: sst: Fix the return value of 'sst_send_byte_stream_mrfld()'Christophe JAILLET2018-01-081-1/+1
| | | | | | | | | | | In some error handling paths, an error code is assiegned to 'ret'. However, the function always return 0. Fix it and return the error code if such an error paths is taken. Fixes: 3d9ff34622ba ("ASoC: Intel: sst: add stream operations") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'fix/intel' of ↵Mark Brown2018-01-082-0/+2
|\ | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel
| * Merge remote-tracking branch 'asoc/topic/intel' into asoc-nextMark Brown2017-11-105-293/+25Star
| |\
| * | License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman2017-11-022-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | ASoC: intel: sst: Handle return value of platform_get_irqArvind Yadav2017-12-011-0/+3
| |/ |/| | | | | | | | | | | platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: move all ACPI match tables to common modulePierre-Louis Bossart2017-10-211-292/+19Star
| | | | | | | | | | | | | | | | | | | | | | | | First step of cleaning, move all tables to soc-acpi-intel-match module. The tables remain in separate files per platform to keep them manageable. Skylake+ platforms are still handled elsewhere since there is no conflict with SOF for now, but this will have to be handled at a later point. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: move ACPI common code out of Intel/sst treePierre-Louis Bossart2017-10-211-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ACPI support is not specific to the Intel/SST driver. Move the enumeration and matching code which is not hardware-dependent to sound/soc and rename relevant sst_acpi_ structures and functions with snd_soc_acpi_ prefix soc-acpi.h is protected by a #ifndef __LINUX_SND_SOC_ACPI_H for consistency with all other SoC .h files: grep -L __LINUX include/sound/soc* | wc -l 0 grep __LINUX include/sound/soc* | wc -l 14 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: intel: Kill BUG_ON() usageTakashi Iwai2017-09-202-2/+0Star
| | | | | | | | | | | | | | | | | | Don't use BUG_ON() for a non-critical sanity check on production systems. This patch either removes useless BUG_ON() calls. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: Atom: Remove unneeded linux/miscdevice.h includeCorentin LABBE2017-09-191-1/+0Star
| | | | | | | | | | | | | | | | No file in sound/soc/intel/ use any miscdevice. This patch remove this uncessary include. Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: atom: use cht_bsw_max98090 for Baytrail ChromebooksPierre-Louis Bossart2017-09-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Baytrail Chromebooks used to be managed with legacy driver which is not compatible with atom/sst drivers. Reuse CHT driver to handle max98098 codec and allow distributions to support all Atom platforms with the same build. The legacy byt-max98090 can still be used but in a build for Baytrail+max98090 only. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: atom: make sst_platform_compr_ops constBhumika Goyal2017-09-192-2/+2
|/ | | | | | | | | Make this const as it not modified in the file referencing it. It only stored in the const field 'compr_ops' of a snd_soc_platform_driver structure. Also, add const to the declaration in the header file. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: Atom: make snd_pcm_hardware constBhumika Goyal2017-08-171-1/+1
| | | | | | | | Make this const as it is only used in a copy operation. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: constify snd_compr_codec_caps structuresJulia Lawall2017-08-161-2/+2
| | | | | | | | | | These snd_compr_codec_caps structures are only copied into other structures, so they can be const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: make snd_soc_platform_driver constBhumika Goyal2017-08-141-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>
* ASoC: Intel: constify pci_device_id.Arvind Yadav2017-08-041-1/+1
| | | | | | | | | pci_device_id are not supposed to change at runtime. All functions working with pci_device_id provided by <linux/pci.h> work with const pci_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: Atom: constify snd_soc_dai_ops structuresGustavo A. R. Silva2017-07-171-3/+3
| | | | | | | | | These structures are only stored in the ops field of a snd_soc_dai_driver structure. That field is declared const, so snd_soc_dai_ops structures that have this property can be declared as const also. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: intel: Use kvzalloc() for suspend buffersTakashi Iwai2017-06-162-15/+15
| | | | | | | | | | | Intel SST driver allocates lots of pages at suspend for saving the firmware states, and this may occasionally lead to the allocation error due to the high order, ending up with the suspend failure. Use kvzalloc() so that it can fall back to vmalloc() gracefully. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: add machine driver for BYT/CHT + ES8316Daniel Drake2017-06-131-0/+7
| | | | | | | | | | | | Add new machine driver, tested with Weibu F3C MiniPC. Based heavily on code provided by David Yang @ Everest, and other machine drivers in the same directory. Signed-off-by: David Yang <yangxiaohua@everest-semi.com> [drake@endlessm.com: cleanups and modernization] Signed-off-by: Daniel Drake <drake@endlessm.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: sst: Delete sst_shim_regs64; saved regs are never usedDouglas Anderson2017-06-063-55/+0Star
| | | | | | | | | | | | | | | | | | | | | | | In commit 9a075265c6dc ("ASoC: Intel: sst: Remove unused function sst_restore_shim64()"), we deleted the sst_restore_shim64() since it was never used. ...but a quick look at the code shows that we should also be able to remove the sst_save_shim64() function and the structure members we were storing data in. Once we delete sst_save_shim64() there are no longer any users of the 'sst_shim_regs64' structure. That means we can delete it completely and also avoid allocating memory for it. This saves a whopping 136 bytes of devm allocated memory. We also get the nice benefit of avoiding an error path in the init code. Note that the saving code that we're removing (and the comments talking about how important it is to do the save) has been around since commit 336cfbb05edf ("ASoC: Intel: mrfld- add ACPI module"). Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Move quirk to identify correct machine driverNaveen M2017-05-241-2/+0Star
| | | | | | | | | | | sst_acpi_mach has a quirk field to handle board specific quirks. Patch moves quirk call to sst_acpi_find_machine() instead of calling it in respective driver Signed-off-by: Naveen M <naveen.m@intel.com> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: Convert atom machine data to C99 styleNaveen M2017-05-241-47/+162
| | | | | | | | | | | | C99 style struct initialization helps in readability as well as initialization of variables not specified as NULL. Patch modifies all atom machine data. Suggested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Naveen M <naveen.m@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: sst: Remove unused function sst_restore_shim64()Matthias Kaehlcke2017-05-241-16/+0Star
| | | | | | | | | | | | Looks like the function has never been used since it was added by commit b0d94acd634a ("ASoC: Intel: mrfld - add shim save restore"). Removing it fixes the following warning when building with clang: sound/soc/intel/atom/sst/sst.c:360:20: error: unused function 'sst_restore_shim64' [-Werror,-Wunused-function] Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: sst: fix spelling mistake: "allocationf" -> "allocation"Colin Ian King2017-05-141-1/+1
| | | | | | | | Trivial fix to spelling mistake in dev_err message. Also replace "fail" with "failure". Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: intel: atom: localize variable without external linkageTakashi Sakamoto2017-05-141-1/+1
| | | | | | | | | | | | | | | | A driver for Intel SST driver for old atom platform includes a variable which has no external linkage. These functions should have static qualifier. This commit adds the qualifier to localize the variable. This issue is detected by sparse: sst.c:261:1: warning: symbol 'dev_attr_firmware_version' was not declared. Should it be static? Cc: Sebastien Guiriec <sebastien.guiriec@intel.com> Cc: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: Atom: update Thinkpad 10 quirkPierre-Louis Bossart2017-04-181-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are multiple skews of the same Lenovo audio hardware based on the Realtek RT5670 codec. Manufacturer: LENOVO Product Name: 20C1CTO1WW Version: ThinkPad 10 Manufacturer: LENOVO Product Name: 20C3001VHH Version: ThinkPad 10 Manufacturer: LENOVO Product Name: 20C10024GE Version: ThinkPad Tablet B Manufacturer: LENOVO Product Name: 20359 Version: Lenovo Miix 2 10 For all these devices, the same quirk is used to force the machine driver to be based on RT5670 instead of RT5640 as indicated by the BIOS. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96691 Tested-by: Nicole Faerber <nicole.faerber@dpin.de> Tested-by: Viacheslav Ostroukh <v.dev@ostroukh.me> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: intel: Don't print FW version repeatedlyTakashi Iwai2017-03-271-1/+3
| | | | | | | | | | | | | | Intel SST driver spews an info message "FW Versoin xxxx" at each time the device gets initialized. Since it's triggered at each PM (or even runtime PM), it appears so ofetn, and rather becomes annoying than useful. This patch suppresses the superfluous messages by checking the currently loaded FW version with the previously loaded one. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: Enable bytcht_nocodec machine driverPierre-Louis Bossart2017-03-131-1/+16
| | | | | | | | | Make sure this machine driver is only used if enabled explicitly and if there is no information found in the SSDT. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>