Commit Graph

26431 Commits

Author SHA1 Message Date
Liang He eda26893da
ASoc: audio-graph-card2: Fix refcount leak bug in __graph_get_type()
We should call of_node_put() for the reference before its replacement
as it returned by of_get_parent() which has increased the refcount.
Besides, we should also call of_node_put() before return.

Fixes: c8c74939f7 ("ASoC: audio-graph-card2: add Multi CPU/Codec support")
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220713071200.366729-1-windhl@126.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-13 13:48:54 +01:00
Dan Carpenter 73acfba792
ASoC: amd: Fix error pointer dereference
The "gpio_pa" pointer is an error pointer, there is no need to try
put it.  Calling gpiod_put() on it will lead to an error pointer
dereference.

Fixes: 02527c3f23 ("ASoC: amd: add Machine driver for Jadeite platform")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Ys2IRPHWGIwuVs21@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-13 13:48:53 +01:00
Mark Brown 4e90651e52
ASoC: SOF: Intel: hda: Correct Firmware State Register use
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

The FSR (Firmware State Register) holds the ROM state information, it does not
contain error information.
The FSR itself is a bit more complicated as well as the state depends on the
module currently in use.

The error code from ROM or the status code from the firmware is located at the
next register.

Fix the handling of the FSR in order to provide usable and human readable (in
most cases) report on the status and error.
2022-07-12 19:21:45 +01:00
Mark Brown 4457fbd66b
Extend ipc stream parameters sent to DSP
Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>
Daniel Baluta <daniel.baluta@nxp.com>:

From: Daniel Baluta <daniel.baluta@nxp.com>

We need a way to send extra parameters to DSP firmware. In order to do
this, we introduce ext_data array at the end of ipc_stream_params.

With this new addition we can send compress parameters.

This requires SOF ABI bump.
2022-07-12 19:21:43 +01:00
Mark Brown 501935dae8
ASoC: SOF: Intel: Do not process IPC reply before firmware boot
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

By mistake a developer managed to create a 'corrupted' IPC4 firmware image which
loaded fine to the DSP and after boot it sent an IPC reply before we would have
received the FW_READY message.
It turned out that the image was an IPC3 firmware and the IPC reply was the IPC3
FW_READY notification message which got understood as an IPC4 reply message due
to the difference between the two IPC mechanism.

This caused a NULL pointer dereference since the reply memory will be allocated
after the FW_READY message.

To make sure this will not bite again, skip any spurious reply messages before
the FW_READY.
2022-07-12 19:21:42 +01:00
Mark Brown 274a3e6f98
ASoC: SOF: Intel: hda-dai: No need to decouple host/link DMA twice
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

There is no need to decouple a decoupled stream twice.
Keep the decoupling in hda_link_stream_assign() only as it is going to be
executed in all cases.

Drop the outdated comment from hda_link_dma_hw_params() as well since the code
has changed around it.
2022-07-12 19:21:41 +01:00
Peter Ujfalusi d5bd47f3ca
ASoC: SOF: ipc3-topology: Prevent double freeing of ipc_control_data via load_bytes
We have sanity checks for byte controls and if any of the fail the locally
allocated scontrol->ipc_control_data is freed up, but not set to NULL.

On a rollback path of the error the higher level code will also try to free
the scontrol->ipc_control_data which will eventually going to lead to
memory corruption as double freeing memory is not a good thing.

Fixes: b5cee8feb1 ("ASoC: SOF: topology: Make control parsing IPC agnostic")
Reported-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.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/20220712130103.31514-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 17:39:25 +01:00
Peter Ujfalusi 9b93eda355
ASoC: SOF: sof-client-probes: Only load the driver if IPC3 is used
The current implementation of probes only supports IPC3 and should not be
loaded for other IPC implementation.

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/20220712131022.1124-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 17:39:24 +01:00
Mark Brown 67e1b7700c
ASoC: SOF: Intel: hda: Use cold/purge boot after firmware crash
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

In case of a firmware crash we force the DSP to be powered down and rebooted.
To make sure that the next boot is going to be clean, force the boot process to
skip the IMR booting and re-download the firmware.
2022-07-12 16:10:05 +01:00
Daniel Baluta 246b135fcd
ASoC: SOF: compress: Prevent current kernel running with older FW
After introducing extended parameters we need to forbid older firmware
versions to run with the current and future kernel versions.

Although in theory the communication protocol will still work the
semantics at application level are undefined. So, prevent this by
disallowing older firmwares to run with newer kernels.

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>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220712141531.14599-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 15:22:08 +01:00
Daniel Baluta 3f70c360d4
ASoC: SOF: Copy compress parameters into extended data
Allocate memory at the end of sof_ipc_stream_params to store
snd_compr_params in order to be sent them to SOF firmware.

This will help firmware correctly configure codecs parameters.

Notice, that we use 2 bytes from the reserved pool in order to store
the extended data length. This is compatible with older FWs where
there was no extended data.

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>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220712141531.14599-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 15:22:07 +01:00
Daniel Baluta d5770daef6
ASoC: SOF: compress: Dynamically allocate pcm params struct
We need to extend sof_ipc_pcm_parmas with additional data in order
to send compress_params to SOF FW.

The extensions will be done at runtime so we need to dynamically
allocate pcm object of type struct sof_ipc_pcm_params.

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>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220712141531.14599-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 15:22:06 +01:00
Peter Ujfalusi fbabebfb26
ASoC: SOF: Intel: hda-dai: Do snd_hdac_ext_stream_decouple() only once
Call snd_hdac_ext_stream_decouple_locked() unconditionally in
hda_link_stream_assign(), the snd_hdac_ext_stream_decouple_locked() have
internal checks to avoid re-configuring.

There is no need to call snd_hdac_ext_stream_decouple() via
hda_link_dma_params() as the stream must have been set to decoupled when
it got assigned (even if it used local condition to call
snd_hdac_ext_stream_decouple_locked()).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220712131620.13365-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 14:22:58 +01:00
Peter Ujfalusi 402355e6cd
ASoC: SOF: Intel: hda-dai: Drop misleading comment regarding dma_data
The comment in hda_link_dma_hw_params() is no longer valid as the dma_data
is set to NULL at system suspend as well.

Instead of rewording the comment to state the obvious: try to take the
hext_stream from the dma_data and if it is not set then assign a new one
and store it as dma_data.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220712131620.13365-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 14:22:57 +01:00
Peter Ujfalusi 15d8370cf6
ASoC: SOF: Intel: hda: Correct the ROM/FW state reporting code
The FSR (Firmware State Register) can be found at offset 0 in the SRAM and
it is holding information about the state of the ROM/FW.
In case of a boot failure it can be used to get the state where the boot
process got stuck, it does not itself contains error codes as such.

The error code (or the firmware state information) is stored in the next
soft register at offset 0x4.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220712125734.30512-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 13:59:57 +01:00
Ranjani Sridharan 98418a08a2
ASoC: SOF: topology: remove unused variable
'ret' is never used. Remove it and return 0 instead.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@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: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220712123902.14696-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 13:45:08 +01:00
Pierre-Louis Bossart 4ccf0949cd
ASoC: soc-pcm: demote warnings on non-atomic BE connection
When an FE, typically non-atomic, is connected to an atomic BE, we
force the BE as non-atomic. There's no reason to throw a warning, this
is a perfectly fine configuration and a conversion that's required
by-design.

This removes the unconditional warnings such as

[   12.054213]  iDisp1: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic
[   12.074693]  iDisp2: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic
[   12.096612]  iDisp3: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic
[   12.118637]  iDisp4: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic
[   12.140660]  dmic01: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic
[   12.147521]  dmic16k: dpcm_be_connect: FE is nonatomic but BE is not, forcing BE as nonatomic

and demotes them to dev_dbg(), as suggested in review comments.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220708200641.26923-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 13:45:07 +01:00
Peter Ujfalusi 57724db17a
ASoC: SOF: Intel: hda: Introduce skip_imr_boot flag
Use a dedicated flag instead of directly checking the
sdev->system_suspend_target to decide if we need to skip IMR boot due to
too deep sleep state where the memory used for IMR booting will not retain
its content.

