When checking if the requested parameters are supported, the driver uses
PCM3168A_FMT_DSP_MASK to check for PCM3168A_FMT_DSP_* values.
However, formally not only PCM3168A_FMT_DSP_* values match that
condition, PCM3168A_FMT_I2S_TDM and PCM3168A_FMT_LEFT_J_TDM also do.
The check still gives correct result because those extra values can't
be in 'fmt' at the check location. Still, to make the code less cryptic,
better to compare 'fmt' with PCM3168A_FMT_DSP_* values explicitly.
Daniel Baluta [Fri, 11 Feb 2022 08:26:31 +0000 (10:26 +0200)]
ASoC: SOF: compr: Mark snd_compress_ops static
Functions won't be directly used outside of compress.c file
so mark them as static.
This will also fix warnings reported by kernel test robot:
>> sound/soc/sof/compress.c:91:5: warning: no previous prototype for
function 'sof_compr_open' [-Wmissing-prototypes]
int sof_compr_open(struct snd_soc_component *component,
^
sound/soc/sof/compress.c:91:1: note: declare 'static' if the function
is not intended to be used outside of this translation unit
int sof_compr_open(struct snd_soc_component *component,
Fixes: 6324cf901e14 ("SoC: SOF: compr: Add compress ops implementation") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20220211082631.179735-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
Julia Lawall [Thu, 10 Feb 2022 20:42:17 +0000 (21:42 +0100)]
ASoC: Intel: bytcr_wm5102: use GFP_KERNEL
Platform_driver probe functions aren't called with locks held
and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.
Problem found with Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220210204223.104181-4-Julia.Lawall@inria.fr Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Thu, 10 Feb 2022 17:20:52 +0000 (17:20 +0000)]
ASoC: wm_adsp: Make compressed buffers optional
Newer firmwares will support compressed buffers that may or may not
exist, for example debugging streams. Update the driver to make a
compressed stream optional. A warning will still be generated at DSP
boot time and opening the stream will fail if the compressed buffer in
question does not exist, however the DSP can still be booted and other
features used.
Ricard Wanderlof [Thu, 10 Feb 2022 17:07:36 +0000 (18:07 +0100)]
ASoC: tlv320adc3xxx: Add IIR filter configuration
The TLV320ADC3001/3101 have an internal DSP, which can either be
used in various preset configurations (called "Processing Blocks"
in the data sheet), or as a freely programmable (using the
"PurePath Studio" graphical programming tool from TI) but rather
small DSP ("miniDSP").
Using the default configuration (PRB_R1) it's possible to set up
filtering using a first-order IIR, which can be useful for adding
a digital high pass filter to the signal chain, for instance.
This patch adds support for configuring the IIR filter coefficients.
The filter itself is always enabled; the default coefficients
implement a pass-through function.
Mark Brown [Thu, 10 Feb 2022 18:16:07 +0000 (18:16 +0000)]
ASoC: SOF: IPC client infrastructure
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
The Linux SOF implementation is historically monolithic in a sense that all
features accessible in the firmware can be used via the snd_sof_dev struct in
one way or another.
Support for features can not be added or removed runtime and with the current
way of things it is hard if not impossible to implement support for dynamic
feature support when based on the firmware manifest we can easily enable/access
independent modules with the SOF.
In order to be able to support such modularity this series introduces a small
framework within SOF for client support using the Auxiliary bus.
Client drivers can be removed runtime and later re-loaded if needed without
affecting the core's behaviour, but it is the core's and the platform's duty
to create the Auxiliary devices usable in the platform and via the firmware.
There is still a need for SOF manifest update to convey information about
features to really make the full dynamic client device creation.
The series will introduce the core SOF client support and converts the generic
ipc flood test, ipc message injector and the probes (Intel HDA only) to a client
driver.
Peter Ujfalusi [Thu, 10 Feb 2022 15:05:25 +0000 (17:05 +0200)]
ASoC: SOF: Convert the generic probe support to SOF client
Add a new client driver for probes support and move
all the probes-related code from the core to the
client driver.
The probes client driver registers a component driver
with one CPU DAI driver for extraction and creates a
new sound card with one DUMMY DAI link with a dummy codec
that will be used for extracting audio data from specific
points in the audio pipeline.
The probes debugfs ops are based on the initial
implementation by Cezary Rojewski and have been moved
out of the SOF core into the client driver making it
easier to maintain. This change will make it easier
for the probes functionality to be added for all platforms
without having the need to modify the existing(15+) machine
drivers.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220210150525.30756-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: SOF: Convert the generic IPC flood test into SOF client
Move the IPC flood test code out from the debug file as separate SOF client
driver.
Based on the kernel configuration, the device registration for the new IPC
flood test is going to happen in the core.
With the separate client driver it is going to be possible to run multiple
flood tests in parallel to increase the stress, the new Kconfig option can
be used to select this (defaults to 1).
In order to preserve backward compatibility with existing SW/scripts, the
first IPC flood test's debugfs files have been linked to the old files.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Co-developed-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220210150525.30756-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Thu, 10 Feb 2022 15:05:22 +0000 (17:05 +0200)]
ASoC: SOF: sof-client: Add support for clients not managed by pm framework
Some SOF client can be of 'passive' type, meaning that they do not handle
PM framework callbacks by themselves but rely on the auxiliary driver's
suspend and resume callbacks to be notified about the core's suspend or
resume event.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220210150525.30756-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Thu, 10 Feb 2022 15:05:21 +0000 (17:05 +0200)]
ASoC: SOF: Introduce IPC SOF client support
A client in the SOF (Sound Open Firmware) context is a driver that needs
to communicate with the DSP via IPC messages. The SOF core is responsible
for serializing the IPC messages to the DSP from the different clients.
One example of an SOF client would be an IPC test client that floods the
DSP with test IPC messages to validate if the serialization works as
expected.
Multi-client support will also add the ability to split the existing audio
cards into multiple ones, so as to e.g. to deal with HDMI with a dedicated
client instead of adding HDMI to all cards.
This patch introduces descriptors for SOF client driver and SOF client
device along with APIs for registering and unregistering a SOF client
driver, sending IPCs from a client device and accessing the SOF core
debugfs root entry.
Along with this, add a couple of new members to struct snd_sof_dev that
will be used for maintaining the list of clients.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Co-developed-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220210150525.30756-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Thu, 10 Feb 2022 15:05:20 +0000 (17:05 +0200)]
ASoC: SOF: Split up utils.c into sof-utils and iomem-utils
The utils.c contains wrappers and implementation for accessing iomem mapped
regions and a single unrelated function to create a compressed page table
from snd_dma_buffer for firmware use.
The latter is used by the PCM and the dma trace code and it needs to be
moved to a generic source/header for the client conversion to be possible.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220210150525.30756-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Thu, 10 Feb 2022 15:05:19 +0000 (17:05 +0200)]
ASoC: SOF: ipc: Read and pass the whole message to handlers for IPC events
Change the parameter list for the firmware initiated message (IPC event)
handler functions to:
handler(struct snd_sof_dev *sdev, void *full_msg);
Allocate memory and read the whole message in snd_sof_ipc_msgs_rx() then
pass the pointer to the function handling the message.
Do this only if we actually have a function which is tasked to process the
given type.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220210150525.30756-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: bindings: fsl-asoc-card: Add compatible for tlv320aic31xx codec
Commit 8c9b9cfb7724 ("ASoC: fsl-asoc-card: Support
fsl,imx-audio-tlv320aic31xx codec")' added support for tlv320aic31xx
codec to fsl-asoc-card, but missed the related device-tree compatible
string documentation. Fix this.
Oder Chiou [Thu, 10 Feb 2022 07:19:00 +0000 (15:19 +0800)]
ASoC: rt5640: Remove the sysclk and sysclk_src checking
Remove the sysclk and sysclk_src checking in the function set_sysclk() to
prevent the PLL power off. It is not getting re-programmed during
subsequent runs after the first run (in BIAS_OFF stage).
Add new machine driver to register sound card on sc7280 based targets and
do the required configuration for lpass cpu dai and external codecs
connected over MI2S and soundwire interfaces.
Add support for audio jack detection, soundwire init and MBHC.
ASoC: dt-bindings: davinci-mcasp: convert McASP bindings to yaml schema
Convert the bindings for McASP controllers for TI SoCs from txt
to YAML schema.
Adds additional properties 'clocks', 'clock-names', 'power-domains',
'#sound-dai-cells' and 'port' which were missing from the txt file.
Removes properties 'sram-size-playback' and 'sram-size-capture'
since they are not used.
Adds 'dmas' and 'dma-names' in the example which were missing from
the txt file.
Changes 'interrupts' and 'interrupt-names' from optional to
required properties.
Changes 'op-modes', 'serial-dir' to optional properties as they are
not needed if the McASP is used only as GPIO.
Changes 'tdm-slots' to required property only for I2S operation mode.
Adds the yaml file in the 'MAINTAINERS' under the heading 'TEXAS
INSTRUMENTS ASoC DRIVERS'
Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com> Link: https://lore.kernel.org/r/20220209063008.2928-1-j-choudhary@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
No functionality change - just renaming of variables/members.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220209063104.9971-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Tue, 8 Feb 2022 18:58:10 +0000 (18:58 +0000)]
ASoC: SOF: dma-trace: Change trace_init() ops parameter list
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
Hi,
the DMA trace implementation on AMD platform assumes that the stream_tag pointer
is pointing the stream_tag member of struct sof_ipc_dma_trace_params_ext, which
is true at the moment, but it can not be guarantied and a change in the dtrace
core can cause out of bound accesses for AMD.
For this reason, change the API to pass the struct itself which will remove the
assumption and makes it clear from both sides what is expected to be sent via the
parameter list.
This opens up a window to clean up the intel and AMD implementation at the same
time.
Regards,
Peter
---
Peter Ujfalusi (2):
ASoC: SOF: intel: hda-trace: Pass the dma buffer pointer to
hda_dsp_trace_prepare
ASoC: SOF: dma-trace: Pass pointer to params_ext struct in
trace_init()
Sascha Hauer [Tue, 11 Jan 2022 08:15:18 +0000 (09:15 +0100)]
ASoC: fsl_sai: Enable combine mode soft
The fsl_sai driver calculates the number of pins used and enables
multiple channels if necessary. This means the SAI expects data in
one FIFO per pin. The SDMA engine only services a single FIFO, so
multi pin support doesn't work at all.
This patch enables the software combine mode in chips that support
it. With this the SAI presents only a single FIFO to the outside
and distributes the data into the different FIFOs internally.
Daniel Baluta [Thu, 20 Jan 2022 14:37:41 +0000 (16:37 +0200)]
ASoC: SOF: compr: Add compress ops implementation
Implement snd_compress_ops. There are a lot of similarities with
PCM implementation.
For now we use sof_ipc_pcm_params to transfer compress parameters to SOF
firmware.
This will be changed in the future once we either add new compress
parameters to SOF or enhance existing sof_ipc_pcm_params structure
to support all native compress params.
Note that get_caps and get_codec_caps are missing and will be added
later. This is because we need to find a way to advertise DSP
capabilities depending on supported platforms.
Mark Brown [Wed, 2 Feb 2022 19:23:33 +0000 (19:23 +0000)]
ASoC: simple-mux: Depend on gpiolib rather than selecting it
The simple-mux driver requires gpiolib. Currently it selects GPIOLIB but
since the use of select can lead to issues with randconfig let's instead
depend on GPIOLIB, select is more idiomatically used for Kconfig symbols
that are not user selectable but GPIOLIB is user selectable.
Mark Brown [Thu, 3 Feb 2022 15:18:28 +0000 (15:18 +0000)]
ASoC: sun4i-i2s: Support for Allwinner R329 and D1 SoCs
Merge series from Samuel Holland <samuel@sholland.org>:
This series extends the sun4i-i2s binding and driver to support some
newer versions of the hardware. Each instance of the hardwar now has
multiple input/output pins, and channels can be muxed between them.
Since so far the driver only supports a "default" linear channel map,
the driver changes are minimal.
Samuel Holland (3):
ASoC: dt-bindings: sun4i-i2s: Add compatibles for R329 and D1
ASoC: sun4i-i2s: Update registers for more channels
ASoC: sun4i-i2s: Add support for the R329/D1 variant
Charles Keepax [Thu, 3 Feb 2022 11:50:25 +0000 (11:50 +0000)]
ASoC: madera: Add dependencies on MFD
The Madera CODECs use regmap_irq functions but nothing ensures that
regmap_irq is built into the kernel. Add dependencies on the ASoC
symbols for the relevant MFD component. There is no point in building
the ASoC driver if the MFD doesn't support it and the MFD part contains
the necessary dependencies to ensure everything is built into the
kernel.
Mark Brown [Wed, 2 Feb 2022 19:13:22 +0000 (19:13 +0000)]
ASoC: samsung: Explicitly include gpiolib header
midas_wm811 uses gpiolib but relies on the header being implicitly included
which can lead to build failures in some configurations, explicitly pull
the header in to avoid problems.
Charles Keepax [Wed, 2 Feb 2022 16:45:45 +0000 (16:45 +0000)]
ASoC: wm8962: Allow switching between analog and digital inputs
When the DMIC_ENA bit is set the analogue inputs are disconnected from
the digital core of the chip, in favour of the digital microphones.
Currently the driver will always enable DMIC_ENA whilst the GPIOs are
configured for the DMIC function, this means the user can't currently
use both the analog inputs and the digital inputs in one system.
Add an additional DAPM mutex that allows switching between analog and
digital inputs into the digital core.
Reported-by: Martin Kepplinger <martin.kepplinger@puri.sm> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reported-and-tested-by: Martin Kepplinger <martin.kepplinger@puri.sm> Link: https://lore.kernel.org/r/20220202164545.30457-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Samuel Holland [Thu, 3 Feb 2022 02:01:15 +0000 (20:01 -0600)]
ASoC: sun4i-i2s: Add support for the R329/D1 variant
This adds a new set of quirks to set the right RX channel map. Since
that is the only change to the register layout, reuse the H6 regmap
config by extending its last register. R329 support is added by its
compatible string. D1 uses R329 as its fallback compatible, so no
additional code change is needed for it.
Samuel Holland [Thu, 3 Feb 2022 02:01:14 +0000 (20:01 -0600)]
ASoC: sun4i-i2s: Update registers for more channels
H6 expands the number of channels in each direction to 16, so the slot
number fields need to be expanded from 3 to 4 bits each.
R329/D1 expand that further by allowing each of the 16 slots to map to
any of 4 data pins. For TX, the configuration of each pin is
independent, so there is a copy of the mapping registers for each pin.
For RX, each of the 16 slots can map to only one pin, so the registers
were changed to add the pin selection inline with the channel mapping.
Samuel Holland [Thu, 3 Feb 2022 02:01:13 +0000 (20:01 -0600)]
ASoC: dt-bindings: sun4i-i2s: Add compatibles for R329 and D1
R329 contains I2S controllers which are similar to, but are incompatible
with, the H6 variant, because they change the layout of the RX channel
mapping registers. The D1 contains I2S controllers which appear to be
identical to those in the R329.
Randy Dunlap [Sat, 29 Jan 2022 08:02:59 +0000 (00:02 -0800)]
ASoC: max98927: add missing header file
Add a header file that provides the missing function prototypes
and macro to fix these build errors (seen on arch/alpha/):
../sound/soc/codecs/max98927.c: In function 'max98927_i2c_probe':
../sound/soc/codecs/max98927.c:902:19: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_regulator_get_optional'? [-Werror=implicit-function-declaration]
902 | = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_HIGH);
| ^~~~~~~~~~~~~~~~~~~~~~~
../sound/soc/codecs/max98927.c:902:63: error: 'GPIOD_OUT_HIGH' undeclared (first use in this function); did you mean 'GPIOF_INIT_HIGH'?
902 | = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_HIGH);
| ^~~~~~~~~~~~~~
../sound/soc/codecs/max98927.c:909:17: error: implicit declaration of function 'gpiod_set_value_cansleep'; did you mean 'gpio_set_value_cansleep'? [-Werror=implicit-function-declaration]
909 | gpiod_set_value_cansleep(max98927->reset_gpio, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~
Fixes: 4d67dc1998f1 ("ASoC: max98927: Handle reset gpio when probing i2c") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kernel test robot <lkp@intel.com> Cc: Alejandro Tafalla <atafalla@dnyon.com> Cc: Mark Brown <broonie@kernel.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Link: https://lore.kernel.org/r/20220129080259.19964-1-rdunlap@infradead.org Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Fri, 28 Jan 2022 20:45:42 +0000 (20:45 +0000)]
SoC: SOF: ipc: Optimizations for tx message
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:
The series will drop the internal use of 'header' parameter which is always
set to hdr->cmd.
The other simplification is to use the provided message directly as it is
guarantied to be valid throughout the message sending and we can save memory
by not allocating a temporary buffer, also saving on needles memcpy()
operations.
Mark Brown [Fri, 28 Jan 2022 20:45:41 +0000 (20:45 +0000)]
(Re)enable DP/HDMI audio for RK3399 Gru
Merge series from Brian Norris <briannorris@chromium.org>:
This series fixes DP/HDMI audio for RK3399 Gru systems.
First, there was a regression with the switch to SPDIF. Patch 1 can be
taken separately as a regression fix if desired. But it's not quite so
useful (at least on Chrome OS systems) without the second part.
Second, jack detection was never upstreamed, because the hdmi-codec
dependencies were still being worked out when this platform was first
supported.
Uwe Kleine-König [Mon, 10 Jan 2022 07:18:32 +0000 (08:18 +0100)]
ASoC: cs42l51: Improve error handling in cs42l51_remove()
When disabling a regulator fails while the device goes away, there is
little we can do and the machine is probably in enough trouble that any
action we'd want to take fails anyhow.
The return value used to be passed on in cs42l51_i2c_remove() (i.e. the
i2c device remove callback). But the i2c core ignores the error code
(apart from emitting a generic warning) and removes the device anyhow.
So return 0 unconditionally in cs42l51_i2c_remove(), and instead of
returning the error code to the upper layer emit a more helpful warning
message. After that nobody is interested any more in the actual error
code, so let cs42l51_remove() return void.
Peter Ujfalusi [Fri, 28 Jan 2022 13:36:20 +0000 (15:36 +0200)]
ASoC: SOF: ipc: Do not allocate buffer for msg_data
The sof_ipc_tx_message does not have support for async operations.
There is no need to allocate a buffer and copy each message to it to be
sent to the DSP, we can use the passed message data pointer directly.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220128133620.9411-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Fri, 28 Jan 2022 13:36:19 +0000 (15:36 +0200)]
ASoC: SOF: ipc: Drop header parameter from sof_ipc_tx_message_unlocked()
The snd_sof_ipc_msg.header is not used by platform code, there is no need
to update it and the 'header' parameter for sof_ipc_tx_message_unlocked()
can be dropped at the same time.
Instead of using the header parameter passed by the caller (which does by
setting it to the hdr->cmd) use the hdr->cmd directly when logging.
At the same time make sure that there is a message passed to the tx_message
function.
All instances of the tx_message passes an IPC message, this check is placed
to make sure the future users can not introduce bugs.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220128133620.9411-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: amd: renoir: Add check for acp configuration flags
We have SOF and generic ACP support enabled for Renoir 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.
ASoC: amd: acp: Add ACP init()/deinit() callback for Renoir.
ACP hardware has PGFSM control registers that can be configured to
power On/Off the ACP IP block. Add acp init()/de_init() callbacks
in renoir platform driver probe()/remove() respectively to power
on and off ACP IP block on ACP3X device.
Audio Co-processor or ACP IP block on AMD's SOC is connected via
PCI bus interface, hence needs to be register as a PCI device. We
have same PCI device ID across multiple SOC's but with different
revision id for PCI hw. Add a generic PCI driver module for ACP
that registers ACP as a PCI device and also register a platform
device based on pci revision id. Any SOC's specific configuration
for ACP block will be done in platform driver probe. We have added
an initial support for ACP revision id 3 or ACP3X device.
ASoC: amd: acp: Add generic support for PDM controller on ACP
Add driver module for PDM controller on ACP IP block. Expose dai
ops to configure ACP_WOV_PDM_BLOCK registers on ACP. Such dai ops
will be used by platform specific driver module to register dmic
related dai with ASoC.
Peter Ujfalusi [Fri, 28 Jan 2022 12:06:27 +0000 (14:06 +0200)]
ASoC: SOF: trace: Simplify count adjustment in trace_read
The first count check and fixup against "buffer - lpos" can be removed as
we will do the adjustment later against the "avail" in
sof_dfsentry_trace_read()
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> Link: https://lore.kernel.org/r/20220128120627.18443-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Rob Herring [Wed, 26 Jan 2022 23:13:58 +0000 (17:13 -0600)]
ASoC: dt-bindings: realtek,rt5682s: Drop Tegra specifics from example
There's no need to complicate examples with a platform specific macro.
It also complicates example parsing to figure out the number of interrupt
cells in examples (based on bracketing).
ASoC: SOF: Intel: hda: Remove link assignment limitation
The limitation to assign a link DMA channel for a BE iff the
corresponding host DMA channel is assigned to a connected FE is only
applicable if the PROCEN_FMT_QUIRK is set. So, remove it for platforms
that do not enable the quirk.
Complements: a792bfc1c2bc ("ASoC: SOF: Intel: hda-stream: limit PROCEN workaround") Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220128130017.28508-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Mohan Kumar [Fri, 28 Jan 2022 12:37:52 +0000 (18:07 +0530)]
ASoC: tegra: Update AHUB driver for Tegra234
The register offsets of switches connecting various AHUB internal
modules have changed from previous chip. Address this variation by
making use of Tegra234 based compatible.
Lad Prabhakar [Tue, 25 Jan 2022 13:24:56 +0000 (13:24 +0000)]
ASoC: sh: rz-ssi: Add rz_ssi_set_substream() helper function
A copy of substream pointer is stored in priv structure during
rz_ssi_dai_trigger() callback ie in SNDRV_PCM_TRIGGER_START case
and the pointer is assigned to NULL in case of SNDRV_PCM_TRIGGER_STOP.
The driver used the locks only in rz_ssi_stream_is_valid() and assigned
the local substream pointer to NULL in rz_ssi_dai_trigger() callback but
never locked it while making a local copy.
This patch adds the rz_ssi_set_substream() helper function to set the
substream pointer with locks acquired and replaces the instances of
setting the local substream pointer with the rz_ssi_set_substream()
function.
Lad Prabhakar [Tue, 25 Jan 2022 13:24:55 +0000 (13:24 +0000)]
ASoC: sh: rz-ssi: Use a do-while loop in rz_ssi_pio_recv()
Use a do-while loop while reading the samples from RX FIFO. The "done"
flag was only changed as an outcome of the last if-statement (last step)
in this entire procedure. This patch moves the condition from if
statement to while and drops the "done" variable for readability.
While at it, also drop the unneeded parentheses around runtime->dma_area.
Mark Brown [Tue, 25 Jan 2022 10:17:41 +0000 (10:17 +0000)]
ASoC: add support for TAS5805M digital amplifier
Merge series from Daniel Beer <daniel.beer@igorinstitute.com>:
This pair of patches implements support for the TAS5805M class D audio
amplifier. This driver, and the example configuration in the device-tree
file, were originally based on a 4.19 series kernel and have been
modified slightly from the tested version.
Mark Brown [Tue, 25 Jan 2022 10:17:40 +0000 (10:17 +0000)]
ASOC: cs42l42: Add support for system suspend
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:
Add system suspend and resume handlers so that the cs42l42 is cleanly
put into power-off state during system suspend and the registers are
restored in resume.
Mark Brown [Tue, 25 Jan 2022 10:17:38 +0000 (10:17 +0000)]
ASoC: SOF: Intel: improve SoundWire _ADR handling
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Make sure the device version is taken into account when selecting a
machine driver, in addition to device manufacturer and part_id, and
simplify code with a macro.
Mark Brown [Tue, 25 Jan 2022 10:17:37 +0000 (10:17 +0000)]
ASoC: fsl-asoc-card: Add optional dt property for setting mclk-id
Merge series from Ariel D'Alessandro <ariel.dalessandro@collabora.com>:
Sound cards may allow using different main clock inputs. In the generic
fsl-asoc-card driver, these values are hardcoded for each specific card
configuration. Let's make it more flexible, allowing setting mclk-id
from the device-tree node.
Mark Brown [Tue, 25 Jan 2022 02:36:24 +0000 (02:36 +0000)]
ASoC: sh: rz-ssi: Code cleanup and fixes
Merge series from Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>:
Hi All,
This patch series does code cleanup and fixes to the rz-ssi driver.
Cheers,
Prabhakar
Lad Prabhakar (5):
ASoC: sh: rz-ssi: Drop calling rz_ssi_pio_recv() recursively
ASoC: sh: rz-ssi: Make the data structures available before
registering the handlers
ASoC: sh: rz-ssi: Drop ssi parameter from rz_ssi_stream_init()
ASoC: sh: rz-ssi: Make return type of rz_ssi_stream_is_valid() to bool
ASoC: sh: rz-ssi: Add functions to get/set substream pointer
Mark Brown [Tue, 25 Jan 2022 02:36:23 +0000 (02:36 +0000)]
ASoC: Xilinx fixes
Merge series from Robert Hancock <robert.hancock@calian.com>:
There are drivers in mainline for the Xilinx Audio Formatter and Xilinx
I2S IP cores. However, because of a few issues, these were only really
usable with Xilinx's xlnx_pl_snd_card top-level driver, which is not in
mainline (and not suitable for mainline).
The fixes in this patchset, for the simple-card layer as well as the
Xilinx drivers, now allow these drivers to be properly used with
simple-card without any out-of-tree support code.
Mark Brown [Tue, 25 Jan 2022 02:36:22 +0000 (02:36 +0000)]
ASoC: SOF: Intel: don't download firmware at each resume
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
After the first firmware boot, the firmware is capable of
saving/restoring its context to/from IMR (Isolated Memory Region, set
aside by BIOS on startup). This capability improves the resume speed.
Due to an unexplained issue on Up2 boards, this capability is disabled
on ApolloLake.
For backwards compatibility, the regular boot flow is used with older
firmware. For added peace of mind, a kernel module parameter is
provided to force the regular boot flow - this shouldn't be necessary
since we've been testing these patches for 6+ months.
Mark Brown [Tue, 25 Jan 2022 02:36:20 +0000 (02:36 +0000)]
ASoC: topology: Fixes
Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>:
Following series performs few cleanups in topology code.
First patch reduces number of prints we get from failure.
Second allos TLV controls to be either read or write which should be
possible as evidenced by further code in function.
Last one cleanups after refactoring of memory handling.
v2:
- Add missing Fixes tag on second patch
- Add Reviewed-by tag from Pierre
Amadeusz Sławiński (3):
ASoC: topology: Remove superfluous error prints
ASoC: topology: Allow TLV control to be either read or write
ASoC: topology: Optimize soc_tplg_dapm_graph_elems_load behavior
Robert Hancock [Thu, 20 Jan 2022 19:58:32 +0000 (13:58 -0600)]
ASoC: simple-card-utils: Add new system-clock-fixed flag
Add a new system-clock-fixed flag, which can be used to specify that the
driver cannot or should not allow the clock frequency of the mapped clock
to be modified. This behavior is also implied if the system-clock-frequency
parameter is set explicitly - the flag is meant for cases where a clock is
mapped to the DAI but which is, or should be treated as, fixed.
When mclk-fs is also specified, this causes a PCM constraint to be added
which enforces that only the corresponding valid sample rate can be used.
Robert Hancock [Thu, 20 Jan 2022 19:58:31 +0000 (13:58 -0600)]
ASoC: dt-bindings: simple-card: document new system-clock-fixed flag
Document the new system-clock-fixed flag, which can be used to specify
that the driver cannot or should not allow the clock frequency of the
mapped clock to be modified.
Robert Hancock [Thu, 20 Jan 2022 19:58:30 +0000 (13:58 -0600)]
ASoC: simple-card-utils: Set sysclk on all components
If an mclk-fs value was provided in the device tree configuration, the
calculated MCLK was fed into the downstream codec DAI and CPU DAI,
however set_sysclk was not being called on the platform device. Some
platform devices such as the Xilinx Audio Formatter need to know the MCLK
as well.
Call snd_soc_component_set_sysclk on each component in the stream to set
the proper sysclk value in addition to the existing call of
snd_soc_dai_set_sysclk on the codec DAI and CPU DAI. This may end up
resulting in redundant calls if one of the snd_soc_dai_set_sysclk calls
ends up calling snd_soc_component_set_sysclk itself, but that isn't
expected to cause any significant harm.
Fixes: f48dcbb6d47d ("ASoC: simple-card-utils: share asoc_simple_hw_param()") Signed-off-by: Robert Hancock <robert.hancock@calian.com> Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/20220120195832.1742271-5-robert.hancock@calian.com Signed-off-by: Mark Brown <broonie@kernel.org>
Robert Hancock [Thu, 20 Jan 2022 19:58:29 +0000 (13:58 -0600)]
ASoC: xilinx: xlnx_i2s: Handle sysclk setting
This driver previously only handled the set_clkdiv divider callback when
setting the SCLK Out Divider field in the I2S Timing Control register.
However, when using the simple-audio-card driver, the set_sysclk function
is called but not set_clkdiv. This caused the divider not to be set,
leaving it at an invalid value of 0 and resulting in a very low SCLK
output rate.
Handle set_clkdiv and store the sysclk (MCLK) value for later use in
hw_params to set the SCLK Out Divider such that:
MCLK/SCLK = divider * 2
Robert Hancock [Thu, 20 Jan 2022 19:58:28 +0000 (13:58 -0600)]
ASoC: xilinx: xlnx_i2s: create drvdata structure
An upcoming change will require storing additional driver data other
than the memory base address. Create a drvdata structure and use that
rather than storing the raw base address pointer.
This driver did not set the MM2S Fs Multiplier Register to the proper
value for playback streams. This needs to be set to the sample rate to
MCLK multiplier, or random stream underflows can occur on the downstream
I2S transmitter.
Store the sysclk value provided via the set_sysclk callback and use that
in conjunction with the sample rate in the hw_params callback to calculate
the proper value to set for this register.
Jiasheng Jiang [Fri, 21 Jan 2022 17:10:31 +0000 (01:10 +0800)]
ASoC: codecs: Check for error pointer after calling devm_regmap_init_mmio
Since the potential failure of the devm_regmap_init_mmio(), it will
return error pointer and be assigned to the regmap.
Then the error pointer will be dereferenced.
For example rx->regmap will be used in rx_macro_mclk_enable().
Therefore, it should be better to check it.
Fixes: af3d54b99764 ("ASoC: codecs: lpass-rx-macro: add support for lpass rx macro") Fixes: c39667ddcfc5 ("ASoC: codecs: lpass-tx-macro: add support for lpass tx macro") Fixes: 809bcbcecebf ("ASoC: codecs: lpass-wsa-macro: Add support to WSA Macro") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Link: https://lore.kernel.org/r/20220121171031.2826198-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
codec system clock source support 512FS MCLK synchronous directly, so
no need to set PLL configuration when MCLK 24.576MHz.
Suggested-by: Shuming Fan <shumingf@realtek.com> Signed-off-by: Mac Chiang <mac.chiang@intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220120054012.15849-1-mac.chiang@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: amd: sof-mach: Add support for RT5682S and RT1019 card
We have new platform with rt5682s as a primary codec and rt1019 as an
amp codec. Add machine struct to register sof audio based sound card
on such Chrome machine.
Shengjiu Wang [Thu, 20 Jan 2022 02:44:02 +0000 (10:44 +0800)]
ASoC: soc-generic-dmaengine-pcm: separate max_buffer_size assignment
The config->pcm_hardware may be NULL when config->prealloc_buffer_size
is not zero, so it is better to move max_buffer_size assignment under
a separate condition.
ASoC: fsl-asoc-card: Add optional dt property for setting mclk-id
Sound cards may allow using different main clock inputs. In the generic
fsl-asoc-card driver, these values are hardcoded for each specific card
configuration.
Let's make it more flexible, allowing setting mclk-id from the
device-tree node. Otherwise, the default value for each card
configuration is used.