OSDN Git Service

tomoyo/tomoyo-test1.git
22 months agoASoC: codecs: allow compile testing without MFD drivers
Krzysztof Kozlowski [Fri, 26 Aug 2022 09:36:59 +0000 (12:36 +0300)]
ASoC: codecs: allow compile testing without MFD drivers

Motorola CPCAP, Lochnagar Sound, Rockchip RK817 and Qualcomm
WCD9340/WCD9341 do not depend on parent MFD driver in build time and can
be compile tested without respective MFD part for increased build
coverage.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220826093659.1059276-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agodt-bindings: mediatek: Add axi clock in mt8173 dts example
Xiangsheng Hou [Mon, 25 Jul 2022 12:02:05 +0000 (20:02 +0800)]
dt-bindings: mediatek: Add axi clock in mt8173 dts example

For mt8173, it is needed to add the axi clock for dma mode.

Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220725120204.10834-1-xiangsheng.hou@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: acp: Modify dai_id macros to be more generic
Venkata Prasad Potturu [Fri, 26 Aug 2022 06:42:45 +0000 (12:12 +0530)]
ASoC: amd: acp: Modify dai_id macros to be more generic

Change dai_id macros to make I2S instances in order.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20220826064250.3302260-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: Cleanup deprecated regmap-irq functionality
Mark Brown [Sun, 28 Aug 2022 20:58:57 +0000 (21:58 +0100)]
ASoC: Cleanup deprecated regmap-irq functionality

Merge series from Aidan MacDonald <aidanmacdonald.0x0@gmail.com>:

Update two ASoC codec drivers to remove uses of regmap-irq type
registers, which have recently been deprecated by the "regmap-irq
cleanups and refactoring" series in linux-next.

Link: https://lore.kernel.org/lkml/20220623211420.918875-1-aidanmacdonald.0x0@gmail.com/
22 months agoASoC: wcd938x: Remove spurious type_base from irq chip
Aidan MacDonald [Thu, 21 Jul 2022 10:25:58 +0000 (11:25 +0100)]
ASoC: wcd938x: Remove spurious type_base from irq chip

There is no reason to set type_base here: the chip doesn't set
num_type_regs and none of the IRQs have type information so it's
not possible for regmap-irq to configure IRQ types.

Type registers are also deprecated in regmap-irq, so any IRQ type
support in the future should be implemented using config registers
instead.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20220721102558.25457-3-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: wcd9335: Convert irq chip to config regs
Aidan MacDonald [Thu, 21 Jul 2022 10:25:57 +0000 (11:25 +0100)]
ASoC: wcd9335: Convert irq chip to config regs

Type registers in regmap-irq have been deprecated in favor of config
registers, which are more general. Chips using type_base can switch
over to a single config base register and a standard ->set_irq_type()
callback provided by regmap-irq, which uses the type info associated
with each 'struct regmap_irq' to update type registers in the same
way as the old code did.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20220721102558.25457-2-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: soc-pcm.c: call __soc_pcm_close() in soc_pcm_close()
Kuninori Morimoto [Mon, 22 Aug 2022 02:35:32 +0000 (02:35 +0000)]
ASoC: soc-pcm.c: call __soc_pcm_close() in soc_pcm_close()

commit b7898396f4bbe16 ("ASoC: soc-pcm: Fix and cleanup DPCM locking")
added __soc_pcm_close() for non-lock version of soc_pcm_close().
But soc_pcm_close() is not using it. It is no problem, but confusable.

static int __soc_pcm_close(...)
{
=> return soc_pcm_clean(rtd, substream, 0);
}

static int soc_pcm_close(...)
{
...
snd_soc_dpcm_mutex_lock(rtd);
=> soc_pcm_clean(rtd, substream, 0);
snd_soc_dpcm_mutex_unlock(rtd);
return 0;
}

This patch use it.

Fixes: b7898396f4bbe16 ("ASoC: soc-pcm: Fix and cleanup DPCM locking")
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87czctgg3w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC platform driver for Apple MCA
Mark Brown [Thu, 25 Aug 2022 15:24:42 +0000 (16:24 +0100)]
ASoC platform driver for Apple MCA

Merge series from Martin Povišer <povik+lin@cutebit.org>:

sending what should be the final touches on Apple MCA driver. It most
likely goes without saying but please do not merge the DT additions
into the ASoC tree.

23 months agoASoC: sigmadsp: switch to use kmemdup_nul() helper
Yang Yingliang [Thu, 25 Aug 2022 12:35:25 +0000 (20:35 +0800)]
ASoC: sigmadsp: switch to use kmemdup_nul() helper

Use kmemdup_nul() helper instead of open-coding to
simplify the code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220825123525.1845695-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Add Apple MCA I2S transceiver bindings
Martin Povišer [Wed, 24 Aug 2022 16:07:12 +0000 (18:07 +0200)]
ASoC: Add Apple MCA I2S transceiver bindings

Add binding schema for MCA I2S transceiver found on Apple M1 and other
chips.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220824160715.95779-2-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: apple: mca: Add locking
Martin Povišer [Wed, 24 Aug 2022 16:07:15 +0000 (18:07 +0200)]
ASoC: apple: mca: Add locking

In DAI ops, accesses to the native cluster (of the DAI), and to data of
clusters related to it by a DPCM frontend-backend link, should have
been synchronized by the 'pcm_mutex' lock at ASoC level.

What is not covered are the 'port_driver' accesses on foreign clusters
to which the current cluster has no a priori relation, so fill in
locking for that. (This should only matter in bizarre configurations of
sharing one MCA peripheral between ASoC cards.)

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220824160715.95779-5-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: apple: mca: Start new platform driver
Martin Povišer [Wed, 24 Aug 2022 16:07:14 +0000 (18:07 +0200)]
ASoC: apple: mca: Start new platform driver

Add ASoC platform driver for the MCA peripheral found on Apple M1 and
other chips.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220824160715.95779-4-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: mediatek: update SOF driver for mt8186
Mark Brown [Thu, 25 Aug 2022 12:37:57 +0000 (13:37 +0100)]
ASoC: SOF: mediatek: update SOF driver for mt8186