The skip_imr_boot flag will be set true during suspend if the target state
is deeper than S3 and reset back to false on successful boot to re-enable
IMR booting in shallower sleep states.

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/20220712120936.28072-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 13:45:05 +01:00
Peter Ujfalusi 1549a69b89
ASoC: SOF: Intel: mtl: Do not process IPC reply before firmware boot
It is not yet clear, but it is possible to create a firmware so broken
that it will send a reply message before a FW_READY message (it is not
yet clear if FW_READY will arrive later).
Since the reply_data is allocated only after the FW_READY message, this
will lead to a NULL pointer dereference if not filtered out.

Reported-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.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/20220712122357.31282-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 13:45:03 +01:00
Peter Ujfalusi 499cc881b0
ASoC: SOF: Intel: hda-ipc: Do not process IPC reply before firmware boot
It is not yet clear, but it is possible to create a firmware so broken
that it will send a reply message before a FW_READY message (it is not
yet clear if FW_READY will arrive later).
Since the reply_data is allocated only after the FW_READY message, this
will lead to a NULL pointer dereference if not filtered out.

The issue was reported with IPC4 firmware but the same condition is present
for IPC3.

Reported-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.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/20220712122357.31282-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 13:45:02 +01:00
Peter Ujfalusi acacd9eefd
ASoC: SOF: Intel: cnl: Do not process IPC reply before firmware boot
It is not yet clear, but it is possible to create a firmware so broken
that it will send a reply message before a FW_READY message (it is not
yet clear if FW_READY will arrive later).
Since the reply_data is allocated only after the FW_READY message, this
will lead to a NULL pointer dereference if not filtered out.

The issue was reported with IPC4 firmware but the same condition is present
for IPC3.

Reported-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.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/20220712122357.31282-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-12 13:45:01 +01:00
Mark Brown 388fe2b8a3
ASoC: Intel: avs: Updates and cleanups
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Series consists of loosely connected patches and does not concentrate on
one specific subject.

First, as generic HDAudio codec driver is now part of ASoC, avs-driver
core is updated to register missing ext_bus operations. This completes
driver's core implementation.

The next change adds the last missing piece for port descriptions coming
from topology in formatted string format e.g.: ssp%d have full
effect. To do that, the port value needs to be provided to respective
copier configuration.

Third change relaxes core transition timings so that scenarios where
modules are interfering with each other while being on separate cores
are not occasionally causing trouble.

All other changes are addressing warnings, cleaning things up a little
and protecting driver from invalid firmware behavior - while not
expected in release binaries, does not hurt to add them.
2022-07-11 22:13:49 +01:00
Seven Lee 2551b6e899
ASoC: nau8821: Add headset button detection
This patch adds the function of headphone button detection,
Button detection will be enabled if the device tree
has a key_enable property.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20220627032959.3442064-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 17:18:45 +01:00
Mark Brown 8e26c518d3
ASoC: codecs: Series of fixes for realtek codecs used on RVPs
Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>:

Our tests platforms do use realtek codecs, while implementing avs driver
and machine boards for it, we identified some problems with those codec
drivers.

This series aims to fix those issues.
2022-07-11 17:00:54 +01:00
Mark Brown 61b23b6b7b
ADD legacy audio driver support for rembrandt
Merge series from V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>:

Add Generic driver to support multiple platform,
ADD HS control instance for Rembrandt platform.
Add nau8825,max98560 and rt5682s,rt1019 combination support for legacy
platform.
2022-07-11 16:18:15 +01:00
Mark Brown 3585da93a2
ASoC: SOF: ipc4-topology: fix error and memory handling
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Two patches to improve error and memory handling. When IPC4 is used,
some of the flows were incorrect.
2022-07-11 16:18:13 +01:00
Pierre-Louis Bossart fd1c769d33
ASoC: SOF: remove warning on ABI checks
We should only have an error when enforcing strict mapping between
kernel and firmware versions. In all other cases, there is no reason
to throw a warning.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220708200719.26961-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 16:16:13 +01:00
Claudiu Beznea 375f53566c
ASoC: atmel: mchp-pdmc: remove space in front of mchp_pdmc_dt_init()
Remove extra space in front of mchp_pdmc_dt_init().

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220711112212.888895-1-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 16:16:12 +01:00
Mark Brown 39c5c44fc4
ASoC: Merge up fixes
Needed for the Rockchip driver.
2022-07-11 15:51:01 +01:00
Amadeusz Sławiński b9f098aa7a
ASoC: codecs: rt274: Set component to NULL on remove
Make sure that component is set to proper value, otherwise we may
dereference freed component in interrupt.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707125701.3518263-6-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 14:59:10 +01:00
Amadeusz Sławiński af3b33b970
ASoC: codecs: rt298: Set component to NULL on remove
Make sure that component is set to proper value, otherwise we may
dereference freed component in interrupt.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707125701.3518263-5-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 14:59:09 +01:00
Amadeusz Sławiński c1d7ebda11
ASoC: codecs: rt286: Set component to NULL on remove
Make sure that component is set to proper value, otherwise we may
dereference freed component in interrupt.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707125701.3518263-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 14:59:08 +01:00
Amadeusz Sławiński c0c5a242bb
ASoC: codecs: rt298: Fix jack detection
On our RVP platforms using rt298 with combojack we've seen issues with
controls being in incorrect state after suspend/resume cycle. This is
caused by codec driver not setting pins to correct state and causing
codec suspend method to not be called. Which on resume caused codec
registers to be in undefined state. Fix this by setting pins correctly
in jack detect function.

Above problem is caused by the fact that when jack == NULL code doesn't
reach rt298_jack_detect() function which sets pins. Alternatively
problem could be fixed by just moving rt298_jack_detect, but as rt298
codec is similar to rt286, align the code by setting pins explicitly.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707125701.3518263-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 14:59:07 +01:00
Amadeusz Sławiński 9b6803ec1f
ASoC: codecs: rt298: Fix NULL jack in interrupt
Set rt298->jack to passed value in mic_detect, otherwise when jack is
set to NULL on next interrupt call, we may use freed pointer.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707125701.3518263-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 14:59:06 +01:00
Alexandru Elisei 26b9f2fa7b
ASoC: rockchip: i2s: Fix NULL pointer dereference when pinctrl is not found
Commit a5450aba73 ("ASoC: rockchip: i2s: switch BCLK to GPIO") switched
BCLK to GPIO functions when probing the i2s bus interface, but missed
adding a check for when devm_pinctrl_get() returns an error.  This can lead
to the following NULL pointer dereference on a rockpro64-v2 if there are no
"pinctrl" properties in the i2s device tree node.

Check that i2s->pinctrl is valid before attempting to search for the
bclk_on and bclk_off pinctrl states.

Fixes: a5450aba73 ("ASoC: rockchip: i2s: switch BCLK to GPIO")
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20220711130522.401551-1-alexandru.elisei@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 14:25:18 +01:00
Shengjiu Wang eaa27e7fe4
ASoC: fsl_utils: Drop usage of __clk_get_name()
Avoid build errors when CONFIG_COMMON_CLK is not set/enabled.

ERROR: modpost: "__clk_get_name" [sound/soc/fsl/snd-soc-fsl-utils.ko] undefined!

Fixes: 7bad812554 ("ASoC: fsl_utils: Add function to handle PLL clock source")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1657507190-14546-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 12:06:29 +01:00
Zhongjun Tan 19bb587f3f
ASoC: mediatek: mt8186: Remove condition with no effect
Remove condition with no effect

Signed-off-by: Zhongjun Tan <tanzhongjun@coolpad.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220708024651.42999-1-hbut_tan@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 12:06:28 +01:00
YC Hung 99bad46884
ASoC: SOF: mediatek: fix mt8195 StatvectorSel wrong setting
Fix StatVectorSel wrong setting.

