Commit graph

41484 commits

Author SHA1 Message Date
Ranjani Sridharan
e0974a382e
ASoC: SOF: topology: Rename arguments in sof_parse_token_sets()
Rename the priv_size arg to array_size and clarify the arguments in the
comments.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220308164344.577647-16-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:07 +00:00
Ranjani Sridharan
38a9a06794
ASoC: SOF: topology: Modify signature for token parsing functions
Modify the signature for sof_parse_uuid_tokens(),
sof_parse_word_tokens() and sof_parse_string_tokens() to reorder the
arguments to be more intuitive and rename the count arg to num_tokens.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220308164344.577647-15-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:06 +00:00
Ranjani Sridharan
c7b655ade9
ASoC: SOF: Add a tuples array to struct snd_sof_widget
Add 2 new fields to snd_sof_widget to store an array of tuples
defined by struct snd_sof_tuple and the number of tuples. When the
topology gets parsed, the tuples associated with a widget will be stored
in this array and will be used to construct the IPC structure
depending on the IPC version.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220308164344.577647-14-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:05 +00:00
Ranjani Sridharan
2b4b383f85
ASoC: SOF: topology: make sof_route_load() IPC agnostic
The IPC structure can be set up using the fields in struct snd_sof_route
when the pipeline connections are established.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220308164344.577647-13-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:03 +00:00
Ranjani Sridharan
7a976552a4
ASoC: SOF: make struct snd_sof_widget IPC agnostic
Parse the UUID token and save it in the new uuid field in struct
snd_sof_widget. struct sof_ipc_comp_ext is no longer needed. So remove
it too.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220308164344.577647-12-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-09 13:30:02 +00:00
Mark Brown
73d9cf7ca1
Clean ups and preparation for IPC abstraction in the SOF driver
Merge series from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:

In preparation for adding support for the new IPC version that has been
introduced in the SOF firmware, this patch set includes some clean ups
and necessary modifications to commonly used functions that will be
re-used across different IPC-specific code.
2022-03-08 17:19:21 +00:00
Mark Brown
6b1b0f7d7d
Add driver for SAMA7G5's PDMC
Merge series from Codrin Ciubotariu <codrin.ciubotariu@microchip.com>:

This patch series adds support for Pulse Density Microphone Controller
(PDMC), present on Microchip's SAMA7G5.
The PDMC interfaces up to 4 digital microphones having Pulse Density
Modulated (PDM) outputs. It generates a single clock line and samples 1 or
2 data lines. The signal path includes an audio grade programmable
decimation filter and outputs 24-bit audio words.
The source of each channel can be independently defined as PDMC_DS0 or
PDMC_DS1, sampled at the rising or falling edge of PDMC_CLK.

The patch series starts with a fix on the ASoC DMA engine support. Then
continues with the bindings and the driver of PDMC. It is followed by the
DT nodes for SAMA7G5 and SAMA7G5-EK. In the end, the drivers for PDMC
and PDM microphones are enabled in sama7_defconfig.
2022-03-08 17:19:20 +00:00
Miaoqian Lin
6ae0a4d8fe
ASoC: mxs: Fix error handling in mxs_sgtl5000_probe
This function only calls of_node_put() in the regular path.
And it will cause refcount leak in error paths.
For example, when codec_np is NULL, saif_np[0] and saif_np[1]
are not NULL, it will cause leaks.

of_node_put() will check if the node pointer is NULL, so we can
call it directly to release the refcount of regular pointers.

Fixes: e968194b45 ("ASoC: mxs: add device tree support for mxs-sgtl5000")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220308020146.26496-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 13:41:15 +00:00
Codrin Ciubotariu
50291652af
ASoC: atmel: mchp-pdmc: add PDMC driver
The Pulse Density Microphone Controller (PDMC) interfaces up to 4 digital
microphones having Pulse Density Modulated (PDM) outputs. It generates a
single clock line and samples 1 or 2 data lines. The signal path includes
an audio grade programmable decimation filter and outputs 24-bit audio
words on the APB bus.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220307122202.2251639-4-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 13:38:59 +00:00
Codrin Ciubotariu
9a1e13440a
ASoC: dmaengine: do not use a NULL prepare_slave_config() callback
Even if struct snd_dmaengine_pcm_config is used, prepare_slave_config()
callback might not be set. Check if this callback is set before using it.

Fixes: fa654e0853 ("ASoC: dmaengine-pcm: Provide default config")
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220307122202.2251639-2-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 13:38:56 +00:00
Miaoqian Lin
a6b44a2518
ASoC: rk817: Fix missing clk_disable_unprepare() in rk817_platform_probe
Fix the missing clk_disable_unprepare() before return
from rk817_platform_probe() in the error handling case.

