Commit graph

41253 commits

Author SHA1 Message Date
Ajit Kumar Pandey
2d7d9f36b5
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.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220117115854.455995-7-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-28 15:59:35 +00:00
Ajit Kumar Pandey
611ba05e8b
ASoC: amd: acp: acp-legacy: Add DMIC dai link support for Renoir
Add DMIC related dai link for pdm-dmic dai on Renoir platform with
generic dmic codec dai.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220117115854.455995-6-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-28 15:59:34 +00:00
Ajit Kumar Pandey
6a75585a3d
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.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220117115854.455995-5-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-28 15:59:32 +00:00
Ajit Kumar Pandey
5a9f07a415
ASoC: amd: acp: Add generic PCI driver module for ACP 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.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220117115854.455995-4-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-28 15:59:31 +00:00
Ajit Kumar Pandey
def6dc2507
ASoC: amd: acp: Add PDM controller based dmic dai for Renoir
Renoir ACP IP has a PDM controller block. Add DMIC dai instance in
dai_driver struct to enable dmic capture support on Renoir platform.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220117115854.455995-3-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-28 15:59:30 +00:00
Ajit Kumar Pandey
c32bd332ce
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.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220117115854.455995-2-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-28 15:59:29 +00:00
Mark Brown
74cc53cf59
Tegra234 APE support
Merge series from Sameer Pujar <spujar@nvidia.com>:

This adds APE support on Tegra234 and enables sound card on
Jetson AGX Orin platform.
2022-01-28 15:57:04 +00:00
Peter Ujfalusi
7bd04b8d46
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>
2022-01-28 13:06:48 +00:00
Ranjani Sridharan
2ce0d008dc
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: a792bfc1c2 ("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>
2022-01-28 13:06:46 +00:00
Mohan Kumar
4fcc8710fd
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.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1643373476-8538-2-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-28 13:05:26 +00:00
Lad Prabhakar
acfa1e2c2f
ASoC: sh: rz-ssi: Remove duplicate macros
Remove SSICR_MST and SSICR_CKDV macros which are defined more than once.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20220125132457.14984-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-25 13:55:18 +00:00
Lad Prabhakar
962ff7ecb6
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.

Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20220125132457.14984-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-25 13:51:17 +00:00
Lad Prabhakar
7276d3f329
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.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20220125132457.14984-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-25 13:51:16 +00:00
Mark Brown
9ebb50df2b
ASoC: Intel: sof_rt5682: add two derivative options
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Add support for platforms without amplifier (headset codec only) and
without Intel graphics.
2022-01-25 10:17:43 +00:00
Mark Brown
2e5a74c68d
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.
2022-01-25 10:17:41 +00:00
Mark Brown
8f1a27bb8a
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.
2022-01-25 10:17:40 +00:00
Mark Brown
a567abf5de
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.
2022-01-25 10:17:38 +00:00
Mark Brown
e6ec5a3936
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.
2022-01-25 10:17:37 +00:00
Mark Brown
d2fe7fc51f
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

 sound/soc/sh/rz-ssi.c | 147 ++++++++++++++++++++++++------------------
 1 file changed, 86 insertions(+), 61 deletions(-)

--
2.17.1
2022-01-25 02:36:24 +00:00
Mark Brown
8bcd0f121b
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.
2022-01-25 02:36:23 +00:00
Mark Brown
01f5060e42
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.
2022-01-25 02:36:22 +00:00
Mark Brown
cef982dc48
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

 sound/soc/soc-topology.c | 103 ++++++++++-----------------------------
 1 file changed, 27 insertions(+), 76 deletions(-)

--
2.25.1
2022-01-25 02:36:20 +00:00
Robert Hancock
5ca2ab4598
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.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20220120195832.1742271-7-robert.hancock@calian.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 19:45:43 +00:00
Robert Hancock
ce2f7b8d42
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: f48dcbb6d4 ("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>
2022-01-24 19:45:39 +00:00
Robert Hancock
c47aef899c
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

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20220120195832.1742271-4-robert.hancock@calian.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 19:45:38 +00:00
Robert Hancock
5e46c63ca2
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.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20220120195832.1742271-3-robert.hancock@calian.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 19:45:36 +00:00
Robert Hancock
1c5091fbe7
ASoC: xilinx: xlnx_formatter_pcm: Handle sysclk setting
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.

Fixes: 6f6c3c36f0 ("ASoC: xlnx: add pcm formatter platform driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20220120195832.1742271-2-robert.hancock@calian.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 19:45:35 +00:00
Jiasheng Jiang
aa505ecccf
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: af3d54b997 ("ASoC: codecs: lpass-rx-macro: add support for lpass rx macro")
Fixes: c39667ddcf ("ASoC: codecs: lpass-tx-macro: add support for lpass tx macro")
Fixes: 809bcbcece ("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>
2022-01-24 13:32:00 +00:00
Mac Chiang
dbf2f8e3fe
ASoC: Intel: sof_rt5682: add 512FS MCLK clock configuration
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>
2022-01-24 13:31:59 +00:00
V sujith kumar Reddy
330dc18356
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.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Signed-off-by: V sujith kumar Reddy <vsujithkumar.reddy@amd.com>
Link: https://lore.kernel.org/r/20220122194707.2661026-1-vsujithkumar.reddy@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:58 +00:00
Shengjiu Wang
88c62b1628
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.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1642646642-15908-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:57 +00:00
Minghao Chi
de531908ca
ASoC: samsung: remove unneeded ret variable
Return value from io_remap_pfn_range() directly instead
of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Link: https://lore.kernel.org/r/20220117110357.863990-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:56 +00:00
Minghao Chi
4ec19deec7
ASoC: codecs: remove redundant ret variable
Return value from devm_snd_soc_register_component() directly instead
of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220110012833.643994-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:55 +00:00
Ariel D'Alessandro
85f856f790
ASoC: Rename tlv320aic31xx-micbias.h as tlv320aic31xx.h
Let's use a more generic name, so other definitions for tlv320aic31xx
can be included.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220117132109.283365-2-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:52 +00:00
Ariel D'Alessandro
d4c4e28615
ASoC: fsl-asoc-card: Remove BCLK default value for tlv320aic31xx card
Now that fsl-asoc-card support setting mclk-id through the device-tree
mclk-id property, let's remove the default BCLK configuration for this
card.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Link: https://lore.kernel.org/r/20220117132109.283365-6-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:51 +00:00
Ariel D'Alessandro
91e4e40b59
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.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Link: https://lore.kernel.org/r/20220117132109.283365-5-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:50 +00:00
Ajye Huang
c8e98eaf2b
ASoC: Intel: sof_rt5682: Add support for platform without amplifier
Add a board config adl_rt5682 to support alc5682 headset codec without
speaker amplifier. Follow Intel BT offload design by connecting
alc5682 to SSP0.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220120230226.175906-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:47 +00:00
Yong Zhi
22cefca393
ASoC: Intel: sof_rt5682: add support for systems without i915 audio
Add support to systems where iDisp HDMI/DP audio codec is disabled for some
reason, switch codecs to SoC dummy in the affected DAI links. This allows
to reuse existing topologies as hdmi_num is 3 by default.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220120230226.175906-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:46 +00:00
Bard Liao
7afed13b58
ASoC: SOF: Intel: Compare sdw adr directly
We can exclude the sdw unique id and compare the sdw adr directly when
we are finding out identical parts.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220120232157.199919-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:44 +00:00
Bard Liao
f67c0c0d3b
ASoC: SOF: Intel: match sdw version on link_slaves_found
Codecs with the same part id, manufacturer id and part id, but different
sdw version should be treated as different codecs. For example, rt711 and
rt711-sdca are different. So, we should match sdw version as well.

Reported-by: Reddy Muralidhar <muralidhar.reddy@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220120232157.199919-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:43 +00:00
Richard Fitzgerald
f8593e8854
ASoC: cs42l42: Handle system suspend
Add system suspend functions to handle clean power-down on suspend and
restoring registers on resume.

The jack state could change during suspend. Plug->unplug and unplug->plug
are straightforward because this looks no different from any other plug
state change - there will be a plugged or unplugged interrupt pending.
The jack could be unplugged and a different type of jack plugged, and on
resume the plug state would not have changed. Setting plug_state back to
TS_TRANS (transitioning) will make the next plug interrupt after resume
run a type detection.

During system suspend any jack plug/unplug and button events will not be
reported or generate a system wakeup. If the plug state or headset type
has changed it will be reported after resume.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220121120412.672284-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:35 +00:00
Richard Fitzgerald
5982b5a8ec
ASoC: cs42l42: Change jack_detect_mutex to a lock of all IRQ handling
Rename jack_detect_mutex to irq_lock and make it lock the entire IRQ
handling.

The jack_detect_mutex was introduced to synchronize registering an
ALSA jack handler, via cs42l42_set_jack(), with the jack state
processing in the IRQ handler, and was taken only around the
relevant part of the IRQ handling code.

System suspend will need to synchronize with the IRQ handler thread
so will need a similar mutex that surrounds all of the IRQ handling.
Repurposing the existing jack_detect_mutex is the simplest option.
It does no harm for a call to cs42l42_set_jack() to additionally
block the first few lines of IRQ handling, and the only interrupts
used by the driver are all for jack handling.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220121120412.672284-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:34 +00:00
Richard Fitzgerald
8d06f797f8
ASoC: cs42l42: Report full jack status when plug is detected
When a plug event is detect report the full state of all status
bits, don't assume that there will have been a previous unplug
event to clear all the bits. Report the state of both HEADPHONE
and MICROPHONE bits according to detected type, and clear all the
button status bits. The current button status is already checked
and reported at the end of the function.

During a system suspend the jack could be unplugged and plugged,
possibly changing the jack type. On resume the interrupt status will
indicate a plug event - there will not be an unplug event to clear
the bits.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220121120412.672284-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:33 +00:00
Lad Prabhakar
e42c903e8b
ASoC: sh: rz-ssi: Make return type of rz_ssi_stream_is_valid() to bool
rz_ssi_stream_is_valid() never returns an int, it returns the result of
a condition which is either true or false.

While at it, drop "!!" as the expression is boolean.

Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20220110094711.8574-5-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:31 +00:00
Lad Prabhakar
4f78f3c970
ASoC: sh: rz-ssi: Drop ssi parameter from rz_ssi_stream_init()
ssi parameter is unused in rz_ssi_stream_init() so just drop it.

While at it, change the return type of rz_ssi_stream_init() to void
instead of int.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20220110094711.8574-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:30 +00:00
Lad Prabhakar
0788785c78
ASoC: sh: rz-ssi: Make the data structures available before registering the handlers
Initialize the spinlock and make the data structures available before
registering the interrupt handlers.

Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20220110094711.8574-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:29 +00:00
Lad Prabhakar
6570f99158
ASoC: sh: rz-ssi: Drop calling rz_ssi_pio_recv() recursively
Instead of recursively calling rz_ssi_pio_recv() use a while loop
to read the samples from RX fifo.

This also fixes an issue where the return value of rz_ssi_pio_recv()
was ignored when called recursively.

Fixes: 03e786bd43 ("ASoC: sh: Add RZ/G2L SSIF-2 driver")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20220110094711.8574-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:27 +00:00
Daniel Beer
ec45268467
ASoC: add support for TAS5805M digital amplifier
The Texas Instruments TAS5805M is a class D audio amplifier with an
integrated DSP. DSP configuration is supplied in a firmware image
specified through a device-tree attribute.

These register writes set up application-specific DSP settings and are
expected to be generated using TI's PPC3 tool.

Signed-off-by: Daniel Beer <daniel.beer@igorinstitute.com>
Link: https://lore.kernel.org/r/b82fac1d21a33a5f57a5819eaf37c31f5c86eb65.1642298336.git.daniel.beer@igorinstitute.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:24 +00:00
Amadeusz Sławiński
cc44c7492b
ASoC: topology: Optimize soc_tplg_dapm_graph_elems_load behavior
Before commit "ASoC: topology: Change allocations to resource managed"
soc_tplg_dapm_graph_elems_load() used to free routes on error. During
migration to managed allocations the routes table was left as is, but
looking at it again it is unnecessary, so remove routes table and just
keep pointer to DAPM route currently being set up. Also remove outdated
comments which keep describing old behavior of remove_route() freeing
memory. While it still does some cleanup, it leaves freeing memory to
framework.

Fixes: ff92262244 ("ASoC: topology: Change allocations to resource managed")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220112170030.569712-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:23 +00:00
Amadeusz Sławiński
feb00b736a
ASoC: topology: Allow TLV control to be either read or write
There is no reason to force readwrite access on TLV controls. It can be
either read, write or both. This is further evidenced in code where it
performs following checks:
                if ((k->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ) && !sbe->get)
                        return -EINVAL;
                if ((k->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) && !sbe->put)
                        return -EINVAL;

Fixes: 1a3232d2f6 ("ASoC: topology: Add support for TLV bytes controls")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220112170030.569712-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24 13:31:22 +00:00