Fixes: b7f6503830 ("ASoC: SOF: mediatek: Add fw loader and mt8195 dsp ops to load firmware")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Li-Yu Yu <afg984@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: KuanHsun Cheng <Allen-KH.Cheng@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220708203904.29214-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 12:04:35 +01:00
YC Hung 13a45b9484
ASoC: SOF: mediatek: Revise mt8195 boot flow
1. Revise hifixdsp shutdown flow to pull runstall high then reset high.
2. Add 1 us delay between D/BRESET high and low for 10 DSP cycles(26M)
   based on IP vendor's suggestion.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Li-Yu Yu <afg984@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: KuanHsun Cheng <Allen-KH.Cheng@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220708203904.29214-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-11 12:04:34 +01:00
Mark Brown 7d596d9bb2
ASoC: audio-graph-card2.c: make Codec2Codec settings optional
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Audio Graph Card2 has Codec2Codec support, but I noticed
 - Current Codec2Codec setting value is not correct
   because it is using of_get_property().
 - simple-card-utils has default Codec2Codec settings
   and it is overwriting Card2 settings
 - This default settings works for non Codec2Codec case
   (= DPCM::BE case) too.

This patch-set solve these issues.
2022-07-08 21:46:29 +01:00
Mark Brown bf02bb4d3b
ASoC: Intel: sof_cs42l42: adding support for ADL configuration and BT offload
Merge series from Brent Lu <brent.lu@intel.com>:

1. Add BT offload fetch to cs42l42 machine driver
2. Support cs42l42+max98360a on ADL platform
2022-07-08 21:46:28 +01:00
Libin Yang dc4fc0ae94
ASoC: SOF: ipc4-topology: free memories allocated in sof_ipc4_get_audio_fmt
Free the memories allocated in sof_ipc4_get_audio_fmt in error handling
and ipc_free()

Fixes: 2cabd02b60 ("ASoC: SOF: ipc4-topology: Add support for parsing AIF_IN/AIF_OUT widgets")
Fixes: abfb536bd1 ("ASoC: SOF: ipc4-topology: Add support for parsing DAI_IN/DAI_OUT widgets")
Fixes: 4f838ab208 ("ASoC: SOF: ipc4-topology: Add support for parsing and preparing pga widgets")
Fixes: 4d4ba014ac ("ASoC: SOF: ipc4-topology: Add support for parsing mixer widgets")
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220708200516.26853-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 21:30:31 +01:00
Libin Yang b737fd8cf1
ASoC: SOF: ipc4-topology: check dai->private in ipc_free()
Set the swidget->private or dai->private to NULL after kfree in the error
handling in ipc_setup(). The private needs to be set NULL because if
ipc_setup() returns error, ipc_free() will be called later. ipc_free()
will judge the private is NULL or not to do the clearing.

For dai widget, dai->private is allocated and set in dai widget
ipc_setup(). So we need to check dai->private is NULL or not
in the ipc_free().

Fixes: 2cabd02b60 ("ASoC: SOF: ipc4-topology: Add support for parsing AIF_IN/AIF_OUT widgets")
Fixes: abfb536bd1 ("ASoC: SOF: ipc4-topology: Add support for parsing DAI_IN/DAI_OUT widgets")
Fixes: 4f838ab208 ("ASoC: SOF: ipc4-topology: Add support for parsing and preparing pga widgets")
Fixes: 4d4ba014ac ("ASoC: SOF: ipc4-topology: Add support for parsing mixer widgets")
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220708200516.26853-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 21:30:30 +01:00
Cezary Rojewski f1eea11523
ASoC: Intel: avs: Update AVS_FW_INIT_TIMEOUT_US declaration
To reduce the number of places to update if timeouts would have to
change, modify the constant declaration.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-13-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:29 +01:00
Cezary Rojewski 8758ae88f0
ASoC: Intel: avs: Lower UNLOAD_MULTIPLE_MODULES IPC timeout
Module unloading operation performs memory unmapping and the weight of
the opration does not different from any other standard IPC. There is no
dependency on secondary task like in module loading scenario where
larger message timeout is recommended.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-12-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:28 +01:00
Cezary Rojewski 4b38bd16ca
ASoC: Intel: avs: Replace hardcodes with SD_CTL_STREAM_RESET
Improve readability of CLDMA reset operation by making use of
already defined SD_CTL_STREAM_RESET.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:26 +01:00
Cezary Rojewski 79c351fb50
ASoC: Intel: avs: Recognize FW_CFG_RESERVED
If exposed by firmware, count RESERVED parameter as known one to avoid
dumping noise in kernel logs.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:25 +01:00
Amadeusz Sławiński a5bbbde2b8
ASoC: Intel: avs: Use helper function to set up DMA
dma_set_mask() and dma_set_coherent_mask() can be performed with one
call to dma_set_mask_and_coherent(), which slightly reduces amount of
code on our side.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:24 +01:00
Amadeusz Sławiński 8544eebc78
ASoC: Intel: avs: Set max DMA segment size
Apparently it is possible for code to allocate large buffers which may
cause warnings as reported in [1]. This was fixed for HDA, SOF and
skylake in patchset [2], fix it also for avs driver.

[1] https://github.com/thesofproject/linux/issues/3430
[2] https://lore.kernel.org/all/20220215132756.31236-1-tiwai@suse.de/

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:23 +01:00
Cezary Rojewski daa36bbcd7
ASoC: Intel: avs: Block IPC channel on suspend
To allow for driver's filesystem interfaces e.g.: debugfs, to be touched
even when the device is asleep, mark IPC-channel as blocked when the
device is suspended. This causes any invocation of said interfaces that
do not toggle PM themselves to gracefully fail with "Operation not
permitted" message.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:22 +01:00
Cezary Rojewski 00566ad4ce
ASoC: Intel: avs: Shield LARGE_CONFIG_GETs against zero payload_size
Some LARGE_CONFIG_GETs are never expected to return payload of size 0.
Check for such situation and collapse if met.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:21 +01:00
Cezary Rojewski 3c1923a119
ASoC: Intel: avs: Copy only as many RX bytes as necessary
There is no need to copy number of bytes specified by IPC message caller
if DSP firmware returned lower number. In consequence, LARGE_CONFIG_GET
handler is simplified.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:20 +01:00
Cezary Rojewski 8192d24ccc
ASoC: Intel: avs: Relax DSP core transition timings
To avoid any false positives when checking CPA after setting SPA, do a
short wait. For stall operation, give HW more time to propagate the
change before moving on.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:19 +01:00
Cezary Rojewski 5f267aa4ad
ASoC: Intel: avs: Assign I2S gateway when parsing topology
For formatted port - ssp%d - descriptions to have an effect, copier
module templates need to be updated with specified port value. This
value is later propagated to the firmware when module instances are
being instantiated.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:18 +01:00
Cezary Rojewski c50cea054e
ASoC: Intel: avs: Register HDAudio ext-bus operations
With ASoC representation of HDAudio codec added, update bus initiazation
to complete it.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707124153.1858249-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:17 +01:00
V sujith kumar Reddy e8a33a9407
ASoC: amd: acp: Add legacy audio driver support for Rembrandt platform
Add i2s and dmic support for Rembrandt platform,
Add machine support for nau8825, max98360 and rt5682s,rt1019 codec
in legacy driver for rembrandt platform.
Here codec is in a slave mode.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20220707161142.491034-4-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:15 +01:00
V sujith kumar Reddy b24484c18b
ASoC: amd: acp: ACP code generic to support newer platforms
ADD Generic code to support to newer platforms, add
control threshold, irq control macros ,added structure for register
offset differences.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20220707161142.491034-3-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:14 +01:00
V sujith kumar Reddy ac2606df8a
ASoC: amd: acp: Remove rt1019_1 codec conf from machine driver
Remove rt1019_1 codec configuration which has i2c-10EC1019:01 and
i2c-10EC1019:02 codec components, Now Using default i2c-10EC1019:00
and i2c-10EC1019:01 codec components.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20220707161142.491034-2-Vsujithkumar.Reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 18:53:13 +01:00
Brent Lu cd486d3749
ASoC: Intel: sof_cs42l42: add adl_mx98360a_cs4242 board config
This patch adds driver data for adl_mx98360a_cs4242 which supports
two max98360a speaker amplifiers on SSP1 and cs42l42 headphone codec
on SSP0 running on ADL platform.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220708110030.658468-3-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 16:08:25 +01:00
Brent Lu 1460b85daa
ASoC: Intel: sof_cs42l42: support BT offload audio
Add the capability to machine driver of creating DAI Link for BT
offload. Although BT offload always uses SSP2 port but we reserve the
flexibility to assign the port number in macro.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220708110030.658468-2-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 16:08:24 +01:00
David Lin 0ca3d2ba1d
ASoC: nau8825: Declare 2 channels for DAI of capture stream
The patch is to make driver with flexibility for more platforms support even if
the internal design is just one ADC. Besides, many I2S controllers only support
2 channels.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20220708054647.540621-1-CTLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:52:55 +01:00
Yang Li 657efd9c98
ASoC: amd: Remove duplicated include in acp-es8336.c
Fix following includecheck warning:
./sound/soc/amd/acp-es8336.c: linux/module.h is included more than once.

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220707232540.22589-1-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:52:54 +01:00
Raphael-Xu eae9f9ce18
ASoC: add tas2780 driver
1.update Kconfig and Makefile 2.add tas2780.c and tas2780.h