Merge series from Chunxu Li <chunxu.li@mediatek.com>:

In these patches, we update SOF driver for mt8186

23 months agoASoC: max98088: add support for noise gate reg
Tommaso Merciai [Thu, 25 Aug 2022 10:17:13 +0000 (12:17 +0200)]
ASoC: max98088: add support for noise gate reg

Add support for Noise Gate Threshold reg (ANTH reg 0x40 bit 4 to 7)

References:
 - https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf, p75

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
Link: https://lore.kernel.org/r/20220825101714.81580-1-tommaso.merciai@amarulasolutions.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: add suspend and resume for ES8316
Zhu Ning [Thu, 25 Aug 2022 01:49:52 +0000 (09:49 +0800)]
ASoC: codecs: add suspend and resume for ES8316

The registers may be lost after suspend due to powerdown.
regcache_sync solves this issue.

Signed-off-by: Zhu Ning <zhuning@everest-semi.com>
Link: https://lore.kernel.org/r/20220825014952.1038508-1-zhuning0077@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: mediatek: Use generic implementation for .ipc_msg_data field
Chunxu Li [Thu, 25 Aug 2022 06:54:11 +0000 (14:54 +0800)]
ASoC: SOF: mediatek: Use generic implementation for .ipc_msg_data field

Use generic sof_ipc_msg_data instead of specific implementation as
they do the same things

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220825065411.31279-4-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: mediatek: add snd_sof_dsp_ops callbacks for pcm and mail box
Chunxu Li [Thu, 25 Aug 2022 06:54:10 +0000 (14:54 +0800)]
ASoC: SOF: mediatek: add snd_sof_dsp_ops callbacks for pcm and mail box

Use generic IPC stream and mailbox ops for mt8186

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220825065411.31279-3-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: mediatek: Add dai driver for mt8186
Chunxu Li [Thu, 25 Aug 2022 06:54:09 +0000 (14:54 +0800)]
ASoC: SOF: mediatek: Add dai driver for mt8186

Add dsp ops callback to register AFE DL1/DL2/UL1/UL2 SOF dai's with ALSA

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220825065411.31279-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: dt-bindings: modify machine
Mark Brown [Wed, 24 Aug 2022 16:23:44 +0000 (17:23 +0100)]
ASoC: mediatek: dt-bindings: modify machine

Merge series from Chunxu Li <chunxu.li@mediatek.com>:

Add SOF related field.
1. Add a property "mediatek,adsp", Only when adsp phandle could be retrieved,
 from DTS, the SOF related part of machine driver is executed.
2. Add a property "mediatek,dai-link" to support dai-links could be specified
 from DTS

23 months agoASoC: mediatek: dt-bindings: modify machine bindings for SOF
chunxu.li [Wed, 24 Aug 2022 12:23:19 +0000 (20:23 +0800)]
ASoC: mediatek: dt-bindings: modify machine bindings for SOF

Add SOF related field.
1. Add a property "mediatek,adsp", Only when adsp phandle could be
retrieved, from DTS, the SOF related part of machine driver is executed.
2. Add a property "mediatek,dai-link" to support dai-links could be
specified from DTS

Signed-off-by: chunxu.li <chunxu.li@mediatek.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220824122319.23918-3-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: dt-bindings: modify machine bindings for SOF
chunxu.li [Wed, 24 Aug 2022 12:23:18 +0000 (20:23 +0800)]
ASoC: mediatek: dt-bindings: modify machine bindings for SOF

Add SOF related field.
1. Add a property "mediatek,adsp", Only when adsp phandle could be
retrieved, from DTS, the SOF related part of machine driver is executed.
2. Add a property "mediatek,dai-link" to support dai-links could be
specified from DTS

Signed-off-by: chunxu.li <chunxu.li@mediatek.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220824122319.23918-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: imx8ulp: add missing of_node_put() in imx8ulp_probe()
Yang Yingliang [Wed, 24 Aug 2022 01:32:34 +0000 (09:32 +0800)]
ASoC: SOF: imx8ulp: add missing of_node_put() in imx8ulp_probe()

After using 'res_node' returned by of_parse_phandle(), of_node_put()
need be called to decrease the refcount.

Fixes: fb5319af6ad8 ("ASoC: SOF: imx: Add i.MX8ULP HW support")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220824013234.375738-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codes: src4xxx: Avoid clang -Wsometimes-uninitialized in src4xxx_hw_params()
Nathan Chancellor [Tue, 23 Aug 2022 15:19:40 +0000 (08:19 -0700)]
ASoC: codes: src4xxx: Avoid clang -Wsometimes-uninitialized in src4xxx_hw_params()

Clang warns:

  sound/soc/codecs/src4xxx.c:280:3: error: variable 'd' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
                  default:
                  ^~~~~~~
  sound/soc/codecs/src4xxx.c:298:59: note: uninitialized use occurs here
                  ret = regmap_write(src4xxx->regmap, SRC4XXX_RCV_PLL_11, d);
                                                                          ^
  sound/soc/codecs/src4xxx.c:223:20: note: initialize the variable 'd' to silence this warning
          int val, pj, jd, d;
                            ^
                            = 0
  sound/soc/codecs/src4xxx.c:280:3: error: variable 'jd' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
                  default:
                  ^~~~~~~
  sound/soc/codecs/src4xxx.c:293:59: note: uninitialized use occurs here
                  ret = regmap_write(src4xxx->regmap, SRC4XXX_RCV_PLL_10, jd);
                                                                          ^~
  sound/soc/codecs/src4xxx.c:223:17: note: initialize the variable 'jd' to silence this warning
          int val, pj, jd, d;
                        ^
                          = 0
  sound/soc/codecs/src4xxx.c:280:3: error: variable 'pj' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
                  default:
                  ^~~~~~~
  sound/soc/codecs/src4xxx.c:288:59: note: uninitialized use occurs here
                  ret = regmap_write(src4xxx->regmap, SRC4XXX_RCV_PLL_0F, pj);
                                                                          ^~
  sound/soc/codecs/src4xxx.c:223:13: note: initialize the variable 'pj' to silence this warning
          int val, pj, jd, d;
                    ^
                      = 0
  3 errors generated.

