30 Jan, 2021
1 commit
-
This is similar with the refactor for i.MX8MP added in commit
ba2d283f5d9 ("LF-3026-2 ASoC: SOF: imx8m: Remove internal
priv->suspended variable").Because SOF state machine assumes that even if the DSP wasn't previously
active at a System resume, will re-load the firmware we need to make sure
that all needed resources are active.Kernel core will take care of enabling the PD, we need to make sure that
we request the MU channels.Signed-off-by: Daniel Baluta
04 Jan, 2021
1 commit
-
This is the 5.10.4 stable release
* tag 'v5.10.4': (717 commits)
Linux 5.10.4
x86/CPU/AMD: Save AMD NodeId as cpu_die_id
drm/edid: fix objtool warning in drm_cvt_modes()
...Signed-off-by: Jason Liu
Conflicts:
drivers/gpu/drm/imx/dcss/dcss-plane.c
drivers/media/i2c/ov5640.c
30 Dec, 2020
1 commit
-
[ Upstream commit 358f0ac1f2791c80c19cc26706cf34664c9fd756 ]
SND_INTEL_DSP_CONFIG is selected by the HDaudio, Skylake and SOF
drivers. When the HDaudio link is not selected as a option, this
Kconfig option is not touched and will default to whatever other
drivers selected. In the case e.g. where HDaudio is compiled as
built-in, the linker will complain:ld: sound/soc/sof/sof-pci-dev.o: in function `sof_pci_probe':
sof-pci-dev.c:(.text+0x5c): undefined reference to
`snd_intel_dsp_driver_probe'Adding the select for all HDaudio platforms, regardless of whether
they rely on the HDaudio link or not, solves the problem.Reported-by: Randy Dunlap
Acked-by: Randy Dunlap
Fixes: 82d9d54a6c0ee ('ALSA: hda: add Intel DSP configuration / probe code')
Signed-off-by: Pierre-Louis Bossart
Reviewed-by: Ranjani Sridharan
Link: https://lore.kernel.org/r/20201112164425.25603-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown
Signed-off-by: Sasha Levin
17 Dec, 2020
2 commits
-
This is buggy and causes kernel crashes.
Instead of priv->suspended we can use pm_runtime_suspended call.
priv->suspended was used to keep track if the SOF device is suspended
in order to avoid suspending an already suspended device.SOF has refined its state machine. One problem for SOF imx
implementation was that if the DSP is turned of and a System PM
happens then it will leave the DSP turned on.In order to fix this in System PM resume we activate runtime PM suspend.
Thus after SND_SOF_SUSPEND_DELAY_MS timeout the DSP device will enter
runtime suspend and the DSP will be turned off.Signed-off-by: Daniel Baluta
-
This is used by SOF core to keep track of PM state.
Each PM handler (system/runtime) must call snd_sof_dsp_set_power_state
and change the state according to the desired PM state.Signed-off-by: Daniel Baluta
14 Dec, 2020
25 commits
-
After commit 17b3f99a360d76 ("ASoC: SOF: imx: Replace sdev->private with
sdev->pdata->hw_pdata") sdev->private was replaced with
sdev->pdata->hw_pdata.Because there are some patches that are not upstream yet, this update
wasn't propagated to those patches.Signed-off-by: Daniel Baluta
-
Signed-off-by: Daniel Baluta
-
Signed-off-by: Daniel Baluta
-
This fixes the following compilation error:
sound/soc/sof/imx/imx8m.c:340:17: error: implicit declaration of function
‘syscon_regmap_lookup_by_compatible’ [-Werror=implicit-function-declaration]
priv->regmap = syscon_regmap_lookup_by_compatible("fsl,imx8mp-audio-blk-ctrl");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/sof/imx/imx8m.c:340:15: warning: assignment to ‘struct regmap
*’ from ‘int’ makes pointer from integer without a cast [-Wint-convers
ion]Signed-off-by: Daniel Baluta
-
sound/soc/sof/imx/imx8m.c: In function imx8m_reset:
sound/soc/sof/imx/imx8m.c:240:25: error: struct imx8m_priv has no
member named regmap_audiomixâ240: regmap_update_bits(priv->regmap_audiomix, AudioDSP_REG2,
We changed in the last moment the filed for audiomix regmap
but did not update all over the places.Signed-off-by: Daniel Baluta
-
Resume common flow (System PM / Runtime PM) is like this:
sof_resume
-> specific device resume
-> snd_sof_load_firmware
-> snd_sof_dsp_reset (1)
-> load_modules()
-> snd_sof_run_firmware (2)We need to implement dsp_reset callback (1) that will actually reset the
DSP but keep it stalled.In order to implement this we do the following:
-> put DSP into reset (assert CoreReset bit from PWRCTL)
-> stall the DSP using RunStall bit from AudioDSP_REG2 Audiomix
-> take DSP out of reset (de-assert CoreReset bit from PWRCTL)At this moment the DSP is taken out of reset and Stalled! This means
that we can load the firmware and then start the DSP (2).Until now we resetted the DSP by turning down the Audiomix PD. This
doesn't work for Runtime PM if another IP is keeping Audiomix PD up.By introducing dsp_reset() we no longer rely on turning off the audiomix
to reset the DSP.Signed-off-by: Daniel Baluta
-
On i.MX8M DSP is controlled via a set of registers
from Audio Mix. This patches gets a reference (via regmap)
to Audio Mix registers and implements DSP start.Signed-off-by: Daniel Baluta
-
We make use of common imx8m_suspend / imx8m_resume functions
for both system PM and runtime PM.imx8m_suspend:
- frees the MU channels
- disables the clocksimx8m_resume
- enables the clocks
- requests the MU channelsOn i.MX8MP there is no dedicated functionality to put the DSP in reset.
The only way of doing this is to POWER DOWN the Audiomix domain.We are able to do this because turning off the clocks and freeing the
channels makes the Audiomix to have no users thus PM kernel core turns
it down.Now, care must be taken when handling system sleep. For this we
introduce a global variable to hold if the system was suspend or not via
system PM handlers.SOF core will not call system PM suspend handler if the DSP is already down,
but at resume it will call the system PM resume. So, we need to keep track of
the state via the suspend variable.Few insights on how SOF core handles the PM:
- SOF core uses PM runtime autosuspend (with a timeout of 2 secs)
- at probe, SOF core boots the DSP and lets the PM runtime suspend to
turn it off, if there is no activity
- when someone opens the ALSA sound card (aplay/arecord, etc) SOF core
calls PM runtime resume to turn on the DSP
- when the ALSA sound card is closed SOF core make use of PM subsystem
to call PM runtime suspend and thus turning off the DSP.Signed-off-by: Daniel Baluta
-
We introduce arrays of clocks that will be enabled/disable
at resume/suspend in order to save power.There are two types of clocks:
* DSP IP clocks
* DAI clocksNormally, DAI clocks would be managed by the DSP firmware
but this is hard to achieve now, so just manage them from
Application Processor side for now.Signed-off-by: Daniel Baluta
-
For now, they are just dummy ops to allow SOF core
to properly boot the DSP after suspend.Signed-off-by: Daniel Baluta
-
Handle clocks and mailbox channels at runtime suspend/resume
in order to save power.Signed-off-by: Daniel Baluta
-
For now this only saves requested dsp_power_state to snd_sof_dev
private member.Signed-off-by: Daniel Baluta
-
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.Signed-off-by: Daniel Baluta
-
We introduce arrays of clocks that will be enabled/disable
at resume/suspend in order to save power.There are two types of clocks:
* DSP IP clocks
* DAI clocksNormally, DAI clocks would be managed by the DSP firmware
but this is hard to achieve now, so just manage them from
Application Processor side for now.Signed-off-by: Daniel Baluta
-
Suspend() prototyle was changed since:
61e285caf40f ("ASoC: SOF: Move DSP power state transitions to platform-specific ops")So we met below build break:
../sound/soc/sof/imx/imx8.c:425:14: error: initialization of ‘int (*)(struct snd_sof_dev *, u32)’ {aka ‘int (*)(struct snd_sof_dev *, unsigned int)’} from incompatible pointer type ‘int (*)(struct snd_sof_dev *)’ [-Werror=incompatible-pointer-types]
425 | .suspend = imx8_dsp_suspend,
| ^~~~~~~~~~~~~~~~Signed-off-by: Dong Aisheng
-
This INFO_ flags in dsp_osp for imx8x. Similar with
commit 27e322fabd508b (" ASoC: SOF: define INFO_ flags in dsp_ops")Signed-off-by: Daniel Baluta
-
We need to provide PM macros in order for the SOF core
to suspend/resume the DSP.PM support on the DSP side is quite limited and we are mostly
doing PM for ARM core.Without this patch DSP won't be restarted after a resume causing
SOF driver calls to time out.Signed-off-by: Daniel Baluta
-
This is most likely introduced by a rebase. One can notice that
same lines are copied.Signed-off-by: Daniel Baluta
-
On OF platforms information about machine driver is stored
in sof_pdata->machine_drv_name.Without this SOF probe fails with:
error: no matching ASoC machine driver found - aborting probeSigned-off-by: Daniel Baluta
-
ACPI creates tables with information about the machine driver.
With DT there is no need for such tables because we can directly
get all the information needed from DT file.This patch introduces machine driver property inside dsp node.
Signed-off-by: Daniel Baluta
-
Introduce two DT properties in dsp node:
* fw-filename, optional property giving the firmware filename
(if this is missing fw filename is read from board description)
* tplg-filename, mandatory giving the topology filename.Signed-off-by: Daniel Baluta
-
We use the nocodec tplg_filename for now. Proper name
should be read from device tree file.Signed-off-by: Daniel Baluta
-
Signed-off-by: Daniel Baluta
-
We need to find a way to pass the machine driver name to SOF core. So
far just hard code it.Signed-off-by: Daniel Baluta
-
For some platforms, the refcount is explicitly incremented
to prevent it from entering runtime suspend. This
should be be done during probe in the core instead
of being done in the PCM driver.Signed-off-by: Ranjani Sridharan
24 Oct, 2020
1 commit
-
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 0x10Signed-off-by: Bard Liao
Reviewed-by: Pierre-Louis Bossart
Reviewed-by: Ranjani Sridharan
Reviewed-by: Guennadi Liakhovetski
Signed-off-by: Kai Vehmanen
Link: https://lore.kernel.org/r/20201021182419.1160391-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown
06 Oct, 2020
1 commit
-
Linux 5.9-rc5
26 Sep, 2020
2 commits
-
Use SOF defined callbacks (snd_sof_prepare/snd_sof_complete)
in order to update internal SOF system suspend target.Reviewed-by: Kai Vehmanen
Reviewed-by: Paul Olaru
Reviewed-by: Pierre-Louis Bossart
Signed-off-by: Daniel Baluta
Link: https://lore.kernel.org/r/20200924151518.15841-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown -
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
Reviewed-by: Paul Olaru
Reviewed-by: Pierre-Louis Bossart
Signed-off-by: Daniel Baluta
Link: https://lore.kernel.org/r/20200924151518.15841-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown
22 Sep, 2020
6 commits
-
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 -
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
Reviewed-by: Guennadi Liakhovetski
Reviewed-by: Pierre-Louis Bossart
Link: https://lore.kernel.org/r/20200921100841.2882662-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown -
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
Reviewed-by: Ranjani Sridharan
Reviewed-by: Guennadi Liakhovetski
Signed-off-by: Kai Vehmanen
Link: https://lore.kernel.org/r/20200921110814.2910477-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown -
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
Reviewed-by: Ranjani Sridharan
Reviewed-by: Guennadi Liakhovetski
Signed-off-by: Kai Vehmanen
Link: https://lore.kernel.org/r/20200921110814.2910477-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown -
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
Reviewed-by: Ranjani Sridharan
Reviewed-by: Guennadi Liakhovetski
Signed-off-by: Kai Vehmanen
Link: https://lore.kernel.org/r/20200921110814.2910477-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown -
Fix build warning:
WARNING: modpost: missing MODULE_LICENSE() in sound/soc/sof/imx/imx-common.oFixes: 18ebffe4d043 ("ASoC: SOF: imx: Add debug support for imx platforms")
Reported-by: Stephen Rothwell
Signed-off-by: Kai Vehmanen
Reviewed-by: Daniel Baluta
Reviewed-by: Pierre-Louis Bossart
Link: https://lore.kernel.org/r/20200921104746.2903507-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown