aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sof (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-10-23ASoC: SOF: loader: handle all SOF_IPC_EXT typesBard Liao1-0/+5
Do not emit a warning for extended firmware header fields that are not used by kernel. This creates unnecessary noise to kernel logs like: sof-audio-pci 0000:00:1f.3: warning: unknown ext header type 3 size 0x1c sof-audio-pci 0000:00:1f.3: warning: unknown ext header type 4 size 0x10 Signed-off-by: Bard Liao <yung-chuan.liao@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: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20201021182419.1160391-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-06Merge tag 'v5.9-rc5' into asoc-5.10Mark Brown2-4/+4
Linux 5.9-rc5
2020-09-25ASoC: SOF: Add .prepare/.complete callbacksDaniel Baluta1-0/+2
Use SOF defined callbacks (snd_sof_prepare/snd_sof_complete) in order to update internal SOF system suspend target. Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Paul Olaru <paul.olaru@nxp.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20200924151518.15841-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-25ASoC: SOF: Activate runtime PM with SOF OF deviceDaniel Baluta1-0/+4
SOF boots the DSP at probe and keeps it up all the time. With this change, after booting if no one is using the DSP the SOF core will turn off the DSP to save power. Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Paul Olaru <paul.olaru@nxp.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20200924151518.15841-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21Merge series "ASoC: SOF: fix kcontrol size checks" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:Mark Brown1-1/+32
Series that fixes checks for 'size' in kcontrol get/put ext_bytes methods for SOF. The gaps in these checks were discovered via cppcheck warnings on unused variable values. Pierre-Louis Bossart (5): ASoC: SOF: control: fix size checks for ext_bytes control .get() ASoC: SOF: control: fix size checks for volatile ext_bytes control .get() ASoC: SOF: control: add size checks for ext_bytes control .put() ASoC: SOF: control: remove const in sizeof() ASoC: SOF: topology: remove const in sizeof() sound/soc/sof/control.c | 53 +++++++++++++++++++++++++++++++--------- sound/soc/sof/topology.c | 2 +- 2 files changed, 43 insertions(+), 12 deletions(-) -- 2.27.0
2020-09-21ASoC: hdac: make SOF HDA codec driver probe deterministicKai Vehmanen1-9/+8
To provide backward compatibility to older systems, the SOF HDA driver allows user to specify which HDMI codec driver to use at runtime via kernel parameter. This mechanism has a subtle flaw in that it assumes the codec drivers not to be loaded when the SOF PCI driver is loaded. The problem is rooted in use of the hdev->type field. snd_hdac_ext_bus_device_init() initializes this field to HDA_DEV_ASOC. This signals the HDA core that ASoC drivers should be considered in driver matching (hda_bus_match()). The SOF and SST drivers continue by overriding this field to HDA_DEV_LEGACY and proceeding to load driver modules with request_module(). Correct drivers will get loaded and attached. If however the codec drivers are already loaded when snd_hdac_ext_bus_device_init() is called, the matching will not work as expected as device type is still set to HDA_DEV_ASOC. Specifically if hdac-hdmi is attached when machine driver is configured to use hdac-hda, this leads to out-of-bounds memory access in hda_dsp_hdmi_build_controls(). Fix the issue by adding codec type as a parameter to snd_hdac_ext_bus_device_init() and ensuring type is set correctly from the start. Fixes: 139c7febad1a ("ASoC: SOF: Intel: add support for snd-hda-codec-hdmi") Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200921100841.2882662-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21ASoC: SOF: control: add size checks for ext_bytes control .put()Pierre-Louis Bossart1-0/+11
Make sure the TLV header and size are consistent before copying from userspace. Fixes: c3078f5397046 ('ASoC: SOF: Add Sound Open Firmware KControl support') Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200921110814.2910477-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21ASoC: SOF: control: fix size checks for volatile ext_bytes control .get()Pierre-Louis Bossart1-0/+14
Mirror addition of checks for regular ext_bytes controls. Fixes: 783560d02dd61 ('ASoC: SOF: Implement snd_sof_bytes_ext_volatile_get kcontrol IO') Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200921110814.2910477-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21ASoC: SOF: control: fix size checks for ext_bytes control .get()Pierre-Louis Bossart1-1/+7
cppcheck complains twice: sound/soc/sof/control.c:436:2: style: Assignment of function parameter has no effect outside the function. [uselessAssignmentArg] size -= sizeof(const struct snd_ctl_tlv); ^ sound/soc/sof/control.c:436:7: style: Variable 'size' is assigned a value that is never used. [unreadVariable] size -= sizeof(const struct snd_ctl_tlv); Somehow we dropped the checks for the size argument when upstreaming the code, somewhere between v5 and v6. Re-add a size check to avoid providing userspace with more data that it asked for. Also fix all error codes, we should return -ENOSPC instead of -EINVAL. Fixes: c3078f5397046 ('ASoC: SOF: Add Sound Open Firmware KControl support') Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200921110814.2910477-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21ASoC: SOF: imx: add missing MODULE_LICENSE() for imx-commonKai Vehmanen1-0/+3
Fix build warning: WARNING: modpost: missing MODULE_LICENSE() in sound/soc/sof/imx/imx-common.o Fixes: 18ebffe4d043 ("ASoC: SOF: imx: Add debug support for imx platforms") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200921104746.2903507-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21ASoC: SOF: pm: Fix prepare callback behavior for OF usecaseDaniel Baluta2-5/+16
On i.MX platforms PM is not managed via ACPI although CONFIG_ACPI can be set. So, in order to correctly set the system target state we introduce a flag for platforms that require to use acpi target states. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200921105038.2909899-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-21ASoC: SOF: topology: fix the process being scheduled on core0 alwaysKeyon Jie1-47/+35
In commit 783898ce68de ("ASoC: SOF: append extended data to sof_ipc_comp_process") the process components are set to run on the fixed core 0, this break us from scheduling components on any other DSP core. Since we can get the DSP core index from swidget->core, it is duplicated to pass the extra 'core' argument for those sof_widget_load_xx() functions. Here removes the duplicate 'core' argument and get component core from swidget->core directly to fix the issue mentioned above. Fixes: 783898ce68de ("ASoC: SOF: append extended data to sof_ipc_comp_process") Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200921104544.2897112-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17Merge series "ASoC: SOF: small fixes for 5.10" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:Mark Brown14-68/+223
Series that adds debug support for IMX platforms, more details to FW version information, adds missing -EACCESS handling to pm_runtime_get_sync() calls and a set of minor cosmetic, trace verbosity and coding style issues. Guennadi Liakhovetski (3): ASoC: SOF: (cosmetic) remove redundant "ret" variable uses ASoC: SOF: remove several superfluous type-casts ASoC: SOF: fix range checks Iulian Olaru (1): ASoC: SOF: imx: Add debug support for imx platforms Karol Trzcinski (1): ASoC: SOF: Add `src_hash` to `sof_ipc_fw_version` structure Pierre-Louis Bossart (3): ASoC: SOF: debug: update test for pm_runtime_get_sync() ASoC: SOF: control: update test for pm_runtime_get_sync() ASoC: SOF: Intel: hda: reduce verbosity of boot error logs include/sound/sof/info.h | 4 +- sound/soc/sof/control.c | 62 +++++++++++++-------------- sound/soc/sof/debug.c | 2 +- sound/soc/sof/imx/Kconfig | 8 ++++ sound/soc/sof/imx/Makefile | 3 ++ sound/soc/sof/imx/imx-common.c | 72 ++++++++++++++++++++++++++++++++ sound/soc/sof/imx/imx-common.h | 16 +++++++ sound/soc/sof/imx/imx8.c | 23 +++++++++- sound/soc/sof/imx/imx8m.c | 17 +++++++- sound/soc/sof/intel/hda-loader.c | 16 +++---- sound/soc/sof/intel/hda.c | 12 ++++-- sound/soc/sof/intel/hda.h | 2 + sound/soc/sof/sof-audio.c | 6 +-- sound/soc/sof/sof-priv.h | 8 ++++ sound/soc/sof/topology.c | 44 ++++++++++--------- 15 files changed, 226 insertions(+), 69 deletions(-) create mode 100644 sound/soc/sof/imx/imx-common.c create mode 100644 sound/soc/sof/imx/imx-common.h -- 2.27.0
2020-09-17ASoC: SOF: Intel: Add support for tgl-hRander Wang3-1/+34
SOF will support tgl-h and tgl-lp in different FW binaries due to hardware difference, so create another dev_desc entry with FW name of sof-tgl-h.ri and dsp_desc named tglh_chip_info for tgl-h. Fixes: c8d2e2bfaeffa ("ASoC: SOF: Intel: add PCI IDs for ICL-H and TGL-H") Signed-off-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200917103609.2559916-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17ASoC: SOF: Intel: hda: reduce verbosity of boot error logsPierre-Louis Bossart4-10/+28
Previous commits reduced the verbosity of errors during boot iterations, but there are still a couple remaining which generate false positives. Errors should only be logged when after last attempt to download firmware failed. Duplicating logs and assigning them different levels based on the iteration number isn't really elegant, use macro as suggested by Guennadi. Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@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: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200917105633.2579047-9-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17ASoC: SOF: fix range checksGuennadi Liakhovetski2-23/+35
On multiple locations checks are performed of untrusted values after adding a constant to them. This is wrong, because the addition might overflow and the result can then pass the check, although the original value is invalid. Fix multiple such issues by checking the actual value and not a sum of it and a constant. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200917105633.2579047-8-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17ASoC: SOF: remove several superfluous type-castsGuennadi Liakhovetski1-3/+3
No need to type-cast assignments between void and other pointers in C. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200917105633.2579047-7-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17ASoC: SOF: (cosmetic) remove redundant "ret" variable usesGuennadi Liakhovetski2-28/+18
In some cases no "ret" variable is even needed, those functions always return 0 anyway, in other cases "ret" initialisation is redundant. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200917105633.2579047-6-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17ASoC: SOF: control: update test for pm_runtime_get_sync()Pierre-Louis Bossart1-1/+1
We need to avoid reporting an error for -EACCESS when pm_runtime is not enabled. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200917105633.2579047-5-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17ASoC: SOF: debug: update test for pm_runtime_get_sync()Pierre-Louis Bossart1-1/+1
We need to avoid reporting an error for -EACCESS when pm_runtime is not enabled. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200917105633.2579047-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-17ASoC: SOF: imx: Add debug support for imx platformsIulian Olaru6-2/+137
This patch adds debug support for imx platforms. This is important in order to gather information about the state of the DSP in case of an oops and the reason for the oops. This is done by checking if a message with a panic code has been placed in the debug box, in the imx8_dsp_handle_request function from sof/imx. If positive, the function imx8_dump, added in common, will be called. The first step is to gather information about the registers, filename, line number and stack by calling the imx8_get_registers, added in common. Then the information will be printed to the console by calling the get_status function. Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200917105633.2579047-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11Merge series "ASoC: SOF: DSP core management fixes for 5.10" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:Mark Brown10-31/+34
This series contains some improvements to how DSP core management is done in SOF, and adds a distinction between cores managed by the host versus cores managed by the DSP. Pierre-Louis Bossart (1): ASoC: SOF: Intel: hda-loader: s/master/primary Ranjani Sridharan (3): ASoC: SOF: rename cores_mask to host_managed_cores_mask ASoC: SOF: Intel: hda: modify core_power_up/down op ASoC: SOF: Intel: remove the HDA_DSP_CORE_MASK() macro sound/soc/sof/intel/apl.c | 2 +- sound/soc/sof/intel/bdw.c | 2 +- sound/soc/sof/intel/byt.c | 6 +++--- sound/soc/sof/intel/cnl.c | 15 ++++----------- sound/soc/sof/intel/hda-dsp.c | 20 +++++++++++++++++--- sound/soc/sof/intel/hda-loader.c | 11 +++++------ sound/soc/sof/intel/hda.c | 2 +- sound/soc/sof/intel/hda.h | 3 --- sound/soc/sof/intel/shim.h | 2 +- sound/soc/sof/intel/tgl.c | 2 +- 10 files changed, 34 insertions(+), 31 deletions(-) -- 2.27.0
2020-09-11ASoC: SOF: Intel: Use DMI oem string search for tgl_max98373_rt5682Sathyanarayana Nujella1-1/+1
DMI product name is used to support system variants based out of tgl_max98373_rt5682 in current implementation. Replace this DMI search with DMI_OEM_STRING. Coreboot(BIOS used in these systems) is setting the needed DMI_OEM_STRING field to uniquely identify these systems. Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200910162705.2026036-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11ASoC: SOF: Intel: hda-loader: s/master/primaryPierre-Louis Bossart1-1/+1
Use inclusive language for DSP cores. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com> Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200910164125.2033062-5-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11ASoC: SOF: Intel: remove the HDA_DSP_CORE_MASK() macroRanjani Sridharan5-19/+8
Remove the HDA_DSP_CORE_MASK() macro and use BIT() and GENMASK() macros directly for more clarity. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200910164125.2033062-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11ASoC: SOF: Intel: hda: modify core_power_up/down opRanjani Sridharan1-2/+16
Modify the core_power_up/down ops for HDA platforms to restrict the core_mask to the ones allowed by chip->cores_mask. This is needed because on some HDA platforms not all cores can be powered up/down by the host and this must be handled internally in the FW. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200910164125.2033062-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11ASoC: SOF: rename cores_mask to host_managed_cores_maskRanjani Sridharan9-16/+16
Rename the cores_mask in struct sof_intel_dsp_desc to host_managed_cores_mask to be more indicative of the fact that only these cores can be powered up/down by the host. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200910164125.2033062-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-08ASoC: SOF: Implement snd_sof_bytes_ext_volatile_get kcontrol IODharageswari R3-0/+61
This patch implements the snd_sof_bytes_ext_volatile_get() to read the actual parameters from DSP by sending the SOF_IPC_COMP_GET_DATA IPC for the kcontrol of type SOF_TPLG_KCTL_BYTES_VOLATILE_RO. Signed-off-by: Dharageswari R <dharageswari.r@intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200908092825.1813847-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: topology: make process type optionalKeyon Jie1-6/+0
As components can be now identified with a UUID based mechanism, the process type is no longer required. For new DSP components, process and its component type can be set to SOF_PROCESS_NONE and SOF_COMP_NONE. Allow this combination in topology load, modify the load time check for process type to reflect this. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Curtis Malainey <curtis@malainey.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-17-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: append extended data to sof_ipc_comp_muxKeyon Jie1-7/+4
Append the extended data to the end of the struct sof_ipc_comp_mux, construct the ipc for COMP_NEW during the topology load stage. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-16-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: append extended data to sof_ipc_comp_processKeyon Jie1-5/+2
Append the extended data to the end of the struct sof_ipc_comp_process, construct the ipc for COMP_NEW during the topology load stage. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-15-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: append extended data to sof_ipc_comp_toneKeyon Jie1-7/+4
Append the extended data to the end of the struct sof_ipc_comp_tone, construct the ipc for COMP_NEW during the topology load stage. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-14-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: append extended data to sof_ipc_comp_asrcKeyon Jie1-7/+4
Append the extended data to the end of the struct sof_ipc_comp_asrc, construct the ipc for COMP_NEW during the topology load stage. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-13-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: append extended data to sof_ipc_comp_srcKeyon Jie1-7/+4
Append the extended data to the end of the struct sof_ipc_comp_src, construct the ipc for COMP_NEW during the topology load stage. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-12-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: append extended data to sof_ipc_comp_hostKeyon Jie1-7/+4
Append the extended data to the end of the struct sof_ipc_comp_host, construct the ipc for COMP_NEW during the topology load stage. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-11-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: append extended data to sof_ipc_comp_volumeKeyon Jie1-7/+4
Append the extended data to the end of the struct sof_ipc_comp_volume, construct the ipc for COMP_NEW during the topology load stage. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-10-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: append extended data to sof_ipc_comp_mixerKeyon Jie1-7/+4
Append the extended data to the end of the struct sof_ipc_comp_mixer, construct the ipc for COMP_NEW during the topology load stage. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-9-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: append extended data to sof_ipc_comp_daiKeyon Jie2-24/+45
Append the extended data to the end of the struct sof_ipc_comp_dai, and update the ext_data_offset, to construct the IPC for the topology load and runtime restore. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-8-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: topology: add helper for setting up IPC componentKeyon Jie1-0/+45
Add helper to allocate buffer for IPC component, configure the basic settings, and set up the extended data for the subsequent IPC sending. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-7-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: topology: parse comp_ext_tokens for all widgetsKeyon Jie1-0/+10
Parse comp_ext_tokens in the common sof_widget_ready(), and the swidget->comp_ext will be used to construct the COMP_NEW ipc in the subsequent commits. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-5-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: topology: create component extended tokensKeyon Jie1-0/+17
Add comp_ext_tokens which will be used to parse all extended tokens, these tokens will be stored it to struct snd_sof_widget. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-07ASoC: SOF: add comp_ext to struct snd_sof_widgetKeyon Jie1-0/+3
Add member comp_ext to struct snd_sof_widget, which will be used for topology extended tokens parsing. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200904132744.1699575-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-04ASoC: SOF: topology: fix core enable sequenceRanjani Sridharan1-6/+14
Core power up involves 2 steps: The first step tries to power up the core by setting the ADSPCS.SPA bit for the host-managed cores. The second step involves sending the IPC to power up other cores that are not host managed. The enabled_cores_mask should be updated only when both these steps are successful. If the IPC to the DSP fails, the host-managed core that was powered in step 1 should be powered off before returning the error. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Keyon Jie <yang.jie@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200902140756.1427005-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-04ASoC: SOF: support topology components on secondary coresGuennadi Liakhovetski4-34/+125
Currently SOF supports running pipelines on secondary DSP cores in a limited way. This patch represents the next step in SOF multi-core DSP support, it adds checks for core ID to individual topology components. It takes care to power up all the requested cores. More advanced DSP core power management should be added in the future. Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com> Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200902140756.1427005-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-04ASoC: SOF: add a "core" parameter to widget loading functionsGuennadi Liakhovetski2-27/+50
We want to be able to explicitly assign cores to individual pipeline components. This patch adds a "core" parameter to widget loading functions to be sent to the DSP for appropriate component scheduling. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200902140756.1427005-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27ASoC: SOF: Intel: hda: Simplify error handling during FW bootRanjani Sridharan1-54/+19
Modify cl_stream_prepare() to return a pointer to the prepared stream if successful or ERR_PTR() otherwise. This would simplify the error paths in hda_dsp_cl_boot_firmware() and hda_dsp_cl_boot_firmware_iccmax() to perform the stream cleanup after FW boot. This change also renders the function get_stream_with_tag() redundant. Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200826184532.1612070-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27ASoC: SOF: Intel: hda: Add sof_tgl_ops for TGL platformsRanjani Sridharan6-22/+147
Separate the dsp ops for TGL ops to specify the use of ICCMAX FW boot sequence in the run op. All other ops are identical. Also separate the TGL descriptors into a separate file to make it easier to follow. Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200826184532.1612070-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27ASoC: SOF: Intel: hda: Define FW boot sequence with ICCMAXRanjani Sridharan2-15/+78
Define the FW boot sequence for platforms that are recommended to use ICCMAX. This function uses the existing prepare and cleanup functions for creating a specially crafted capture stream before powering up the DSP cores. Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200826184532.1612070-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27ASoC: SOF: Intel: hda: define macro for code loader stream formatRanjani Sridharan1-1/+2
This will be used for the ICCMAX stream as well. Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200826184532.1612070-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-27ASoC: SOF: Intel: hda: modify the signature of get_stream_with_tag()Ranjani Sridharan1-7/+4
Modify the signature of get_stream_with_tag() to add the direction as an argument to extend it for using with capture streams. Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20200826184532.1612070-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>