Signed-off-by: Raphael-Xu <13691752556@139.com>
Link: https://lore.kernel.org/r/20220707123343.2403-1-13691752556@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:52:42 +01:00
Vijendar Mukunda 0de876c125
ASoC: amd: fix for variable set but not used warning
Fix below kernel warning.
>>> sound/soc/amd/acp-es8336.c:200:13: warning: variable 'ret' set but
>>> not used [-Wunused-but-set-variable]

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20220707132613.3150931-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:50 +01:00
Vijendar Mukunda 8d9cd3ead4
ASoC: amd: drop machine driver remove function
Drop machine driver remove() function.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220707132613.3150931-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:49 +01:00
Vijendar Mukunda d7e5d8d24c
ASoC: amd: remove unused header file inclusion
Removed unused header file inclusion from Jadeite platform machine
driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220707132613.3150931-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:48 +01:00
Pierre-Louis Bossart f460e3a974
ASoC: amd: acp-es8336: use static variables
Sparse warnings:

sound/soc/amd/acp-es8336.c:36:15: error: symbol 'codec_dev' was not
declared. Should it be static?

sound/soc/amd/acp-es8336.c:37:18: error: symbol 'gpio_pa' was not
declared. Should it be static?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220707214614.61081-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:47 +01:00
Kuninori Morimoto 16b7ba9c0f
ASoC: simple-card-utils.c: care Codec2Codec vs DPCM:BE
Current asoc_simple_init_for_codec2codec() adds default Codec2Codec
settings if rtd was Codec only.
But DPCM:BE also judged as Codec only, because dummy-DAI doesn't have
"endianness" (which is key parameter to judge as Codec).

This patch ignores setup Codec2Codec settings if it was DPCM:BE case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a69ts950.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:46 +01:00
Kuninori Morimoto 75d1b39067
ASoC: simple-card-utils.c: ignore Codec2Codec setting if it already have
Audio Graph Card2 setups own Codec2Codec settings,
but current simple-card-utils.c will try to setup Codec2Codec default
settings if needed, it will overwirtes the settings.
This patch ignores default Codec2Codec settings if it already have.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bku9s95b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:45 +01:00
Kuninori Morimoto d33083f941
ASoC: audio-graph-card2-custom-sample.dtsi: add verbose explanation
audio-graph-card2-custom-sample.dtsi will be used to test
Audio-Graph-Card2 behavior. But it is difficult to say that it is easy
to understand, because the comment/explanation are not so many.

This patch add verbose explanation to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87czeps95h.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:44 +01:00
Kuninori Morimoto 6976ed0137
ASoC: audio-graph-card2.c: remove pre-alloced Codec2Codec space
Because Codec2Codec settings becomes optional, we don't need to keep
its parameter space when init time. This patch removes its default
memory allocation from simple-card-utils.c, and allocate it at
audio-graph-card2 ondemand.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edz5s95o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:43 +01:00
Kuninori Morimoto c2ff7f15a4
ASoC: audio-graph-card2.c: make Codec2Codec settings optional
Current audio-graph-card2 can use Codec2Codec, and having its
original parameter (= rate) on DT is mandatory for now.

But simple-card-utils.c has asoc_simple_init_for_codec2codec() to
setup *default* Codec2Codec settings.

This patch makes Audio Graph Card2 Codec2Codec rate settings
optional.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fsjls95u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:42 +01:00
Kuninori Morimoto 817a62108d
ASoC: audio-graph-card2.c: use of_property_read_u32() for rate
Audio Graph Card2 is using of_get_property(), but it should use
of_property_read_u32() to getting rate. Otherwise the setting will be
strange value. This patch fixup it.

Fixes: c3a15c92a6 ("ASoC: audio-graph-card2: add Codec2Codec support")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h741s961.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-08 11:51:41 +01:00
Peter Ujfalusi fc976f5629
ASoC: Intel: Skylake: Correct the handling of fmt_config flexible array
The struct nhlt_format's fmt_config is a flexible array, it must not be
used as normal array.
When moving to the next nhlt_fmt_cfg we need to take into account the data
behind the ->config.caps (indicated by ->config.size).

The logic of the code also changed: it is no longer saves the _last_
fmt_cfg for all found rates.

Fixes: bc2bd45b1f ("ASoC: Intel: Skylake: Parse nhlt and register clock device")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220630065638.11183-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:40 +01:00
Peter Ujfalusi 219af251bd
ASoC: Intel: Skylake: Correct the ssp rate discovery in skl_get_ssp_clks()
The present flag is only set once when one rate has been found to be saved.
This will effectively going to ignore any rate discovered at later time and
based on the code, this is not the intention.

Fixes: bc2bd45b1f ("ASoC: Intel: Skylake: Parse nhlt and register clock device")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220630065638.11183-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:39 +01:00
Oder Chiou 051dade346
ASoC: rt5640: Fix the wrong state of JD1 and JD2
The patch fixes the wrong state of JD1 and JD2 while the bst1 or bst2 is
power on in the HDA JD using.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Reported-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20220705101134.16792-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:38 +01:00
Brent Lu c7dab6745f
ASoC: Intel: sof_rt5682: fix out-of-bounds array access
Starting from ADL platform we have four HDMI PCM devices which exceeds
the size of sof_hdmi array. Since each sof_hdmi_pcm structure
represents one HDMI PCM device, we remove the sof_hdmi array and add a
new member hdmi_jack to the sof_hdmi_pcm structure to fix the
out-of-bounds problem.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220701141517.264070-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:37 +01:00
Jianglei Nie df5b4aca72
ASoC: qdsp6: fix potential memory leak in q6apm_get_audioreach_graph()
q6apm_get_audioreach_graph() allocates a memory chunk for graph->graph
with audioreach_alloc_graph_pkt(). When idr_alloc() fails, graph->graph
is not released, which will lead to a memory leak.

We can release the graph->graph with kfree() when idr_alloc() fails to
fix the memory leak.

Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220629182520.2164409-1-niejianglei2021@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:36 +01:00
Hector Martin 1c4f29ec87
ASoC: tas2764: Fix amp gain register offset & default
The register default is 0x28 per the datasheet, and the amp gain field
is supposed to be shifted left by one. With the wrong default, the ALSA
controls lie about the power-up state. With the wrong shift, we get only
half the gain we expect.

Signed-off-by: Hector Martin <marcan@marcan.st>
Fixes: 827ed8a0fa ("ASoC: tas2764: Add the driver for the TAS2764")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220630075135.2221-4-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:35 +01:00
Hector Martin 3e99e5697e
ASoC: tas2764: Correct playback volume range
DVC value 0xc8 is -100dB and 0xc9 is mute; this needs to map to
-100.5dB as far as the dB scale is concerned. Fix that and enable
the mute flag, so alsamixer correctly shows the control as
<0 dB .. -100 dB, mute>.