Fixes: 0d6a04da9b ("ASoC: Add Rockchip rk817 audio CODEC support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Tested-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20220307090146.4104-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:32:01 +00:00
Miaoqian Lin
e45ac7831f
ASoC: mediatek: mt8192-mt6359: Fix error handling in mt8192_mt6359_dev_probe
The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.

This function only calls of_node_put() in the regular path.
And it will cause refcount leak in error paths.
Fix this by calling of_node_put() in error handling too.

Fixes: 4e28491a7a ("ASoC: mediatek: mt8192-mt6359: fix device_node leak")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220308015224.23585-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:59 +00:00
Miaoqian Lin
5575f7f491
ASoC: SOF: Add missing of_node_put() in imx8m_probe
The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.

Fixes: afb93d7165 ("ASoC: SOF: imx: Add i.MX8M HW support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220308023325.31702-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:58 +00:00
Miaoqian Lin
f725d20579
ASoC: rockchip: i2s: Fix missing clk_disable_unprepare() in rockchip_i2s_probe
Fix the missing clk_disable_unprepare() before return
from rockchip_i2s_probe() in the error handling case.

Fixes: 01605ad128 ("ASoC: rockchip-i2s: enable "hclk" for rockchip I2S controller")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220307083553.26009-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:57 +00:00
YueHaibing
6f6f28bf5d
ASoC: amd: acp3x: Fix signedness bug in acp3x
In acp3x_audio_probe() platform_get_irq() may return error, but i2s_irq now
is unsigned int so the error handling is never triggered.

Fixes: 87d71a1287 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20220305123613.6324-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:56 +00:00
YueHaibing
954e615497
ASoC: amd: acp5x-pcm-dma: Fix signedness bug
In acp5x_audio_probe() platform_get_irq() may return error, but i2s_irq now
is unsigned int so the error handling is never triggered.

Fixes: 87d71a1287 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20220305123705.3708-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:55 +00:00
Jiaxin Yu
5ea14bf62e
ASoC: mediatek: mt8183: support wb bt audio
Use "bt-sco-pcm-wb" codec dai driver for wb bt audio.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220307033056.11463-1-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:53 +00:00
Lianjie Zhang
51996ca26f
ASoC: Intel: catpt: use asoc_substream_to_rtd()
Now we can use asoc_substream_to_rtd() macro,
let's use it.

Signed-off-by: Lianjie Zhang <zhanglianjie@uniontech.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220307151939.32870-1-zhanglianjie@uniontech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:52 +00:00
Miaoqian Lin
b0bfaf0544
ASoC: atmel: Fix error handling in snd_proto_probe
The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.

This function only calls of_node_put() in the regular path.
And it will cause refcount leak in error paths.
Fix this by calling of_node_put() in error handling too.

Fixes: a45f8853a5 ("ASoC: Add driver for PROTO Audio CODEC (with a WM8731)")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220308013949.20323-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:51 +00:00
Ranjani Sridharan
40bdb2fd6b
ASoC: SOF: change comp_dai to a pointer in struct snd_sof_dai
This will avoid having to add the extended data for DAI components during
sof_widget_setup() as an extra step.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-11-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:49 +00:00
Ranjani Sridharan
ea7e5ee67f
ASoC: SOF: topology: expose some get_token ops
These will be used later on by IPC-specific code.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-10-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:48 +00:00
Ranjani Sridharan
5ef969e2f8
ASoC: SOF: topology: Modify the get_token op for string tokens
Modify the get_token op for string type tokens to pass the string as the
argument instead of a pointer to struct snd_soc_tplg_vendor_string_elem.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-9-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:46 +00:00
Ranjani Sridharan
6a6b5727f8
ASoC: SOF: topology: Drop the size parameter from struct sof_topology_token
It is always 0 and never used while parsing.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-8-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:45 +00:00
Ranjani Sridharan
9911ce06db
ASoC: SOF: topology: remove redundant code in sof_link_afe_load()
Looks like a copy-paste error. The CPU DAI is never used.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-7-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:44 +00:00
Ranjani Sridharan
fb763299bd
ASoC: SOF: topology: remove redundant code
With the change in the commit:
"ASoC: SOF: Intel: hda: assign link DMA channel at run-time",
there is no need to find the CPU DAI in sof_link_hda_load().

Fixes: bdf4ad3fd0 ('ASoC: SOF: Intel: hda: assign link DMA channel at
run-time')

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-6-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:43 +00:00
Pierre-Louis Bossart
c99b70a2d2
ASoC: SOF: sof-audio: removed unused function
cppcheck warning:

sound/soc/sof/sof-audio.c:884:0: style: The function
'snd_sof_find_spcm_pcm_id' is never used. [unusedFunction]

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220307181111.49392-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:42 +00:00
Ranjani Sridharan
3a790f3a7c
ASoC: SOF: set swidget's core for scheduler widget
Set the swidget's core for scheduler type widgets to match that of the
pipeline core. This simplifies the flow for core get/put during widget
setup/free.

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>
Link: https://lore.kernel.org/r/20220307181111.49392-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:41 +00:00
Ranjani Sridharan
80df222626
ASoC: SOF: simplify snd_sof_device_remove()
The commit "ASoC: SOF: core: Unregister machine driver before IPC and
debugfs" moved the call to unregister the machine driver to be done
before freeing the IPC. With this change, we can safely move the call to
snd_sof_remove() inside the same if() block just above.

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>
Link: https://lore.kernel.org/r/20220307181111.49392-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:40 +00:00
Ranjani Sridharan
5187357e45
ASoC: SOF: remove snd_sof_pipeline_find()
It is not used.

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>
Link: https://lore.kernel.org/r/20220307181111.49392-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-08 12:27:39 +00:00
Mark Brown
9fce18ab0b
ASoC: fsl_sai: Cleanups and 1:1 bclk:mclk ratio support
Merge series from Sascha Hauer <s.hauer@pengutronix.de>:

This series has some updates for the fsl_sai driver: Some general
cleanup patches, a bugfix in the ip revision checking and finally
the mclk setting is made more accurate and support for 1:1 bclk:mclk
setting is added.
2022-03-07 20:37:00 +00:00
Mark Brown
5e36946abc
ASoC: SOF: updates for 5.18
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

A couple of updates for Intel and AMD hardware, along with minor
cleanups

Ajit Kumar Pandey (4):
  ASoC: SOF: amd: Flush cache after ATU_BASE_ADDR_GRP register update
  ASoC: SOF: amd: Use semaphore register to synchronize ipc's irq
  ASoC: SOF: amd: Move group register configuration to acp-loader
  ASoC: SOF: amd: Increase ACP_HW_SEM_RETRY_COUNT value

Curtis Malainey (1):
  ASoC: SOF: fix 32 signed bit overflow

Gongjun Song (1):
  ASoC: SOF: Intel: pci-tgl: add RPL-S support

Peter Ujfalusi (2):
  ASoC: SOF: amd: acp-pcm: Take buffer information directly from runtime
  ASoC: SOF: amd: Do not set ipc_pcm_params ops as it is optional

Pierre-Louis Bossart (2):
  ASoC: SOF: debug: clarify operator precedence
  ASoC: SOF: Intel: hda: clarify operator precedence

 include/sound/sof/header.h         |  2 +-
 include/uapi/sound/sof/abi.h       |  2 +-
 sound/soc/sof/amd/acp-dsp-offset.h |  1 +
 sound/soc/sof/amd/acp-ipc.c        | 22 ++++++++++++++--------
 sound/soc/sof/amd/acp-loader.c     |  9 +++++++++
 sound/soc/sof/amd/acp-pcm.c        |  7 ++++---
 sound/soc/sof/amd/acp-stream.c     |  3 +++
 sound/soc/sof/amd/acp.c            | 29 ++++++++++++++---------------
 sound/soc/sof/amd/acp.h            |  3 +--
 sound/soc/sof/amd/renoir.c         |  1 -
 sound/soc/sof/debug.c              |  2 +-
 sound/soc/sof/intel/hda.c          |  2 +-
 sound/soc/sof/intel/pci-tgl.c      |  2 ++
 13 files changed, 52 insertions(+), 33 deletions(-)

--
2.30.2
2022-03-07 20:36:58 +00:00
Mark Brown
2f4d6de533
ASoC: Intel: boards: cleanups for 5.18
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Updates to clean-up the GPIOLIB dependency and a quirk for HP
SoundWire devices.
2022-03-07 20:36:57 +00:00
Mark Brown
3066987e11
ASoC: audio_graph_card2: Support variable slot widths
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

This adds support for I2S/TDM links where the slot width varies
depending on the sample width, in a way that cannot be guessed by
component hw_params().

A typical example is:

- 16-bit samples use 16-bit slots
- 24-bit samples use 32-bit slots

There is no way for a component hw_params() to deduce from the information
it is passed that 24-bit samples will be in 32-bit slots.

Some audio hardware cannot support a fixed slot width or a slot width
equal to the sample width in all cases. This is usually due either to
limitations of the audio serial port or system clocking restrictions.
2022-03-07 20:36:55 +00:00
Mark Brown
fc14fac286
ASoC: codecs: Add Awinic AW8738 audio amplifier driver
Merge series from Stephan Gerhold <stephan@gerhold.net>:

This series adds a simple driver and DT schema for the Awinic AW8738
audio amplifier. It's fairly simple - the main difference to
simple-amplifier is that there is a "one-wire pulse control" that
allows configuring the amplifier to one of a few pre-defined modes.
This can be used to configure the speaker-guard function (primarily
the power limit for the amplifier).
2022-03-07 20:36:54 +00:00
Dan Carpenter
468f252930
ASoC: amd: vg: fix signedness bug in acp5x_audio_probe()
The "adata->i2s_irq" variable is unsigned so the error handling
will not work.

Fixes: 87d71a1287 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220304131256.GA28739@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 15:45:56 +00:00
Richard Fitzgerald
71a6254c8b
ASoC: cs42l42: Add warnings about DETECT_MODE and PLL_START
DETECT_MODE and PLL_START must be zero while HP_PDN and ADC_PDN are
both 1. If this condition is broken it can discharge FILT+ and it
can then take up to 1 second for FILT+ to recharge.

There is no workaround required for this, simply avoiding settings
and sequences that would break the requirement. The driver already
meets the requirement.

But it is not obvious from reading the code that this requirement
exists, or what is ensuring it is met. So it would not currently be
obvious to someone changing the code that there is certain special
behaviour that must be maintained.

To avoid accidental breakage in the future:

- Add comments into the register definitions to warn about this so
  that anyone changing the code around DETECT_MODE and PLL_START is
  aware of this requirement.

- Add a comment where PLL_START is written to 1 to highlight the
  requirement and why it is satisfied.

- Add a comment in cs42l42_setup_hs_type_detect() when DETECT_MODE is
  initialized.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220304144015.398656-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:59 +00:00
Simon Trimmer
b6b62d942b
ASoC: wm_adsp: Expand firmware loading search options
The parts supported by this driver can have product-specific
firmware and tunings files. Typically these have been used on
embedded systems where the manufacturer is responsible for
installing the correct product-specific firmware files into
/lib/firmware. However, the linux-firmware repository places all
available firmwares into /lib/firmware and it is up to the driver to
select the correct product-specific firmware from that directory.

For example a product containing four smart amplifiers may provide
firmware specific for that product and each of the amplifiers may
have coefficient files containing tunings for their placement in the
mechanical design.

This change extends firmware (wmfw) and coefficient (bin) filenames
to be of the general form:

<cirrus/>part-dspN-fwtype<-system_name<-asoc_component_prefix>>.type

Where the cirrus subdirectory, system_name and asoc_component_prefix
are optional.

New files will be placed in the cirrus subdirectory to avoid
polluting the main /lib/firmware/ location. The generic name must be
searched in /lib/firmware before /lib/firmware/cirrus so that a
generic file in the new location does not override existing
product-specific files in the legacy location.

The search order for firmware files is:
  - cirrus/part-dspN-fwtype-system_name-asoc_component_prefix.wmfw
  - cirrus/part-dspN-fwtype-system_name.wmfw
  - part-dspN-fwtype.wmfw
  - cirrus/part-dspN-fwtype.wmfw

- Qualifications are added to the filename so that rightwards is more
  specific.
- The system_name is provided by the codec driver.
- The asoc_component_prefix is used to identify tunings for individual
  parts because it would already exist to disambiguate the controls
  and it makes it obvious which firmware file applies to which device.

The optional coefficient file must have the same filename
construction as the discovered wmfw except:
  - where the wmfw has only system_name then the bin file can
    optionally include the asoc_component_prefix. This is to allow a
    common wmfw for all amps but separate tunings per amp.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220303155016.122125-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:57 +00:00
Jiasheng Jiang
405afed8a7
ASoC: fsi: Add check for clk_enable
As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: ab6f6d8521 ("ASoC: fsi: add master clock control functions")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220302062844.46869-1-jiasheng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:56 +00:00
Srinivas Kandagatla
6ed5dbba6c
ASoC: qcom: select correct WCD938X config for SC7280
SC7280 config selected WCD938X instead of WCD938X_SDW Soundwire codecs.
WCD938X_SDW actually selects WCD938X, so directly selecting WCD938X results
in unmet dependencies and below warning

WARNING: unmet direct dependencies detected for SND_SOC_WCD938X
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=m]
 && SND_SOC_WCD938X_SDW [=n] && (SOUNDWIRE [=n] || !SOUNDWIRE [=n])
  Selected by [m]:
  - SND_SOC_SC7280 [=m] && SOUND [=y] && !UML && SND [=y]
 && SND_SOC [=m] && SND_SOC_QCOM [=m] && (I2C [=y] && SOUNDWIRE [=n] ||
 COMPILE_TEST [=y])

Fix this issue by selecting WCD SoundWire codecs instead of component driver.

Fixes: 57350bd41c ("ASoC: qcom: SC7280: Add machine driver")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220304160934.32010-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:55 +00:00
Lucas Tanure
139cad4bde
ASoC: cs35l41: Remove unnecessary param
cs35l41_private is not used on cs35l41_handle_pdata

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220304150721.3802-5-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:54 +00:00
Lucas Tanure
dacf1497a8
ASoC: cs35l41: Fix max number of TX channels
This device only has 4 TX channels.

Fixes: fe1024d504 ("ASoC: cs35l41: Combine adjacent register writes")
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220304150721.3802-3-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:53 +00:00
Derek Fang
b41d6195b2
ASoC: rt5682s: Stabilize the combo jack detection
Changes:
1. Revise rt5682s_sar_power_mode and rt5682s_headset_detect to be more
   rational.
2. Manually set to the jack-unplugging state via rt5682s_headset_detect
   during going to suspend. Close unnecessary powers and prepare for
   re-detecting the CBJ during resuming.
3. Simplize rt5682s_resume.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20220307102154.26065-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:52 +00:00
Jiasheng Jiang
db0350da80
ASoC: wm8350: Handle error for wm8350_register_irq
As the potential failure of the wm8350_register_irq(),
it should be better to check it and return error if fails.
Also, use 'free_' in order to avoid the same code.

Fixes: a6ba2b2dab ("ASoC: Implement WM8350 headphone jack detection")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220304023821.391936-1-jiasheng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:51 +00:00
Miaoqian Lin
f590797fa3
ASoC: atmel: Add missing of_node_put() in at91sam9g20ek_audio_probe
This node pointer is returned by of_parse_phandle() with refcount
incremented in this function.
Calling of_node_put() to avoid the refcount leak.

Fixes: 531f67e41d ("ASoC: at91sam9g20ek-wm8731: convert to dt support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20220307124539.1743-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:50 +00:00
Dan Carpenter
9a33f5632c
ASoC: amd: pcm-dma: Fix signedness bug in acp3x_audio_probe()
The "adata->i2s_irq" variable is unsigned so this error handling
code will not work.

Fixes: 87d71a1287 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220304131534.GD28739@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:49 +00:00
Dan Carpenter
00925272f1
ASoC: amd: pcm-dma: Fix signedness bug in acp_pdm_audio_probe()
The "adata->pdm_irq" variable is unsigned so the error handling will
not work.

Fixes: 87d71a1287 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220304131335.GB28739@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:48 +00:00
Dan Carpenter
899a9a7f62
ASoC: amd: acp: Fix signedness bug in renoir_audio_probe()
The "adata->i2s_irq" is unsigned so this error handling will not
work.

Fixes: 3304a242f4 ("ASoC: amd: Use platform_get_irq_byname() to get the interrupt")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220304131449.GC28739@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:14:47 +00:00
Anthony I Gilea
ce73ef6ec6
ASoC: Intel: sof_sdw: fix quirks for 2022 HP Spectre x360 13"
HP changed the DMI identification for 2022 devices:
Product Name: HP Spectre x360 Conv 13-ap0001na
Product Name: 8709
This patch relaxes the DMI_MATCH criterion to work with all versions of this product.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Anthony I Gilea <i@cpp.in>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220304204532.54675-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:13:15 +00:00
Pierre-Louis Bossart
bdfc385948
ASoC: Intel: boards: add GPIOLIB dependency where missed
We have eleven machine drivers who make explicit references to
gpios. Let's add the dependency.

The use of 'depends on' instead of 'select' is intentional. On one
side it could be argued that the GPIOs are required, but on the other
it might create more issues with randconfig builds. This patch sticks
with the existing direction of using 'depends' on high-level non-audio
dependencies

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220304204532.54675-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:13:14 +00:00
Pierre-Louis Bossart
32666b866f
ASoC: Intel: boards: remove explicit dependency on GPIOLIB when DMIC is used"
This patch reverts commit 4262ddc2ad ("ASoC: Intel: boards: add
explicit dependency on GPIOLIB when DMIC is used") and all follow-up
additions of this dependency.

Now that the DMIC does not depend on GPIOLIB we can simplify again.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220304204532.54675-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-07 13:13:13 +00:00