The datasheet does not have any default values for these regmap values
so pick some arbitrary values and print to the user that this is the
case to silence the warnings.

Link: https://github.com/ClangBuiltLinux/linux/issues/1691
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: "Sudip Mukherjee (Codethink)" <sudipm.mukherjee@gmail.com>
Suggested-by: Matt Flax <flatmax@flatmax.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Matt Flax <flatmax@flatmax.com>
Link: https://lore.kernel.org/r/20220823151939.2493697-1-nathan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: Intel: hda: Skip IMR boot after a firmware crash or boot failure
Peter Ujfalusi [Tue, 23 Aug 2022 12:43:59 +0000 (15:43 +0300)]
ASoC: SOF: Intel: hda: Skip IMR boot after a firmware crash or boot failure

To make sure that we start from a clean state next time when the DSP is
powered up after a firmware crash or boot failure we must skip the IMR
booting attempt.

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/20220823124359.24865-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: dt-bindings: Add missing (unevaluated|additional)Properties on child nodes
Rob Herring [Tue, 23 Aug 2022 14:56:39 +0000 (09:56 -0500)]
ASoC: dt-bindings: Add missing (unevaluated|additional)Properties on child nodes

In order to ensure only documented properties are present, node schemas
must have unevaluatedProperties or additionalProperties set to false
(typically).

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220823145649.3118479-8-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: ipc4-loader: Verify ext manifest magic number
Peter Ujfalusi [Tue, 23 Aug 2022 12:42:19 +0000 (15:42 +0300)]
ASoC: SOF: ipc4-loader: Verify ext manifest magic number

Firmware image must start with an extended manifest. Add a check to make
sure that the image does contain it.

The magic number (the first u32 of a firmware image if manifest is present)
for an IPC4 image must be 0x31454124 (ASCI "$AE1").

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220823124219.927-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: imx: imx8ulp: declare ops structure as static
Pierre-Louis Bossart [Tue, 23 Aug 2022 15:40:27 +0000 (17:40 +0200)]
ASoC: SOF: imx: imx8ulp: declare ops structure as static

Sparse warning:

sound/soc/sof/imx/imx8ulp.c:416:24: error: symbol 'sof_imx8ulp_ops'
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/20220823154027.762889-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: fsl_sai: Update slots number according to bclk_ratio
Shengjiu Wang [Fri, 5 Aug 2022 06:45:26 +0000 (14:45 +0800)]
ASoC: fsl_sai: Update slots number according to bclk_ratio

The bclk_ratio is set by .set_bclk_ratio API.
bclk_ratio = slots * slot_width
So if slots is not set by .set_tdm_slot, then it can be calculated
by bclk_ratio.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1659681926-13493-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: Intel: hda: Correct Firmware State Register use
Mark Brown [Tue, 23 Aug 2022 18:48:41 +0000 (19:48 +0100)]
ASoC: SOF: Intel: hda: Correct Firmware State Register use

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

Hi,

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.

Regards,
Peter
---
Peter Ujfalusi (3):
  ASoC: SOF: Intel: hda: Correct the ROM/FW state reporting code
  ASoC: SOF: Intel: hda-loader: Use the FSR state definitions during
    bootup
  ASoC: SOF: Intel: hda: Drop no longer used ROM state definitions

 sound/soc/sof/intel/hda-loader.c |  10 +--
 sound/soc/sof/intel/hda.c        | 147 ++++++++++++++++++++++++++-----
 sound/soc/sof/intel/hda.h        |  69 +++++++++++++--
 3 files changed, 194 insertions(+), 32 deletions(-)

--
2.37.0

23 months agoIntroduce sof_of_machine_select
Mark Brown [Tue, 23 Aug 2022 18:48:39 +0000 (19:48 +0100)]
Introduce sof_of_machine_select

Merge series from Chunxu Li <chunxu.li@mediatek.com>:

In these patches, we introduce function sof_of_machine_select for SOF

23 months agoASoC: SOF: mediatek: Add sof_mt8186_machs for mt8186
Chunxu Li [Fri, 5 Aug 2022 07:04:49 +0000 (15:04 +0800)]
ASoC: SOF: mediatek: Add sof_mt8186_machs for mt8186

Add .of_machines field sof_mt8186_machs for mt8186

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220805070449.6611-3-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: Introduce function sof_of_machine_select
Chunxu Li [Fri, 5 Aug 2022 07:04:48 +0000 (15:04 +0800)]
ASoC: SOF: Introduce function sof_of_machine_select

From current design in sof_machine_check and snd_sof_new_platform_drv,
the SOF can only support ACPI type machine.

1. In sof_machine_check if there is no ACPI machine exist, the function
will return -ENODEV directly, that's we don't expected if we do not
base on ACPI machine.

2. In snd_sof_new_platform_drv the component driver need a driver name
to do ignore_machine, currently the driver name is obtained from
machine->drv_name, and the type of machine is snd_soc_acpi_mach.

So we add a new function named sof_of_machine_select that we can pass
sof_machine_check and obtain info required by snd_sof_new_platform_drv.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220805070449.6611-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: Intel: hda: Drop no longer used ROM state definitions
Peter Ujfalusi [Tue, 12 Jul 2022 12:57:34 +0000 (15:57 +0300)]
ASoC: SOF: Intel: hda: Drop no longer used ROM state definitions

All code have been switched to use the new FSR defines and macros for
ROM/FW state tracking.
The old definitions can be dropped now.

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-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: Intel: hda-loader: Use the FSR state definitions during bootup
Peter Ujfalusi [Tue, 12 Jul 2022 12:57:33 +0000 (15:57 +0300)]
ASoC: SOF: Intel: hda-loader: Use the FSR state definitions during bootup

