platform/kernel/linux-starfive.git
3 years agoASoC: dt-bindings: mt8195: remove dependent headers in the example
Trevor Wu [Tue, 31 Aug 2021 08:39:56 +0000 (16:39 +0800)]
ASoC: dt-bindings: mt8195: remove dependent headers in the example

Drop the use of the defines including clock and power id, so that
we can remove the headers which are not applied in the example.

Fixes: b5bac34fcfb4 ("dt-bindings: mediatek: mt8195: add audio afe document")
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210831083956.9804-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: SND_SOC_MT8195 should depend on ARCH_MEDIATEK
Geert Uytterhoeven [Tue, 31 Aug 2021 13:18:54 +0000 (15:18 +0200)]
ASoC: mediatek: SND_SOC_MT8195 should depend on ARCH_MEDIATEK

The Mediatek MT8195 sound hardware is only present on Mediatek MT8195
SoCs.  Hence add a dependency on ARCH_MEDIATEK, to prevent asking the
user about this driver when configuring a kernel without Mediatek SoC
support.

Fixes: 6746cc858259985a ("ASoC: mediatek: mt8195: add platform driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/7e628e359bde04ceb9ddd74a45931059b4a4623c.1630415860.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: samsung: s3c24xx_simtec: fix spelling mistake "devicec" -> "device"
Colin Ian King [Fri, 27 Aug 2021 18:50:03 +0000 (19:50 +0100)]
ASoC: samsung: s3c24xx_simtec: fix spelling mistake "devicec" -> "device"

There is a spelling mistake in a dev_err error message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210827185003.507006-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: audio-graph: respawn Platform Support
Kuninori Morimoto [Mon, 30 Aug 2021 00:44:44 +0000 (09:44 +0900)]
ASoC: audio-graph: respawn Platform Support

commit 63f2f9cceb09f8 ("ASoC: audio-graph: remove Platform support")
removed Platform support from audio-graph, because it doesn't have
"plat" support on DT (simple-card has).
But, Platform support is needed if user is using
snd_dmaengine_pcm_register() which adds generic DMA as Platform.
And this Platform dev is using CPU dev.

Without this patch, at least STM32MP15 audio sound card is no more
functional (v5.13 or later). This patch respawn Platform Support on
audio-graph again.

Reported-by: Olivier MOYSAN <olivier.moysan@foss.st.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Olivier MOYSAN <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/878s0jzrpf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: add MTK_PMIC_WRAP dependency
Trevor Wu [Tue, 31 Aug 2021 02:13:03 +0000 (10:13 +0800)]
ASoC: mediatek: mt8195: add MTK_PMIC_WRAP dependency

randconfig builds show the warning below,

WARNING: unmet direct dependencies detected for SND_SOC_MT6359
   Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && MTK_PMIC_WRAP [=n]
   Selected by [y]:
   - SND_SOC_MT8195_MT6359_RT1019_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8195 [=y]

Add a dependency to avoid it.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Link: https://lore.kernel.org/r/20210831021303.5230-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Revert PCM trigger changes
Mark Brown [Mon, 30 Aug 2021 11:13:46 +0000 (12:13 +0100)]
ASoC: Revert PCM trigger changes

These have turned up some issues in further testing.

Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: wcd9335: Firx some resources leak in the probe and remove functio...
Mark Brown [Thu, 26 Aug 2021 18:15:14 +0000 (19:15 +0100)]
Merge series "ASoC: wcd9335: Firx some resources leak in the probe and remove function" from Christophe JAILLET <christophe.jaillet@wanadoo.fr>:

The first 2 patches are sraightforward and look logical to me.

However, the 3rd one in purely speculative. It is based on the fact that a
comment states that we enable some irqs on some slave ports. That said, it writes
0xFF in some registers.

So, I guess that we should disable these irqs when the driver is removed. That
said, writing 0x00 at the same place looks logical to me.

This cis untested and NOT based on any documentation. Just a blind fix.
Review with care.
You'll be warned :)

Christophe JAILLET (3):
  ASoC: wcd9335: Fix a double irq free in the remove function
  ASoC: wcd9335: Fix a memory leak in the error handling path of the
    probe function
  ASoC: wcd9335: Disable irq on slave ports in the remove function

 sound/soc/codecs/wcd9335.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

--
2.30.2

3 years agoASoC: soc-pcm: test refcount before triggering
Pierre-Louis Bossart [Tue, 17 Aug 2021 16:40:54 +0000 (11:40 -0500)]
ASoC: soc-pcm: test refcount before triggering

On start/pause_release/resume, when more than one FE is connected to
the same BE, it's possible that the trigger is sent more than
once. This is not desirable, we only want to trigger a BE once, which
is straightforward to implement with a refcount.

For stop/pause/suspend, the problem is more complicated: the check
implemented in snd_soc_dpcm_can_be_free_stop() may fail due to a
conceptual deadlock when we trigger the BE before the FE. In this
case, the FE states have not yet changed, so there are corner cases
where the TRIGGER_STOP is never sent - the dual case of start where
multiple triggers might be sent.

This patch suggests an unconditional trigger in all cases, without
checking the FE states, using a refcount protected by a spinlock.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20210817164054.250028-3-pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: protect BE dailink state changes in trigger
Pierre-Louis Bossart [Tue, 17 Aug 2021 16:40:53 +0000 (11:40 -0500)]
ASoC: soc-pcm: protect BE dailink state changes in trigger

When more than one FE is connected to a BE, e.g. in a mixing use case,
the BE can be triggered multiple times when the FE are opened/started
concurrently. This race condition is problematic in the case of
SoundWire BE dailinks, and this is not desirable in a general
case. The code carefully checks when the BE can be stopped or
hw_free'ed, but the trigger code does not use any mutual exclusion.

Fix by using the same spinlock already used to check FE states, and
set the state before the trigger. In case of errors,  the initial
state will be restored.

This patch does not change how the triggers are handled, it only makes
sure the states are handled in critical sections.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20210817164054.250028-2-pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wcd9335: Disable irq on slave ports in the remove function
Christophe JAILLET [Mon, 16 Aug 2021 05:25:28 +0000 (07:25 +0200)]
ASoC: wcd9335: Disable irq on slave ports in the remove function

The probe calls 'wcd9335_setup_irqs()' to enable interrupts on all slave
ports.
This must be undone in the remove function.

Add a 'wcd9335_teardown_irqs()' function that undoes 'wcd9335_setup_irqs()'
function, and call it from the remove function.

Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <8f761244d79bd4c098af8a482be9121d3a486d1b.1629091028.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wcd9335: Fix a memory leak in the error handling path of the probe function
Christophe JAILLET [Mon, 16 Aug 2021 05:25:20 +0000 (07:25 +0200)]
ASoC: wcd9335: Fix a memory leak in the error handling path of the probe function

If 'wcd9335_setup_irqs()' fails, me must release the memory allocated in
'wcd_clsh_ctrl_alloc()', as already done in the remove function.

Add an error handling path and the missing 'wcd_clsh_ctrl_free()' call.

Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <6dc12372f09fabb70bf05941dbe6a1382dc93e43.1629091028.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wcd9335: Fix a double irq free in the remove function
Christophe JAILLET [Mon, 16 Aug 2021 05:25:10 +0000 (07:25 +0200)]
ASoC: wcd9335: Fix a double irq free in the remove function

There is no point in calling 'free_irq()' explicitly for
'WCD9335_IRQ_SLIMBUS' in the remove function.

The irqs are requested in 'wcd9335_setup_irqs()' using a resource managed
function (i.e. 'devm_request_threaded_irq()').
'wcd9335_setup_irqs()' requests all what is defined in the 'wcd9335_irqs'
structure.
This structure has only one entry for 'WCD9335_IRQ_SLIMBUS'.

So 'devm_request...irq()' + explicit 'free_irq()' would lead to a double
free.

Remove the unneeded 'free_irq()' from the remove function.

Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <0614d63bc00edd7e81dd367504128f3d84f72efa.1629091028.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "Patches to update for rockchip i2s" from Sugar Zhang <sugar.zhang@rock...
Mark Brown [Thu, 26 Aug 2021 14:08:30 +0000 (15:08 +0100)]
Merge series "Patches to update for rockchip i2s" from Sugar Zhang <sugar.zhang@rock-chips.com>:

These patches fixup or update for rockchip i2s.

Changes in v3:
- Drop property 'rockchip,playback-only', 'rockchip,capture-only'.
  Implement it by 'dma-names' of DT instead.

Changes in v2:
- split property trcm into single 'trcm-sync-tx-only' and
  'trcm-sync-rx-only' suggested by Nicolas.
- split property trcm into single 'trcm-sync-tx-only' and
  'trcm-sync-rx-only' suggested by Nicolas.
- drop change-id

Sugar Zhang (12):
  ASoC: rockchip: i2s: Add support for set bclk ratio
  ASoC: rockchip: i2s: Fixup clk div error
  ASoC: rockchip: i2s: Improve dma data transfer efficiency
  ASoC: rockchip: i2s: Fix regmap_ops hang
  ASoC: rockchip: i2s: Fix concurrency between tx/rx
  ASoC: rockchip: i2s: Reset the controller if soft reset failed
  ASoC: dt-bindings: rockchip: Document reset property for i2s
  ASoC: rockchip: i2s: Make playback/capture optional
  ASoC: rockchip: i2s: Add compatible for more SoCs
  ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs
  ASoC: rockchip: i2s: Add support for frame inversion
  ASoC: dt-bindings: rockchip: i2s: Document property TRCM

Xiaotan Luo (1):
  ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B

Xing Zheng (1):
  ASoC: rockchip: i2s: Add support for TRCM property

 .../devicetree/bindings/sound/rockchip-i2s.yaml    |  19 ++
 sound/soc/rockchip/rockchip_i2s.c                  | 278 +++++++++++++++------
 sound/soc/rockchip/rockchip_i2s.h                  |  10 +-
 3 files changed, 224 insertions(+), 83 deletions(-)

--
2.7.4

3 years agoMerge series "Patches to update for rockchip spdif" from Sugar Zhang <sugar.zhang...
Mark Brown [Thu, 26 Aug 2021 14:08:28 +0000 (15:08 +0100)]
Merge series "Patches to update for rockchip spdif" from Sugar Zhang <sugar.zhang@rock-chips.com>:

These patches fixup or update for rockchip spdif.

Sugar Zhang (4):
  ASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile
  ASoC: rockchip: spdif: Fix some coding style
  ASoC: rockchip: spdif: Add support for rk3568 spdif
  ASoC: dt-bindings: rockchip: Add compatible for rk3568 spdif

 .../devicetree/bindings/sound/rockchip-spdif.yaml  |  1 +
 sound/soc/rockchip/rockchip_spdif.c                | 38 ++++++++++++----------
 2 files changed, 22 insertions(+), 17 deletions(-)

--
2.7.4

3 years agoASoC: rockchip: i2s: Add support for frame inversion
Sugar Zhang [Thu, 26 Aug 2021 04:03:12 +0000 (12:03 +0800)]
ASoC: rockchip: i2s: Add support for frame inversion

This patch adds support for frame inversion.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950594-14345-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: rockchip: Add compatible strings for more SoCs
Sugar Zhang [Thu, 26 Aug 2021 04:03:11 +0000 (12:03 +0800)]
ASoC: dt-bindings: rockchip: Add compatible strings for more SoCs

This patch adds compatible strings for more SoCs.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1629950594-14345-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: i2s: Add compatible for more SoCs
Sugar Zhang [Thu, 26 Aug 2021 04:02:38 +0000 (12:02 +0800)]
ASoC: rockchip: i2s: Add compatible for more SoCs

This patch adds more compatible strings for SoCs.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950562-14281-5-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: i2s: Make playback/capture optional
Sugar Zhang [Thu, 26 Aug 2021 04:02:37 +0000 (12:02 +0800)]
ASoC: rockchip: i2s: Make playback/capture optional

There are some controllers which support playback only or
capture only. so, make it optional. and initial capability
by 'dma-names' of DT.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950562-14281-4-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B
Xiaotan Luo [Thu, 26 Aug 2021 04:02:36 +0000 (12:02 +0800)]
ASoC: rockchip: i2s: Fixup config for DAIFMT_DSP_A/B

- DSP_A: PCM delay 1 bit mode, L data MSB after FRM LRC
- DSP_B: PCM no delay mode, L data MSB during FRM LRC

Signed-off-by: Xiaotan Luo <lxt@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950562-14281-3-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: rockchip: Document reset property for i2s
Sugar Zhang [Thu, 26 Aug 2021 04:02:35 +0000 (12:02 +0800)]
ASoC: dt-bindings: rockchip: Document reset property for i2s

This patch documents reset property for i2s.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1629950562-14281-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: i2s: Fix regmap_ops hang
Sugar Zhang [Thu, 26 Aug 2021 04:01:50 +0000 (12:01 +0800)]
ASoC: rockchip: i2s: Fix regmap_ops hang

API 'set_fmt' maybe called when PD is off, in the situation,
any register access will hang the system. so, enable PD
before r/w register.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-4-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: i2s: Improve dma data transfer efficiency
Sugar Zhang [Thu, 26 Aug 2021 04:01:49 +0000 (12:01 +0800)]
ASoC: rockchip: i2s: Improve dma data transfer efficiency

This patch changes dma data burst from 4 to 8 to improve
data transfer efficiency.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-3-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: i2s: Fixup clk div error
Sugar Zhang [Thu, 26 Aug 2021 04:01:48 +0000 (12:01 +0800)]
ASoC: rockchip: i2s: Fixup clk div error

MCLK maybe not precise as required because of PLL,
but which still can be used and no side effect. so,
using DIV_ROUND_CLOSEST instead div.

e.g.

set mclk to 11289600 Hz, but get 11289598 Hz.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: i2s: Add support for set bclk ratio
Sugar Zhang [Thu, 26 Aug 2021 04:01:47 +0000 (12:01 +0800)]
ASoC: rockchip: i2s: Add support for set bclk ratio

This patch adds support for set bclk ratio from machine driver.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629950520-14190-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: rockchip: Add compatible for rk3568 spdif
Sugar Zhang [Tue, 24 Aug 2021 10:16:02 +0000 (18:16 +0800)]
ASoC: dt-bindings: rockchip: Add compatible for rk3568 spdif

This patch adds compatible string for rk3568 spdif.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1629800162-12824-5-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: spdif: Add support for rk3568 spdif
Sugar Zhang [Tue, 24 Aug 2021 10:16:01 +0000 (18:16 +0800)]
ASoC: rockchip: spdif: Add support for rk3568 spdif

This patch adds support for rk3568 spdif which is the same
with rk3366.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629800162-12824-4-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: spdif: Fix some coding style
Sugar Zhang [Tue, 24 Aug 2021 10:16:00 +0000 (18:16 +0800)]
ASoC: rockchip: spdif: Fix some coding style

This patch fix some coding style.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629800162-12824-3-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile
Sugar Zhang [Tue, 24 Aug 2021 10:15:59 +0000 (18:15 +0800)]
ASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile

This patch marks SPDIF_SMPDR as volatile to make it resaonable,
which also requires marking it as readable, even though it isn't.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1629800162-12824-2-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: Fix spelling mistake "bitwiedh" -> "bitwidth"
Colin Ian King [Thu, 26 Aug 2021 11:26:11 +0000 (12:26 +0100)]
ASoC: mediatek: mt8195: Fix spelling mistake "bitwiedh" -> "bitwidth"

There is a spelling mistake in a dev_dbg message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210826112611.10356-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dwc: Get IRQ optionally
Robin Murphy [Wed, 25 Aug 2021 15:42:03 +0000 (16:42 +0100)]
ASoC: dwc: Get IRQ optionally

The IRQ is explicitly optional, so use platform_get_irq_optional() and
avoid platform_get_irq() logging a spurious error when trying to use the
thing in DMA mode.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/c857f334e3c9e651e088b675b3938cb5f798b133.1629906123.git.robin.murphy@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: imx-rpmsg: change dev_err to dev_err_probe for -EPROBE_DEFER
Shengjiu Wang [Wed, 25 Aug 2021 07:14:41 +0000 (15:14 +0800)]
ASoC: imx-rpmsg: change dev_err to dev_err_probe for -EPROBE_DEFER

Change dev_err to dev_err_probe for no need print error message
when defer probe happens.

Fixes: 39f8405c3e50 ("ASoC: imx-rpmsg: Add machine driver for audio base on rpmsg")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1629875681-16373-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5682: Fix the vol+ button detection issue
Derek Fang [Wed, 25 Aug 2021 04:03:46 +0000 (12:03 +0800)]
ASoC: rt5682: Fix the vol+ button detection issue

Fix the wrong button vol+ detection issue with some brand headsets
by fine tuning the threshold of button vol+ and SAR ADC button accuracy.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20210825040346.28346-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: bytcr_rt5640: Make rt5640_jack_gpio/rt5640_jack2_gpio static
Peter Ujfalusi [Wed, 25 Aug 2021 12:25:19 +0000 (15:25 +0300)]
ASoC: Intel: bytcr_rt5640: Make rt5640_jack_gpio/rt5640_jack2_gpio static

Marking the two jack gpio as static fixes the following Sparse errors:
sound/soc/intel/boards/bytcr_rt5640.c:468:26: error: symbol 'rt5640_jack_gpio' was not declared. Should it be static?
sound/soc/intel/boards/bytcr_rt5640.c:475:26: error: symbol 'rt5640_jack2_gpio' was not declared. Should it be static?

Fixes: 9ba00856686ad ("ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2 jack-detect")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210825122519.3364-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge branch 'for-5.14' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Wed, 25 Aug 2021 13:14:30 +0000 (14:14 +0100)]
Merge branch 'for-5.14' of https://git./linux/kernel/git/broonie/sound into asoc-5.15