Signed-off-by: Hector Martin <marcan@marcan.st>
Fixes: 827ed8a0fa ("ASoC: tas2764: Add the driver for the TAS2764")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220630075135.2221-3-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:34 +01:00
Martin Povišer d1a10f1b48
ASoC: tas2764: Fix and extend FSYNC polarity handling
Fix setting of FSYNC polarity in case of LEFT_J and DSP_A/B formats.
Do NOT set the SCFG field as was previously done, because that is not
correct and is also in conflict with the "ASI1 Source" control which
sets the same SCFG field!

Also add support for explicit polarity inversion.

Fixes: 827ed8a0fa ("ASoC: tas2764: Add the driver for the TAS2764")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220630075135.2221-2-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:33 +01:00
Martin Povišer cd10bb89b0
ASoC: tas2764: Add post reset delays
Make sure there is at least 1 ms delay from reset to first command as
is specified in the datasheet. This is a fix similar to commit
307f314520 ("ASoC: tas2770: Insert post reset delay").

Fixes: 827ed8a0fa ("ASoC: tas2764: Add the driver for the TAS2764")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220630075135.2221-1-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:32 +01:00
Charles Keepax f99e930655
ASoC: arizona: Update arizona_aif_cfg_changed to use RX_BCLK_RATE
Currently the function arizona_aif_cfg_changed uses the TX_BCLK_RATE,
however this register is not used on wm8998. This was not noticed as
previously snd_soc_component_read did not print an error message.
However, now the log gets filled with error messages, further more the
test for if the LRCLK changed will return spurious results.

Update the code to use the RX_BCLK_RATE register, the LRCLK parameters
are written to both registers and the RX_BCLK_RATE register is used
across all Arizona devices.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220628153409.3266932-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:28 +01:00
Charles Keepax 870d72ab92
ASoC: cs47l92: Fix event generation for OUT1 demux
cs47l92_put_demux returns the value of snd_soc_dapm_mux_update_power,
which returns a 1 if a path was found for the kcontrol. This is
obviously different to the expected return a 1 if the control
was updated value. This results in spurious notifications to
user-space. Update the handling to only return a 1 when the value is
changed.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220628153409.3266932-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:27 +01:00
Charles Keepax 15b2e5d10c
ASoC: wm8998: Fix event generation for input mux
wm8998_inmux_put returns the value of snd_soc_dapm_mux_update_power,
which returns a 1 if a path was found for the kcontrol. This is
obviously different to the expected return a 1 if the control
was updated value. This results in spurious notifications to
user-space. Update the handling to only return a 1 when the value is
changed.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220628153409.3266932-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:26 +01:00
Charles Keepax 71b5ab96ff
ASoC: wm5102: Fix event generation for output compensation
The output compensation controls always returns zero regardless of if
the control value was updated. This results in missing notifications
to user-space of the control change. Update the handling to return 1
when the value is changed.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220628153409.3266932-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:25 +01:00
Yassine Oudjana a5d6d28e2e
ASoC: wcd9335: Use int array instead of bitmask for TX mixers
Currently slim_tx_mixer_get reports all TX mixers as enabled when
at least one is, due to it reading the entire tx_port_value bitmask
without testing the specific bit corresponding to a TX port.
Furthermore, using the same bitmask for all capture DAIs makes
setting one mixer affect them all. To prevent this, and since
the SLIM TX muxes effectively only connect to one of the mixers
at a time, turn tx_port_value into an int array storing the DAI
index each of the ports is connected to.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Link: https://lore.kernel.org/r/20220622061745.35399-1-y.oudjana@protonmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:24 +01:00
Sascha Hauer 7d90c8e639
ASoC: tlv320adcx140: Fix tx_mask check
The tx_mask check doesn't reflect what the driver and the chip support.

The check currently checks for exactly two slots being enabled. The
tlv320adcx140 supports anything between one and eight channels, so relax
the check accordingly.

The tlv320adcx140 supports arbitrary tx_mask settings, but the driver
currently only supports adjacent slots beginning with the first slot,
so extend the check to check that the first slot is being used and that
there are no holes in the tx_mask.

Leave a comment to make it's the driver that limits the tx_mask
settings, not the chip itself.

While at it remove the set-but-unused struct adcx140p_priv::tdm_delay
field.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20220624105716.2579539-1-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:23 +01:00
Daniel Mack 9e51ac6ea6
ASoC: max98396: Fix register access for PCM format settings
max98396_dai_set_fmt() modifes register 2041 and touches bits in the mask
0x3a. Make sure to use the right mask for that operation.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Link: https://lore.kernel.org/r/20220624104712.1934484-7-daniel@zonque.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:22 +01:00
David Owens f0d96937d3
ASoC: ti: omap-mcbsp: duplicate sysfs error
Convert to managed versions of sysfs and clk allocation to simplify
unbinding and error handling in probe.  Managed sysfs node
creation specifically addresses the following error seen the second time
probe is attempted after sdma_pcm_platform_register() previously requsted
probe deferral:

sysfs: cannot create duplicate filename '/devices/platform/68000000.ocp/49022000.mcbsp/max_tx_thres'

Signed-off-by: David Owens <dowens@precisionplanting.com>
Link: https://lore.kernel.org/r/20220620183744.3176557-1-dowens@precisionplanting.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:21 +01:00
Sascha Hauer 242a88ff27
ASoC: audio_graph_card2: Fix port numbers in example
The example in audio-graph-card2.c has multiple nodes with the same name
in it. Change the port numbers to get different names.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20220624092601.2445224-1-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:20 +01:00
Francesco Dolcini 040e3360af
ASoC: sgtl5000: Fix noise on shutdown/remove
Put the SGTL5000 in a silent/safe state on shutdown/remove, this is
required since the SGTL5000 produces a constant noise on its output
after it is configured and its clock is removed. Without this change
this is happening every time the module is unbound/removed or from
reboot till the clock is enabled again.

The issue was experienced on both a Toradex Colibri/Apalis iMX6, but can
be easily reproduced everywhere just playing something on the codec and
after that removing/unbinding the driver.

Fixes: 9b34e6cc3b ("ASoC: Add Freescale SGTL5000 codec support")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20220624101301.441314-1-francesco.dolcini@toradex.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 17:16:19 +01:00
Shengjiu Wang 050237e6b0
ASoC: fsl_utils: Don't use plain integer as NULL pointer
Fix sparse warning:
sound/soc/fsl/fsl_utils.c:125:31: sparse: warning: Using plain integer as NULL pointer
sound/soc/fsl/fsl_utils.c:125:42: sparse: warning: Using plain integer as NULL pointer

Fixes: 7bad812554 ("ASoC: fsl_utils: Add function to handle PLL clock source")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1657192806-10569-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 16:25:04 +01:00
Mark Brown dfec073fc9
ASoC: cleanups and improvements for jz4740-i2s
Merge series from Aidan MacDonald <aidanmacdonald.0x0@gmail.com>:

This series is a preparatory cleanup of the jz4740-i2s driver before
adding support for a new SoC.
2022-07-07 14:53:16 +01:00
Aidan MacDonald 8a76910109
ASoC: jz4740-i2s: Refactor DMA channel setup
It's simpler to set up the playback and capture DMA settings
at driver probe time instead of during DAI probing.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220706211330.120198-3-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 12:23:43 +01:00
Aidan MacDonald 98356c89d4
ASoC: jz4740-i2s: Remove Open Firmware dependency
This driver doesn't require Open Firmware support. Remove the
OF-specific includes and drop the Kconfig dependency.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220706211330.120198-2-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 12:23:42 +01:00
Vijendar Mukunda ab34403db2
ASoC: amd: fix ACPI dependency compile errors and warnings
Fixed ACPI dependency complie errors and warnings as listed below.

All warnings (new ones prefixed by >>):