Switch to use the newly added FSR (Firmware State Register) definitions
for DSP state handling and targeting.

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-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: fsl_sai: Add support multi fifo sdma script
Shengjiu Wang [Tue, 23 Aug 2022 01:36:13 +0000 (09:36 +0800)]
ASoC: fsl_sai: Add support multi fifo sdma script

With disabling combine mode, the multiple successive
FIFO registers or non successive FIFO registers of SAI module
can work with the sdma multi fifo script.

This patch is to configure the necessary information to
the SDMA engine driver for support multi fifo script.

'words_per_fifo' is the channels for each dataline
'n_fifos_src' and 'n_fifos_dst' are the fifo number
'stride_fifos_src' and 'stride_fifos_dst' are the stride
between enable FIFOs
'maxburst' is the multiply of datalines

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1661218573-2154-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: compress: Remove dai_posn variable
Daniel Baluta [Mon, 22 Aug 2022 17:49:37 +0000 (20:49 +0300)]
ASoC: SOF: compress: Remove dai_posn variable

dai_posn is set but never used. Initial intention was
to use dai_posn to shorthen one code line but it looks fine
without it too.

Fixes: c1a731c71359 ("ASoC: SOF: compress: Add support for computing timestamps")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220822174937.254873-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: atmel_ssc_dai: Remove the unneeded result variable
ye xingchen [Tue, 23 Aug 2022 07:53:35 +0000 (07:53 +0000)]
ASoC: atmel_ssc_dai: Remove the unneeded result variable

Return the value from asoc_ssc_init() directly instead of storing it
in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/20220823075335.209072-1-ye.xingchen@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: mt8186: rename sound card name
chunxu.li [Tue, 23 Aug 2022 09:07:35 +0000 (17:07 +0800)]
ASoC: mediatek: mt8186: rename sound card name

The field 'topology_shortname' in 'snd_soc_card' is defined as char[32],
Current card name will be truncated when SOF is enabled, so rename the
sound card name.

Signed-off-by: chunxu.li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220823090735.12176-1-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: samsung: Use iio_get_channel_type() accessor.
Jonathan Cameron [Sun, 21 Aug 2022 16:09:14 +0000 (17:09 +0100)]
ASoC: samsung: Use iio_get_channel_type() accessor.

struct iio_chan_spec is meant to be opaque to IIO consumer drivers
which should only use the interfaces in linux/iio/consumer.h.
Use the provided accessor function to find get the type of the
channel instead of directly reading it form the structure.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20220821160914.2207116-1-jic23@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: soc-pcm.c: summarize related settings at soc_new_pcm()
Kuninori Morimoto [Mon, 22 Aug 2022 02:46:25 +0000 (02:46 +0000)]
ASoC: soc-pcm.c: summarize related settings at soc_new_pcm()

soc_new_pcm() sets pcm->no_device_suspend, but it sets other pcm->xxx
at the same function with different timing.
pcm->no_device_suspend setup timing has no effect. This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bksdgflq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: support SOF for mt8186
Mark Brown [Fri, 19 Aug 2022 22:46:57 +0000 (23:46 +0100)]
ASoC: mediatek: support SOF for mt8186

Merge series from Chunxu Li <chunxu.li@mediatek.com>:

In these patches, we add SOF support for mt8186 which have HiFi5 DSP
inside.

23 months agoASoC: amd: acp: remove unnecessary NULL checks
Dan Carpenter [Fri, 19 Aug 2022 05:23:09 +0000 (08:23 +0300)]
ASoC: amd: acp: remove unnecessary NULL checks

The list iterator can never be NULL.  Delete the bogus NULL checks.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yv8ePUuBfzaRu6xV@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Change handling of unimplemented set_bclk_ratio
Martin Povišer [Thu, 18 Aug 2022 16:53:36 +0000 (18:53 +0200)]
ASoC: Change handling of unimplemented set_bclk_ratio

If a 'set_bclk_ratio' call is attempted on a DAI not implementing the
method, make it an -ENOSUPP error instead of -EINVAL. Assume the DAI can
still be okay with the ratio, just does not care to register a handler.

No current in-tree users of snd_soc_dai_set_bclk_ratio seem to inspect
the return value, but -ENOSUPP disables an error print from within the
common soc_dai_ret return filter. With the new behavior a machine
driver can do a blanket 'set_bclk_ratio' on all DAIs on a bus, some of
which may care about the ratio, some of which may not.

Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220818165336.76403-1-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: amd: acp: add a label to make error path more clean
Yang Yingliang [Fri, 19 Aug 2022 07:37:58 +0000 (15:37 +0800)]
ASoC: amd: acp: add a label to make error path more clean

Move platform_device_unregister() to a new label to make code more clean.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220819073758.1273160-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: amd: acp: switch to use dev_err_probe()
Yang Yingliang [Fri, 19 Aug 2022 07:37:57 +0000 (15:37 +0800)]
ASoC: amd: acp: switch to use dev_err_probe()

Use dev_err_probe() to simplify code and print error code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220819073758.1273160-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe()
Yang Yingliang [Fri, 19 Aug 2022 07:37:56 +0000 (15:37 +0800)]
ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe()

Add missing platform_device_unregister() in error path in acp_pci_probe().

Fixes: c49f5e74a11e ("ASoC: amd: acp: Add error handling cases")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220819073758.1273160-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: imx: Add i.MX8ULP HW support
Zhang Peng [Thu, 18 Aug 2022 01:53:54 +0000 (09:53 +0800)]
ASoC: SOF: imx: Add i.MX8ULP HW support

This adds skeleton support for the audio DSP hardware found on
NXP i.MX8ULP platform.

On i.MX8ULP resources (clocks, power, etc) are managed by the
System Integration Module in LPAV domain and XRDC which is handled
by arm trusted firmware.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1660787634-28550-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agodt-bindings: dsp: fsl: Add SOF compatile string for i.MX8ULP
Shengjiu Wang [Thu, 18 Aug 2022 01:53:53 +0000 (09:53 +0800)]
dt-bindings: dsp: fsl: Add SOF compatile string for i.MX8ULP