3 years agoMerge series "ASoC: mediatek: Add support for MT8195 SoC" from Trevor Wu <trevor...
Mark Brown [Wed, 25 Aug 2021 09:50:21 +0000 (10:50 +0100)]
Merge series "ASoC: mediatek: Add support for MT8195 SoC" from Trevor Wu <trevor.wu@mediatek.com>:

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

Changes since v4:
  - removed sof related code

Changes since v3:
  - fixed warnings found by kernel test robot
  - removed unused critical section
  - corrected the lock protected sections on etdm driver
  - added DPTX and HDMITX audio support

Changes since v2:
  - added audio clock gate control
  - added 'mediatek' prefix to private dts properties
  - added consumed clocks to dt-bindins and adopted suggestions from Rob
  - refined clock usage and remove unused clock and control code
  - fixed typos

Changes since v1:
  - fixed some problems related to dt-bindings
  - added some missing properties to dt-bindings
  - added depency declaration on dt-bindings
  - fixed some warnings found by kernel test robot

Trevor Wu (11):
  ASoC: mediatek: mt8195: update mediatek common driver
  ASoC: mediatek: mt8195: support audsys clock control
  ASoC: mediatek: mt8195: support etdm in platform driver
  ASoC: mediatek: mt8195: support adda in platform driver
  ASoC: mediatek: mt8195: support pcm in platform driver
  ASoC: mediatek: mt8195: add platform driver
  dt-bindings: mediatek: mt8195: add audio afe document
  ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and
    rt5682
  ASoC: mediatek: mt8195: add DPTX audio support
  ASoC: mediatek: mt8195: add HDMITX audio support
  dt-bindings: mediatek: mt8195: add mt8195-mt6359-rt1019-rt5682
    document

 .../bindings/sound/mt8195-afe-pcm.yaml        |  184 +
 .../sound/mt8195-mt6359-rt1019-rt5682.yaml    |   47 +
 sound/soc/mediatek/Kconfig                    |   24 +
 sound/soc/mediatek/Makefile                   |    1 +
 sound/soc/mediatek/common/mtk-afe-fe-dai.c    |   22 +-
 sound/soc/mediatek/common/mtk-base-afe.h      |   10 +-
 sound/soc/mediatek/mt8195/Makefile            |   15 +
 sound/soc/mediatek/mt8195/mt8195-afe-clk.c    |  441 +++
 sound/soc/mediatek/mt8195/mt8195-afe-clk.h    |  109 +
 sound/soc/mediatek/mt8195/mt8195-afe-common.h |  158 +
 sound/soc/mediatek/mt8195/mt8195-afe-pcm.c    | 3281 +++++++++++++++++
 sound/soc/mediatek/mt8195/mt8195-audsys-clk.c |  214 ++
 sound/soc/mediatek/mt8195/mt8195-audsys-clk.h |   15 +
 .../soc/mediatek/mt8195/mt8195-audsys-clkid.h |   93 +
 sound/soc/mediatek/mt8195/mt8195-dai-adda.c   |  830 +++++
 sound/soc/mediatek/mt8195/mt8195-dai-etdm.c   | 2639 +++++++++++++
 sound/soc/mediatek/mt8195/mt8195-dai-pcm.c    |  389 ++
 .../mt8195/mt8195-mt6359-rt1019-rt5682.c      | 1087 ++++++
 sound/soc/mediatek/mt8195/mt8195-reg.h        | 2796 ++++++++++++++
 19 files changed, 12350 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/mt8195-afe-pcm.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/mt8195-mt6359-rt1019-rt5682.yaml
 create mode 100644 sound/soc/mediatek/mt8195/Makefile
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-clk.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-clk.h
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-common.h
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-audsys-clk.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-audsys-clk.h
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-audsys-clkid.h
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-dai-adda.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-dai-etdm.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-dai-pcm.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c
 create mode 100644 sound/soc/mediatek/mt8195/mt8195-reg.h

