platform/kernel/linux-starfive.git
21 months agoASoC: SOF: sof-audio: Set up/free DAI/AIF widgets only once
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:16 +0000 (14:00 +0200)]
ASoC: SOF: sof-audio: Set up/free DAI/AIF widgets only once

Calling the sof_widget_setup/free() for the DAI/AIF widgets inside the
snd_soc_dapm_widget_for_each_sink_path() loop will end up setting up or
freeing the widget multiple times if there are multiple paths leaving
the widget. Fix this by moving the widget setup/free for the starting
widget in each path outside the loop.

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>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: soc-pcm: Export widget_in_list()
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:15 +0000 (14:00 +0200)]
ASoC: soc-pcm: Export widget_in_list()

Export the widget_in_list() function to be used by other modules.

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>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: ipc4-topology: No need to unbind routes within a pipeline
Ranjani Sridharan [Fri, 27 Jan 2023 12:00:14 +0000 (14:00 +0200)]
ASoC: SOF: ipc4-topology: No need to unbind routes within a pipeline

The FW currently ignores unbinding routes if the source and sink widgets
belong to the same pipeline. So no need to send the IPC at all in the
first place.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230127120031.10709-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8188: remove some dead code
Dan Carpenter [Thu, 26 Jan 2023 09:26:35 +0000 (12:26 +0300)]
ASoC: mediatek: mt8188: remove some dead code

We know that "irq < 0", so delete the unnecessary check.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/Y9JHSwcfdNcfMjjt@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoUpdate lpass dt-bindings
Mark Brown [Thu, 26 Jan 2023 17:04:48 +0000 (17:04 +0000)]
Update lpass dt-bindings

Merge series from Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>:

Update va-macro driver dt-bindings and add missing properties in sc7280
machine driver dt-bindings.

Changes since v2:
    -- Update commit message and example in "Add platform property" patch.
    -- Update commit message in "Update clock name" patch.
Changes since v1:
    -- Remove sound-dai cells property patch.
    -- Update example in clock name change patch.
    -- Update commit message and add maxItems in platform proerty patch.

Srinivasa Rao Mandadapu (2):
  ASoC: qcom: dt-bindings: lpass-va-macro: Update clock name
  ASoC: dt-bindings: google,sc7280-herobrine: Add platform property

 .../devicetree/bindings/sound/google,sc7280-herobrine.yaml   | 12 ++++++++++++
 .../devicetree/bindings/sound/qcom,lpass-va-macro.yaml       |  4 ++--
 2 files changed, 14 insertions(+), 2 deletions(-)

--
2.7.4

21 months agoASoC: SOF: ipc4-topology: use different channel mask for each sdw amp feedback
Bard Liao [Wed, 25 Jan 2023 14:13:17 +0000 (16:13 +0200)]
ASoC: SOF: ipc4-topology: use different channel mask for each sdw amp feedback

Currently, we use the same channel mask for aggregated speakers.
It works fine for playback because we duplicate the audio data for all
aggregated speakers. But we need to get audio data from each aggregated
speaker and combine them to the captured audio. So we need to set
non-overlapping channel mask for aggregated ALH DAIs.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230125141317.30302-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: dt-bindings: renesas,rsnd: simplify list of compatibles
Krzysztof Kozlowski [Thu, 26 Jan 2023 10:07:22 +0000 (11:07 +0100)]
ASoC: dt-bindings: renesas,rsnd: simplify list of compatibles

The fallback compatible in a list (the last one) cannot be enum, because
it is always fixed.  Also if such fallback is used alone ("Generic"
case), it's not a list anymore.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230126100722.9473-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: ipc4-topology: add buffer type support
Bard Liao [Thu, 26 Jan 2023 11:06:37 +0000 (13:06 +0200)]
ASoC: SOF: ipc4-topology: add buffer type support

The corresponding IPC4 module of snd_soc_dapm_buffer widget is module
-to-module copier.
The module-to-module copier is a buffer-like component with demuxing
capabilities.
Rename the host_token_list to common_copier_token_list since it will
be used by host copier and module-to-module copier.
The setup callback is almost the same as sof_ipc4_widget_setup_pcm except
the gtw_cfg data, and the free callback is exactly the same as
sof_ipc4_widget_free_comp_pcm. To reduce the duplication, the commit
reuses the setup and free callbacks.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230126110637.25542-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: dt-bindings: google,sc7280-herobrine: Add platform property
Srinivasa Rao Mandadapu [Mon, 23 Jan 2023 10:13:22 +0000 (15:43 +0530)]
ASoC: dt-bindings: google,sc7280-herobrine: Add platform property

Add platform property in sc7280 machine driver bindings for including
platform subnode in dai-links.
This is required for binding the frontend dai driver to do dynamic pcm
routing in ADSP based platforms.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1674468802-14834-3-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: qcom: dt-bindings: lpass-va-macro: Update clock name
Srinivasa Rao Mandadapu [Mon, 23 Jan 2023 10:13:21 +0000 (15:43 +0530)]
ASoC: qcom: dt-bindings: lpass-va-macro: Update clock name

Update clock name from core to macro in lpass-va-macro node
to make it compatible with existing driver and existing DTS files.

Fixes: 67d99b23c881 ("ASoC: qcom: dt-bindings: add bindings for lpass va macro codec")
Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Reported-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/1674468802-14834-2-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Kconfig: fix spelling of "up to"
Randy Dunlap [Tue, 24 Jan 2023 18:17:46 +0000 (10:17 -0800)]
ASoC: Kconfig: fix spelling of "up to"

Fix spelling in sound/soc/ Kconfig files:
s/upto/up to/
(reported by codespell)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de> #rockchip
Link: https://lore.kernel.org/r/20230124181746.19028-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: qcom: lpass-platform: Use SNDRV_DMA_TYPE_NONCOHERENT page allocation
Judy Hsiao [Thu, 8 Dec 2022 08:42:00 +0000 (08:42 +0000)]
ASoC: qcom: lpass-platform: Use SNDRV_DMA_TYPE_NONCOHERENT page allocation

Replace SNDRV_DMA_TYPE_DEV by SNDRV_DMA_TYPE_NONCOHERENT for pcm
buffer allocation. We measured about 18x performance improvement
when accessing the snd_pcm_mmap() buffer from userspace.

Eg: aarch64 with internal speaker
==
SNDRV_DMA_TYPE_DEV
    frames_per_second=66.4557M/s
    max_time_per_4096_frames=106.094u
    time_per_4096_frames=61.6351us

SNDRV_DMA_TYPE_NONCOHERENT
    frames_per_second=1028.58M/s
    max_time_per_4096_frames=20.312u
    time_per_4096_frames=3.98221us