Add SOF compatile string "fsl,imx8ulp-dsp" for supporting DSP
device on i.MX8ULP platform.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1660787634-28550-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: mt8186: add SOF support on mt8186-mt6366-da7219-max98357
Chunxu Li [Thu, 18 Aug 2022 02:51:13 +0000 (10:51 +0800)]
ASoC: mediatek: mt8186: add SOF support on mt8186-mt6366-da7219-max98357

1. Add widgets, routes and dai-links required by SOF

2. Only when adsp phandle could be retrieved from DTS, the SOF related part
of machine driver is executed.

3. Support dai-links could be specified from DTS, so that
we can disable AP side hardware controls when DSP SOF controls the same
audio FE.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220818025113.17144-4-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: mt8186: add SOF support on mt8186-mt6366-rt1019-rt5682s
Chunxu Li [Thu, 18 Aug 2022 02:51:12 +0000 (10:51 +0800)]
ASoC: mediatek: mt8186: add SOF support on mt8186-mt6366-rt1019-rt5682s

1. Add widgets, routes and dai-links required by SOF

2. Only when adsp phandle could be retrieved from DTS, the SOF related part
of machine driver is executed.

3. Support dai-links could be specified from DTS, so that
we can disable AP side hardware controls when DSP SOF controls the same
audio FE.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220818025113.17144-3-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: mt8186: support DSP downlink
Chunxu Li [Thu, 18 Aug 2022 02:51:11 +0000 (10:51 +0800)]
ASoC: mediatek: mt8186: support DSP downlink

1. add DSP downlink link widget
2. add DSP to I2S route path

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220818025113.17144-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: fsl_sai: Remove unnecessary FIFO reset in ISR
Shengjiu Wang [Wed, 17 Aug 2022 05:24:27 +0000 (13:24 +0800)]
ASoC: fsl_sai: Remove unnecessary FIFO reset in ISR

The FIFO reset drops the words in the FIFO, which may cause
channel swap when SAI module is running, especially when the
DMA speed is low. So it is not good to do FIFO reset in ISR,
then remove the operation.

Fixes: e2681a1bf5ae ("ASoC: fsl_sai: Add isr to deal with error flag")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1660713867-26921-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: cs42l42: Some small code improvements
Mark Brown [Wed, 17 Aug 2022 17:05:13 +0000 (18:05 +0100)]
ASoC: cs42l42: Some small code improvements

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

This is a collection of minor improvements to the code or comments.

23 months agoASoC: soc-utils-test: Add test for snd_soc_params_to_bclk()
Richard Fitzgerald [Wed, 17 Aug 2022 12:55:08 +0000 (13:55 +0100)]
ASoC: soc-utils-test: Add test for snd_soc_params_to_bclk()

snd_soc_params_to_bclk() calculates the BCLK from only the information in
snd_pcm_hw_params. It is therefore a subset of the functionality of
snd_soc_tdm_params_to_bclk() so can use a subset of the test case table.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817125508.1406651-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoEnable timestamp support for SOF compress driver
Mark Brown [Wed, 17 Aug 2022 14:18:49 +0000 (15:18 +0100)]
Enable timestamp support for SOF compress driver

Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:

This patchseries computes pcm_io_frames from the DAI position reported
by SOF firmware.  Using pcm_io_frames userspace applications can later
compute timestamps for compressed stream.

23 months agoASoC/soundwire: log actual PING status on resume issues
Mark Brown [Wed, 17 Aug 2022 14:18:47 +0000 (15:18 +0100)]
ASoC/soundwire: log actual PING status on resume issues

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

we've been stuck with problems in the dual-amplifier configurations where
one of the two devices seems to become UNATTACHED and never regains sync,
see https://github.com/thesofproject/linux/issues/3638.

This is a rather infrequent issue that may happen once or twice per month,
but still it remains a concern.

One possibility is that the device does lose sync but somehow our hardware
detection fails to see it resync.

This series just adds a basic read directly from the PING frames to help
confirm if yes/no the device regain sync.

23 months agoASoC: cs42l42: Use snd_soc_tdm_params_to_bclk()
Richard Fitzgerald [Wed, 17 Aug 2022 12:23:47 +0000 (13:23 +0100)]
ASoC: cs42l42: Use snd_soc_tdm_params_to_bclk()

Use the new snd_soc_tdm_params_to_bclk() helper function to
calculate the bclk. This function handles most of the previous
manipulation and makes the code tidier.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-6-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: cs42l42: Fix comment typo in cs42l42_slow_start_put()
Richard Fitzgerald [Wed, 17 Aug 2022 12:23:46 +0000 (13:23 +0100)]
ASoC: cs42l42: Fix comment typo in cs42l42_slow_start_put()

Fix "much change together" to "must change together".

It's probably obvious what was meant but it's nice to fix it.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: cs42l42: Move cs42l42_supply_names to .c file
Richard Fitzgerald [Wed, 17 Aug 2022 12:23:45 +0000 (13:23 +0100)]
ASoC: cs42l42: Move cs42l42_supply_names to .c file

The array of supply name strings doesn't need to be in the header file.
Move it to the .c file.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: cs42l42: Add include dependencies to cs42l42.h
Richard Fitzgerald [Wed, 17 Aug 2022 12:23:44 +0000 (13:23 +0100)]
ASoC: cs42l42: Add include dependencies to cs42l42.h

Make cs42l42.h include the other headers it depends on instead of
assuming that the .c file already included them.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: cs42l42: Don't include kernel.h
Richard Fitzgerald [Wed, 17 Aug 2022 12:23:43 +0000 (13:23 +0100)]
ASoC: cs42l42: Don't include kernel.h

kernel.h includes a lot of other headers that we don't need.
Replace with an include of types.h.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220817122347.1356773-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: show PING status on resume failures
Pierre-Louis Bossart [Thu, 14 Jul 2022 01:10:43 +0000 (09:10 +0800)]
ASoC: codecs: show PING status on resume failures