--
2.18.0

3 years agoASoC: SOF: intel: remove duplicate include
Changcheng Deng [Tue, 24 Aug 2021 03:00:15 +0000 (20:00 -0700)]
ASoC: SOF: intel: remove duplicate include

Clean up the following includecheck warning:

./sound/soc/sof/intel/pci-tng.c: shim.h is included more than once.

No functional change.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210824030015.57267-1-deng.changcheng@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agodt-bindings: mediatek: mt8195: add mt8195-mt6359-rt1019-rt5682 document
Trevor Wu [Thu, 19 Aug 2021 08:41:44 +0000 (16:41 +0800)]
dt-bindings: mediatek: mt8195: add mt8195-mt6359-rt1019-rt5682 document

This patch adds document for mt8195 board with mt6359, rt1019 and rt5682

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-12-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: add HDMITX audio support
Trevor Wu [Thu, 19 Aug 2021 08:41:43 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: add HDMITX audio support

This patch adds HDMITX audio support on mt8195-mt6359-rt1019-rt5682 board.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-11-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: add DPTX audio support
Trevor Wu [Thu, 19 Aug 2021 08:41:42 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: add DPTX audio support

This patch adds DPTX audio support on mt8195-mt6359-rt1019-rt5682 board.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-10-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682
Trevor Wu [Thu, 19 Aug 2021 08:41:41 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682

This patch adds support for mt8195 board with mt6359, rt1019 and rt5682.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20210819084144.18483-9-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agodt-bindings: mediatek: mt8195: add audio afe document
Trevor Wu [Thu, 19 Aug 2021 08:41:40 +0000 (16:41 +0800)]
dt-bindings: mediatek: mt8195: add audio afe document

This patch adds mt8195 audio afe document.

In order to support dynamic clock reparenting for ADDA and ETDM, PLL
and MUX clocks are requested even though they are not consumed by afe
directly.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-8-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: add platform driver
Trevor Wu [Thu, 19 Aug 2021 08:41:39 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: add platform driver

This patch adds mt8195 platform and affiliated driver.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20210819084144.18483-7-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: support pcm in platform driver
Trevor Wu [Thu, 19 Aug 2021 08:41:38 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: support pcm in platform driver

This patch adds mt8195 pcm dai driver.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-6-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: support adda in platform driver
Trevor Wu [Thu, 19 Aug 2021 08:41:37 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: support adda in platform driver

This patch adds mt8195 adda dai driver.

audio_h clock is used by ADSP bus and ADDA module.
When ADDA requires audio_h clock, it is switched to APLL1, otherwise
it is switched to Xtal_26m so that APLL1 can be turned off when audio
feature is not used.
ADSP bus only requires that the clock is on, so dynamic reparenting
is used for the purpose of lowering power consumption.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-5-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: support etdm in platform driver
Trevor Wu [Thu, 19 Aug 2021 08:41:36 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: support etdm in platform driver

This patch adds mt8195 tdm/i2s dai driver.

MCLK clock tree is as follows.
PLL -> MUX -> DIVIDER -> MCLK

For PLL source of MCLK, driver only supports APLL1 and APLL2 now.
APLL3 and APLL4 are used to track external clock source, so they are
only used when slave input is connected.

For example,
case 1: (HDMI RX connected)
DL memif (a1sys) -> etdm out2 (clk from apll1/apll2) -> codec
case 2: (HDMI RX disconnected)
HDMI RX -> a3sys -> UL memif (a3sys) -> DL memif (a3sys) -> .... ->
etdm out2 (clk from apll3) -> codec

We keep all modules in the pipeline working on the same clock domain.
MCLK is expected to output the clock generated from the same clock
source as the pipeline, so dynamic reparenting is required for MCLK
configuration.

As a result, clk_set_parent() is used to select PLL source,
and clk_set_rate() is used to configure divider to get MCLK output rate.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-4-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: support audsys clock control
Trevor Wu [Thu, 19 Aug 2021 08:41:35 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: support audsys clock control

This patch adds mt8195 audio cg control.
Audio clock gates are registered to CCF for reference count and
clock parent management.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8195: update mediatek common driver
Trevor Wu [Thu, 19 Aug 2021 08:41:34 +0000 (16:41 +0800)]
ASoC: mediatek: mt8195: update mediatek common driver

Update mediatek common driver to support MT8195

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20210819084144.18483-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm_adsp: Put debugfs_remove_recursive back in
Charles Keepax [Tue, 24 Aug 2021 10:15:52 +0000 (11:15 +0100)]
ASoC: wm_adsp: Put debugfs_remove_recursive back in

This patch reverts commit acbf58e53041 ("ASoC: wm_adsp: Let
soc_cleanup_component_debugfs remove debugfs"), and adds an
alternate solution to the issue. That patch removes the call to
debugfs_remove_recursive, which cleans up the DSPs debugfs. The
intention was to avoid an unbinding issue on an out of tree
driver/platform.

The issue with the patch is it means the driver no longer cleans up
its own debugfs, instead relying on ASoC to remove recurive on the
parent debugfs node. This is conceptually rather unclean, but also it
would prevent DSPs being added/removed independently of ASoC and soon
we are going to be upstreaming some non-audio parts with these DSPs,
which will require this.

Finally, it seems the issue on the platform is a result of the
wm_adsp2_cleanup_debugfs getting called twice. This is very likely a
problem on the platform side and will be resolved there. But in the mean
time make the code a little more robust to such issues, and again
conceptually a bit nicer, but clearing the debugfs_root variable in the
DSP structure when the debugfs is removed.

Fixes: acbf58e53041 ("ASoC: wm_adsp: Let soc_cleanup_component_debugfs remove debugfs"
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210824101552.1119-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: Intel: Skylake: Fix and support complex" from Cezary Rojewski...
Mark Brown [Mon, 23 Aug 2021 17:26:22 +0000 (18:26 +0100)]
Merge series "ASoC: Intel: Skylake: Fix and support complex" from Cezary Rojewski <cezary.rojewski@intel.com>:

Existing skylake-driver supports very basic scenarios with limited range
of modules and their control. Attached changes first fix code as several
advanced configurations are 'mentioned' throughout the files but are not
actually functional. Follow up are changes adding missing support for
said configurations.

Cezary Rojewski (5):
  ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373
  ASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs
  ASoC: Intel: Skylake: Fix module resource and format selection
  ASoC: Intel: Skylake: Fix module configuration for KPB and MIXER
  ASoC: Intel: Skylake: Select first entry for singular pipe config
    arrays

Gustaw Lewandowski (2):
  ASoC: Intel: Skylake: Fix passing loadable flag for module
  ASoC: Intel: Skylake: Simplify m_state for loadable modules

Kareem Shaik (1):
  ASoC: Intel: Skylake: Support multiple format configs

Pawel Harlozinski (1):
  ASoC: Intel: Skylake: Properly configure modules with generic
    extension

Piotr Maziarz (1):
  ASoC: Intel: Skylake: Select proper format for NHLT blob

Szymon Mielczarek (1):
  ASoC: Intel: Skylake: Support modules with generic extension

 include/uapi/sound/snd_sst_tokens.h          |   6 +-
 sound/soc/intel/boards/kbl_da7219_max98927.c |  55 +------
 sound/soc/intel/skylake/skl-messages.c       | 155 ++++++++++++-------
 sound/soc/intel/skylake/skl-pcm.c            |  25 ++-
 sound/soc/intel/skylake/skl-topology.c       | 155 +++++++++++--------
 sound/soc/intel/skylake/skl-topology.h       |  26 +++-
 6 files changed, 231 insertions(+), 191 deletions(-)

--
2.25.1

3 years agoASoC: rt1015: remove possible unused variable `bclk_ms'
Tzung-Bi Shih [Mon, 23 Aug 2021 15:33:23 +0000 (23:33 +0800)]
ASoC: rt1015: remove possible unused variable `bclk_ms'

bclk_ms is possible unused by using the given config (see [1]).

sound/soc/codecs/rt1015.c:724:2: warning: Value stored to 'bclk_ms' is
never read [clang-analyzer-deadcode.DeadStores]
           bclk_ms = frame_size > 32;
           ^         ~~~~~~~~~~~~~~~

In addition, bclk_ms is meaningless and confusing after applying commit
a5db2ca51367 ("ASoC: rt1015: remove unneeded variables in rt1015_priv").
The "> 32" in the expression looks like a typo but it was not.

Let's remove the confusing variable bclk_ms.

[1]: https://lkml.org/lkml/2021/8/23/305

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210823153323.1297723-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: bytcr_rt5640: Mark hp_elitepad_1000g2_jack?_check functions static
Hans de Goede [Mon, 23 Aug 2021 11:04:32 +0000 (13:04 +0200)]
ASoC: Intel: bytcr_rt5640: Mark hp_elitepad_1000g2_jack?_check functions static

The byt_rt5640_hp_elitepad_1000g2_jack?_check functions are only
used inside bytcr_rt5640.c, mark them as static.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210823110432.64860-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt1015p: correct indentation
Krzysztof Kozlowski [Thu, 19 Aug 2021 10:10:20 +0000 (12:10 +0200)]
ASoC: rt1015p: correct indentation

Use common enum instead of oneOf and correct indentation warning:
  realtek,rt1015p.yaml:18:7: [warning] wrong indentation: expected 4 but found 6 (indentation)

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Tzung-Bi Shih <tzungbi@google.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210819101020.26368-2-krzysztof.kozlowski@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ics43432: add compatible for CUI Devices
Angelo Dureghello [Sat, 21 Aug 2021 08:26:58 +0000 (10:26 +0200)]
ASoC: ics43432: add compatible for CUI Devices

Add compatible for CUI Devices CMM-4030D-261-I2S-TR.

Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Link: https://lore.kernel.org/r/20210821082658.4147595-3-angelo.dureghello@timesys.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agodt-bindings: add compatible vendor prefix for CUI Devices
Angelo Dureghello [Sat, 21 Aug 2021 08:26:57 +0000 (10:26 +0200)]
dt-bindings: add compatible vendor prefix for CUI Devices

Add vendor prefix for CUI Devices.

Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Link: https://lore.kernel.org/r/20210821082658.4147595-2-angelo.dureghello@timesys.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ics43432: add CMM-4030D-261 support
Angelo Dureghello [Sat, 21 Aug 2021 08:26:56 +0000 (10:26 +0200)]
ASoC: ics43432: add CMM-4030D-261 support

Despite minimal datasheet differences, the driver seems
perfectly compatible with CMM-4030D-261.

Tested CMM-4030D-261 to work with this changes:

/ {
        cmm4030d: cmm4030d {
                #sound-dai-cells = <0>;
                compatible = "cui,cmm-4030d-261";
        };

        sound_mic {
                compatible = "simple-audio-card";
                simple-audio-card,name = "i2s mem mic";
                simple-audio-card,format = "i2s";
                simple-audio-card,bitclock-master = <&sound_master>;
                simple-audio-card,frame-master = <&sound_master>;
                sound_master: simple-audio-card,cpu {
                        sound-dai = <&ssi2>;
                        system-clock-frequency = <2822400>;
                };
                simple-audio-card,codec {
                        sound-dai = <&cmm4030d>;
                };
        };
};

Audio has been captured and tested successfully by:

arecord -D "hw:1,0" -f S24_LE > test.wav
aplay test.wav

Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Link: https://lore.kernel.org/r/20210821082658.4147595-1-angelo.dureghello@timesys.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: Select first entry for singular pipe config arrays
Cezary Rojewski [Wed, 18 Aug 2021 07:57:42 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Select first entry for singular pipe config arrays

When pipe does not expose multiple configuration options, always select
the first entry without searching for matching one.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-12-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: Properly configure modules with generic extension
Pawel Harlozinski [Wed, 18 Aug 2021 07:57:41 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Properly configure modules with generic extension

Make use of struct skl_base_cfg_ext and its format setter to configure
modules which are described with said structure.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Pawel Harlozinski <pawel.harlozinski@linux.intel.com>
Signed-off-by: Szymon Mielczarek <szymonx.mielczarek@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: Support modules with generic extension
Szymon Mielczarek [Wed, 18 Aug 2021 07:57:40 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Support modules with generic extension

Some DSP modules require, besides the module base configuration, a
generic extension containing audio format for all module's pins that are
in use.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Szymon Mielczarek <szymonx.mielczarek@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: Support multiple format configs
Kareem Shaik [Wed, 18 Aug 2021 07:57:39 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Support multiple format configs

A module can have two kinds of set params, as per topology requirements.
For example, one pre-init and one post-init. But currently, there is
support for just one type, as the format_config.

This patch extends the format_configs to 4, so as to be able to support
pre-init, post-init and post-bind type of set params, for the same
module, simultaneously.

Signed-off-by: Kareem Shaik <kareem.m.shaik@intel.com>
Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: Simplify m_state for loadable modules
Gustaw Lewandowski [Wed, 18 Aug 2021 07:57:38 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Simplify m_state for loadable modules

States SKL_MODULE_LOADED and SKL_MODULE_UNLOADED are redundant with
'loadable' flag in struct skl_module. Additionally
skl_tplg_mixer_dapm_post_pmd_event() sets m_state always to
SKL_MODULE_UNINIT so next unload function isn't called for such modules.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: Fix passing loadable flag for module
Gustaw Lewandowski [Wed, 18 Aug 2021 07:57:37 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Fix passing loadable flag for module

skl_get_module_info() tries to set mconfig->module->loadable before
mconfig->module has been assigned thus flag was always set to false
and driver did not try to load module binaries.

Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: Fix module configuration for KPB and MIXER
Cezary Rojewski [Wed, 18 Aug 2021 07:57:36 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Fix module configuration for KPB and MIXER

KeyPhrasebuffer, Mixin and Mixout modules configuration is described by
firmware's basic module configuration structure. There are no extended
parameters required. Update functions taking part in building
INIT_INSTANCE IPC payload to reflect that.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: Fix module resource and format selection
Cezary Rojewski [Wed, 18 Aug 2021 07:57:35 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Fix module resource and format selection

Module configuration may differ between its instances depending on
resources required and input and output audio format. Available
parameters to select from are stored in module resource and interface
(format) lists. These come from topology, together with description of
each of pipe's modules.

Ignoring index value provided by topology and relying always on 0th
entry leads to unexpected module behavior due to under/overbudged
resources assigned or impropper format selection. Fix by taking entry at
index specified by topology.

Fixes: f6fa56e22559 ("ASoC: Intel: Skylake: Parse and update module config structure")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: Select proper format for NHLT blob
Piotr Maziarz [Wed, 18 Aug 2021 07:57:34 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Select proper format for NHLT blob

Use actual pipeline format, not PCM format for blob selection. Otherwise
selected blobs are not correct in pipelines with format conversion
e.g.: SRC module.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Signed-off-by: Lewandowski, Gustaw <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs
Cezary Rojewski [Wed, 18 Aug 2021 07:57:33 +0000 (09:57 +0200)]
ASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs

Advancing pointer initially fixed issue for some users but caused
regression for others. Leave data as it to make it easier for end users
to adjust their topology files if needed.

Fixes: a8cd7066f042 ("ASoC: Intel: Skylake: Strip T and L from TLV IPCs")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373
Cezary Rojewski [Wed, 18 Aug 2021 07:57:32 +0000 (09:57 +0200)]
ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373

Contrary to what is said in board's file, topology targeting
kbl_da7219_max98373 expects format 16b, not 24/32b. Partially revert
changes added in 'ASoC: Intel: Boards: Add Maxim98373 support' to bring
old behavior back, aligning with topology expectations.

Fixes: 716d53cc7837 ("ASoC: Intel: Boards: Add Maxim98373 support")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Link: https://lore.kernel.org/r/20210818075742.1515155-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: Intel/rt5640: Add support for HP Elite Pad 1000G2 jack-detect...
Mark Brown [Fri, 20 Aug 2021 14:32:26 +0000 (15:32 +0100)]
Merge series "ASoC: Intel/rt5640: Add support for HP Elite Pad 1000G2 jack-detect" from Hans de Goede <hdegoede@redhat.com>:

Changes in v2:
- Rebase on asoc/for-next
- New patch: "ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2"
  DAPM pin for the mic on the 2nd jack"
- Addressed Pierre-Louis' comments about calling
  acpi_dev_add_driver_gpios() twice

Original cover-letter:

The HP Elitepad 1000 G2 tablet has 2 headset jacks:

1. on the dock which uses the output of the codecs built-in HP-amp +
the standard IN2 input which is always used with the headset-jack.

2. on the tablet itself, this uses the line-out of the codec + an external
HP-amp, which gets enabled by the ALC5642 codec's GPIO1 pin; and IN1 for
the headset-mic.

The codec's GPIO1 is also its only IRQ output pin, so this means that
the codec's IRQ cannot be used on this tablet. Instead the jack-detect
is connected directly to GPIOs on the main SoC. The dock has a helper
chip which also detects if a headset-mic is present or not, so there
are 2 GPIOs for the jack-detect status of the dock. The tablet jack
uses a single GPIO which indicates if a jack is present or not.

Differentiating between between headphones vs a headset on the tablet jack
is done by using the usual mic-bias over-current-detection mechanism.

Regards,

Hans

Hans de Goede (6):
  ASoC: rt5640: Move rt5640_disable_jack_detect() up in the rt5640.c
    file
  ASoC: rt5640: Delay requesting IRQ until the machine-drv calls
    set_jack
  ASoC: rt5640: Add optional hp_det_gpio parameter to
    rt5640_detect_headset()
  ASoC: rt5640: Add rt5640_set_ovcd_params() helper
  ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for
    the mic on the 2nd jack
  ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2
    jack-detect

 sound/soc/codecs/rt5640.c             | 136 ++++++++++++----------
 sound/soc/codecs/rt5640.h             |   6 +
 sound/soc/intel/boards/bytcr_rt5640.c | 158 +++++++++++++++++++++++++-
 3 files changed, 234 insertions(+), 66 deletions(-)

--
2.31.1

3 years agoASoC: rsnd: adg: clearly handle clock error / NULL case
Kuninori Morimoto [Fri, 20 Aug 2021 04:08:26 +0000 (13:08 +0900)]
ASoC: rsnd: adg: clearly handle clock error / NULL case

This driver is assuming that all adg->clk[i] is not NULL.
Because of this prerequisites, for_each_rsnd_clk() is possible to work
for all clk without checking NULL. In other words, all adg->clk[i]
should not NULL.

Some SoC might doesn't have clk_a/b/c/i. devm_clk_get() returns error in
such case. This driver calls rsnd_adg_null_clk_get() and use null_clk
instead of NULL in such cases.

But devm_clk_get() might returns NULL even though such clocks exist, but
it doesn't mean error (user deliberately chose to disable the feature).
NULL clk itself is not error from clk point of view, but is error from
this driver point of view because it is not assuming such case.

But current code is using IS_ERR() which doesn't care NULL.
This driver uses IS_ERR_OR_NULL() instead of IS_ERR() for clk check.
And it uses ERR_CAST() to clarify null_clk error.

One concern here is that it unconditionally uses null_clk if clk_a/b/c/i
was error. It is correct if it doesn't exist, but is not correct if it
returns error even though it exist.
It needs to check "clock-names" from DT before calling devm_clk_get() to
handling such case. But let's assume it is overkill so far.

Link: https://lore.kernel.org/r/YMCmhfQUimHCSH/n@mwanda
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v940wyf9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: core: make some arrays static const, makes object smaller
Kuninori Morimoto [Fri, 20 Aug 2021 04:09:14 +0000 (13:09 +0900)]
ASoC: rsnd: core: make some arrays static const, makes object smaller

Don't populate arrays on the stack but instead them static const.
Makes the object code smaller by 48 bytes.

Before:
   text    data     bss     dec     hex filename
  20938     916     104   21958    55c6 ./sound/soc/sh/rcar/core.o

After:
   text    data     bss     dec     hex filename
  20890     916     104   21910    5596 ./sound/soc/sh/rcar/core.o

gcc version 11.1.0)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tujkwydx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2 jack-detect
Hans de Goede [Thu, 19 Aug 2021 19:05:43 +0000 (21:05 +0200)]
ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2 jack-detect

The HP Elitepad 1000 G2 tablet has 2 headset jacks:

1. on the dock which uses the output of the codecs built-in HP-amp +
the standard IN2 input which is always used with the headset-jack.

2. on the tablet itself, this uses the line-out of the codec + an external
HP-amp, which gets enabled by the ALC5642 codec's GPIO1 pin; and IN1 for
the headset-mic.

The codec's GPIO1 is also its only IRQ output pin, so this means that
the codec's IRQ cannot be used on this tablet. Instead the jack-detect
is connected directly to GPIOs on the main SoC. The dock has a helper
chip which also detects if a headset-mic is present or not, so there
are 2 GPIOs for the jack-detect status of the dock. The tablet jack
uses a single GPIO which indicates if a jack is present or not.

Differentiating between headphones vs a headset on the tablet jack
is done by using the usual mic-bias over-current-detection mechanism.

Add support for this unique setup, this support gets enabled on this
tablet through a new BYT_RT5640_JD_HP_ELITEP_1000G2 quirk.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213415
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-7-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for the mic on...
Hans de Goede [Thu, 19 Aug 2021 19:05:42 +0000 (21:05 +0200)]
ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for the mic on the 2nd jack

In order to be able to do jack-detection reporting for the
mic contact on the 2nd jack found on some devices, the
DAPM topology needs to have a separate DAPM pin/input for that
microphone, instead of re-using the "Internal Mic" pin which is
normally used together with the IN1P input of the codec.

Using the "Internal Mic" dapm-pin-switch for this in a snd_soc_jack_pin to
report hotplug events causes the "Internal Mic" pin to get deactivated
when unplugging a headset from the 2nd jack, thus turning off the actual
Internal Mic (typically a pair of digital mics on devices with 2 jacks).

Fixes: 79c1123bac3b ("ASoC: Intel: bytcr_rt5640: Add support for a second headset mic input")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-6-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5640: Add rt5640_set_ovcd_params() helper
Hans de Goede [Thu, 19 Aug 2021 19:05:41 +0000 (21:05 +0200)]
ASoC: rt5640: Add rt5640_set_ovcd_params() helper

Some devices don't use the builtin jack-detect but can still benefit
from the mic-bias-current over-current-detection to differentiate
between headphones vs a headset.

Move the ovcd init code from rt5640_enable_jack_detect() into a new
rt5640_set_ovcd_params() helper and export this helper as well
as a couple of related ovcd functions.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-5-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5640: Add optional hp_det_gpio parameter to rt5640_detect_headset()
Hans de Goede [Thu, 19 Aug 2021 19:05:40 +0000 (21:05 +0200)]
ASoC: rt5640: Add optional hp_det_gpio parameter to rt5640_detect_headset()

Some devices don't use the builtin jack-detect but can still benefit
from the mic-bias-current over-current-detection headphones vs
headset detection done by rt5640_detect_headset().

In this case the jack-inserted check done by rt5640_detect_headset()
needs to be done through a GPIO rather then by using the codec's
builtin jack-detect. Add an optional hp_det_gpio parameter and export
rt5640_detect_headset() for use on machines where jack-detect is
handled outside of the codec.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5640: Delay requesting IRQ until the machine-drv calls set_jack
Hans de Goede [Thu, 19 Aug 2021 19:05:39 +0000 (21:05 +0200)]
ASoC: rt5640: Delay requesting IRQ until the machine-drv calls set_jack

Delay requesting the IRQ until the machine-drv calls set_jack.

The main reason for this is that the codec's IRQ is unused on some boards,
in which case we really should not call request_irq at all.

On some boards there is an IRQ listed at index 0 for the codec, but
this is not connected to the codec, but rather is directly connected
to the jack's jack-detect pin. These special setups will be handled
by the machine-driver, but the machine driver can only request the IRQ
if it is not first requested by the codec driver. Moving the request_irq
to the set_jack callback (which will not get called in this case) avoids
the codec-driver clobbering the IRQ.

Moving the request_irq also removes the need to disable the IRQ immediately
after requesting it, avoiding a small race (this could also have been fixed
by using the new IRQF_NO_AUTOEN flag when requesting the IRQ).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5640: Move rt5640_disable_jack_detect() up in the rt5640.c file
Hans de Goede [Thu, 19 Aug 2021 19:05:38 +0000 (21:05 +0200)]
ASoC: rt5640: Move rt5640_disable_jack_detect() up in the rt5640.c file

Move rt5640_disable_jack_detect() to above rt5640_enable_jack_detect().
This is a preparation patch for reworking how the IRQ gets requested.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: uniphier: make arrays mul and div static const, makes object smaller
Colin Ian King [Wed, 18 Aug 2021 15:17:46 +0000 (16:17 +0100)]
ASoC: uniphier: make arrays mul and div static const, makes object smaller

Don't populate the arrays mul and div on the stack but instead make them
static const. Makes the object code smaller by 4 bytes.

Before:
   text    data     bss     dec     hex filename
  16226    4984      64   21274    531a ./sound/soc/uniphier/aio-cpu.o

After:
   text    data     bss     dec     hex filename
  16062    5144      64   21270    5316 ./sound/soc/uniphier/aio-cpu.o

(gcc version 10.2.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20210818151746.38520-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sh: rz-ssi: Improve error handling in rz_ssi_dma_request function
Biju Das [Wed, 18 Aug 2021 10:14:50 +0000 (11:14 +0100)]
ASoC: sh: rz-ssi: Improve error handling in rz_ssi_dma_request function

dma_request_chan() returns error pointer in case of failures, but
the rz_ssi_dma_request() checked for NULL pointer instead.

This patch fixes the issue by checking for ERR_PTR() instead of
NULL and sets the DMA pointers to NULL in error case so that ssi
can fallback to PIO mode.

Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20210818101450.15948-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl_rpmsg: Check -EPROBE_DEFER for getting clocks
Shengjiu Wang [Wed, 18 Aug 2021 06:03:34 +0000 (14:03 +0800)]
ASoC: fsl_rpmsg: Check -EPROBE_DEFER for getting clocks

The devm_clk_get() may return -EPROBE_DEFER, then clocks
will be assigned to NULL wrongly. As the clocks are
optional so we can use devm_clk_get_optional() instead of
devm_clk_get().

Fixes: b73d9e6225e8 ("ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1629266614-6942-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: tegra30: Fix use of of_device_get_match_data" from Aakash Hemadri...
Mark Brown [Tue, 17 Aug 2021 14:14:06 +0000 (15:14 +0100)]
Merge series "ASoC: tegra30: Fix use of of_device_get_match_data" from Aakash Hemadri <aakashhemadri123@gmail.com>:

Hi,
This patchset fixes my previous incorrect patches.

356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data")
80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data")

Aakash Hemadri (2):
  ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data
  ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data

 sound/soc/tegra/tegra30_ahub.c | 6 ++----
 sound/soc/tegra/tegra30_i2s.c  | 8 ++++----
 2 files changed, 6 insertions(+), 8 deletions(-)

--
2.32.0

3 years agoASoC: Intel: bytcr_rt5640: Use cfg-lineout:2 in the components string
Hans de Goede [Mon, 16 Aug 2021 11:47:22 +0000 (13:47 +0200)]
ASoC: Intel: bytcr_rt5640: Use cfg-lineout:2 in the components string

Use "cfg-lineout:2" in the components string on boards with a lineout
instead of "cfg-lineout:1", this better mirrors the speaker part of
the components string where we use "cfg-spk:1" for devices with a single
speaker and "cfg-spk:2" for stereo speakers.

The lineout is stereo by default, so using ":2" makes more sense, this
way we keep ":1" reserved in case we ever encounter a device with
a mono lineout.

We can make this change without breaking userspace because no kernel
has shipped with "cfg-lineout:1" in the component-string yet; and there
also are no userspace bits (UCM profiles) checking for this yet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210816114722.107363-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sh: rz-ssi: Fix wrong operator used issue
Biju Das [Mon, 16 Aug 2021 18:23:36 +0000 (19:23 +0100)]
ASoC: sh: rz-ssi: Fix wrong operator used issue

Fix wrong operator used issue reported by Coverity by replacing |
operator with & operator.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reported-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210816182336.29959-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data
Aakash Hemadri [Mon, 16 Aug 2021 21:14:52 +0000 (02:44 +0530)]
ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data

const struct of_device_id incorrectly assigned "match->data" using
    of_device_get_match_data()

Instead assign `const struct tegra30_i2s_soc_data *soc_data` with
const void *of_device_get_match_data(...)

Fixes: 356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data")

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
Link: https://lore.kernel.org/r/4805c7fcd35c8deada63d41cb34d40de80f85a13.1629148177.git.aakashhemadri123@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data
Aakash Hemadri [Mon, 16 Aug 2021 21:14:51 +0000 (02:44 +0530)]
ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data

const struct of_device_id incorrectly assigned "match->data" using
of_device_get_match_data()

Instead assign `const struct tegra30_ahub_soc_data *soc_data` with
const void *of_device_get_match_data(...)

Fixes: 80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data")

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
Link: https://lore.kernel.org/r/bb61c41f2ee0cf0d85fecdfea05f23a7205992e6.1629148177.git.aakashhemadri123@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sh: rz-ssi: Fix dereference of noderef expression warning
Biju Das [Mon, 16 Aug 2021 13:20:49 +0000 (14:20 +0100)]
ASoC: sh: rz-ssi: Fix dereference of noderef expression warning

Fix following sparse warning:
sound/soc/sh/rz-ssi.c:156:15: sparse: warning: dereference of
noderef expression

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20210816132049.28128-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: soc-xxx: cleanup cppcheck warning" from Kuninori Morimoto <kunino...
Mark Brown [Mon, 16 Aug 2021 14:20:05 +0000 (15:20 +0100)]
Merge series "ASoC: soc-xxx: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.

These are cppcheck warning cleanup patches for soc-xxx.

Kuninori Morimoto (9):
  ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_hw_params()
  ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_new()
  ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_copy_user()
  ASoC: soc-dai: cleanup cppcheck warning at snd_soc_dai_link_set_capabilities()
  ASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new()
  ASoC: soc-jack: cleanup cppcheck warning at snd_soc_jack_report()
  ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB
  ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get()
  ASoC: soc-ac97: cleanup cppcheck warning

 sound/soc/soc-ac97.c                  | 14 ++++++--------
 sound/soc/soc-component.c             |  4 ++--
 sound/soc/soc-dai.c                   | 18 ++++++++----------
 sound/soc/soc-generic-dmaengine-pcm.c |  9 +++------
 sound/soc/soc-jack.c                  | 15 +++++++--------
 5 files changed, 26 insertions(+), 34 deletions(-)

--
2.25.1

3 years agoASoC: tegra30: i2s: Use of_device_get_match_data
Aakash Hemadri [Sat, 14 Aug 2021 20:12:19 +0000 (01:42 +0530)]
ASoC: tegra30: i2s: Use of_device_get_match_data

Prefer `of_device_get_match_data` over `of_match_device`

Retrieve OF match data using `of_device_get_match_data`, this is cleaner
and better expresses intent.

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/f4e632e0023d90c43b2b927e752585142a9d9c26.1628971397.git.aakashhemadri123@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra30: ahub: Use of_device_get_match_data
Aakash Hemadri [Sat, 14 Aug 2021 20:12:18 +0000 (01:42 +0530)]
ASoC: tegra30: ahub: Use of_device_get_match_data

Prefer `of_device_get_match_data` over `of_match_device`

Retrieve OF match data using `of_device_get_match_data`, this is cleaner
and better expresses intent.

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/e568d621c9c05ee23732a6a6f9e3606a780b1707.1628971397.git.aakashhemadri123@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-ac97: cleanup cppcheck warning
Kuninori Morimoto [Mon, 16 Aug 2021 04:56:23 +0000 (13:56 +0900)]
ASoC: soc-ac97: cleanup cppcheck warning

This patch cleanups below cppcheck warning.

sound/soc/soc-ac97.c:41:15: style: struct member 'snd_ac97_gpio_priv::gpios_set' is never used. [unusedStructMember]
 unsigned int gpios_set;
              ^
sound/soc/soc-ac97.c:42:28: style: struct member 'snd_ac97_gpio_priv::component' is never used. [unusedStructMember]
 struct snd_soc_component *component;
                           ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1euyolk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get()
Kuninori Morimoto [Mon, 16 Aug 2021 04:56:19 +0000 (13:56 +0900)]
ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get()

This patch cleanups below cppcheck warning.

sound/soc/soc-component.c:1183:9: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int i, ret;
        ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sfzayolo.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB
Kuninori Morimoto [Mon, 16 Aug 2021 04:56:15 +0000 (13:56 +0900)]
ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB

This patch cleanups below cppcheck warning.

sound/soc/soc-jack.c:21:6: style: struct member 'jack_gpio_tbl::count' is never used. [unusedStructMember]
 int count;
     ^
sound/soc/soc-jack.c:23:28: style: struct member 'jack_gpio_tbl::gpios' is never used. [unusedStructMember]
 struct snd_soc_jack_gpio *gpios;
                           ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tujqyols.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-jack: cleanup cppcheck warning at snd_soc_jack_report()
Kuninori Morimoto [Mon, 16 Aug 2021 04:56:10 +0000 (13:56 +0900)]
ASoC: soc-jack: cleanup cppcheck warning at snd_soc_jack_report()

This patch cleanups below cppcheck warning.

sound/soc/soc-jack.c:45:6: style: The scope of the variable 'enable' can be reduced. [variableScope]
 int enable;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v946yolx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new()
Kuninori Morimoto [Mon, 16 Aug 2021 04:56:06 +0000 (13:56 +0900)]
ASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new()

This patch cleanups below cppcheck warning.

sound/soc/soc-dai.c:553:13: style: Variable 'ret' is assigned a value that is never used. [unreadVariable]
 int i, ret = 0;
            ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnomyom1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-dai: cleanup cppcheck warning at snd_soc_dai_link_set_capabilities()
Kuninori Morimoto [Mon, 16 Aug 2021 04:56:01 +0000 (13:56 +0900)]
ASoC: soc-dai: cleanup cppcheck warning at snd_soc_dai_link_set_capabilities()

This patch cleanups below cppcheck warning.

sound/soc/soc-dai.c:454:7: style: The scope of the variable 'supported_cpu' can be reduced. [variableScope]
 bool supported_cpu;
      ^
sound/soc/soc-dai.c:455:7: style: The scope of the variable 'supported_codec' can be reduced. [variableScope]
 bool supported_codec;
      ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y292yom6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_copy_user()
Kuninori Morimoto [Mon, 16 Aug 2021 04:55:56 +0000 (13:55 +0900)]
ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_copy_user()

This patch cleanups below cppcheck warning.

sound/soc/soc-generic-dmaengine-pcm.c:310:6: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int ret;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zgtiyomb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_new()
Kuninori Morimoto [Mon, 16 Aug 2021 04:55:51 +0000 (13:55 +0900)]
ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_new()

This patch cleanups below cppcheck warning.

sound/soc/soc-generic-dmaengine-pcm.c:233:28: style: The scope of the variable 'substream' can be reduced. [variableScope]
 struct snd_pcm_substream *substream;
                           ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871r6u0yzs.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_hw_params()
Kuninori Morimoto [Mon, 16 Aug 2021 04:55:44 +0000 (13:55 +0900)]
ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_hw_params()

This patch cleanups below cppcheck warning.

sound/soc/soc-generic-dmaengine-pcm.c:82:6: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int ret;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8735ra0yzz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: Intel: boards: use software node API" from Pierre-Louis Bossart...
Mark Brown [Fri, 13 Aug 2021 16:49:06 +0000 (17:49 +0100)]
Merge series "ASoC: Intel: boards: use software node API" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This is an update on an earlier contribution from Heikki Krogerus

The function device_add_properties() is going to be removed.
Replacing it with software node API equivalents.

Thanks for Hans de Goede and Andy Shevchenko for their comments,
suggestions and Reviewed-by tags on GitHub. The review thread can be
found at https://github.com/thesofproject/linux/pull/3041)

v3 changes:
Fixed nit-picks from Andy: label, return value, missing commas/periods.
Added Andy's Reviewed-by tag

v2 changes: feedback from Andy and Hans
Better error handling
Codec reference is kept until the .remove callback
Remove bus search to find device

v1 changes from Heikki's patches:
Avoid the use of devm_ routines for Baytrail machine drivers.

Heikki Krogerus (1):
  ASoC: Intel: boards: use software node API in Atom boards

Pierre-Louis Bossart (7):
  ASoC: Intel: boards: harden codec property handling
  ASoC: Intel: boards: handle errors with acpi_dev_get_first_match_dev()
  ASoC: Intel: boards: get codec device with ACPI instead of bus search
  ASoC: Intel: sof_sdw: pass card information to init/exit functions
  ASoC: Intel: sof_sdw_rt711*: keep codec device reference until remove
  ASoC: Intel: use software node API in SoundWire machines
  ASoC: Intel: remove device_properties for Atom boards

 sound/soc/intel/boards/bytcht_es8316.c      | 31 ++++++++--
 sound/soc/intel/boards/bytcr_rt5640.c       | 60 +++++++++++++++-----
 sound/soc/intel/boards/bytcr_rt5651.c       | 63 ++++++++++++++-------
 sound/soc/intel/boards/sof_sdw.c            | 20 ++++---
 sound/soc/intel/boards/sof_sdw_common.h     | 37 +++++++-----
 sound/soc/intel/boards/sof_sdw_max98373.c   |  3 +-
 sound/soc/intel/boards/sof_sdw_rt1308.c     |  3 +-
 sound/soc/intel/boards/sof_sdw_rt1316.c     |  3 +-
 sound/soc/intel/boards/sof_sdw_rt5682.c     |  3 +-
 sound/soc/intel/boards/sof_sdw_rt700.c      |  3 +-
 sound/soc/intel/boards/sof_sdw_rt711.c      | 51 +++++++++--------
 sound/soc/intel/boards/sof_sdw_rt711_sdca.c | 52 +++++++++--------
 sound/soc/intel/boards/sof_sdw_rt715.c      |  3 +-
 sound/soc/intel/boards/sof_sdw_rt715_sdca.c |  3 +-
 14 files changed, 223 insertions(+), 112 deletions(-)

--
2.25.1

3 years agoMerge series "Add RZ/G2L Sound support" from Biju Das <biju.das.jz@bp.renesas.com>:
Mark Brown [Fri, 13 Aug 2021 16:49:04 +0000 (17:49 +0100)]
Merge series "Add RZ/G2L Sound support" from Biju Das <biju.das.jz@bp.renesas.com>:

This patch series aims to add ASoC support on RZ/G2L SoC's.

It is based on the work done by Chris Brandt for RZ/A ASoC driver.

v4->v5
 * Moved validation of sample bits in hw_params
 * Removed validation of frame bits as it is redundant
 * split the rz_ssi_start_stop function into rz_ssi_start and rz_ssi_stop.
 * remove the spin_lock around rz_ssi_stream_init.
 * Updated dmas description and removed fixes as it is an enhancement
   now.
 * updated ssi_start functions with setting fifo thresholds
   and ssi_stop function with cancel all dma txn.
v3->v4:
 * Updated the subject line as per style for the subsystem.
 * Removed select SND_SIMPLE_CARD from Kconfig
 * Added C++ comments for copyright and driver description.
 * Moved validation of channels in hw_params
 * removed asm issue reported by bot as well as Mark
 * replaced master/slave macros with provider/consumer macros
 * Improved locking and added more null pointer checks.
v2->v3:
 * Fixed the dependency on KCONFIG
 * Merged the binding patch with dma feature added
 * Updated dt binding example with encoded #dma-cells value.
 * Improved Error handling in probe function
 * Removed the passing legacy channel configuration parameters from
   dmaengine_slave_config function
 * started using dma_request_chan instead of deprecated
   dma_request_slave_channel
 * Removed SoC dtsi and config patches from this series. Will send it later.
v1->v2:
 * Rebased to latest rc kernel

Biju Das (3):
  ASoC: sh: Add RZ/G2L SSIF-2 driver
  ASoC: dt-bindings: renesas,rz-ssi: Update slave dma channel
    configuration parameters
  ASoC: sh: rz-ssi: Add SSI DMAC support

 .../bindings/sound/renesas,rz-ssi.yaml        |   22 +-
 sound/soc/sh/Kconfig                          |    6 +
 sound/soc/sh/Makefile                         |    4 +
 sound/soc/sh/rz-ssi.c                         | 1063 +++++++++++++++++
 4 files changed, 1093 insertions(+), 2 deletions(-)
 create mode 100644 sound/soc/sh/rz-ssi.c

--
2.17.1

3 years agoMerge series "ASoC: SOF: Intel: DMI L1 power optimization for HDaudio platforms"...
Mark Brown [Fri, 13 Aug 2021 16:49:03 +0000 (17:49 +0100)]
Merge series "ASoC: SOF: Intel: DMI L1 power optimization for HDaudio platforms" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This patchset provides an optimization that result in significant power
savings on Intel HDAudio platforms using SOF (Sound Open Firmware).

We previously prevented the Intel DSP from enabling the DMI_L1
capability to work-around issues with pause on capture streams. It
turns out that this also prevented the platform from entering high C
states in full-duplex usages such as videoconferencing - a rather
basic use case since the start of the pandemic.

The support for pause_push/release was already a bit controversial for
Intel platforms, in theory platforms should only enable PAUSE if they
can resume on the same sample, which is not the case on any Intel
platform.

With this patchset, when the user enables DMI L1 via a kernel
parameter, the PAUSE support is disabled for capture streams. A kernel
parameter is far from ideal but it's a placeholder until we have an
API to negotiate capabilities between applications and driver, and
it's far less confusing than a Kconfig option.

Changes since v1:
Removal of SPIB support since it may conflict with Takashi's memalloc
changes. These SPIB changes will be provided after rebase.
Addition of one cleanup for cppcheck warning
Move all changes to intel/ directory, no changes in shared code
Flipped the logic: the selection of DMI L1 disables PAUSE

Pierre-Louis Bossart (4):
  ASoC: SOF: Intel: Kconfig: clarify DMI L1 option description
  ASoC: SOF: Intel: hda-stream: remove always true condition
  ASoC: SOF: Intel: simplify logic for DMI_L1 handling
  ASoC: SOF: Intel: make DMI L1 selection more robust

 sound/soc/sof/intel/Kconfig      | 10 ----------
 sound/soc/sof/intel/hda-pcm.c    | 16 ++++++++++++++--
 sound/soc/sof/intel/hda-stream.c | 11 +++++------
 3 files changed, 19 insertions(+), 18 deletions(-)

--
2.25.1

3 years agoASoC: Intel: boards: use software node API in Atom boards
Heikki Krogerus [Fri, 13 Aug 2021 15:11:16 +0000 (10:11 -0500)]
ASoC: Intel: boards: use software node API in Atom boards

The function device_add_properties() is going to be removed.
Replacing it with software node API equivalents.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20210813151116.23931-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>