Signed-off-by: Judy Hsiao <judyhsiao@chromium.org>
Link: https://lore.kernel.org/r/20221208084200.2136311-1-judyhsiao@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: qcom: sdm845: add remark about unneeded compatibles
Krzysztof Kozlowski [Wed, 18 Jan 2023 10:15:42 +0000 (11:15 +0100)]
ASoC: qcom: sdm845: add remark about unneeded compatibles

If all devices are the same or compatible, there is no single need to
keep growing of_device_id list with new entries.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230118101542.96705-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: dt-bindings: qcom,sm8250: use fallback for SDM845 sound cards
Krzysztof Kozlowski [Wed, 18 Jan 2023 10:15:41 +0000 (11:15 +0100)]
ASoC: dt-bindings: qcom,sm8250: use fallback for SDM845 sound cards

All SDM845 sound cards are compatible with each other, so use one
generic fallback compatible for them.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230118101542.96705-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: dt-bindings: samsung-i2s: drop unneeded assigned-clock*
Krzysztof Kozlowski [Fri, 20 Jan 2023 15:30:20 +0000 (16:30 +0100)]
ASoC: dt-bindings: samsung-i2s: drop unneeded assigned-clock*

assigned-clock-parents and assigned-clocks are coming from dtschema, so
there is no need anymore to keep them in bindings.  Their presence were
also causing false positives:

  exynos5422-odroidxu3.dtb: i2s@3830000: Unevaluated properties are not allowed ('assigned-clock-rates' was unexpected)

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230120153020.320270-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: dt-bindings: samsung,odroid: correct codec DAI phandles
Krzysztof Kozlowski [Fri, 20 Jan 2023 15:30:19 +0000 (16:30 +0100)]
ASoC: dt-bindings: samsung,odroid: correct codec DAI phandles

The order of codec DAI phandles is reversed - first comes HDMI (always
present) and then codec (physically not present on Odroid XU4).

Fixes: 97709d365bbd ("ASoC: dt-bindings: Centralize the 'sound-dai' definition")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230120153020.320270-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: wsa88xx: remove unneeded includes
Krzysztof Kozlowski [Tue, 24 Jan 2023 16:39:53 +0000 (17:39 +0100)]
ASoC: codecs: wsa88xx: remove unneeded includes

Remove unneeded includes from wsa881x and wsa883x drivers.  The drivers
do not reference anything from the headers.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124163953.345949-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: constify static sdw_port_config struct
Krzysztof Kozlowski [Tue, 24 Jan 2023 16:39:52 +0000 (17:39 +0100)]
ASoC: codecs: constify static sdw_port_config struct

The struct sdw_port_config is not modified, so make it a const for code
safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124163953.345949-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: constify static sdw_slave_ops struct
Krzysztof Kozlowski [Tue, 24 Jan 2023 16:39:51 +0000 (17:39 +0100)]
ASoC: codecs: constify static sdw_slave_ops struct

The struct sdw_slave_ops is not modified and sdw_driver takes pointer to
const, so make it a const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124163953.345949-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: avs: Simplify probe-component implementation
Cezary Rojewski [Mon, 23 Jan 2023 12:21:44 +0000 (13:21 +0100)]
ASoC: Intel: avs: Simplify probe-component implementation

There is no need for the probe-component to be part of the PCM component
list as it does not make use of ASoC-topology and does not participate
in creating any PCM streams.

To achieve that, remove probe() and remove() functions.

Fixes: ed914a2a45a4 ("ASoC: Intel: avs: Data probing soc-component")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230123122144.1356890-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: qdsp6: audioreach: Add ADSP ready check
Srinivasa Rao Mandadapu [Thu, 12 Jan 2023 07:30:17 +0000 (13:00 +0530)]
ASoC: qdsp6: audioreach: Add ADSP ready check

Check for SPF readiness in prm driver probe to avoid race conditions
during ADSP pil loading.
This patch is to avoid, sending requests to ADSP before it's
power domains are up and ready.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Tested-by: Ratna Deepthi Kudaravalli <rkudarav@qti.qualcomm.com>
Link: https://lore.kernel.org/r/1673508617-27410-1-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8186: add AFE_DAC_CON0 to volatile register list
Chunxu Li [Tue, 10 Jan 2023 09:26:23 +0000 (17:26 +0800)]
ASoC: mediatek: mt8186: add AFE_DAC_CON0 to volatile register list

Mark AFE_DAC_CON0 as volatile since DSP firmware will access this
register too.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20230110092623.13035-1-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: ux500: remove stedma40 references
Arnd Bergmann [Wed, 18 Jan 2023 16:10:48 +0000 (17:10 +0100)]
ASoC: ux500: remove stedma40 references

ux500_pcm_request_chan() is never called because the dma channels
are already set up from DT. Remove this, along with the
ux500_msp_dma_params structure.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230118161110.521504-4-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: ux500: remove platform_data support
Arnd Bergmann [Wed, 18 Jan 2023 16:10:47 +0000 (17:10 +0100)]
ASoC: ux500: remove platform_data support

The platform data definition for ux500 sound devices was removed
six years ago after the DT conversion was completed, see commit
4b483ed0be8b ("ARM: ux500: cut some platform data").

Remove some leftover bits in the ASoC driver and just assume that
it always gets probed using DT.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230118161110.521504-3-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: Add support for MT8188 SoC
Mark Brown [Thu, 19 Jan 2023 15:31:47 +0000 (15:31 +0000)]
ASoC: mediatek: Add support for MT8188 SoC

Merge series from Trevor Wu <trevor.wu@mediatek.com>:

This series of patches adds support for Mediatek AFE of MT8188 SoC.
Patches are based on broonie tree "for-next" branch.

Changes since v4:
  - refine etdm dai driver based on reviewer's suggestions
  - refine dt-binding files based on reviewer's suggestions

Changes since v3:
  - replace apll_ck with apll to sync with the relationship in CCF
  - add mtk-soundcard-driver.c to support codec parsing
  - drop mclk-always-on-rates support in mt8188-dai-etdm.c
  - refine dt-binding files based on reviewer's suggestions

Changes since v2:
  - drop CLK_IGNORE_UNUSED flag
  - include bitfield.h to reslove the issue reported by kernel test robot
  - rename mt8188-afe-pcm.yaml to mt8188-afe.yaml
  - refine dt-binding files based on reviewer's suggestions

Changes since v1:
  - remove bus protection functions in case of unmerged dependency problem
  - replace some bit operation macro with FIELD_PREP
  - simplify register control by regmap_set_bits and regmap_clear_bits
  - fix dt-binding errors
  - rename compatible string for recognition

