David Lin [Fri, 14 Apr 2023 10:39:44 +0000 (18:39 +0800)]
ASoC: nau8825: Add delay control for input path
Change the original fixed delay to the assignment from property. It will make
more flexible to different platforms for avoiding pop noise at the beginning
of recording.
David Lin [Fri, 14 Apr 2023 10:39:42 +0000 (18:39 +0800)]
ASoC: dt-bindings: nau8825: Add delay control for input path
Change the original fixed delay to the assignment from property. It will make
more flexible to different platforms for avoiding pop noise at the beginning
of recording.
David Rau [Thu, 13 Apr 2023 02:41:34 +0000 (02:41 +0000)]
ASoC: da7219: Improve the relability of AAD IRQ process
- Configure the default gound switch delay time before enabling IRQ
to avoid the unexpected delay time is set up
- Apply DA7219 AAD own work queue to handle AAD events
- Replace msleep with queue_delayed_work to have better relability
This commit improves the control of ground switches in AAD IRQ
Mark Brown [Wed, 12 Apr 2023 18:59:27 +0000 (19:59 +0100)]
ASoC: cs35l56: Add system suspend handling
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:
This set of patches adds handling for system suspend.
Patches 1..4 make some code changes that simplify the
suspend implementation, mainly to avoid race conditions.
There are two seperate aspects to suspend, and these have
been done as two patches:
- the main suspend-resume handling,
- re-loading the firmware if necessary after resume.
ASoC: cs35l56: Re-patch firmware after system suspend
Check during cs35l56_system_resume() whether the firmware patch must
be applied again.
The FIRMWARE_MISSING flag in the PROTECTION_STATUS register indicates
whether the firmware has been patched.
In non-secure mode the FIRMWARE_MISSING flag is cleared at the end of
dsp_work(). If it is set after system-resume we know that dsp_work()
must be run again.
In secure mode the pre-OS loader will have done the secure patching
and cleared the FIRMWARE_MISSING flag. So this flag does not tell us
whether firmware memory was lost. But the driver could only be
downloading non-secure tunings, which is always safe to do.
If the driver has control of RESET we will have asserted it during
suspend so the firmware patch will have been lost. The driver would only
have control of RESET in non-secure mode.
ASoC: cs35l56: Remove quick-cancelling of dsp_work()
Delete the 'removing' flag and don't kick init_completion to make a
quick cancel of dsp_work(). Just let it timeout on the wait for the
completion.
Simplify the code to standard cancelling or flushing of the work.
This avoids introducing corner cases from a layer of custom signalling.
It also avoids potential race conditions when system-suspend handling
is added.
Unless the hardware is broken, the dsp_work() will already have started
and passed the completion before the driver would want to cancel it.
This adds the main handling for system suspend but does not handle
re-patching the firmware after system resume.
This is a multi-stage suspend and resume because if there is a
RESET line it is almost certain that it will be shared by all the
amps. So every amp must have done its suspend before we can
assert RESET. Likewise we must de-assert RESET before the amps
can resume.
It's preferable to assert RESET before we turning off regulators, and
while they power up.
The actual suspend and resume is done by using the pair
pm_runtime_force_suspend() and pm_runtime_force_resume() to
re-use our runtime suspend/resume sequences.
pm_runtime_force_suspend() will disable our pm_runtime. If we were
runtime-resumed it calls our runtime_suspend().
pm_runtime_force_resume() re-enables pm_runtime and if we were
originally runtime-resumed before the pm_runtime_force_suspend()
it calls our runtime_resume(). Otherwise it leaves us
runtime-suspended.
The general process is therefore:
suspend() -> finish dsp_work and then run our runtime_suspend
suspend_late() -> assert RESET and turn off supplies
resume_early() -> enable supplies and de-assert RESET
resume() -> pm_runtime_force_resume()
In addition, to prevent the IRQ handler running in the period
between pm_runtime_force_suspend() and pm_runtime_force_resume()
the parent IRQ is temporarily disabled:
- from suspend until suspend_noirq
- from resume_noirq until resume
ASoC: cs35l56: Always wait for firmware boot in runtime-resume
When we are resuming from a system suspend the CS35L56 has probably
been hard reset (usually a power-on reset). So we must wait for the
firmware to boot. On SoundWire we also need it to re-initialize before
we can read the registers to check the CS35L56 state.
The simplest way to handle this is for runtime-resume to always wait
for firmware boot. If the firmware is already booted the overhead is
only one register read.
The system-resume will have to runtime-resume the driver anyway before
attempting any register access. So this will automatically include the
wait for initialization on SoundWire.
ASoC: cs35l56: Skip first init_completion wait in dsp_work if init_done
At the start of dsp_work() only wait for init_completion if !init_done.
This allows system suspend to re-queue dsp_work() without having to
do a dummy complete() of init_completion.
A dummy completion in system suspend would have to be conditional on
init_done. But that would create a possible race condition between our
system resume and cs35l56_init() in the corner case that we suspend right
after the SoundWire core has enumerated and reported ATTACHED.
It is safer and simpler to have cs35l56_init() as the only place that
init_completion is completed, and dsp_work() as the only place that
it is consumed.
ASoC: cs35l56: Use DAPM widget for firmware PLAY/PAUSE
If we use a DAPM widget instead of mute_stream() to send the
PLAY command we can issue the plays to multiple amps in parallel.
With mute_stream each codec driver instance is called one at a
time so we get N * PS0 delay time.
DAPM does each stage on every widget in a card before moving to
the next stage. So all amps will do the PRE_PMU then all will do
the POST_PMU. The PLAY is sent in the PRE_PMU so that they all
power-up in parallel. After the PS0 wait in the first POST_PMU
all the other amps will also be ready so there won't be any extra
delay, or it will be negligible.
There's also no point waiting for the MBOX ack in the PRE_PMU.
We won't see a PS0 state in POST_PMU if it didn't ack the PLAY
command. So we can save a little extra time.
We have SOF and generic ACP support enabled for Rembrandt and
pheonix platforms on some machines. Since we have same PCI id
used for probing, add check for machine configuration flag to
avoid conflict with newer pci drivers. Such machine flag has
been initialized via dmi match on few Chrome machines. If no
flag is specified probe and register older platform device.
Ying Liu [Tue, 11 Apr 2023 17:09:12 +0000 (01:09 +0800)]
ASoC: tas5720: add missing unwind goto in tas5720_codec_probe
Smatch complains that missing unwind goto in tas5720_codec_probe.
When tas5720 has an invalid devtype, it is expected to invoke
regulator_bulk_disable to handle the failure. But the default
option return an error code directly. Fix it by reusing the
probe_fail label.
Fred Oh [Wed, 12 Apr 2023 06:14:57 +0000 (09:14 +0300)]
ASoC: SOF: Intel: mtl: fix page fault in dspless mode when DSP is disabled
The patch to make DSPless mode work even if the DSP is
disabled in BIOS missed to touch the MTL code to add
the needed checks.
If the DSP is disabled this can lead to page fault due to not
accesible registers.
Fixes: 9fc6786f549c ("ASoC: SOF: Intel: hda: make DSPless mode work with DSP disabled in BIOS") Signed-off-by: Fred Oh <fred.oh@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: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230412061457.27937-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Tue, 11 Apr 2023 18:47:17 +0000 (19:47 +0100)]
ASoC: SOF: Intel: hda-mlink: HDaudio multi-link
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
The following series adds the core support to handle the recently updated
HDaudio multi-link support to hanlde non HDA links, like SoundWire/DMIC/SSP on
Intel platform.
For details, please see the first patch which documents the current mlink
support (introduced at Skylake) and the new extensions, arriving with LNL.
There is no change in functionality for existing HDA support, the extension is
backwards compatible with existing implementations.
ASoC: mediatek: common: Fix refcount leak in parse_dai_link_info
Add missing of_node_put()s before the returns to balance
of_node_get()s and of_node_put()s, which may get unbalanced
in case the for loop 'for_each_available_child_of_node' returns
early.
- Switch to REGCACHE_FLAT, the whole overhead of RBTREE is not worth it
with non sparse register set in the address range 1..7.
- Move register width to central location
ASoC: ep93xx: i2s: move enable call to startup callback
Make startup/shutdown callbacks symmetric to avoid clock subsystem warnings
(reproduced with "aplay --dump-hw-params" + ctrl-c):
WARNING: CPU: 0 PID: 102 at drivers/clk/clk.c:1048 clk_core_disable
lrclk already disabled
CPU: 0 PID: 102 Comm: aplay Not tainted 6.2.0-rc4 #1
Hardware name: Generic DT based system
...
clk_core_disable from clk_core_disable_lock
clk_core_disable_lock from ep93xx_i2s_shutdown
ep93xx_i2s_shutdown from snd_soc_dai_shutdown
snd_soc_dai_shutdown from soc_pcm_clean
soc_pcm_clean from soc_pcm_close
soc_pcm_close from snd_pcm_release_substream.part.0
snd_pcm_release_substream.part.0 from snd_pcm_release
snd_pcm_release from __fput
__fput from task_work_run
...
WARNING: CPU: 0 PID: 102 at drivers/clk/clk.c:907 clk_core_unprepare
lrclk already unprepared
CPU: 0 PID: 102 Comm: aplay Tainted: G W 6.2.0-rc4 #1
Hardware name: Generic DT based system
...
clk_core_unprepare from clk_unprepare
clk_unprepare from ep93xx_i2s_shutdown
ep93xx_i2s_shutdown from snd_soc_dai_shutdown
snd_soc_dai_shutdown from soc_pcm_clean
soc_pcm_clean from soc_pcm_close
soc_pcm_close from snd_pcm_release_substream.part.0
snd_pcm_release_substream.part.0 from snd_pcm_release
snd_pcm_release from __fput
__fput from task_work_run
...
ASoC: dt-bindings: asahi-kasei,ak4458: fix missing quotes around hash
The yamllint expect comments to start with hash and space ('# '), so
quote the description to fix:
asahi-kasei,ak4458.yaml:40:30: [error] missing starting space in comment (comments)
Reported-by: Rob Herring <robh@kernel.org> Closes: https://lore.kernel.org/all/CAL_JsqJzxQb1g=yVgHduLnYOpk8-Q3jppA1qQT1Ce51_gNWjhg@mail.gmail.com/ Fixes: 009e83b591dd ("ASoC: dt-bindings: ak4458: Convert to dtschema") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230407170032.102412-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: SOF: Intel: hda-mlink: add helper to retrieve eml_lock
For SoundWire usages, we need to use the global eml_lock to
serialize/protect all accesses to shared registers. Due to the split
implementation across two subsystems, we need to pass a pointer
around.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230404104127.5629-19-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: SOF: Intel: hda-mlink: program SoundWire LSDIID registers
Each SoundWire peripheral can be programmed from the manager side
either with a regular command FIFO, or with the HDaudio CORB/RIRB
DMA-based mechanism. The mapping between SoundWire peripheral and SDI
address is handled with the LSDIID register.
This mapping only works of course if each peripheral has a unique
address across all links. This has already been enforced in previous
Intel contributions allowing for an IDA-based solution for the device
number allocation.
The checks on the dev_num are handled at the SoundWire level, but the
locking is handled at the hda-mlink level.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230404104127.5629-16-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: SOF: Intel: hda-mlink: add helpers to set link SYNC frequency
These helpers configure the ratio between the base clock and the
hardware signal used for link synchronization.
The SYNCPRD is written before the first sublink is powered-up. The
SYNCPU bit is set, but it will only be cleared after the link is
powered-up, hence the implementation with a set/wait pattern.
These helpers are currently only needed by SoundWire support, where
the lock is taken at a higher level, so only the _unlocked versions
are exposed for now.
Note that the _wait_bit() implementation is similar to previous
helpers in drivers/soundwire, but with sleep duration and timeout
aligned with hardware recommendations. If desired, this helper could
be modified in a second step with e.g. readl_poll_timeout().
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230404104127.5629-13-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: SOF: Intel: hda-mlink: add convenience helpers for SoundWire PM
The updated SoundWire Intel driver will need to rely on Extended
HDaudio links for power management, but it doesn't need to be aware of
all the HDaudio structures. Add convenience helpers to avoid polluting
SoundWire drivers too much with HDaudio information.
Since the SoundWire/Intel solution already takes the lock at a higher
level, the _unlocked PM helpers are used.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230404104127.5629-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: SOF: Intel: hda-mlink: introduce helpers for 'extended links' PM
Add helpers to program SPA/CPA bits, using a mutex to access the
shared LCTL register if required.
All links are managed with the same LCTLx.SPA bits. However there are
quite a few implementation details to be aware of:
Legacy HDaudio multi-links are powered-up when exiting reset, which
requires the ref_count to be manually set to one when initializing the
link.
Alternate links for SoundWire/DMIC/SSP need to be explicitly
powered-up before accessing the SHIM/IP/Vendor-Specific SHIM space for
each sublink. DMIC/SSP/SoundWire are all different cases with a
different device/dai/hlink relationship.
SoundWire will handle power management with the auxiliary device
resume/suspend routine. The ref_count is not necessary in this case.
The DMIC/SSP will by contrast handle the power management from DAI
.startup and .shutdown callbacks.
The SSP has a 1:1 mapping between sublink and DAI, but it's
bidirectional so the ref_count will help avoid turning off the sublink
when one of the two directions is still in use.
The DMIC has a single link but two DAIs for data generated at
different sampling frequencies, again the ref_count will make sure the
two DAIs can be used concurrently.
And last the SoundWire Intel require power-up/down and bank switch to
be handled with a lock already taken, so the 'eml_lock' is made
optional with the _unlocked versions of the helpers.
Note that the _check_power_active() implementation is similar to
previous helpers in sound/hda/ext, with sleep duration and timeout
aligned with hardware recommendations. If desired, this helper could
be modified in a second step with .e.g. readl_poll_timeout()
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230404104127.5629-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
For backwards compatibility, HDaudio/iDISP links are powered-on when
exiting reset, and the existing driver forces them to be powered-off
when entering S0ix. In addition, the get/put helpers are invoked
directly by the ASoC codec drivers, which a historical layering
violation.
Extended links are powered-on by software only, during the probe and
DAI startup phases. This calls for a different handling of the
'regular' and 'extended' audio links.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230404104127.5629-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: SOF: Intel: hda-mlink: add structures to parse ALT links
Extend hdac_ext_link to store information needed for ALT
links. Follow-up patches will include more functional patches for
power-up and down.
Note that this patch suggests the use of an 'eml_lock' to serialize
access to shared registers. SoundWire-specific sequence require the
lock to be taken at a higher level, as a result the helpers added in
follow-up patches will provide 'unlocked' versions when needed.
Also note that the low-level sequences with the 'hdaml_' prefix are
taken directly from the hardware specifications - naming conventions
included. The code will be split in two, with locking and linked-list
management handled separately to avoid mixing required hardware setup
and Linux-based resource management.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230404104127.5629-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: SOF: Intel: hda-mlink: move to a dedicated module
Some of the functions will be used for SoundWire enumeration and power
management, to avoid cycles in module dependencies and simplify
integration all the HDaudio multi-link needs to move to a dedicated
module.
Drop no longer needed headers at the same time.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20230404104127.5629-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Thu, 6 Apr 2023 15:02:24 +0000 (16:02 +0100)]
ASoC: qcom: fixes for Click/Pop Noise
Merge series from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
Click/Pop Noise was a long pending issue with WSA Codecs which are prone
to accumlate DC when ports are active but without any data streams.
There are multiple places in the current setup, where this could happen
in both startup as well as shutdown path.
ASoC: qcom: sdw: do not restart soundwire ports for every prepare
unpreparing/disabling and preparing/reenabling soundwire ports is not required
for every prepare call, this add lots of click and pop noise if we do this in
middle of playback or capture.
ASoC: qcom: q6apm-lpass-dai: close graphs before opening a new one
On multiple prepare calls, its possible that the playback graphs are
not unloaded from the DSP, which can have some wierd side-effects,
one of them is that the data not consumed without any errors.
dapm_connect_dai_pair() handles
"Normal/Codec2Codec" x "CPU/Codec" x "Playback/Capture".
(A) is "Codec2Codec" case of "CPU" widget x "Playback/Capture",
(B) is "Normal" case of "CPU" widget x "Playback/Capture",
(C) is each case of "Codec" widget.
(X) is handling "Playback" case DAI connecting,
(Y) is handling "Capture" case DAI connecting.
^ /* connect BE DAI playback if widgets are valid */
| stream = SNDRV_PCM_STREAM_PLAYBACK;
| (C) codec = codec_dai->playback_widget;
|
| if (playback_cpu && codec) {
(X) if (dai_link->params && !rtd->c2c_widget[stream]) {
| ...
| }
|
| (z) dapm_connect_dai_routes(...);
v }
capture:
^ /* connect BE DAI capture if widgets are valid */
| stream = SNDRV_PCM_STREAM_CAPTURE;
| (C) codec = codec_dai->capture_widget;
|
| if (codec && capture_cpu) {
(Y) if (dai_link->params && !rtd->c2c_widget[stream]) {
| ...
| }
|
| (z) dapm_connect_dai_routes(...);
v }
}
(X) part and (Y) part are almost same.
Main purpose of these parts (and this function) is calling
dapm_connect_dai_routes() (= z) on each cases.
The difference is "parameter"
(= Normal/Codec2Codec x CPU/Codec x Playback/Capture).
This patch cleanup these, but nothing changed for meaning.
ASoC: samsung: switch to use c2c_params instead of params
ASoC is now using c2c_params instead of params. This patch replace it.
num_c2c_params (was num_params) was not mandatory before,
but let's set it by this patch.
ASoC: meson: switch to use c2c_params instead of params
ASoC is now using c2c_params instead of params. This patch replace it.
num_c2c_params (was num_params) was not mandatory before,
but let's set it by this patch.
Mark Brown [Tue, 4 Apr 2023 17:40:48 +0000 (18:40 +0100)]
ASoC: SOF: core/Intel: Introduce DSPless mode
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
This series will add support for SOF Linux stack to run without using the DSP.
DSPless mode provides a good tool for verification that the hardware itself
works correctly by taking the DSP use out from the picture.
It can only work with interfaces which supports this mode: Intel HDA at the
moment but with LNL it could be possible to support other audio interfaces.
The main driver for this mode is to be able to test programming sequences,
low-level code and for low-level verification of a platform.
The feature is not targetted for end-users and it will not make the SOF stack
to work on hardware without DSP, but it is giving us a tool to debug and enable
platforms earlier (when for example t he firmware is not mature enough).
The goto will set the "soc_ac97_ops" and "soc_ac97_bus" operations to
NULL. But they are already NULL at this point so it is a no-op.
However, just for consistency, change the direct return to a goto. No
functional change.
ASoC: SOF: Intel: hda: make DSPless mode work with DSP disabled in BIOS
When the DSP is disabled in the BIOS, the DSP_BAR and PP_BAR cannot be
accessed.
One possible objection noted in initial reviews is that this patch
adds a number of branches. However the number of branches is actually
limited in probe/suspend/resume routines mostly, so there isn't really
a degradation in terms of readability and maintainability. Adding yet
another level of abstraction/ops/callbacks would increase complexity
and not really help in terms of code reuse or readability and
maintainability. A split between controller and DSP driver would be
even more invasive.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230404092115.27949-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:08 +0000 (12:21 +0300)]
ASoC: SOF: Intel: hda: Add support for DSPless mode
Via the SOF_DBG_DSPLESS_MODE sof_debug flag the SOF stack can be asked to
not use the DSP for audio.
The use of DSPless mode is governed by the sdev->dspless_mode_selected
flag which is only going to be set if the user sets sof_debug=0x8000 and
the platform advertises that the DSPless mode is supported on them.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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: Rander Wang <rander.wang@intel.com> Link: https://lore.kernel.org/r/20230404092115.27949-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:07 +0000 (12:21 +0300)]
ASoC: SOF: Intel: hda: Skip interfaces not supported on a platform
Not all interfaces (SSP/DMIC/HDA/SDW) are available on all platforms.
If the interface is not even supported then there is no point in executing
a probe or query for that interface.
Introduce a simple function (hda_get_interface_mask) to query the
interfaces supported on the platform.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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: Rander Wang <rander.wang@intel.com> Link: https://lore.kernel.org/r/20230404092115.27949-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Tue, 4 Apr 2023 09:21:05 +0000 (12:21 +0300)]
ASoC: SOF: Add flag and state which will be used for DSP-less mode
The DSPless mode of the ASoC/SOF driver can be used for hardware
verification and debug on platforms with HDaudio codecs. The DSP mode is
still needed on existing platforms for SSP, DMIC, SoundWire interfaces
managed by the GP-DMA.
This mode is also helpful to compare the legacy HDaudio driver with the
ASoC/SOF driver wrt. codec management and handling. In theory we use the
same code but differences are sometimes seen on jack detection and event
handling.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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: Rander Wang <rander.wang@intel.com> Link: https://lore.kernel.org/r/20230404092115.27949-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
During initial SOF driver bring up on AMD platforms, only DMIC
support was added. As of today, we have a complete SOF solution for
I2S endpoints along with DMIC endpoint.
This code is no longer required.
Remove unused code from RMB and RN platform ACP PCI driver.
Simon Trimmer [Tue, 28 Mar 2023 13:10:18 +0000 (14:10 +0100)]
firmware: cs_dsp: Add a debugfs entry containing control details
The file named 'controls' in the DSP's debugfs root contains a
formatted table describing the controls defined within the loaded DSP
firmware, it is of the form
name: len region:offset addr fwname algid ctltype flags en dirty
Where flags is represented as a character for each flag if set, or '-',
enabled is whether the control is enabled or disabled and dirty is
whether the control value is set in the cache but not the hardware.
Ryan Lee [Thu, 30 Mar 2023 23:43:18 +0000 (16:43 -0700)]
ASoC: max98363: add soundwire amplifier driver
Added Analog Devices MAX98363 SoundWire Amplifier Driver.
The MAX98363 is a SoundWire peripheral device that supports
MIPI SoundWire v1.2-compatible digital interface for audio and
control data.
Several devices (e.g. SC8280XP and SM8450) expect a NPL (Near Pad Logic)
clock. Add the clock and customize allowed clocks per each variant.
The clocks are also required by ADSP in all variants.
ASoC: dt-bindings: qcom,lpass-rx-macro: correct minItems for clocks
The RX macro codec comes on some platforms in two variants - ADSP
and ADSP bypassed - thus the clock-names varies from 3 to 5. The clocks
must vary as well:
sc7280-idp.dtb: codec@3200000: clocks: [[202, 8], [202, 7], [203]] is too short
Fixes: 852fda58d99a ("ASoC: qcom: dt-bindings: Update bindings for clocks in lpass digital codes") Cc: <stable@vger.kernel.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230330071333.24308-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Fri, 24 Mar 2023 16:33:28 +0000 (16:33 +0000)]
ASoC: dapm: Sort speakers after other outputs
Currently we sequence speakers with line and headphone outputs in DAPM.
This works well when speakers are integrate into a CODEC but when there is
an external speaker driver connected to a line or headphone output it can
mean that the speaker driver ends up getting sequenced such that it picks
up pops and clicks from the CODEC. Mask this by moving speakers after the
other outputs in DAPM.
We may want to consider doing this for headphones too but separate drivers
are less common there and headphone drivers often also function as line
outputs so the situation is less clear.
On SOF, many topology is assuming dai_link->platform exists, and is
allowed to be overwritten on each link_load().
This patch restore the removed dai_link->platform for SOF, and add
the comment.