sound/soc/soc-acpi.c:34:1: error: redefinition of 'snd_soc_acpi_find_machine'
  34 | snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines)
     | ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from sound/soc/soc-acpi.c:9:
include/sound/soc-acpi.h:38:1: note: previous definition of
'snd_soc_acpi_find_machine'
with type 'struct snd_soc_acpi_mach *(struct snd_soc_acpi_mach *)'
38 | snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines)
   | ^~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/soc-acpi.c: In function 'snd_soc_acpi_find_package':
sound/soc/soc-acpi.c:58:36: error: implicit declaration of function
'acpi_fetch_acpi_dev';
did you mean 'device_match_acpi_dev'?
[-Werror=implicit-function-declaration]
58 | struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
   |                            ^~~~~~~~~~~~~~~~~~~
   |                            device_match_acpi_dev
>> sound/soc/soc-acpi.c:58:36: warning: initialization of
   'struct acpi_device *' from 'int' makes pointer from integer
   without a cast [-Wint-conversion]
sound/soc/soc-acpi.c:64:25: error: invalid use of undefined type
'struct acpi_device'

64 |  if (adev && adev->status.present && adev->status.functional) {
   |                  ^~
sound/soc/soc-acpi.c:64:49: error: invalid use of undefined type
'struct acpi_device'
64 |  if (adev && adev->status.present && adev->status.functional) {
   |                                          ^~
sound/soc/soc-acpi.c:80:26: error: implicit declaration of function
'acpi_extract_package'  [-Werror=implicit-function-declaration]
 80 | status = acpi_extract_package(myobj,
    |          ^~~~~~~~~~~~~~~~~~~~
 sound/soc/soc-acpi.c: At top level:
 sound/soc/soc-acpi.c:95:6: error: redefinition of
 'snd_soc_acpi_find_package_from_hid'
 95 | bool snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
    |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 In file included from sound/soc/soc-acpi.c:9:
 include/sound/soc-acpi.h:44:1: note: previous definition of
 'snd_soc_acpi_find_package_from_hid'
   with type 'bool(const u8 *, struct snd_soc_acpi_package_context *)'
   {aka '_Bool(const unsigned char *,
               struct snd_soc_acpi_package_context *)'}
   44 | snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/soc-acpi.c:109:27: error: redefinition of
   'snd_soc_acpi_codec_list'
   109 | struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg)
       |                           ^~~~~~~~~~~~~~~~~~~~~~~
In file included from sound/soc/soc-acpi.c:9:
include/sound/soc-acpi.h:51:41: note: previous definition of
'snd_soc_acpi_codec_list' with type 'struct snd_soc_acpi_mach *(void *)'
51 | static inline struct snd_soc_acpi_mach
     *snd_soc_acpi_codec_list(void *arg)
   | ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20220706205515.2485601-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-07 12:16:51 +01:00
Uwe Kleine-König e57297fc09
ASoC: rsnd: Emit useful error messages in .remove()
If more than one call of rsnd_dai_call(remove, ...) fails the platform
remove callback returns all values orred together which then makes the
driver core emit a generic error message which is little helpful.

Instead emit details of which call failed exactly and return 0. Note
returning 0 instead of an error code doesn't make a difference in the
driver core apart from the error message.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220705063613.93770-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-06 15:20:22 +01:00
Cezary Rojewski f1fd46e068
ASoC: Intel: avs: Fix i2s_test card name initialization
Update printf formatting as 'ssp_port' argument is of type 'int', not
'long int'.

Fixes: e39acc4cfd ("ASoC: Intel: avs: Add I2S-test machine board")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220706062952.251704-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-06 12:10:48 +01:00
Shengjiu Wang c0fabd12a8
ASoC: imx-card: Fix DSD/PDM mclk frequency
The DSD/PDM rate not only DSD64/128/256/512, which are the
multiple rate of 44.1kHz,  but also support the multiple
rate of 8kHz, so can't force all mclk frequency to be
22579200Hz, need to assign the frequency according to
rate.

Fixes: aa736700f4 ("ASoC: imx-card: Add imx-card machine driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1657100575-8261-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-06 12:10:47 +01:00
Mark Brown 676c6cc50d
I2S driver changes for Jadeite platform
Merge series from Vijendar Mukunda <Vijendar.Mukunda@amd.com>:

Jadeite(JD) platform is Stoney APU varaint which uses I2S MICSP
instance and ES8336 Codec.
This patch series creates I2S platform devices for JD platform,
adds I2S MICSP instance support and Machine driver support
2022-07-06 12:06:46 +01:00
Mark Brown 945c7683c5
Add support of two Audio PLL source
Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

i.MX8MQ/MN/MM/MP platforms typically have 2 AUDIO PLLs being
configured to handle 8kHz and 11kHz series audio rates.

The patches implement the functionality to select at runtime
the appropriate AUDIO PLL for root clock, if there is no
two PLL registered, then no action taken.
2022-07-06 12:06:44 +01:00
Andy Shevchenko 65b6851d24
ASoC: SOF: Intel: byt: remove duplicating driver data retrieval
device_get_match_data() in ACPI case calls similar to acpi_match_device().
Hence there is no need to duplicate the call. Just assign what is in
the id->driver_data.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220705161102.76250-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 19:54:03 +01:00
Andy Shevchenko 0d356c186f
ASoC: SOF: Intel: bdw: remove duplicating driver data retrieval
device_get_match_data() in ACPI case calls similar to acpi_match_device().
Hence there is no need to duplicate the call. Just assign what is in
the id->driver_data.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220705161102.76250-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 19:54:01 +01:00
Uwe Kleine-König fb617612fd
ASoC: tegra: tegra20_das: Drop write-only driver data member
The dev member of struct tegra20_das is only written once in .probe().
There is no loss of functionality if the member and the assignment go away.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220629194224.175607-5-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 19:54:00 +01:00
Uwe Kleine-König a10a8b6661
ASoC: tegra: tegra20_das: Make helper functions return void
These only ever return a value != 0 if the parameter das is NULL. In the
only caller however it's already asserted this isn't the case.

So convert the functions to return void and simplify the caller
accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220629194224.175607-4-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 19:53:59 +01:00
Uwe Kleine-König eefaea9323
ASoC: tegra: tegra20_das: Get rid of global pointer for driver data
This enables the driver (at least theoretically) to bind to more than one
device.

The remove function has nothing to do now, so it is dropped.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220629194224.175607-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 19:53:57 +01:00
Uwe Kleine-König 9a99b9b264
ASoC: tegra: tegra20_das: Remove unused function tegra20_das_read
This function is unused since commit 7203a62562 ("ASoC: convert
Tegra20 DAS driver to regmap").

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220629194224.175607-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 19:53:56 +01:00
Uwe Kleine-König 6dbc34d9c3
ASoC: tegra: tegra20_das: Fold header file into only user
Since commit fcff5f9974 ("ASoC: tegra: remove unnecessary includes")
the header file (which at the time was named tegra_das.h) there is only
the actual driver that includes it. Just move the definitions into the
driver, drop the exports and remove the completely unused function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220629194224.175607-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 19:53:55 +01:00
Judy Hsiao 0ff9f8b9f5
ASoC: rockchip: i2s: Fix error code when fail to read I2S_CLR
Add the error code '-EBUSY' when fail to read I2S_CLR
in rockchip_snd_rxctrl() and rockchip_snd_txctrl()

Fixes: 44f362c2cc ("ASoC: rockchip: i2s: switch BCLK to GPIO")
Signed-off-by: Judy Hsiao <judyhsiao@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Link: https://lore.kernel.org/r/20220701021427.3120549-1-judyhsiao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 19:53:53 +01:00
Andy Shevchenko b03bd21574
ASoC: Intel: catpt: remove duplicating driver data retrieval
device_get_match_data() in ACPI case calls similar to acpi_match_device().
Hence there is no need to duplicate the call. Just assign what is in
the id->driver_data.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220705155813.75917-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 19:53:50 +01:00
Lukas Bulwahn f4ba35b79b
ASoC: Intel: avs: correct config reference for I2S test board
Commit e39acc4cfd ("ASoC: Intel: avs: Add I2S-test machine board") adds
the config "SND_SOC_INTEL_AVS_MACH_I2S_TEST", but in the Makefile refers
to  config "SND_SOC_INTEL_AVS_MACH_i2s_TEST" (notice the uppercase and
lowercase difference).

Adjust the Makefile to refer to the actual existing config.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20220705103238.7484-1-lukas.bulwahn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 16:44:32 +01:00
Uwe Kleine-König 275cc7f5bd
ASoC: xilinx: Suppress second error message about reset failure in .remove()
Returning an error value in a platform remove callback results in an error
message being emitted by the platform core, but otherwise it doesn't make
a difference. If ret is != 0, there is already an error message and another
very generic doesn't add any value, so return 0 unconditionally.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220705092645.101343-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 16:44:31 +01:00
Gaosheng Cui eec8a5f44e
ASoC: codecs: wsa883x: fix warning using-module-alias-sdw.cocci
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20220705005315.663920-1-cuigaosheng1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 16:44:31 +01:00
Oder Chiou 8dbefb20b2
ASoC: rt5640: Add the MICBIAS1 to the dapm routing
The patch adds the MICBIAS1 to the dapm routing while the HDA header used.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Reported-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20220705101134.16792-2-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:48 +01:00
Vijendar Mukunda f94fa84058
ASoC: amd: enable machine driver build for Jadeite platform
Enable machine driver build for Jadeite platform using ES8336 Codec.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220701114107.1105948-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:46 +01:00
Vijendar Mukunda 02527c3f23
ASoC: amd: add Machine driver for Jadeite platform
Add Machine driver for Jadeite platform which uses ES8336 codec.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220701114107.1105948-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:45 +01:00
Vijendar Mukunda 3eb8440d0d
ASoC: amd: add I2S MICSP instance support
Add I2S MICSP instance support for Stoney variant.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220701114107.1105948-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:44 +01:00
Shengjiu Wang 7cb7f07d24
ASoC: fsl_sai: Add support for PLL switch at runtime
i.MX8MQ/MN/MM/MP platforms typically have 2 AUDIO PLLs being
configured to handle 8kHz and 11kHz series audio rates.

The patch implements the functionality to select at runtime
the appropriate AUDIO PLL as function of sysclk rate.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1656667961-1799-5-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:40 +01:00
Shengjiu Wang 93f54100fb
ASoC: fsl_micfil: Add support for PLL switch at runtime
i.MX8MQ/MN/MM/MP platforms typically have 2 AUDIO PLLs being
configured to handle 8kHz and 11kHz series audio rates.

The patch implements the functionality to select at runtime
the appropriate AUDIO PLL as function of audio file rate.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1656667961-1799-4-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:39 +01:00
Shengjiu Wang 34dcdebecf
ASoC: fsl_spdif: Add support for PLL switch at runtime.
i.MX8MQ/MN/MM/MP platforms typically have 2 AUDIO PLLs being
configured to handle 8kHz and 11kHz series audio rates.

The patch implements the functionality to select at runtime
the appropriate AUDIO PLL as function of audio file rate.
As the clock parent may be changed, need to probe txclk
according to sample rate again.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1656667961-1799-3-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:38 +01:00
Shengjiu Wang 7bad812554
ASoC: fsl_utils: Add function to handle PLL clock source
i.MX8MQ/MN/MM/MP platforms typically have 2 AUDIO PLLs being
configured to handle 8kHz and 11kHz series audio rates.
Add common function in fsl_utils to handle these two PLL
clock source, which are needed by CPU DAI drivers

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1656667961-1799-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-05 13:00:37 +01:00
Takashi Iwai 4a1e6ac7d5 Merge branch 'for-linus' into for-next
Back-merge of 5.19-rc branch for the futher development, mainly about
USB-audio and HD-audio Cirrus stuff.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2022-07-04 14:15:13 +02:00
Jiapeng Chong acf981f94e
ASoC: tegra20_ac97: Fix missing error code in tegra20_ac97_platform_probe()
The error code is missing in this code scenario, add the error code
'-EINVAL' to the return value 'ret'.

This was found by coccicheck:

sound/soc/tegra/tegra20_ac97.c:357 tegra20_ac97_platform_probe() warn: missing error code 'ret'.

Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220701072850.62408-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-04 12:44:21 +01:00
Shengjiu Wang 446499743b
ASoC: fsl_asrc_dma: Add legacy_dai_naming flag
Need to add legacy_dai_naming flag otherwise there
will be issue when registerring component, that cause
the probe failure.

Fixes: 1e63fcc74a ("ASoC: fsl: Migrate to new style legacy DAI naming flag")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1656899417-4775-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-04 12:44:20 +01:00
Shengjiu Wang 978bd27c9a
ASoC: fsl_micfil: Add legacy_dai_naming flag
Need to add legacy_dai_naming flag otherwise there
will be issue when registerring component, that cause
the probe failure.

Fixes: 1e63fcc74a ("ASoC: fsl: Migrate to new style legacy DAI naming flag")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1656899417-4775-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-04 12:44:19 +01:00
Zhu Ning 3684020a82
ASoC: codes: Add support for ES8316 producer mode
The AMD acp-es8336 machine driver requires ES8316 run in producer
mode, which is not supported previously.

Signed-off-by: David Yang <yangxiaohua@everest-semi.com>
Signed-off-by: Zhu Ning <zhuning0077@gmail.com>
Link: https://lore.kernel.org/r/20220704012416.3165-1-zhuning0077@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-04 12:44:18 +01:00
Yang Yingliang 679139ea62
ASoC: fsl: pcm030-audio-fabric: use platform_device_unregsiter()
Replace platform_device_del/put() with platform_device_unregsiter()
to simplify code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220704075134.26230-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-04 12:44:17 +01:00
Jiapeng Chong 1d5c7a91df
ASoC: codecs: max98088: Clean up some inconsistent indenting
This was found by coccicheck:

sound/soc/codecs/max98088.c:1761 max98088_i2c_probe() warn: inconsistent indenting.

Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220701073039.64556-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-04 12:44:16 +01:00
Liang He f507c0c67d
ASoC: qcom: Fix missing of_node_put() in asoc_qcom_lpass_cpu_platform_probe()
We should call of_node_put() for the reference 'dsp_of_node' returned by
of_parse_phandle() which will increase the refcount.

Fixes: 9bae4880ac ("ASoC: qcom: move ipq806x specific bits out of lpass driver.")
Co-authored-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220702020109.263980-1-windhl@126.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-04 12:44:13 +01:00
Srinivas Kandagatla 68f26639dc
ASoC: codecs: wsa883x: add missing break statement
Add missing break in one of the switch statement.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: cdb09e6231 ("ASoC: codecs: wsa883x: add control, dapm widgets and map")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220701125515.32332-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-01 15:23:33 +01:00
Srinivas Kandagatla 0df73e1a9f
ASoC: codecs: wsa883x: handle timeouts in resume path
Currently we do not check if SoundWire slave initialization timeout
expired before continuing to access its registers.

Its possible that the registers are not accessible if timeout is
expired. Handle this by returning timeout in resume path.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fixes: 43b8c7dc85 ("ASoC: codecs: add wsa883x amplifier support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220630130023.9308-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-30 16:10:50 +01:00
Srinivas Kandagatla cf6af24b54
ASoC: codecs: wsa881x: handle timeouts in resume path
Currently we do not check if SoundWire slave initialization timeout
expired before continuing to access its registers.

Its possible that the registers are not accessible if timeout is
expired. Handle this by returning timeout in resume path.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fixes: 8dd5524583 ("ASoC: codecs: wsa881x: add runtime pm support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220630130023.9308-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-30 16:10:49 +01:00
Mark Brown f3762ddfa2
ASoC: soc-core.c: fixup snd_soc_of_get_dai_link_cpus()
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Current ASoC has fixup both snd_soc_of_get_dai_link_cpus/codecs().
I guess cpu was copied from codec, but it is using "codec" naming everwhere
in "cpu" function. It is strange, and thus, error case will be issue
(It should call cpu function instead of codec).

This patch tidyup it, and try to cleanup.
[1/2] is for bug-fix,
[2/2] is for new feature.
2022-06-30 16:09:32 +01:00
Li kunyu d8d6253b36
ASoC: tegra: delete a semicolon
extra semicolons could be deleted.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
Link: https://lore.kernel.org/r/20220630020347.7148-1-kunyu@nfschina.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-30 13:40:31 +01:00
Charles Keepax e8010efc7b
ASoC: wm_adsp: Minor clean and redundant code removal
The cs_dsp core will return an error if passed a NULL cs_dsp struct so
there is no need for the wm_adsp_write|read_ctl functions to manually
check that. The cs_dsp core will also check the data is within bounds of
the control so the additional bounds check is redundant too. Simplify
things a bit by removing said code.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220630101459.3442327-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-30 13:40:30 +01:00
Tom Rix 871325d800
ASoC: samsung: change neo1973_audio from a global to static
sparse reports
sound/soc/samsung/neo1973_wm8753.c:347:24: warning: symbol 'neo1973_audio' was not declared. Should it be static?

neo1973_audio is only used in neo1973_wm8753.c, so it's
storage class specifier should be static.

Fixes: e26a2abcc2 ("ASoC: samsung: neo1973: turn into platform driver")
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220629201811.2537853-1-trix@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-30 13:40:29 +01:00
Srinivas Kandagatla cdb09e6231
ASoC: codecs: wsa883x: add control, dapm widgets and map
Add controls, dapm widgets along with route.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220630123633.8047-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-30 13:40:28 +01:00
Mark Brown 53447365cc
ASoC: dt-bindings: Add bindings for WCD9335 DAIs
Merge series from Yassine Oudjana <yassine.oudjana@gmail.com>:

Add DT bindings for WCD9335 DAIs and use them in the driver as well
as all device trees currently using WCD9335.
2022-06-30 12:45:02 +01:00
Tom Rix d2294461b9
ASoC: samsung: change gpiod_speaker_power and rx1950_audio from global to static variables
sparse reports
sound/soc/samsung/rx1950_uda1380.c:131:18: warning: symbol 'gpiod_speaker_power' was not declared. Should it be static?
sound/soc/samsung/rx1950_uda1380.c:231:24: warning: symbol 'rx1950_audio' was not declared. Should it be static?

Both gpiod_speaker_power and rx1950_audio are only used in rx1950_uda1380.c,
so their storage class specifiers should be static.

Fixes: 83d74e3542 ("ASoC: samsung: rx1950: turn into platform driver")
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220629185345.910406-1-trix@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-30 10:56:26 +01:00
Yassine Oudjana 66348f178d
ASoC: wcd9335: Use DT bindings instead of local DAI definitions
Get DAI indices from DT bindings and remove the currently used
local definitions.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220622161322.168017-3-y.oudjana@protonmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-29 18:11:28 +01:00
Kuninori Morimoto 9cc6952818
ASoC: soc-core.c: share code for snd_soc_of_get_dai_link_cpus/codecs()
ASoC has snd_soc_of_get_dai_link_cpus/codecs(), and these are almost same
code. The main difference are below.

	for_each_link_cpus()	dai_link->cpus		dai_link->num_cpus
	for_each_link_codecs()	dai_link->codecs	dai_link->num_codecs

Because we need to use these parameters, we can't share full-code for now,
but can share some codes.
This patch adds __snd_soc_of_get/put_xxx() functions, and share the code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y1xpp7ju.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-29 18:10:15 +01:00
Kuninori Morimoto 586fb26413
ASoC: soc-core.c: fixup snd_soc_of_get_dai_link_cpus()
commit 900dedd7e4 ("ASoC: Introduce snd_soc_of_get_dai_link_cpus")
adds new snd_soc_of_get_dai_link_cpus(), but it is using
"codec" everywhere. It is very strange, and is issue when error case.
It should call cpu instead of codec in error case.
This patch tidyup it.

Fixes: 900dedd7e4 ("ASoC: Introduce snd_soc_of_get_dai_link_cpus")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/87zgi5p7k1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-29 18:10:14 +01:00
Mark Brown fc34ece41f
ASoC: Refactor non_legacy_dai_naming flag
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

Historically, the legacy DAI naming scheme was applied to platform
drivers and the newer scheme to CODEC drivers. During componentisation
the core lost the knowledge of if a driver was a CODEC or platform, they
were all now components. To continue to support the legacy naming on
older platform drivers a flag was added to the snd_soc_component_driver
structure, non_legacy_dai_naming, to indicate to use the new scheme and
this was applied to all CODECs as part of the migration.

However, a slight issue appears to be developing with respect to this
flag being opt in for the non-legacy scheme, which presumably we want to
be the primary scheme used. Many codec drivers appear to forget to
include this flag:

  grep -l -r "snd_soc_component_driver" sound/soc/codecs/*.c |
  xargs grep -L "non_legacy_dai_naming" | wc
     48      48    556

Whilst in many cases the configuration of the DAIs themselves will cause
the core to apply the new scheme anyway, it would seem more sensible to
change the flag to legacy_dai_naming making the new scheme opt out. This
patch series migrates across to such a scheme.
2022-06-29 16:58:08 +01:00
Mark Brown 7ed186642e
ASoC: codecs: add WSA883x support
Merge series from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

This patchset adds support for WSA883x smart speaker amplifier codec
connected via SoundWire. This codec also has a temperature sensor used
for speaker protection, support for this is not added yet.

Most of the code is derived from Qualcomm downstream msm-5.10 kernel.
Thanks to Patrick Lai's Team.

This codec is tested on SM8450 MTP.
2022-06-29 15:43:09 +01:00
Judy Hsiao d6910eaa6f
ASoC: rockchip: i2s: Remove unwanted dma settings in rockchip_i2s_probe
Remove the unwanted dma settings in rockchip_i2s_probe.

Fixes: 44f362c2cc ("ASoC: rockchip: i2s: switch BCLK to GPIO")
Signed-off-by: Judy Hsiao <judyhsiao@chromium.org>
Link: https://lore.kernel.org/r/20220629080421.2427933-1-judyhsiao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-29 11:58:47 +01:00
Shengjiu Wang 3b13b1437d
ASoC: fsl_micfil: change micfil default settings
Previous default settings resulted in loose dynamic
range and low sound level.
New default configuration changes:
- outgain = 2
- quality mode = VLOW0
- dc remover = bypass

Signed-off-by: Irina Patru <ioana-irina.patru@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1656405589-29850-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-29 11:58:45 +01:00
Daniel Mack d29e0a6e36
ASoC: max98396: Fix TDM mode BSEL settings
In TDM mode, the BSEL register value must be set according to table 5 in the
datasheet. This patch adds a lookup function and uses it in
max98396_dai_tdm_slot().

As the first 3 entries can also be used for non-TDM setups, the code re-uses
the same table for such scenarios.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Link: https://lore.kernel.org/r/20220629050630.2848317-1-daniel@zonque.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-29 11:58:44 +01:00
Judy Hsiao 48620f17e0
ASoC: rockchip: i2s: Fix the debug level on missing pinctrl
Use dev_dbg on missing i2s->pinctrl as the pinctrl property is optional.

Fixes: 44f362c2cc ("ASoC: rockchip: i2s: switch BCLK to GPIO")
Signed-off-by: Judy Hsiao <judyhsiao@chromium.org>
Link: https://lore.kernel.org/r/20220629080345.2427872-1-judyhsiao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-29 11:58:43 +01:00
Srinivas Kandagatla 43b8c7dc85
ASoC: codecs: add wsa883x amplifier support
This patch adds support to WSA8830/WSA8812/WSA8835 Class-D Smart
Speaker Amplifier. This Amplifier is primarily interfaced with
SoundWire.

This patch is tested on SM8450 MTP Board.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220629090644.67982-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-29 11:58:41 +01:00