Trevor Wu (13):
  ASoC: mediatek: common: add SMC ops and SMC CMD
  ASoC: mediatek: mt8188: add common header
  ASoC: mediatek: mt8188: support audsys clock
  ASoC: mediatek: mt8188: support adda in platform driver
  ASoC: mediatek: mt8188: support etdm in platform driver
  ASoC: mediatek: mt8188: support pcmif in platform driver
  ASoC: mediatek: mt8188: support audio clock control
  ASoC: mediatek: mt8188: add platform driver
  ASoC: mediatek: mt8188: add control for timing select
  ASoC: dt-bindings: mediatek,mt8188-afe: add audio afe document
  ASoC: mediatek: common: add soundcard driver common code
  ASoC: mediatek: mt8188: add machine driver with mt6359
  ASoC: dt-bindings: mediatek,mt8188-mt6359: add mt8188-mt6359 document

 .../bindings/sound/mediatek,mt8188-afe.yaml   |  208 +
 .../sound/mediatek,mt8188-mt6359.yaml         |   97 +
 sound/soc/mediatek/Kconfig                    |   23 +
 sound/soc/mediatek/Makefile                   |    1 +
 sound/soc/mediatek/common/Makefile            |    2 +-
 sound/soc/mediatek/common/mtk-base-afe.h      |   19 +
 .../mediatek/common/mtk-soundcard-driver.c    |   79 +
 .../mediatek/common/mtk-soundcard-driver.h    |   14 +
 sound/soc/mediatek/mt8188/Makefile            |   15 +
 sound/soc/mediatek/mt8188/mt8188-afe-clk.c    |  658 ++++
 sound/soc/mediatek/mt8188/mt8188-afe-clk.h    |  115 +
 sound/soc/mediatek/mt8188/mt8188-afe-common.h |  151 +
 sound/soc/mediatek/mt8188/mt8188-afe-pcm.c    | 3359 +++++++++++++++++
 sound/soc/mediatek/mt8188/mt8188-audsys-clk.c |  205 +
 sound/soc/mediatek/mt8188/mt8188-audsys-clk.h |   15 +
 .../soc/mediatek/mt8188/mt8188-audsys-clkid.h |   83 +
 sound/soc/mediatek/mt8188/mt8188-dai-adda.c   |  632 ++++
 sound/soc/mediatek/mt8188/mt8188-dai-etdm.c   | 2588 +++++++++++++
 sound/soc/mediatek/mt8188/mt8188-dai-pcm.c    |  367 ++
 sound/soc/mediatek/mt8188/mt8188-mt6359.c     |  785 ++++
 sound/soc/mediatek/mt8188/mt8188-reg.h        | 3180 ++++++++++++++++
 21 files changed, 12595 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8188-afe.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml
 create mode 100644 sound/soc/mediatek/common/mtk-soundcard-driver.c
 create mode 100644 sound/soc/mediatek/common/mtk-soundcard-driver.h
 create mode 100644 sound/soc/mediatek/mt8188/Makefile
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-clk.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-clk.h
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-common.h
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.h
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clkid.h
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-dai-adda.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-dai-etdm.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-dai-pcm.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-mt6359.c
 create mode 100644 sound/soc/mediatek/mt8188/mt8188-reg.h

--
2.18.0

21 months agoAdd support to compress API to ipc_msg_data /
Mark Brown [Wed, 18 Jan 2023 15:45:21 +0000 (15:45 +0000)]
Add support to compress API to ipc_msg_data /

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

This patch series adds compress API support to ipc_msg_data /
set_stream_data_offset callbacks.

Changes since v1:
- fixed reviewed-by list (+Peter, -Pierre). Since github had
  some glitches I added the reviews received manually in the
          commits.
link: https://github.com/thesofproject/linux/pull/4133
Daniel Baluta (4):
  ASoC: SOF: Prepare ipc_msg_data to be used with compress API
  ASoC: SOF: Prepare set_stream_data_offset for compress API
  ASoC: SOF: Add support for compress API for stream data/offset
  ASoC: SOF: compress: Set compress data offset

 sound/soc/sof/amd/acp-ipc.c            |  8 ++--
 sound/soc/sof/amd/acp.h                |  5 ++-
 sound/soc/sof/compress.c               |  9 +++++
 sound/soc/sof/intel/hda-ipc.c          |  8 ++--
 sound/soc/sof/intel/hda.h              |  4 +-
 sound/soc/sof/ipc3-pcm.c               |  3 +-
 sound/soc/sof/ipc3.c                   |  4 +-
 sound/soc/sof/mediatek/mt8186/mt8186.c |  2 +-
 sound/soc/sof/mediatek/mt8195/mt8195.c |  2 +-
 sound/soc/sof/ops.h                    |  8 ++--
 sound/soc/sof/sof-priv.h               | 11 ++++--
 sound/soc/sof/stream-ipc.c             | 53 +++++++++++++++++++-------
 12 files changed, 81 insertions(+), 36 deletions(-)

--
2.25.1

21 months agoASoC: Merge up 6.2 fixes
Mark Brown [Wed, 18 Jan 2023 15:33:51 +0000 (15:33 +0000)]
ASoC: Merge up 6.2 fixes

To resolve a conflict and support further development.

21 months agoASoC: SOF: sof-audio: Fixes for widget prepare and
Mark Brown [Wed, 18 Jan 2023 15:28:17 +0000 (15:28 +0000)]
ASoC: SOF: sof-audio: Fixes for widget prepare and

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

This series contains one fix (first patch) followed by a nice to have safety
belts in case we get a widget from topology which is not handled by SOF and will
not have corresponding swidget associated with.

21 months agoASoC: samsung: fsd: audio support for FSD SoC
Mark Brown [Wed, 18 Jan 2023 13:41:51 +0000 (13:41 +0000)]
ASoC: samsung: fsd: audio support for FSD SoC

Merge series from Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>:

This patch series enables audio support on FSD SoC.

Changes in v4:
1. Rebased and addressed review comments provided for v3.

Changes in v3:
1. Addressed all the review comments provided for v2 patch.
2. Fixed compilation warnings reported by kernel test robot.

Changes in v2:
1. New compatible added in Exynos I2S driver for FSD platform.
2. Added Fixup support for Exynos I2S CPU DAI.
3. Migration of manual PSR, OPCLK configuration to Exynos CPU DAI driver as
fixup.
4. Migrated from dedicated sound card to simple audio card.
5. Support added for tlv320aic3x-i2c codec on FSD platform.

Changes in v1:
1. Add TDM support on samsung I2S interface.
2. Allow sound card to directly configure I2S prescaler divider instead of
calculating it from frame clock.
3. The sound card support for FSD SoC which utilizes samsung I2S interface
as CPU DAI.