This helper should help identify cases where devices fall off the bus
and don't resync.

BugLink: https://github.com/thesofproject/linux/issues/3638
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agosoundwire: add sdw_show_ping_status() helper
Pierre-Louis Bossart [Thu, 14 Jul 2022 01:10:42 +0000 (09:10 +0800)]
soundwire: add sdw_show_ping_status() helper

This helper provides an optional delay parameter to wait for devices
to resync in case of errors, and checks that devices are indeed
attached on the bus.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agosoundwire: intel/cadence: expose PING status in manager ops
Pierre-Louis Bossart [Thu, 14 Jul 2022 01:10:41 +0000 (09:10 +0800)]
soundwire: intel/cadence: expose PING status in manager ops

Simple indirection to existing register.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agosoundwire: add read_ping_status helper definition in manager ops
Pierre-Louis Bossart [Thu, 14 Jul 2022 01:10:40 +0000 (09:10 +0800)]
soundwire: add read_ping_status helper definition in manager ops

The existing manager ops provide callbacks to transfer read/write
commands, but don't allow for direct access to PING status
register. This is accessible in all existing IP, and would help
diagnose timeouts or resume issues by reporting the 'true' status
instead of the internal status reported by the IP.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: core: remove setting platform_max in kcontrol macros
Srinivas Kandagatla [Tue, 16 Aug 2022 17:21:29 +0000 (18:21 +0100)]
ASoC: core: remove setting platform_max in kcontrol macros

platform_max should not be set by the driver, its intended for machine drivers
or DT to override the max value for platform specific reasons.

So remove setting this from Kcontrol macros.

Setting this to max in these macros would limit the range when min
value is less then zero.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220816172129.6661-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: tlv320adcx140: Add a new kcontrol
Kevin Lu [Mon, 15 Aug 2022 11:27:15 +0000 (19:27 +0800)]
ASoC: tlv320adcx140: Add a new kcontrol

Add a new kcontrol for phase calib

Signed-off-by: Kevin Lu <luminlong@139.com>
Link: https://lore.kernel.org/r/20220815112715.21617-1-luminlong@139.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: qcom: qdsp6: q6prm: add new clocks
Srinivas Kandagatla [Tue, 16 Aug 2022 17:01:18 +0000 (18:01 +0100)]
ASoC: qcom: qdsp6: q6prm: add new clocks

Add support to new clocks that are added in Q6DSP as part of newer version
of LPASS support on SM8450 and SC8280XP.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220816170118.13470-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Variable type completion
Xin Gao [Tue, 16 Aug 2022 17:51:05 +0000 (01:51 +0800)]
ASoC: Variable type completion

'unsigned int' is better than 'unsigned'.

Signed-off-by: Xin Gao <gaoxin@cdjrlc.com>
Link: https://lore.kernel.org/r/20220816175105.8084-1-gaoxin@cdjrlc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: es8326: change es8326_regmap_config to static
Yang Yingliang [Wed, 17 Aug 2022 09:15:19 +0000 (17:15 +0800)]
ASoC: codecs: es8326: change es8326_regmap_config to static

es8326_regmap_config is only used in es8326.c now, change it to static.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220817091519.2487385-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: compress: Add support for computing timestamps
Laurentiu Mihalcea [Wed, 17 Aug 2022 08:05:29 +0000 (11:05 +0300)]
ASoC: SOF: compress: Add support for computing timestamps

We compute the number of pcm_io_frames by dividing the
dai position to size of a frame (channels * sample size).

Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: compress: Save channel count and sample bytes
Laurentiu Mihalcea [Wed, 17 Aug 2022 08:05:28 +0000 (11:05 +0300)]
ASoC: SOF: compress: Save channel count and sample bytes

The purpose of this change is to enable the saving of the
channel count and sample container bytes format parameters for later use
to compute the timestamps.

This is done when setting the compress stream parameters
(in sof_compr_set_params).

Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: compress: Introduce sof_compr_stream
Daniel Baluta [Wed, 17 Aug 2022 08:05:27 +0000 (11:05 +0300)]
ASoC: SOF: compress: Introduce sof_compr_stream

This will keep SOF compress stream private data. So far
we used snd_compr_tstamp to hold the private data but this
is no longer enough as we need to hold other info like
number of channels or sample bytes.

Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: SOF: compress: Remove byte offset computation
Daniel Baluta [Wed, 17 Aug 2022 08:05:26 +0000 (11:05 +0300)]
ASoC: SOF: compress: Remove byte offset computation

Byte offset is the offset in the ring buffer to the DSP
while posn_offset is an offset inside the stream_box where
we keep position information.

Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: HSW and BDW updates
Mark Brown [Tue, 16 Aug 2022 16:33:11 +0000 (17:33 +0100)]
ASoC: Intel: HSW and BDW updates

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Sharing this PR as it touches on cross-driver subjects. Four commits yet
two subject. Given the small delta, decided to combine within single PR
here.

23 months agoASoC: SOF: Intel: pci-tgl: use RPL specific firmware definitions
Kai Vehmanen [Tue, 16 Aug 2022 13:05:10 +0000 (16:05 +0300)]
ASoC: SOF: Intel: pci-tgl: use RPL specific firmware definitions

Split out firmware definitions for Intel Raptor Lake platforms.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Suggested-by: Gopal Vamshi Krishna <vamshi.krishna.gopal@intel.com>
Link: https://lore.kernel.org/r/20220816130510.190427-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: common: add ACPI matching tables for Raptor Lake
Kai Vehmanen [Tue, 16 Aug 2022 13:05:09 +0000 (16:05 +0300)]
ASoC: Intel: common: add ACPI matching tables for Raptor Lake

Initial support for RPL w/ RT711

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Gopal Vamshi Krishna <vamshi.krishna.gopal@intel.com>
Link: https://lore.kernel.org/r/20220816130510.190427-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoAdd support for linked list to store acp_stream and tdm support.
Mark Brown [Tue, 16 Aug 2022 13:47:35 +0000 (14:47 +0100)]
Add support for linked list to store acp_stream and tdm support.

Merge series from Venkata Prasad Potturu <venkataprasad.potturu@amd.com>:

This patch is to add support for linked list to store acp_stream instead
static array and add tdm support for acp I2S stream.

23 months agoASoC: fsl_sai: fix incorrect mclk number in error message
Pieterjan Camerlynck [Sat, 13 Aug 2022 08:33:52 +0000 (10:33 +0200)]
ASoC: fsl_sai: fix incorrect mclk number in error message

In commit c3ecef21c3f26 ("ASoC: fsl_sai: add sai master mode support")
the loop was changed to start iterating from 1 instead of 0. The error
message however was not updated, reporting the wrong clock to the user.

Signed-off-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220813083353.8959-1-pieterjan.camerlynck@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: add support for ES8326
Zhu Ning [Tue, 16 Aug 2022 02:44:56 +0000 (10:44 +0800)]
ASoC: codecs: add support for ES8326

The ES8326 codec is not compatible with ES8316 and requires
a dedicated driver.

------
v6 remove rate 96000 remove HEX suffix

Signed-off-by: David Yang <yangxiaohua@everest-semi.com>
Signed-off-by: Zhu Ning <zhuning@everest-semi.com>
Link: https://lore.kernel.org/r/20220816024456.4475-2-zhuning0077@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: dt-bindings: Add Everest ES8326 audio CODEC
Zhu Ning [Tue, 16 Aug 2022 02:44:55 +0000 (10:44 +0800)]
ASoC: dt-bindings: Add Everest ES8326 audio CODEC

Add device tree binding documentation for Everest ES8326

----
v5 tested by dtschema

Signed-off-by: David Yang <yangxiaohua@everest-semi.com>
Signed-off-by: Zhu Ning <zhuning@everest-semi.com>
Link: https://lore.kernel.org/r/20220816024456.4475-1-zhuning0077@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: Drop legacy HSW/BDW board-match information
Cezary Rojewski [Mon, 15 Aug 2022 16:58:18 +0000 (18:58 +0200)]
ASoC: Intel: Drop legacy HSW/BDW board-match information

With board-matching information for legacy solution moved to local
directory, there is no need to expose it globally.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220815165818.3050649-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: catpt: Drop SND_SOC_ACPI_INTEL_MATCH dependency
Cezary Rojewski [Mon, 15 Aug 2022 16:58:17 +0000 (18:58 +0200)]
ASoC: Intel: catpt: Drop SND_SOC_ACPI_INTEL_MATCH dependency

catpt-driver does not make use of most of the fields found in the
descriptor table and is the sole user of haswell machines list. Move the
tables to local directory and clean them up so it's clear what's
actually used by the solution.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220815165818.3050649-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: bdw_rt286: Rename module
Cezary Rojewski [Mon, 15 Aug 2022 16:58:16 +0000 (18:58 +0200)]
ASoC: Intel: bdw_rt286: Rename module

Change kernel module name from snd_soc_sst_broadwell to
snd_soc_bdw_rt286 to better reflect its purpose.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220815165818.3050649-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: hsw_rt5640: Rename module
Cezary Rojewski [Mon, 15 Aug 2022 16:58:15 +0000 (18:58 +0200)]
ASoC: Intel: hsw_rt5640: Rename module

Change kernel module name from snd_soc_sst_haswell to snd_soc_hsw_rt5640
to better reflect its purpose.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220815165818.3050649-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: soc-utils: Improve kerneldoc for snd_soc_tdm_params_to_bclk()
Richard Fitzgerald [Mon, 15 Aug 2022 11:33:46 +0000 (12:33 +0100)]
ASoC: soc-utils: Improve kerneldoc for snd_soc_tdm_params_to_bclk()

The statement that snd_soc_tdm_params_to_bclk() is equivalent to
snd_soc_params_to_bclk() if tdm_width==tdm_slots==0 is not accurate,
it is only true is slot_multiple is also <2.

However, the description of special-case behaviour in terms of pairs of
tdm_width and tdm_slot values is not particularly helpful so we might as
well take the opportunity to rework the description to say the same thing
in a simpler way. The behaviour of a pair of values is obvious from a
description of each argument. At the same time make a few edits to clarify
the rest of the description.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220815113346.3805075-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoDT binding for sample format conversion
Mark Brown [Mon, 15 Aug 2022 16:22:22 +0000 (17:22 +0100)]
DT binding for sample format conversion

Merge series from Sameer Pujar <spujar@nvidia.com>:

DT binding properties are available to fixup rate and channel
parameters of a DAI. This series extends this to sample format
conversion as well. With this now DAI PCM parameters (channels,
sample rate and sample format) can be fixed up as necessary in
an audio path.

23 months agoASoC: Replace sprintf() with sysfs_emit()
Mark Brown [Mon, 15 Aug 2022 16:22:21 +0000 (17:22 +0100)]
ASoC: Replace sprintf() with sysfs_emit()

Merge series from Takashi Iwai <tiwai@suse.de>:

This is a patch set for rather simple conversions from the plain
sprintf() & co to the new helpers, sysfs_emit() and sysfs_emit_at().
No functional changes are expected.

23 months agoASoC: imx-rpmsg: Support configure sysclk for codec dai
Shengjiu Wang [Wed, 3 Aug 2022 03:02:28 +0000 (11:02 +0800)]
ASoC: imx-rpmsg: Support configure sysclk for codec dai

Some codecs need to configure the sysclk even with slave
mode, otherwise it may not work properly with some case.

wm8960 is the one that need sysclk be configured, so add
late_probe() to call the snd_soc_dai_set_sysclk() of codec

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1659495748-10876-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: sam9g20_wm8731: Simplify some error message
Christophe JAILLET [Sat, 6 Aug 2022 05:45:48 +0000 (07:45 +0200)]
ASoC: sam9g20_wm8731: Simplify some error message