Padmanabhan Rajanbabu (5):
  ASoC: dt-bindings: Add FSD I2S controller bindings
  ASoC: samsung: i2s: add support for FSD I2S
  arm64: dts: fsd: Add I2S DAI node for Tesla FSD
  arm64: dts: fsd: Add codec node for Tesla FSD
  arm64: dts: fsd: Add sound card node for Tesla FSD

 .../bindings/sound/samsung-i2s.yaml           |  8 +++
 arch/arm64/boot/dts/tesla/fsd-evb.dts         | 53 +++++++++++++++++++
 arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi    | 14 +++++
 arch/arm64/boot/dts/tesla/fsd.dtsi            | 34 ++++++++++++
 sound/soc/samsung/i2s-regs.h                  |  1 +
 sound/soc/samsung/i2s.c                       | 53 +++++++++++++++++++
 6 files changed, 163 insertions(+)

--
2.17.1

21 months agoASoC: dt-bindings: simple-card: Document simple-audio-card,plat
Faiz Abbas [Tue, 17 Jan 2023 06:18:08 +0000 (11:48 +0530)]
ASoC: dt-bindings: simple-card: Document simple-audio-card,plat

The simple card driver already has support for a simple-audio-card,plat
property but its not reflected in the documentation. Add documentation
for this plat property.

Signed-off-by: Faiz Abbas <faiz.abbas@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230117061808.18422-1-faiz.abbas@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: keep prepare/unprepare widgets in sink path
Bard Liao [Wed, 18 Jan 2023 10:12:55 +0000 (12:12 +0200)]
ASoC: SOF: keep prepare/unprepare widgets in sink path

The existing code return when a widget doesn't need to
prepare/unprepare. This will prevent widgets in the sink path from being
prepared/unprepared.

Cc: <stable@vger.kernel.org> # 6.1
Link: https://github.com/thesofproject/linux/issues/4021
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230118101255.29139-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL
Ranjani Sridharan [Wed, 18 Jan 2023 10:12:54 +0000 (12:12 +0200)]
ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL

Skip preparing/unpreparing widgets if the swidget pointer is NULL. This
will be true in the case of virtual widgets in topology that were added
for reusing the legacy HDA machine driver with SOF.

Fixes: 9862dcf70245 ("ASoC: SOF: don't unprepare widget used other pipelines")
Cc: <stable@vger.kernel.org> # 6.1
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230118101255.29139-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: sof-audio: unprepare when swidget->use_count > 0
Bard Liao [Wed, 18 Jan 2023 10:12:53 +0000 (12:12 +0200)]
ASoC: SOF: sof-audio: unprepare when swidget->use_count > 0

We should unprepare the widget if its use_count = 1.

Fixes: 9862dcf70245 ("ASoC: SOF: don't unprepare widget used other pipelines")
Cc: <stable@vger.kernel.org> # 6.1
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230118101255.29139-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: sof-audio: start with the right widget type
Bard Liao [Tue, 17 Jan 2023 12:35:34 +0000 (14:35 +0200)]
ASoC: SOF: sof-audio: start with the right widget type

If there is a connection between a playback stream and a capture stream,
all widgets that are connected to the playback stream and the capture
stream will be in the list.
So, we have to start with the exactly right widget type.
snd_soc_dapm_aif_out is for capture stream and a playback stream should
start with a snd_soc_dapm_aif_in widget.
Contrarily, snd_soc_dapm_dai_in is for playback stream, and a capture
stream should start with a snd_soc_dapm_dai_out widget.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230117123534.2075-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: compress: Set compress data offset
Daniel Baluta [Tue, 17 Jan 2023 12:25:33 +0000 (14:25 +0200)]
ASoC: SOF: compress: Set compress data offset

Because now snd_sof_set_stream_data_offset has compress
support we use it to set posn_offset for compress stream.

Reviewed-by: Paul Olaru <paul.olaru@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230117122533.201708-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Add support for compress API for stream data/offset
Daniel Baluta [Tue, 17 Jan 2023 12:25:32 +0000 (14:25 +0200)]
ASoC: SOF: Add support for compress API for stream data/offset

snd_sof_pcm_stream keeps information about both PCM (snd_pcm_substream)
and Compress (snd_compr_stream) streams.

When PCM substream pointer is NULL this means we are dealing with a
compress stream.

Reviewed-by: Paul Olaru <paul.olaru@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230117122533.201708-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Prepare set_stream_data_offset for compress API
Daniel Baluta [Tue, 17 Jan 2023 12:25:31 +0000 (14:25 +0200)]
ASoC: SOF: Prepare set_stream_data_offset for compress API

Make second parameter of set_stream_data_offset generic
in order to be used for both PCM and compress streams.

Current patch doesn't introduce any functional change,
just prepare the code for compress support.

Reviewed-by: Paul Olaru <paul.olaru@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230117122533.201708-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: SOF: Prepare ipc_msg_data to be used with compress API
Daniel Baluta [Tue, 17 Jan 2023 12:25:30 +0000 (14:25 +0200)]
ASoC: SOF: Prepare ipc_msg_data to be used with compress API

Make second parameter of ipc_msg_data generic
in order to be able to support compressed streams.

This patch doesn't hold any functional change.

With this case we can use ipc_msg_data, to retrieve information from
DSP for both PCM/Compress API.

Reviewed-by: Paul Olaru <paul.olaru@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230117122533.201708-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: samsung: i2s: add support for FSD I2S
Padmanabhan Rajanbabu [Mon, 16 Jan 2023 10:38:20 +0000 (16:08 +0530)]
ASoC: samsung: i2s: add support for FSD I2S

Add support for enabling I2S controller on FSD platform.

FSD I2S controller is based on Exynos7 I2S controller, supporting
2CH playback/capture in I2S mode and 7.1CH playback/capture in TDM
mode.

Signed-off-by: Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
Link: https://lore.kernel.org/r/20230116103823.90757-3-p.rajanbabu@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: dt-bindings: Add FSD I2S controller bindings
Padmanabhan Rajanbabu [Mon, 16 Jan 2023 10:38:19 +0000 (16:08 +0530)]
ASoC: dt-bindings: Add FSD I2S controller bindings

Add bindings for FSD CPU DAI driver which supports stereo channel
audio playback and capture on FSD platform.

Signed-off-by: Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230116103823.90757-2-p.rajanbabu@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: wsa881x: Use proper shutdown GPIO polarity
Krzysztof Kozlowski [Mon, 2 Jan 2023 11:41:48 +0000 (12:41 +0100)]
ASoC: codecs: wsa881x: Use proper shutdown GPIO polarity

The shutdown GPIO is active low (SD_N), but this depends on actual board
layout.  Linux drivers should only care about logical state, where high
(1) means shutdown and low (0) means do not shutdown.

Invert the GPIO to match logical value while preserving backwards DTB
compatibility.  It is not possible to detect whether ACTIVE_HIGH flag in
DTB is because it is an old DTB (using incorrect flag) or it is a new
DTB with a correct hardware pin polarity description.  Therefore the
solution prioritizes backwards compatibility while relying on relevant
DTS being upstreamed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: wsa881x: Simplify with dev_err_probe
Krzysztof Kozlowski [Mon, 2 Jan 2023 11:41:47 +0000 (12:41 +0100)]
ASoC: codecs: wsa881x: Simplify with dev_err_probe

Code can be a bit simpler with dev_err_probe().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: wsa881x: Simplify &pdev->dev in probe
Krzysztof Kozlowski [Mon, 2 Jan 2023 11:41:46 +0000 (12:41 +0100)]
ASoC: codecs: wsa881x: Simplify &pdev->dev in probe

The probe already stores pointer to &pdev->dev, so use it to make the
code a bit easier to read.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: codecs: wsa883x: Simplify &pdev->dev in probe
Krzysztof Kozlowski [Mon, 2 Jan 2023 11:41:45 +0000 (12:41 +0100)]
ASoC: codecs: wsa883x: Simplify &pdev->dev in probe

The probe already stores pointer to &pdev->dev, so use it to make the
code a bit easier to read.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: fsl_sai: Use dev_err_probe
Alexander Stein [Wed, 11 Jan 2023 16:11:44 +0000 (17:11 +0100)]
ASoC: fsl_sai: Use dev_err_probe

This helps figuring out why the device probe is deferred, e.g. missing
FSL_EDMA driver.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230111161144.3275546-1-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: fsl_sai: initialize is_dsp_mode flag
Shengjiu Wang [Mon, 16 Jan 2023 07:07:54 +0000 (15:07 +0800)]
ASoC: fsl_sai: initialize is_dsp_mode flag

Initialize is_dsp_mode flag in the beginning of function
fsl_sai_set_dai_fmt_tr().

When the DAIFMT is DAIFMT_DSP_B the first time, is_dsp_mode is
true, then the second time DAIFMT is DAIFMT_I2S, is_dsp_mode
still true, which is a wrong state. So need to initialize
is_dsp_mode flag every time.

Fixes: a3f7dcc9cc03 ("ASoC: fsl-sai: Add SND_SOC_DAIFMT_DSP_A/B support.")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Link: https://lore.kernel.org/r/1673852874-32200-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: dt-bindings: mediatek,mt8188-mt6359: add mt8188-mt6359 document
Trevor Wu [Mon, 16 Jan 2023 03:41:31 +0000 (11:41 +0800)]
ASoC: dt-bindings: mediatek,mt8188-mt6359: add mt8188-mt6359 document