dev_err_probe() already prints the error code in a human readable way, so
there is no need to duplicate it as a numerical value at the end of the
message.

Fixes: 29f4078f777f ("ASoC: sam9g20_wm8731: Use dev_err_probe() for snd_soc_register_card()")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/fb959b3bda689aa47e1fbe9948de957b77530b24.1659764734.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: dt bind. doc for the new TI SRC4392 codec
Matt Flax [Sun, 14 Aug 2022 22:22:18 +0000 (08:22 +1000)]
ASoC: codecs: dt bind. doc for the new TI SRC4392 codec

Signed-off-by: Matt Flax <flatmax@flatmax.com>
Link: https://lore.kernel.org/r/20220814222218.119786-1-flatmax@flatmax.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mt6359: fix tests for platform_get_irq() failure
Dan Carpenter [Thu, 11 Aug 2022 11:01:26 +0000 (14:01 +0300)]
ASoC: mt6359: fix tests for platform_get_irq() failure

The platform_get_irq() returns negative error codes.  It can't actually
return zero, but if it did that should be treated as success.

Fixes: eef07b9e0925 ("ASoC: mediatek: mt6359: add MT6359 accdet jack driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YvThhr86N3qQM2EO@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Intel: cirrus-common: Use UID to map correct amp to prefix
Stefan Binding [Mon, 1 Aug 2022 09:40:34 +0000 (10:40 +0100)]
ASoC: Intel: cirrus-common: Use UID to map correct amp to prefix

Since the order of the amps in the ACPI determines the device name,
and the ACPI order may change depending on hardware configuration,
use UID to dynamically compute the dai links, allowing dynamic
assignment of the name_prefix.

The UIDs for these amps in ACPI are fixed, and map to a name_prefix,
where:
UID 0x0 -> WL
UID 0x1 -> WR
UID 0x2 -> TL
UID 0x3 -> TR

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220801094034.3927841-1-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: Variable type completion
Xin Gao [Mon, 8 Aug 2022 15:39:10 +0000 (23:39 +0800)]
ASoC: Variable type completion

'unsigned int' is better than 'unsigned'.

Signed-off-by: Xin Gao <gaoxin@cdjrlc.com>
Link: https://lore.kernel.org/r/20220808153910.59545-1-gaoxin@cdjrlc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mediatek: mt8186: remove unnecessary NULL check
Dan Carpenter [Wed, 3 Aug 2022 09:09:00 +0000 (12:09 +0300)]
ASoC: mediatek: mt8186: remove unnecessary NULL check

The "i2s_priv" pointer cannot be NULL.  Some NULL checks were deleted
in commit d7bffbe9cbd3 ("ASoC: mediatek: mt8186: remove unnecessary
judgments") but this one was accidentally left behind.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yuo7LGPk8KnBW6ac@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: mchp-spdiftx: Fix clang -Wbitfield-constant-conversion
Nathan Chancellor [Wed, 10 Aug 2022 01:08:09 +0000 (18:08 -0700)]
ASoC: mchp-spdiftx: Fix clang -Wbitfield-constant-conversion

A recent change in clang strengthened its -Wbitfield-constant-conversion
to warn when 1 is assigned to a 1-bit signed integer bitfield, as it can
only be 0 or -1, not 1:

  sound/soc/atmel/mchp-spdiftx.c:505:20: error: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Werror,-Wbitfield-constant-conversion]
          dev->gclk_enabled = 1;
                            ^ ~
  1 error generated.

The actual value of the field is never checked, just that it is not
zero, so there is not a real bug here. However, it is simple enough to
silence the warning by making the bitfield unsigned, which matches the
mchp-spdifrx driver.

Fixes: 06ca24e98e6b ("ASoC: mchp-spdiftx: add driver for S/PDIF TX Controller")
Link: https://github.com/ClangBuiltLinux/linux/issues/1686
Link: https://github.com/llvm/llvm-project/commit/82afc9b169a67e8b8a1862fb9c41a2cd974d6691
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20220810010809.2024482-1-nathan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: dt-bindings: fsl,sai: Convert format to json-schema
Shengjiu Wang [Tue, 2 Aug 2022 12:29:54 +0000 (20:29 +0800)]
ASoC: dt-bindings: fsl,sai: Convert format to json-schema

Convert the NXP SAI binding to DT schema format using json-schema.

The Synchronous Audio Interface (SAI) provides an interface that
supports full-duplex serial interfaces with frame synchronization
formats such as I2S, AC97, TDM, and codec/DSP interfaces.

Beside conversion, 'fsl,shared-interrupt' and '#sound-dai-cells'
are added for they are already used by some dts.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/1659443394-9838-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: codecs: add support for the TI SRC4392 codec
Matt Flax [Wed, 10 Aug 2022 01:32:13 +0000 (11:32 +1000)]
ASoC: codecs: add support for the TI SRC4392 codec

The src4xxx keyword is used for future capability to integrate
other codecs similar to the src4392 to the same code base.

Signed-off-by: Matt Flax <flatmax@flatmax.com>
Link: https://lore.kernel.org/r/20220810013213.1544645-1-flatmax@flatmax.com
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: tlv320adcx140: Fix a typo in a comment
Christophe JAILLET [Sat, 6 Aug 2022 19:33:22 +0000 (21:33 +0200)]
ASoC: tlv320adcx140: Fix a typo in a comment

s/TLV320ADCX104/TLV320ADCX140/

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/63efe8fe4e25a8ac386762d2d7cfe9bb9482333f.1659814389.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
23 months agoASoC: simple-card-utils: Fixup DAI sample format
Sameer Pujar [Mon, 8 Aug 2022 05:27:32 +0000 (10:57 +0530)]
ASoC: simple-card-utils: Fixup DAI sample format

Parse "convert-sample-format" DT binding and fixup the sample format
as applicable. This is similar to the existing "convert-channels" and
"convert-rate" properties for channels and rate fixup respectively.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/1659936452-2254-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>