Add document for mt8188 board with mt6359.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230116034131.23943-14-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8188: add machine driver with mt6359
Trevor Wu [Mon, 16 Jan 2023 03:41:30 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: add machine driver with mt6359

Add support for mt8188 board with mt6359.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20230116034131.23943-13-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: common: add soundcard driver common code
Trevor Wu [Mon, 16 Jan 2023 03:41:29 +0000 (11:41 +0800)]
ASoC: mediatek: common: add soundcard driver common code

Add common code to support of_node of codec parsing, so codec phandle
can be assigned by sound-dai in dts.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-12-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: dt-bindings: mediatek,mt8188-afe: add audio afe document
Trevor Wu [Mon, 16 Jan 2023 03:41:28 +0000 (11:41 +0800)]
ASoC: dt-bindings: mediatek,mt8188-afe: add audio afe document

Add mt8188 audio afe document.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230116034131.23943-11-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8188: add control for timing select
Trevor Wu [Mon, 16 Jan 2023 03:41:27 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: add control for timing select

Add mixer control for irq and memif timing selection.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-10-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8188: add platform driver
Trevor Wu [Mon, 16 Jan 2023 03:41:26 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: add platform driver

Add mt8188 platform driver.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20230116034131.23943-9-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8188: support audio clock control
Trevor Wu [Mon, 16 Jan 2023 03:41:25 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: support audio clock control

Add audio clock wrapper and audio tuner control.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-8-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8188: support pcmif in platform driver
Trevor Wu [Mon, 16 Jan 2023 03:41:24 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: support pcmif in platform driver

Add mt8188 pcmif dai driver support

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-7-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8188: support etdm in platform driver
Trevor Wu [Mon, 16 Jan 2023 03:41:23 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: support etdm in platform driver

Add mt8188 etdm dai driver support.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-6-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8188: support adda in platform driver
Trevor Wu [Mon, 16 Jan 2023 03:41:22 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: support adda in platform driver

Add mt8188 adda dai driver support.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-5-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8188: support audsys clock
Trevor Wu [Mon, 16 Jan 2023 03:41:21 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: support audsys clock

Add mt8188 audio cg clock control. Audio clock gates are registered to CCF
for reference count and clock parent management.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-4-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: mt8188: add common header
Trevor Wu [Mon, 16 Jan 2023 03:41:20 +0000 (11:41 +0800)]
ASoC: mediatek: mt8188: add common header

Add header files for register definition and structure.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: mediatek: common: add SMC ops and SMC CMD
Trevor Wu [Mon, 16 Jan 2023 03:41:19 +0000 (11:41 +0800)]
ASoC: mediatek: common: add SMC ops and SMC CMD

SMC call is required to communicate with ATF for some secure operations,
so we add SMC ops IDs and SMC CMD ID to common header.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230116034131.23943-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoFixes for avs driver
Mark Brown [Fri, 13 Jan 2023 15:25:27 +0000 (15:25 +0000)]
Fixes for avs driver

Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>:

First patch fixes problems reported when performing shutdown. Second one
is for a problem reported by LKP. Last one fixes problem reported by
checkpatch.

21 months agoASoC: Intel: avs: Use asoc_substream_to_rtd() to obtain rtd
Cezary Rojewski [Fri, 13 Jan 2023 19:14:09 +0000 (20:14 +0100)]
ASoC: Intel: avs: Use asoc_substream_to_rtd() to obtain rtd

Utilize the helper function instead of casting from ->private_data
or snd_pcm_substream_chip() directly.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230113191410.1454566-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: avs: Use min_t instead of min with cast
Amadeusz Sławiński [Fri, 13 Jan 2023 19:03:10 +0000 (20:03 +0100)]
ASoC: Intel: avs: Use min_t instead of min with cast

Checkpatch script recommends using min_t instead of min with the cast.

Fixes: 69b23b3937a1 ("ASoC: Intel: avs: Event tracing")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230113190310.1451693-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: avs: Correctly access topology fields
Amadeusz Sławiński [Fri, 13 Jan 2023 19:03:09 +0000 (20:03 +0100)]
ASoC: Intel: avs: Correctly access topology fields

Fixes following warning:
sound/soc/intel/avs/topology.c:1636:20: sparse: sparse: restricted __le32 degrades to integer

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230113190310.1451693-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: avs: Implement PCI shutdown
Amadeusz Sławiński [Fri, 13 Jan 2023 19:03:08 +0000 (20:03 +0100)]
ASoC: Intel: avs: Implement PCI shutdown

On shutdown reference to i915 driver needs to be released to not spam
logs with unnecessary warnings. While at it do some additional cleanup
to make sure DSP is powered down and interrupts from device are
disabled.

Fixes: 1affc44ea5dd ("ASoC: Intel: avs: PCI driver implementation")
Reported-by: Kornel Dulęba <korneld@google.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20230113190310.1451693-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: PXA: make SND_PXA2XX_SOC_AC97 user-selectable
Arnd Bergmann [Thu, 5 Jan 2023 13:46:09 +0000 (14:46 +0100)]
ASoC: PXA: make SND_PXA2XX_SOC_AC97 user-selectable

When building a PXA kernel without legacy board file support,
the AC97 code is not built, so none of the AC97 drivers
can be used.

Add a Kconfig prompt to let users turn it on, and have it
enabled by default.

Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230105134622.254560-15-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: sof_es8336: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:28:52 +0000 (13:28 +0200)]
ASoC: Intel: sof_es8336: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: a164137ce91a ("ASoC: Intel: add machine driver for SOF+ES8336")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230112112852.67714-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: bytcr_wm5102: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:28:51 +0000 (13:28 +0200)]
ASoC: Intel: bytcr_wm5102: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: 9a87fc1e0619 ("ASoC: Intel: bytcr_wm5102: Add machine driver for BYT/WM5102")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230112112852.67714-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: bytcr_rt5640: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:28:50 +0000 (13:28 +0200)]
ASoC: Intel: bytcr_rt5640: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: a232b96dcece ("ASoC: Intel: bytcr_rt5640: use HID translation util")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230112112852.67714-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: bytcr_rt5651: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:28:49 +0000 (13:28 +0200)]
ASoC: Intel: bytcr_rt5651: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: 02c0a3b3047f ("ASoC: Intel: bytcr_rt5651: add MCLK, quirks and cleanups")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230112112852.67714-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: Intel: bytcht_es8316: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:28:48 +0000 (13:28 +0200)]
ASoC: Intel: bytcht_es8316: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: 3c22a73fb873 ("ASoC: Intel: bytcht_es8316: fix HID handling")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230112112852.67714-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoAdd tdm support in acp machine driver
Mark Brown [Thu, 12 Jan 2023 15:01:13 +0000 (15:01 +0000)]
Add tdm support in acp machine driver

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

This patch set is to add new cpu dai, refactor dai format
implementation and clock enable/disable and add tdm support
in acp machine driver.

21 months agoASoC: amd: acp-es8336: Drop reference count of ACPI device after use
Andy Shevchenko [Thu, 12 Jan 2023 11:23:56 +0000 (13:23 +0200)]
ASoC: amd: acp-es8336: Drop reference count of ACPI device after use

Theoretically the device might gone if its reference count drops to 0.
This might be the case when we try to find the first physical node of
the ACPI device. We need to keep reference to it until we get a result
of the above mentioned call. Refactor the code to drop the reference
count at the correct place.

While at it, move to acpi_dev_put() as symmetrical call to the
acpi_dev_get_first_match_dev().

Fixes: 02527c3f2300 ("ASoC: amd: add Machine driver for Jadeite platform")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230112112356.67643-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: amd: acp: Enable i2s tdm support for skyrim platforms
Venkata Prasad Potturu [Mon, 9 Jan 2023 13:21:04 +0000 (18:51 +0530)]
ASoC: amd: acp: Enable i2s tdm support for skyrim platforms

Enable i2s tdm support for skyrim platform using dmi quirks.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230109132104.1259479-6-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: amd: acp: Add i2s tdm support in machine driver
Venkata Prasad Potturu [Mon, 9 Jan 2023 13:21:03 +0000 (18:51 +0530)]
ASoC: amd: acp: Add i2s tdm support in machine driver

Add i2s tdm support for amd platforms.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230109132104.1259479-5-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: amd: acp: Refactor i2s clocks programming sequence
Venkata Prasad Potturu [Mon, 9 Jan 2023 13:21:02 +0000 (18:51 +0530)]
ASoC: amd: acp: Refactor i2s clocks programming sequence

Refactor i2s clock values based on hw_params and use srate and
bclk_ratio variables in clock enable API instead hard-code values.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230109132104.1259479-4-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: amd: acp: Refactor dai format implementation
Venkata Prasad Potturu [Mon, 9 Jan 2023 13:21:01 +0000 (18:51 +0530)]
ASoC: amd: acp: Refactor dai format implementation

Refactor dai format implementation in dai_link specific
snd_soc_ops.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230109132104.1259479-3-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: amd: acp: Add new cpu dai's in machine driver
Venkata Prasad Potturu [Mon, 9 Jan 2023 13:21:00 +0000 (18:51 +0530)]
ASoC: amd: acp: Add new cpu dai's in machine driver

when using same cpu dai for 2 different dai links
below error is reported.
error: can't find BE for DAI ACPHS_VIRTUAL1.OUT

To avoid this error add new cpu dai.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230109132104.1259479-2-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: tlv320aic3x: Add optional clock and port properties
Jai Luthra [Fri, 30 Dec 2022 13:26:44 +0000 (18:56 +0530)]
ASoC: tlv320aic3x: Add optional clock and port properties

Describe optional properties for clocks and ports that were missing in
the original txt binding, to fix warnings like:

aic33@18: 'assigned-clock-parents', 'assigned-clock-rates',
'assigned-clocks' do not match any of the regexes:
'pinctrl-[0-9]+'
arch/arm/boot/dts/omap2420-n810.dtb

tlv320aic3106@1b: 'port' does not match any of the regexes:
'pinctrl-[0-9]+'
arch/arm/boot/dts/am335x-sl50.dtb

codec@18: 'clocks' does not match any of the regexes: 'pinctrl-[0-9]+'
arch/arm/boot/dts/imx6dl-gw5903.dtb
arch/arm/boot/dts/imx6q-gw5903.dtb

Some uses of "port" still lead to warnings because they pass clocks in
the endpoint, but that is discouraged:
https://lore.kernel.org/all/20210205152644.GA3083322@robh.at.kernel.org/

Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221230132644.6398-1-j-luthra@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
21 months agoASoC: amd: yc: Add DMI support for new acer/emdoor platforms
Syed Saba Kareem [Wed, 11 Jan 2023 10:21:23 +0000 (15:51 +0530)]
ASoC: amd: yc: Add DMI support for new acer/emdoor platforms

Adding DMI entries to support new acer/emdoor platforms.

Suggested-by: shanshengwang <shansheng.wang@amd.com>
Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/20230111102130.2276391-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoAdd support of MediaTek mt8188 to SOF
Mark Brown [Tue, 10 Jan 2023 16:42:44 +0000 (16:42 +0000)]
Add support of MediaTek mt8188 to SOF

Merge series from Tinghan Shen <tinghan.shen@mediatek.com>:

Add support of MediaTek mt8188 SoC DSP to SOF.
The sof driver patches in this series are taken from
thesofproject/linux/tree/topic/sof-dev-rebase.

22 months agoASoC: fsl-asoc-card: Log error code when we fail to register
Mark Brown [Fri, 6 Jan 2023 23:13:37 +0000 (23:13 +0000)]
ASoC: fsl-asoc-card: Log error code when we fail to register

The chances are that any error we see here will be EPROBE_DEFER but let's
actually tell the user so they know.

Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230106-asoc-fsl-err-log-v1-1-49d845c99434@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core
Tinghan Shen [Tue, 10 Jan 2023 08:43:12 +0000 (16:43 +0800)]
ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core

Set the generic iomem callback for debugfs_add_region_item to support
sof-logger.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Péter 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>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230110084312.12953-4-tinghan.shen@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: SOF: mediatek: Support mt8188 platform
Tinghan Shen [Tue, 10 Jan 2023 08:43:11 +0000 (16:43 +0800)]
ASoC: SOF: mediatek: Support mt8188 platform

Add support of SOF on MediaTek MT8188 SoC.
MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP.
The IPC communication between AP and DSP is based on shared DRAM and
mailbox interrupt.

The change in the mt8186.h is compatible on both mt8186 and
mt8188. The register controls booting the DSP core with the
default address or the user specified address. Both mt8186
and mt8188 should boot with the user specified boot in the driver.
The usage of the register is the same on both SoC, but the
control bit is different on mt8186 and mt8188, which is bit 1 on mt8186
and bit 0 on mt8188. Configure the redundant bit has noside effect
on both SoCs.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: Péter 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>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230110084312.12953-3-tinghan.shen@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agodt-bindings: dsp: mediatek: Add mt8188 dsp compatible
Tinghan Shen [Tue, 10 Jan 2023 08:43:10 +0000 (16:43 +0800)]
dt-bindings: dsp: mediatek: Add mt8188 dsp compatible

Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC
for pre- and post- audio processing.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230110084312.12953-2-tinghan.shen@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets
Mark Brown [Fri, 6 Jan 2023 23:15:07 +0000 (23:15 +0000)]
ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets

The fsl-asoc-card AC'97 support currently tries to route to Playback and
Capture widgets provided by the AC'97 CODEC. This doesn't work since the
generic AC'97 driver registers with an "AC97" at the front of the stream
and hence widget names, update to reflect reality. It's not clear to me
if or how this ever worked.

Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230106-asoc-udoo-probe-v1-2-a5d7469d4f67@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC
Mark Brown [Fri, 6 Jan 2023 23:15:06 +0000 (23:15 +0000)]
ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC

The SSI driver calls the AC'97 playback and transmit streams "AC97 Playback"
and "AC97 Capture" respectively. This is the same name used by the generic
AC'97 CODEC driver in ASoC, creating confusion for the Freescale ASoC card
when it attempts to use these widgets in routing. Add a "CPU" in the name
like the regular DAIs registered by the driver to disambiguate.

Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230106-asoc-udoo-probe-v1-1-a5d7469d4f67@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: dt-bindings: nau8822: add nuvoton,spk-btl property to dtschema
Emanuele Ghidoli [Wed, 4 Jan 2023 19:53:50 +0000 (20:53 +0100)]
ASoC: dt-bindings: nau8822: add nuvoton,spk-btl property to dtschema

Add nuvoton,spk-btl to configure the two loudspeaker outputs
as Bridge Tied Load

Cc: David Lin <CTLIN0@nuvoton.com>
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230104195350.149300-1-francesco@dolcini.it
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: nau8822: add speaker Bridge Tied Output
Mark Brown [Mon, 9 Jan 2023 16:29:02 +0000 (16:29 +0000)]
ASoC: nau8822: add speaker Bridge Tied Output

Merge series from Francesco Dolcini <francesco@dolcini.it>:

Add support for BTL (Bridge Tied Load) configuration to NAU8822 audio codec,
since this requires adding a new property to the binding convert it from
txt to yaml first.

22 months agoAdd support for XCVR on i.MX93 platform
Mark Brown [Mon, 9 Jan 2023 16:28:56 +0000 (16:28 +0000)]
Add support for XCVR on i.MX93 platform

Merge series from Chancel Liu <chancel.liu@nxp.com>:

This patchset supports XCVR on i.MX93 platform.

changes in v2:
- remove unnecessary code which causes kernel test robot reporting error

Chancel Liu (3):
  ASoC: dt-bindings: fsl,xcvr: Add compatible string for i.MX93 platform
  ASoC: fsl_xcvr: Add support for i.MX93 platform
  ASoC: fsl_xcvr: Add constraints of period size while using eDMA

 .../devicetree/bindings/sound/fsl,xcvr.yaml   |   1 +
 sound/soc/fsl/fsl_xcvr.c                      | 155 ++++++++++++------
 sound/soc/fsl/fsl_xcvr.h                      |   7 +
 3 files changed, 115 insertions(+), 48 deletions(-)

--
2.25.1

22 months agoASoC: dt-bindings: qcom,lpass-tx-macro: correct clocks on SC7280
Krzysztof Kozlowski [Sun, 25 Dec 2022 11:59:07 +0000 (12:59 +0100)]
ASoC: dt-bindings: qcom,lpass-tx-macro: correct clocks on SC7280

On SC7280 ADSP bypassed platform, there are only three clocks for TX
macro.  This is already reflected in "clock-names" but not in "clocks"
property:

  sc7280-herobrine-zombie-lte.dtb: codec@3220000: clocks: [[219, 8], [219, 7], [220]] is too short

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221225115907.55250-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: dt-bindings: qcom,lpass-wsa-macro: correct clocks on SM8250
Krzysztof Kozlowski [Sun, 25 Dec 2022 11:59:06 +0000 (12:59 +0100)]
ASoC: dt-bindings: qcom,lpass-wsa-macro: correct clocks on SM8250

SM8250 DTS uses additional "va" clock in WSA macro device node:

  sm8250-sony-xperia-edo-pdx203.dtb: codec@3240000: clock-names: ['mclk', 'npl', 'macro', 'dcodec', 'va', 'fsgen'] is too long

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221225115907.55250-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: nau8315: remove dependency on GPIOLIB
Ajye Huang [Sun, 8 Jan 2023 11:43:51 +0000 (19:43 +0800)]
ASoC: nau8315: remove dependency on GPIOLIB

commit dcc2c012c7691 ("ASoC: Fix gpiolib dependencies") removed a
series of unnecessary dependencies on GPIOLIB when the gpio was
optional.

A similar simplification seems valid for nau8315, so remove the
dependency as well. This will avoid the following warning

  WARNING: unmet direct dependencies detected for SND_SOC_NAU8315

   Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] &&
                   GPIOLIB [=n]
   Selected by [y]:

     - SND_SOC_INTEL_SOF_NAU8825_MACH [=y] && SOUND [=y] && !UML &&
       SND [=y] && SND_SOC [=y] && SND_SOC_INTEL_MACH [=y] &&
       (SND_SOC_SOF_HDA_LINK [=y] || SND_SOC_SOF_BAYTRAIL [=n]) &&
       I2C [=y] && ACPI [=y] && SND_HDA_CODEC_HDMI [=y] &&
       SND_SOC_SOF_HDA_AUDIO_CODEC [=y] && (MFD_INTEL_LPSS [=n] ||
       COMPILE_TEST [=y])

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Link: https://lore.kernel.org/r/20230108114351.539786-1-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: dt-bindings: simple-card: correct DAI subnodes pattern
Krzysztof Kozlowski [Mon, 9 Jan 2023 08:33:01 +0000 (09:33 +0100)]
ASoC: dt-bindings: simple-card: correct DAI subnodes pattern

The simple-audio-card,dai-link node does not allow address/size-cells
thus children (cpu, codec) should come without unit addresses.  For
cases with multiple nodes of same type, require a dash before index
(e.g. cpu-x) and add trailing $ to the pattern to disallow other
characters.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230109083301.76282-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: mediatek: mt8186-rt5682: primary_codec_init() warn: missing error code? 'ret'
Ajye Huang [Sat, 7 Jan 2023 17:59:33 +0000 (01:59 +0800)]
ASoC: mediatek: mt8186-rt5682: primary_codec_init() warn: missing error code? 'ret'

The function primary_codec_init() should return 0 if dmic_sel is null.

Here is the warning message reported by 0-DAY CI Kernel Test Service.

smatch warnings:
primary_codec_init() warn: missing error code? 'ret'
...
2022-11-02  141       if (!priv->dmic_sel) {
2022-11-02  142               dev_info(card->dev, "dmic_sel is null\n");
2022-11-02 @143               return ret;

return -EIVNAL;?  return 0;?

2022-11-02  144       }

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Link: https://lore.kernel.org/r/20230107175933.12973-1-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: amd: ps: Fix uninitialized ret in create_acp64_platform_devs()
Nathan Chancellor [Fri, 6 Jan 2023 00:43:39 +0000 (17:43 -0700)]
ASoC: amd: ps: Fix uninitialized ret in create_acp64_platform_devs()

Clang warns:

  sound/soc/amd/ps/pci-ps.c:218:2: error: variable 'ret' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
          default:
          ^~~~~~~
  sound/soc/amd/ps/pci-ps.c:239:9: note: uninitialized use occurs here
          return ret;
                 ^~~
  sound/soc/amd/ps/pci-ps.c:190:9: note: initialize the variable 'ret' to silence this warning
          int ret;
                 ^
                  = 0
  1 error generated.

ret is used uninitialized if 'goto de_init' is taken. As this is not an
error nor should the ACP be deinitialized, just directly return 0 in
this case statement, which resolves the warning.

Fixes: 1d325cdaf7a2 ("ASoC: amd: ps: refactor platform device creation logic")
Link: https://github.com/ClangBuiltLinux/linux/issues/1779
Suggested-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Syed Saba Kareem <syed.sabakareem@amd.com>
Link: https://lore.kernel.org/r/20230105-wsometimes-uninitialized-pci-ps-c-v2-1-c50321676325@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: dt-bindings: qcom,lpass-cpu: Correct and constrain clocks, interrupts, reg
Krzysztof Kozlowski [Tue, 27 Dec 2022 16:31:35 +0000 (17:31 +0100)]
ASoC: dt-bindings: qcom,lpass-cpu: Correct and constrain clocks, interrupts, reg

The binding allowed multiple variations and number of
reg/interrupts/clocks properties for SC7180 and SC7280.  Maybe this was
done for different use-cases of LPASS CPU audio node, but DTS is
supposed to be a complete picture of the hardware.  The upstreamed
SC7180 and SC7280 DTSes contain the widest set of these
reg/interrupts/clocks, sometimes being even sum of these different
variations.

Correct and narrow the reg, interrupts and clocks to match existing DTS:

  sc7280-herobrine-evoker-lte.dtb: audio@3987000: clock-names: 'oneOf' conditional failed, one must be fixed:
    ['aon_cc_audio_hm_h', 'audio_cc_ext_mclk0', 'core_cc_sysnoc_mport_core', 'core_cc_ext_if0_ibit', 'core_cc_ext_if1_ibit',
     'audio_cc_codec_mem', 'audio_cc_codec_mem0', 'audio_cc_codec_mem1', 'audio_cc_codec_mem2', 'aon_cc_va_mem0'] is too long
    'core_cc_sysnoc_mport_core' was expected
    'audio_cc_codec_mem' was expected
    'audio_cc_codec_mem0' was expected
    'audio_cc_codec_mem1' was expected
    'audio_cc_codec_mem2' was expected
    'aon_cc_va_mem0' was expected

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221227163135.102559-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: dt-bindings: qcom,lpass-cpu: Fix DAI children pattern
Krzysztof Kozlowski [Tue, 27 Dec 2022 16:31:34 +0000 (17:31 +0100)]
ASoC: dt-bindings: qcom,lpass-cpu: Fix DAI children pattern

DAI children (as subnodes) can come with two-digit unit addresses:

  sc7280-herobrine-crd.dtb: audio@3987000: Unevaluated properties are not allowed ('dai-link@19', 'dai-link@25' were unexpected)

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221227163135.102559-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: dt-bindings: qcom,lpass-cpu: Document required-opps
Krzysztof Kozlowski [Tue, 27 Dec 2022 16:31:33 +0000 (17:31 +0100)]
ASoC: dt-bindings: qcom,lpass-cpu: Document required-opps

SC7280 LPASS CPU device node comes with required-opps:

  sc7280-herobrine-crd.dtb: audio@3987000: Unevaluated properties are not allowed ('required-opps' was unexpected)

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221227163135.102559-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: fsl_xcvr: Add constraints of period size while using eDMA
Chancel Liu [Wed, 4 Jan 2023 02:39:53 +0000 (10:39 +0800)]
ASoC: fsl_xcvr: Add constraints of period size while using eDMA

eDMA on i.MX93 platform requires the period size to be multiple of
maxburst.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230104023953.2973362-4-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
22 months agoASoC: fsl_xcvr: Add support for i.MX93 platform
Chancel Liu [Wed, 4 Jan 2023 02:39:52 +0000 (10:39 +0800)]
ASoC: fsl_xcvr: Add support for i.MX93 platform

Add compatible string and specific soc data to support XCVR on i.MX93
platform. XCVR IP on i.MX93 is cut to SPDIF only by removing external
PHY.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230104023953.2973362-3-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>