Commit graph

38822 commits

Author SHA1 Message Date
David Ward
dfa7b01dbd
ASoC: rt286: Fix upper byte in DMIC2 configuration
This HDA verb sets the upper byte of the Configuration Default register, so
only an 8-bit value should be used. For the rt298, the same fix was applied
in commit f8f2dc4a71 ("ASoC: rt298: fix wrong setting of gpio2_en").

Signed-off-by: David Ward <david.ward@gatech.edu>
Link: https://lore.kernel.org/r/20210418134658.4333-2-david.ward@gatech.edu
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-19 16:51:00 +01:00
Takashi Iwai
fd9db1058c ALSA: usb-audio: Re-apply implicit feedback mode to Pioneer devices
Pioneer devices are supposed to be working with the implicit feedback
mode, but so far the attempt to apply the implicit feedback caused
issues, hence we explicitly skipped the implicit feedback mode for
them.  Recently, Geraldo discovered that the device actually works if
you skip the generic matching of the sync EPs for the capture stream.
That is, we should apply the implicit feedback setup for the playback
like other similar devices, while we need to return 1 from
audioformat_capture_quirk() so that no further matching will be done.

And, later on, Olivia reported later that the fiddling with the
capture quirk alone doesn't suffice for the test with speaker-test
program.  This seems to be a similar case like the recently fixed BOSS
devices.  Indeed, the problem could be addressed by setting
playback_first flag, which indicates that the playback URBs have to be
sent out at first even in the implicit feedback mode.

This patch implements the application of the implicit feedback to
Pioneer devices as described in the above.  The former
skip_pioneer_sync_ep() was dropped, and instead we provide
is_pioneer_implicit_fb() to check the Pioneer devices that need the
implicit feedback.  In the audioformat_implicit_fb_quirk(), simply
apply the implicit fb for playback and set chip->playback_first flag
if matching, and in audioformat_capture_quirk()(), it returns 1 for
skipping the generic EP sync handling.

Reported-by: Geraldo <geraldogabriel@gmail.com>
Tested-by: Olivia Mackintosh <livvy@base.nu>
Link: https://lore.kernel.org/r/s5ha6pygqfz.wl-tiwai@suse.de
Link: https://lore.kernel.org/r/20210419153918.450-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-19 17:39:46 +02:00
Mark Brown
87143bfdb9
Merge series "ASoC: remove more cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
I missed those warnings in the previous rounds, they are mostly
trivial and shouldn't change the behavior.

Pierre-Louis Bossart (5):
  ASoC: soc-acpi: remove useless initialization
  ASoC: soc-core: fix signed/unsigned issue
  ASoC: soc-core: fix always-false condition
  ASoC: codecs: lpass-rx-macro: remove useless return
  ASoC: codecs: rt5682: clarify expression

 sound/soc/codecs/lpass-rx-macro.c | 2 --
 sound/soc/codecs/rt5682.c         | 2 +-
 sound/soc/soc-acpi.c              | 2 +-
 sound/soc/soc-core.c              | 7 +------
 4 files changed, 3 insertions(+), 10 deletions(-)

--
2.25.1
2021-04-19 16:21:45 +01:00
Viorel Suman
e86a53fb64
ASoC: ak4458: check reset control status
check the return value of ak4458_rstn_control.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1618826072-29344-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-19 14:03:34 +01:00
Pierre-Louis Bossart
9726db36ed
ASoC: codecs: rt5682: clarify expression
cppcheck warning:

sound/soc/codecs/rt5682.c:2404:42: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
   (pll_code.m_bp << RT5682_PLL_M_BP_SFT | RT5682_PLL_RST));
                                         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210416191144.27006-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-19 14:03:32 +01:00
Pierre-Louis Bossart
36924a12c3
ASoC: codecs: lpass-rx-macro: remove useless return
cppcheck warning:

sound/soc/codecs/lpass-rx-macro.c:1626:9: warning: Identical condition
and return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
 return ret;
        ^
sound/soc/codecs/lpass-rx-macro.c:1623:6: note: If condition 'ret' is
true, the function will return/exit
 if (ret)
     ^
sound/soc/codecs/lpass-rx-macro.c:1626:9: note: Returning identical
expression 'ret'
 return ret;
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210416191144.27006-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-19 14:03:32 +01:00
Pierre-Louis Bossart
e2290daefe
ASoC: soc-core: fix always-false condition
cppcheck warning:

sound/soc/soc-core.c:2784:6: style: Condition '!num_routes' is always
false [knownConditionTrueFalse]
 if (!num_routes) {
     ^
sound/soc/soc-core.c:2777:17: note: Assuming that condition
'num_routes<0' is not redundant
 if (num_routes < 0 || num_routes & 1) {
                ^
sound/soc/soc-core.c:2783:2: note: Compound assignment '/=', assigned
value is 0
 num_routes /= 2;
 ^
sound/soc/soc-core.c:2784:6: note: Condition '!num_routes' is always
false
 if (!num_routes) {
     ^

The documentation for of_property_count_string reads

"
 * Returns the number of strings on
 * success, -EINVAL if the property does not exist, -ENODATA if property
 * does not have a value, and -EILSEQ if the string is not null-terminated
 * within the length of the property data.
"

Since the case for num_routes == 0 is not possible, let's remove this
test.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210416191144.27006-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-19 14:03:31 +01:00
Pierre-Louis Bossart
d3b47a888f
ASoC: soc-core: fix signed/unsigned issue
cppcheck warning:

sound/soc/soc-core.c:2237:13: warning: %x in format string (no. 1)
requires 'unsigned int *' but the argument type is 'signed
int *'. [invalidScanfArgType_int]
 } else if (sscanf(name, "%x-%x", &id1, &id2) == 2) {
            ^
sound/soc/soc-core.c:2237:13: warning: %x in format string (no. 2)
requires 'unsigned int *' but the argument type is 'signed
int *'. [invalidScanfArgType_int]
 } else if (sscanf(name, "%x-%x", &id1, &id2) == 2) {
            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210416191144.27006-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-19 14:03:30 +01:00
Pierre-Louis Bossart
59ce3233a5
ASoC: soc-acpi: remove useless initialization
cppcheck warning:

value that is never used. [unreadVariable]
 acpi_status status = AE_OK;
                    ^

sound/soc/soc-acpi.c:37:21: style: Variable 'status' is assigned a
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210416191144.27006-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-19 14:03:29 +01:00
Olivia Mackintosh
e7df7df5a3 ALSA: usb-audio: DJM-750: ensure format is set
Add case statement to set sample-rate for the DJM-750 Pioneer
mixer. This was included as part of another patch but I think it has
been archived on Patchwork and hasn't been merged.

Signed-off-by: Olivia Mackintosh <livvy@base.nu>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210418165901.25776-1-livvy@base.nu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-19 09:42:35 +02:00
Luke D Jones
76fae6185f ALSA: hda/realtek: GA503 use same quirks as GA401
The GA503 has almost exactly the same default setup as the GA401
model with the same issues. The GA401 quirks solve all the issues
so we will use the full quirk chain.

Signed-off-by: Luke D Jones <luke@ljones.dev>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210419030411.28304-1-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-19 09:36:19 +02:00
Lucas Endres
d86f43b17e ALSA: usb-audio: Add support for many Roland devices' implicit feedback quirks
It makes USB audio capture and playback possible and pristine on my Roland
INTEGRA-7, Boutique D-05, and R-26, along with many more I've encountered
people having had issues with over the last decade or so.

Signed-off-by: Lucas Endres <jaffa225man@gmail.com>
Link: https://lore.kernel.org/r/CAOsVg8rA61B=005_VyUwpw3piVwA7Bo5fs1GYEB054efyzGjLw@mail.gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-17 10:07:04 +02:00
Jack Yu
fa2f98378f
ASoC: rt715: remove kcontrols which no longer be used
Using new kcontrols "Capture Switch" and "Capture Volume" instead,
remove kcontrols which no longer be used.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/5c314f5512654aca9fff0195f77264de@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 17:20:01 +01:00
Jack Yu
dcca646c49
ASoC: rt715: add main capture switch and main capture volume
Add main capture switch and main capture volume control.
Main capture control has its own channel value respectivelly.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/dfd43a8db04e4d52a889d6f5c1262173@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 17:20:00 +01:00
Jack Yu
a48f928e13
ASoC: rt715: modification for code simplicity
Modification for code simplicity.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/340ee2df83ce47fcb1b59541b12ba7f4@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 17:19:59 +01:00
Mark Brown
7ae6af4131
Merge series "ASoC: Intel: add new TGL/ADL configurations" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Very little code but quite a few descriptors to add TigerLake (TGL)
/AlderLake (ADL) ACPI match tables for I2S and SoundWire devices, new
dailinks for Bluetooth offload. Some day this will be read from
platform firmware.

Also clarify how microphones are handled for SoundWire devices, and
create modules to avoid linking the same code multiple times.

Pierre-Louis Bossart (5):
  ASoC: Intel: soc-acpi: add ADL SoundWire base configurations
  ASoC: Intel: soc-acpi: add ADL jack-less SoundWire configurations
  ASoC: Intel: sof_sdw: add mutual exclusion between PCH DMIC and RT715
  ASoC: Intel: boards: handle hda-dsp-common as a module
  ASoC: Intel: boards: create sof-maxim-common module

Vamshi Krishna Gopal (3):
  ASoC: Intel: soc-acpi: add entries for i2s machines in ADL match table
  ASoC: Intel: sof_sdw: add quirk for new ADL-P Rvp
  ASoC: Intel: boards: add support for adl boards in sof-rt5682

Yong Zhi (1):
  ASoC: Intel: Boards: tgl_max98373: Add BT offload support

 sound/soc/intel/boards/Kconfig                |  18 ++
 sound/soc/intel/boards/Makefile               |  28 +-
 sound/soc/intel/boards/bxt_da7219_max98357a.c |   1 +
 sound/soc/intel/boards/bxt_rt298.c            |   1 +
 sound/soc/intel/boards/cml_rt1011_rt5682.c    |   1 +
 sound/soc/intel/boards/ehl_rt5660.c           |   1 +
 sound/soc/intel/boards/glk_rt5682_max98357a.c |   1 +
 sound/soc/intel/boards/hda_dsp_common.c       |   5 +
 sound/soc/intel/boards/skl_hda_dsp_generic.c  |   1 +
 sound/soc/intel/boards/sof_da7219_max98373.c  |   1 +
 sound/soc/intel/boards/sof_maxim_common.c     |  24 +-
 sound/soc/intel/boards/sof_maxim_common.h     |   6 +-
 sound/soc/intel/boards/sof_pcm512x.c          |   1 +
 sound/soc/intel/boards/sof_rt5682.c           |  67 ++++-
 sound/soc/intel/boards/sof_sdw.c              |  32 ++-
 sound/soc/intel/boards/sof_sdw_common.h       |   1 +
 sound/soc/intel/boards/sof_sdw_max98373.c     |   4 +-
 .../intel/common/soc-acpi-intel-adl-match.c   | 249 ++++++++++++++++++
 18 files changed, 415 insertions(+), 27 deletions(-)

--
2.25.1
2021-04-16 16:55:32 +01:00
Mark Brown
ac22cf5252
Merge series "ASoC: soc-pcm: ignore dummy-DAI at soc_pcm_params_symmetry()" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

I noticed if we have...

	1) Sound Card used DPCM
	2) It exchanges rate to 48kHz by using .be_hw_params_fixup()
	3) Codec had symmetric_rate = 1

We will get below error.
I didn't confirm, but maybe same things happen
if it exchanged channels/sample_bits.

	# aplay 44100.wav
	# aplay 44100.wav
=>	[kernel] be.ak4613-hifi: ASoC: unmatched rate symmetry: snd-soc-dummy-dai:44100 - soc_pcm_params_symmetry:48000
	[kernel] be.ak4613-hifi: ASoC: hw_params BE failed -22
	[kernel] fe.rsnd-dai.0: ASoC: hw_params BE failed -22
	aplay: set_params:1407: Unable to install hw params:
	ACCESS:  RW_INTERLEAVED
	FORMAT:  S16_LE
	SUBFORMAT:  STD
	SAMPLE_BITS: 16
	FRAME_BITS: 32
	CHANNELS: 2
	RATE: 44100
	PERIOD_TIME: (23219 23220)
	PERIOD_SIZE: 1024
	PERIOD_BYTES: 4096
	PERIODS: 4
	BUFFER_TIME: (92879 92880)
	BUFFER_SIZE: 4096
	BUFFER_BYTES: 16384
	TICK_TIME: 0

This patch-set solves this issue.
patch 1) - 3) are just cleanup patches.
4) is fot this issue.

Link: https://lore.kernel.org/r/87a6q0z4xt.wl-kuninori.morimoto.gx@renesas.com

Kuninori Morimoto (4):
  ASoC: soc-pcm: don't use "name" on __soc_pcm_params_symmetry() macro
  ASoC: soc-pcm: indicate DAI name if soc_pcm_params_symmetry() failed
  ASoC: soc-utils: add snd_soc_component_is_dummy()
  ASoC: soc-pcm: ignore dummy-DAI at soc_pcm_params_symmetry()

 include/sound/soc-component.h |  1 +
 sound/soc/soc-core.c          |  2 +-
 sound/soc/soc-pcm.c           | 14 ++++++++------
 sound/soc/soc-utils.c         |  6 ++++++
 4 files changed, 16 insertions(+), 7 deletions(-)

--
2.25.1
2021-04-16 16:55:31 +01:00
Thierry Reding
343e55e718
ASoC: simple-card-utils: Increase maximum number of links to 128
On Tegra186 and later, the number of links can go up to 72, so bump the
maximum number of links to the next power of two (128).

Fixes: f2138aed23 ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210416071147.2149109-2-thierry.reding@gmail.com
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 16:54:48 +01:00
Thierry Reding
0f687d8267
ASoC: simple-card-utils: Propagate errors on too many links
The DAI counting code doesn't propagate errors when the number of
maximum links is exceeded, which causes subsequent initialization code
to continue to run and that eventually leads to memory corruption with
the code trying to access memory that is out of bounds.

Fix this by propagating errors when the maximum number of links is
reached, which ensures that the driver fails to load and prevents the
memory corruption.

Fixes: f2138aed23 ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210416071147.2149109-1-thierry.reding@gmail.com
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 16:54:08 +01:00
Kai Vehmanen
0c37e2eb6b ALSA: hda/hdmi: fix race in handling acomp ELD notification at resume
When snd-hda-codec-hdmi is used with ASoC HDA controller like SOF (acomp
used for ELD notifications), display connection change done during suspend,
can be lost due to following sequence of events:

  1. system in S3 suspend
  2. DP/HDMI receiver connected
  3. system resumed
  4. HDA controller resumed, but card->deferred_resume_work not complete
  5. acomp eld_notify callback
  6. eld_notify ignored as power state is not CTL_POWER_D0
  7. HDA resume deferred work completed, power state set to CTL_POWER_D0

This results in losing the notification, and the jack state reported to
user-space is not correct.

The check on step 6 was added in commit 8ae743e82f ("ALSA: hda - Skip
ELD notification during system suspend"). It would seem with the deferred
resume logic in ASoC core, this check is not safe.

Fix the issue by modifying the check to use "dev.power.power_state.event"
instead of ALSA specific card power state variable.

BugLink: https://github.com/thesofproject/linux/issues/2825
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210416131157.1881366-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-16 16:01:21 +02:00
Kuninori Morimoto
9c2ae363f3
ASoC: soc-pcm: ignore dummy-DAI at soc_pcm_params_symmetry()
soc_pcm_params_symmetry() checks CPU / Codec symmetry.
Unfortunately there was bug on it (= A) which didn't check Codec.
But is back by (B).

	A: v5.7:  commit c840f7698d ("ASoC: soc-pcm: Merge for_each_rtd_cpu/codec_dais()")
	B: v5.12: commit 3a90672111 ("ASoC: soc-pcm: cleanup soc_pcm_params_symmetry()")

In total,
old - v5.6 (= Generation-1):

	symmetric_rate		: DAI_Link / CPU / Codec
	symmetric_channels	: DAI_Link / CPU / Codec
	symmetric_sample_bits	: DAI_Link / CPU / Codec

v5.7 - v5.11 (= Generation-2): (= because of bug by (A))

	symmetric_rate		: DAI_Link / CPU
	symmetric_channels	: DAI_Link / CPU / Codec
	symmetric_sample_bits	: DAI_Link / CPU / Codec

v5.12 - (= Generation-3): (= back by (B))

	symmetric_rate		: DAI_Link / CPU / Codec
	symmetric_channels	: DAI_Link / CPU / Codec
	symmetric_sample_bits	: DAI_Link / CPU / Codec

OTOH, we can use DPCM which is configured by FE / BE.
Both FE / BE uses dummy-DAI.

	FE: CPU       <-> dummy-DAI
	BE: dummy-DAI <-> Codec

One note is that we can use .be_hw_params_fixup in DPCM case.
This means BE settings might be fixuped/updated by FE.
This feature is used for example on MIXer case.
It can be happen not only for rate, but for channels/sample_bits too.

Because of these reasons, below issue happen on
Generation-1 / Generation-3, if...

	1) Sound Card used DPCM
	2) It exchanges rate to 48kHz by using .be_hw_params_fixup()
	3) Codec had symmetric_rate = 1

I didn't confirm, but maybe same things happen
if it exchanged channels/sample_bits at Generation-1/2/3 too.

	# aplay 44100.wav
	# aplay 44100.wav
=>	[kernel] be.ak4613-hifi: ASoC: unmatched rate symmetry: snd-soc-dummy-dai:44100 - soc_pcm_params_symmetry:48000
	[kernel] be.ak4613-hifi: ASoC: hw_params BE failed -22
	[kernel] fe.rsnd-dai.0: ASoC: hw_params BE failed -22
	aplay: set_params:1407: Unable to install hw params:
	ACCESS:  RW_INTERLEAVED
	FORMAT:  S16_LE
	SUBFORMAT:  STD
	SAMPLE_BITS: 16
	FRAME_BITS: 32
	CHANNELS: 2
	RATE: 44100
	PERIOD_TIME: (23219 23220)
	PERIOD_SIZE: 1024
	PERIOD_BYTES: 4096
	PERIODS: 4
	BUFFER_TIME: (92879 92880)
	BUFFER_SIZE: 4096
	BUFFER_BYTES: 16384
	TICK_TIME: 0

soc_pcm_params_symmetry() checks by below

	if (symmetry)
		for_each_rtd_cpu_dais(rtd, i, cpu_dai)
			if (cpu_dai->xxx && cpu_dai->xxx != d.xxx) {
				dev_err(rtd->dev, "...");
				return -EINVAL;
			}

Because of above reason 3) (= Codec had symmetric_rate = 1)
BE can't ignore "if (symmetric)".

At 1st aplay, soc_pcm_params_symmetry() ignores it,
because dummy-DAI->rate is 0.
After this check, each DAI sets/keep settings.

In above sample case, BE gets 48000 and FE gets 44100,
and it happen BE -> FE order.
Because DPCM is sharing *same* dummy-DAI,
dummy-DAI sets as 48000 by BE, and is overwrote by 44100 by FE.

This settings never be cleaned (= a) after 1st aplay,
because dummy-DAI is used from FE/BE, never be last user (b).

	static int soc_pcm_hw_clean(...)
	{
		...
		for_each_rtd_dais(rtd, i, dai) {
			...
(b)			if (snd_soc_dai_active(dai) == 1)
(a)				soc_pcm_set_dai_params(dai, NULL);
			...
		}
		...
	}

At 2nd aplay, BE gets 48000 but dummy-DAI is keeping 44100,
soc_pcm_params_symmetry() checks will fail.

To solve this issue, this patch ignores dummy-DAI
at soc_pcm_params_symmetry()

Link: https://lore.kernel.org/r/87a6q0z4xt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2djxa2n.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 14:34:13 +01:00
Kuninori Morimoto
8f1a16818a
ASoC: soc-utils: add snd_soc_component_is_dummy()
There is snd_soc_dai_is_dummy(), but not for component.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zgxzxa2t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 14:34:12 +01:00
Kuninori Morimoto
ee39d77ed9
ASoC: soc-pcm: indicate DAI name if soc_pcm_params_symmetry() failed
It indicates unmatched symmetry value, but not indicates on which DAI.
This patch indicates it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871rbbyono.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 14:34:11 +01:00
Kuninori Morimoto
1cacbac447
ASoC: soc-pcm: don't use "name" on __soc_pcm_params_symmetry() macro
__soc_pcm_params_symmetry() macro is using "name" as parameter
which will be exchanged to rate/channles/sample_bit, like below

	dai->name => dai->rate
	dai->name => dai->channels
	dai->name => dai->sample_bit

But, dai itself has "name". This means

	1) It is very confusable naming
	2) It can't use dai->name

This patch use "xxx" instead of "name"

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8735vryoob.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 14:34:10 +01:00
Daniel Baluta
d971400339
ASoC: core: Don't set platform name when of_node is set
A DAI link has 3 components:
	* CPU
	* platform
	* codec(s)

A component is specified via:
	* name
	* of_node
	* dai_name

In order to avoid confusion when building a sound card we disallow
matching by both name and of_node (1).

soc_check_tplg_fes allows overriding certain BE links by overriding
BE link name. This doesn't work well if BE link was specified via DT,
because we end up with a link with both name and of_node specified
which is conflicting with (1).

In order to fix this we need to:
	* override of_node if component was specified via DT
	* override name, otherwise.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20210414101212.65573-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 13:43:21 +01:00
Vamshi Krishna Gopal
d25bbe8048
ASoC: Intel: sof_sdw: add quirk for new ADL-P Rvp
Add quirks for jack detection, rt711 DAI and DMIC

Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210415175013.192862-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 13:43:19 +01:00
Pierre-Louis Bossart
870dc42fe8
ASoC: Intel: soc-acpi: add ADL jack-less SoundWire configurations
Add one configuration with no RT711.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Link: https://lore.kernel.org/r/20210415175013.192862-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 13:43:18 +01:00
Pierre-Louis Bossart
093b9dcb59
ASoC: Intel: soc-acpi: add ADL SoundWire base configurations
Add configurations ported over from TGL.

The topology names need to include link information given all the
hardware permutations.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Link: https://lore.kernel.org/r/20210415175013.192862-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-16 13:43:17 +01:00
Jonas Witschel
75b62ab65d ALSA: hda/realtek: fix mute/micmute LEDs for HP ProBook 445 G7
The HP ProBook 445 G7 (17T32ES) uses ALC236. Like ALC236_FIXUP_HP_GPIO_LED,
COEF index 0x34 bit 5 is used to control the playback mute LED, but the
microphone mute LED is controlled using pin VREF instead of a COEF index.

AlsaInfo: https://alsa-project.org/db/?f=0d3f4d1af39cc359f9fea9b550727ee87e5cf45a
Signed-off-by: Jonas Witschel <diabonas@archlinux.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210416105852.52588-1-diabonas@archlinux.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-16 14:13:19 +02:00
Takashi Iwai
26928ca1f0 ALSA: hda/realtek: Add quirk for Lenovo Ideapad S740
Lenovo Ideapad S740 requires quite a few COEF setups to make its
speakers working.  The verb table was provided from Ryan Prescott as
the result of investigation via qemu:
  https://github.com/ryanprescott/realtek-verb-tools/wiki/How-to-sniff-verbs-from-a-Windows-sound-driver

BugLink: https://github.com/thesofproject/linux/issues/2748
Tested-by: Ryan Prescott <ryan@cousinscomputers.net>
Link: https://lore.kernel.org/r/20210416081211.20059-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-16 10:12:50 +02:00
Phil Calvin
d1ee66c5d3 ALSA: hda/realtek: fix mic boost on Intel NUC 8
Fix two bugs with the Intel HDA Realtek ALC233 sound codec
present in Intel NUC NUC8i7BEH and probably a few other similar
NUC models.

These codecs advertise a 4-level microphone input boost amplifier on
pin 0x19, but the highest two boost settings do not work correctly,
and produce only low analog noise that does not seem to contain any
discernible signal. There is an existing fixup for this exact problem
but for a different PCI subsystem ID, so we re-use that logic.

Changing the boost level also triggers a DC spike in the input signal
that bleeds off over about a second and overwhelms any input during
that time. Thankfully, the existing fixup has the side effect of
making the boost control show up in userspace as a mute/unmute switch,
and this keeps (e.g.) PulseAudio from fiddling with it during normal
input volume adjustments.

Finally, the NUC hardware has built-in inverted stereo mics. This
patch also enables the usual fixup for this so the two channels cancel
noise instead of the actual signal.

[ Re-ordered the quirk entry point by tiwai ]

Signed-off-by: Phil Calvin <phil@philcalvin.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/80dc5663-7734-e7e5-25ef-15b5df24511a@philcalvin.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-16 10:03:06 +02:00
Takashi Iwai
998f26f47e ALSA: control: Fix racy management of user ctl memory size account
We've got a report about the possible race in the user control element
counts (card->user_ctl_count), and it was confirmed that the race
wasn't serious in the old code up to 5.12.  There, the value
modification itself was exclusive and protected via a write semaphore,
hence it's at most concurrent reads and evaluations before the
increment.  Since it's only about the soft-limit to avoid the
exhausting memory usage, one-off isn't a big problem at all.

Meanwhile, the relevant code has been largely modified recently, and
now card->user_ctl_count was replaced with card->user_ctl_alloc_size,
and a few more places were added to access this field.  And, in this
new code, it turned out to be more serious: the modifications are
scattered in various places, and a few of them are without protection.
It implies that it may lead to an inconsistent value by racy
accesses.

For addressing it, this patch extends the range covered by the
card->controls_rwsem write lock at snd_ctl_elem_add() so that the all
code paths that modify and refer to card->user_ctl_alloc_size are
protected by the rwsem properly.

The patch adds also comments in a couple of functions to indicate that
they are under the rwsem lock.

Fixes: 66c6d1ef86 ("ALSA: control: Add memory consumption limit to user controls")
Link: https://lore.kernel.org/r/FEEBF384-44BE-42CF-8FB3-93470933F64F@purdue.edu
Link: https://lore.kernel.org/r/20210415131856.13113-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-16 09:57:49 +02:00
Ranjani Sridharan
eea1d18e9b
ASoC: SOF: use current DAI config during resume
Recently, the sof_pcm_dai_link_fixup() function was
updated to match SSP config with the PCM hw_params
and set the current_config for the DAI widget.

But the sof_restore_pipelines() function still chooses the
default config for the DAI widget upon resuming. Fix this
to use the last used config when setting up the DAI widget
during resume.

Fixes: c943a586f6 ("ASoC: SOF: match SSP config with pcm hw params")
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210415162107.130963-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-15 18:11:30 +01:00
Lukasz Majczak
a523ef731a
ASoC: Intel: kbl_da7219_max98927: Fix kabylake_ssp_fixup function
kabylake_ssp_fixup function uses snd_soc_dpcm to identify the
codecs DAIs. The HW parameters are changed based on the codec DAI of the
stream. The earlier approach to get snd_soc_dpcm was using container_of()
macro on snd_pcm_hw_params.

The structures have been modified over time and snd_soc_dpcm does not have
snd_pcm_hw_params as a reference but as a copy. This causes the current
driver to crash when used.

This patch changes the way snd_soc_dpcm is extracted. snd_soc_pcm_runtime
holds 2 dpcm instances (one for playback and one for capture). 2 codecs
on the SSP are dmic (capture) and speakers (playback). Based on the
stream direction, snd_soc_dpcm is extracted from snd_soc_pcm_runtime.

Tested for all use cases of the driver.
Based on similar fix in kbl_rt5663_rt5514_max98927.c
from Harsha Priya <harshapriya.n@intel.com> and
Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>

Cc: <stable@vger.kernel.org> # 5.4+
Signed-off-by: Lukasz Majczak <lma@semihalf.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210415124347.475432-1-lma@semihalf.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-15 18:01:05 +01:00
Mark Brown
620f7c08d9
Merge series "ASoC: simple-card/audio-graph: adjust to multi CPU/Codec" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

These patches adjusts to multi CPU/Codec on simple-card / audio-graph.
This is part of prepare for new audio-graph-card2.

Kuninori Morimoto (5):
  ASoC: simple-card: remove unused variable from simple_parse_of()
  ASoC: simple-card: use asoc_link_to_xxx() macro
  ASoC: simple-card: use simple_props_to_xxx() macro
  ASoC: audio-graph: use asoc_link_to_xxx() macro
  ASoC: audio-graph: use simple_props_to_xxx() macro

 sound/soc/generic/audio-graph-card.c | 43 +++++++++++++-----------
 sound/soc/generic/simple-card.c      | 50 +++++++++++++---------------
 2 files changed, 47 insertions(+), 46 deletions(-)

--
2.25.1
2021-04-15 18:00:52 +01:00
Guangqing Zhu
22ff9c4230
ASoC: codecs: wcd934x: Fix missing IRQF_ONESHOT as only threaded handler
Coccinelle noticed:
  sound/soc/codecs/wcd934x.c:5041:7-32: ERROR: Threaded IRQ with no primary
handler requested without IRQF_ONESHOT

Signed-off-by: Guangqing Zhu <zhuguangqing83@gmail.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210415073829.22750-1-zhuguangqing83@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-15 16:07:54 +01:00
Kuninori Morimoto
ae0727ab77
ASoC: audio-graph: use simple_props_to_xxx() macro
We shouldn't use dai_props->cpus/codecs directly,
because these are array now to supporting multi CPU/Codec/Platform.
This patch uses simple_props_to_xxx() macro for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0p5zs97.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-15 16:07:52 +01:00
Kuninori Morimoto
7ed5920995
ASoC: audio-graph: use asoc_link_to_xxx() macro
We shouldn't use dai_link->cpus/codecs/platforms directly,
because these are array now to supporting multi CPU/Codec/Platform.
This patch uses asoc_link_to_xxx() macro for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lf9lzs9c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-15 16:07:51 +01:00
Kuninori Morimoto
2c33e20ffd
ASoC: simple-card: use simple_props_to_xxx() macro
We shouldn't use dai_props->cpus/codecs directly,
because these are array now to supporting multi CPU/Codec/Platform.
This patch uses simple_props_to_xxx() macro for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mtu1zs9i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-15 16:07:50 +01:00
Kuninori Morimoto
5bb5ac71e3
ASoC: simple-card: use asoc_link_to_xxx() macro
We shouldn't use dai_link->cpus/codecs/platforms directly,
because these are array now to supporting multi CPU/Codec/Platform.
This patch uses asoc_link_to_xxx() macro for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8ehzs9n.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-15 16:07:49 +01:00
Kuninori Morimoto
8cbea89e2f
ASoC: simple-card: remove unused variable from simple_parse_of()
commit d9ffff696c ("ASoC: simple-card: Use snd_soc_of_parse_aux_devs()")
switched to use snd_soc_of_parse_aux_devs() on simple_parse_of().
Thus noone is using *top anymore. Let's cleanup unused variable.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmyxzs9w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-15 16:07:48 +01:00
Mark Brown
1ceb019e78
Merge series "kunit: Fix formatting of KUNIT tests to meet the standard" from Nico Pache <npache@redhat.com>:
There are few instances of KUNIT tests that are not properly defined.
This commit focuses on correcting these issues to match the standard
defined in the Documentation.

Issues Fixed:
 - tests should end in KUNIT_TEST, some fixes have been applied to
   correct issues were KUNIT_TESTS is used or KUNIT is not mentioned.
 - Tests should default to KUNIT_ALL_TESTS
 - Tests configs tristate should have if !KUNIT_ALL_TESTS

No functional changes other than CONFIG name changes

Changes since v2:
 - Split patch 1 by subcomponents
 - fix issues where config was *KUNIT_TEST_TEST
 - properly threaded/chained messages

Nico Pache (6):
  kunit: ASoC: topology: adhear to KUNIT formatting standard
  kunit: software node: adhear to KUNIT formatting standard
  kunit: ext4: adhear to KUNIT formatting standard
  kunit: lib: adhear to KUNIT formatting standard
  kunit: mptcp: adhear to KUNIT formatting standard
  m68k: update configs to match the proper KUNIT syntax

 arch/m68k/configs/amiga_defconfig    |  6 +++---
 arch/m68k/configs/apollo_defconfig   |  6 +++---
 arch/m68k/configs/atari_defconfig    |  6 +++---
 arch/m68k/configs/bvme6000_defconfig |  6 +++---
 arch/m68k/configs/hp300_defconfig    |  6 +++---
 arch/m68k/configs/mac_defconfig      |  6 +++---
 arch/m68k/configs/multi_defconfig    |  6 +++---
 arch/m68k/configs/mvme147_defconfig  |  6 +++---
 arch/m68k/configs/mvme16x_defconfig  |  6 +++---
 arch/m68k/configs/q40_defconfig      |  6 +++---
 arch/m68k/configs/sun3_defconfig     |  6 +++---
 arch/m68k/configs/sun3x_defconfig    |  6 +++---
 drivers/base/test/Kconfig            |  2 +-
 drivers/base/test/Makefile           |  2 +-
 fs/ext4/.kunitconfig                 |  2 +-
 fs/ext4/Kconfig                      |  2 +-
 fs/ext4/Makefile                     |  2 +-
 lib/Kconfig.debug                    | 21 +++++++++++++--------
 lib/Makefile                         |  6 +++---
 net/mptcp/Kconfig                    |  2 +-
 net/mptcp/Makefile                   |  2 +-
 net/mptcp/crypto.c                   |  2 +-
 net/mptcp/token.c                    |  2 +-
 sound/soc/Kconfig                    |  2 +-
 sound/soc/Makefile                   |  4 ++--
 25 files changed, 64 insertions(+), 59 deletions(-)

--
2.30.2
2021-04-14 16:29:35 +01:00
Mark Brown
8577bf61a6
Merge series "ASoC: rsnd: tidyup Renesas sound" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

These are tidyup patches for Renesas sound drivers.

Kuninori Morimoto (5):
  ASoC: rsnd: call rsnd_ssi_master_clk_start() from rsnd_ssi_init()
  ASoC: rsnd: check all BUSIF status when error
  ASoC: rsnd: add rsnd_ssi_busif_err_status_clear()
  ASoC: rsnd: add rsnd_ssi_busif_err_irq_enable/disable()
  ASoC: rsnd: add usage for SRC

 sound/soc/sh/rcar/src.c |   9 ++
 sound/soc/sh/rcar/ssi.c | 225 ++++++++++++++++++----------------------
 2 files changed, 110 insertions(+), 124 deletions(-)

--
2.25.1
2021-04-14 16:29:34 +01:00
Lee Jones
1658d6242a Immutable branch between MFD, Clock, GPIO, Regulator and RTC due for the v5.13 merge window
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmB2tEoACgkQUa+KL4f8
 d2GqwRAAoslBlgvaQy5UB/dD1sVFzNNeqUhXJIYHMN0AvC5BRiysEBUqWotf0CKp
 ywl34SRiEyZ7RAgyYZpZ3gR7pmx8tPSf8PzKMLyZgzOfj5JjEM35Qu7oxPpi7Cnl
 g6kRvlUyVHeFS0uNkUORg7pG3MA43kx6u2SjjEHIyPdDgjmT9QWHH8/8sQdv++Hs
 AOFvsqe5rIpyDKvY0h/xG018AMq8Gr3kZNCg2rYPoxzzjXWZK5CPInzbLnrkZ0Nh
 HEehgtEYN+QmFp6tU1AdJXDReEckQkyOGJ1jSy5sPAKWJ0NKKzaTjwcP8T0KN7Nw
 03VYhA6iom9U4oQGVxZLKKm20QRvevx2ZzYU8yK9qEamwsGADBwlNxO1v3C4dYUT
 AC1xrmu570Hr7EaZYQkU0s4kjqIyZfm9JOTcsltOGYACvE34tgIMiIR5qu1VXnmX
 OcOBUGiQqFovu+zYgHvMhggjclTYu5xM+DH7coi9iFLc7FftbjXF+T8Q/EV/qAfL
 SaVbCQ1XYMefA92pI4kntHMhTe+eNSEDHodc1Tuw/dN4kEJ82R13WpCojH5L739I
 VXaB7GO11W6iVD1wgmv03pf2Ce+TLifHZE90t8GSh5zztND1qI60c3Mc4KOSkGHU
 i5qbGdyFph2MYnWzydPJgSNXoCzLsT/sHwABprOIa7/05mNfEyc=
 =7O9a
 -----END PGP SIGNATURE-----
mergetag object a908a71669
 type commit
 tag ib-mfd-extcon-v5.13
 tagger Lee Jones <lee.jones@linaro.org> 1616067995 +0000
 
 Immutable branch between MFD and Extcon due for the v5.13 merge window
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBTPZsACgkQUa+KL4f8
 d2Ew4g/8CZnru5gfuR2uMZIReS8Q4RniTKe3IoQNGE+nyZFp8heJm5sJ/tcHzHuX
 RcBbuY9hLhhZRvQ+WrveYiXYdC3tH/8j/5mHj6CLJDwh8ukEf9H/tcNAx1T0Y8by
 C3Y/lY7avAzfTorJQ2g+LRkbuei3mojTpUuEiwgdJEzydbg/GzYVv2edRvdCkW0Y
 6xCg8ufmWBTjrHHoXm4/wtGSJ2L17coieSRSIiQ4KsGf8xM6QAnUEXbwQV3KjlVS
 SbI0gucfjnYYdsYqrPy+yyA8gzA5utP/0Zis4pfDG1Av1dBm6ZfD5n/z+KYyJUoG
 C1GPkqxukZODBitwO6PdCoHpFTsbwfoqz6HD8o+6oFqScdBtU7C8SectMpis0G4/
 j3VrstGL6T0GgzuVmy5EnpPkqyiiJh3Smv5ZS91Rztiy4CTTvLlkrw5+h0GP9aR7
 uUfNmQU65KCG4WscnwuWeImcQzxRAlsiI0QxXFmHhIxZFG8Bq2z11V5rcpYdJXgx
 GbkOml6iq+G1UQu3sKYgLlE2Lg3IlehjytAbpY0Qoj9VE1FeE8STgYQMEwT5TqIB
 Em6T1fkpXp2kho92rmJ+rjcAJp7rKmlSQHO0xgbJwbzZsA5rKvClAn3PZmoZs7HY
 VHmeWjPihoo7qJTx7LVhWEtYptKG31JqCRPFTbVXjeCvClnjcFU=
 =3CZN
 -----END PGP SIGNATURE-----
mergetag object eac013a0b7
 type commit
 tag ib-mfd-input-v5.13-1
 tagger Lee Jones <lee.jones@linaro.org> 1615374673 +0000
 
 Immutable branch between MFD and Input due for the v5.13 merge window
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBIqV8ACgkQUa+KL4f8
 d2EmIw//fydErEBA/TsNSSMfAxK+WRY3xDFdTwK9NorfJiyPFMwsfIZ2Y0BdGHpa
 cNz4EMqcfKgHzblbla5EOW64RDIIFQfDTiuCJTGaTB5LUlI56hnKEuiKlrtKlQMC
 3ZSxY5+SY5OFwof4LFPCASyn0N3bH8Mdd1inyFAIphFrgHKez353B9N2RwePlpLq
 7jWaGABQVo28cPpkLl3Slo064xadzS2+Sklwii8gOOvtAGMkLkvLpFEcGCNFRX7l
 OBnw8QP3SCg14b7hrtSys2g7onpH3M5eDt5LwJVqOXEY5SCWJUoultF0msNuGVlq
 XGxJATebx0iU3IByhgTFmzj3ymCWZ7I/EeXD1GI0Fn5EscK1AsrRimlQNcxq9Nm7
 tb/mV3FZlkNi6FjOq/rQ90QgT20t74tGrU9qpXlbwpB2Z9jO3GCDTFLt0XQFEE/4
 83nqIjhYfbpkNXfRTH6/FPtFWqpfw+U8/kNMNWSk9BNta+67++vBQzeFAYWC6hFK
 m7LTzyDNb/EHstAYdXIDblEX4x1VLOilKMaltRqlQC9sUZ4ZpA4YxFJKX21mtGBX
 0jrM2SLeBff+Xv4i/UdoiGBC2uWiBPWW0G94IkDwpCM272q5br8LxTuKIzWCv4w4
 /4J8bXtVfmXl74lXw90ZnMwHApq95+yPDd2g8XTcdo+zctSqS6E=
 =NF6J
 -----END PGP SIGNATURE-----
mergetag object aa47ad3f85
 type commit
 tag ib-mfd-platform-x86-v5.13
 tagger Lee Jones <lee.jones@linaro.org> 1615373744 +0000
 
 Immutable branch between MFD and Platform/x86 due for the v5.13 merge window
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBIpbAACgkQUa+KL4f8
 d2H/NA//bVtt5HlRE0LE8QYOrP2+KmAOOOmIH4eU4eTfn82xMWVmsX+1AsC7ANx0
 eq2pPB3BDQU2MkT9YvtZCud5/3TKYPJfzDl5qppkYTxS7BgRPPnFMXLSi5CofiH9
 dDYSE1Iv0XMPBboJoce/RaBck/yWm5DLWHUR2w8Nc3n61uHCFrPBZeI058ZZXYnh
 DZyiItaVIHDs1jIrVjS87SGcIoSXjfWgBFQkTS9jLneZcC0HRebGA78raEHzeBVK
 Zpx5syisRoPkT+Hxb+Qe28ffqf9Qc/RyOpRnhmCDA0xxskembakati/XhnHtbHaT
 kXmSvsC+OeDXZw8jeVTPz8ZGEmd4H2GLXuVAMuQbOlfuPZgFP+9V5C4LFu2oiT9v
 t9USjr3VgqjGocVntP9B1PgqiDlHuzLinvB614WYPFIXiHJa0xKoEzTQlUbUTn22
 v9Tvyfgx5oczktpavCm3YzgWRyFxphaE++vSIBOJlACoqYQT6At0wnn2qr2+mTL0
 dZy6H/vEXLQFGRcwDmHWDRBoU9D1QTQzWIsl8u8+Pq9SGoa12YmpwOjsuK3WP3wS
 iRl1q35AuyEp6zaclowlW4qcTGlwRMN5rUzReMmRbfg3xqwxj6FwxY87fYtDc7Uu
 E3dklJjeZeSGw3rAJSRQzm0JMhlkRWyFdZ6KPxfnWzsPmrza2vY=
 =340a
 -----END PGP SIGNATURE-----
mergetag object ee0975c308
 type commit
 tag ib-mfd-power-v5.13
 tagger Lee Jones <lee.jones@linaro.org> 1616489771 +0000
 
 Immutable branch between MFD and Power due for the v5.13 merge window
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBZrSsACgkQUa+KL4f8
 d2EyiA/9GRBj8piXoHnlqA4lkExInTddmts2r7aDtmPa1iCUT5XeyIoiSWdnFz++
 fr9ion87/T89zVJWLMGHi5HRlOEQwR0eG8VUF7rAp8qV9ANOOB8sYi0KC4k1ADet
 +SNTqUYIbA3xrlH+DSPBRmyWMJ6EHkrtmzBCO4PUyxEexFFGSGz3BuEkCdhKMsUb
 /t/AqxLEs9v8dHOIWHTlKK9M1divTdBkqN8mwUfGMDqvtCpFXIuSZ3koTnK9wJyd
 Pqw+5XAoL8cMfSkQrwIpZGRdzyCa9f0iOJz8gdYYKxq1575zGxUTM53z3MYb+ujX
 ei3oO99bCNLezcWozBNEJIlk4LK2FdzWFrlimsxE+2IStH9p1TE3voWFUJh+tL3f
 mbYHNJr35pBNRXA07iQccA9V2zCFAeN4GaeRrY59blcfw8fvOGcWwni8YDbWmmGz
 E/xYv7WeNtrzrELNDMpGJ4w909EItfXEsWyzItJBhI5ThsRPOpET7uBolkEfbd5M
 jjGM2pGeLq++Zd1c2kBzc3a2gW60iGNI6dMBpZWCwCCPe1Vz7okiu1hVULMYYXgZ
 B7F8xzM60phdlMUrFu/tFyYPOs8/0w8tk5QjGiD7/FkLsFhD6UdJsD0r02PCtqN+
 4BRGwOmZWED83XVDTkwVR61GWPP7mWl5AUywe2XdPBo6/jhWTBY=
 =+5eM
 -----END PGP SIGNATURE-----
mergetag object edbda8f787
 type commit
 tag ib-mfd-pwm-rtc-v5.13-1
 tagger Lee Jones <lee.jones@linaro.org> 1615374433 +0000
 
 Immutable branch between MFD, PWM and RTC due for the v5.13 merge window
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBIqH8ACgkQUa+KL4f8
 d2F8EhAAi4vdKdfmlkJYcOS/wwWHR+wF3LOrTdmv80oP19/QY5Ctk/zgjYOmet+K
 WOLFOH0WCwp+NlEpiFDhlhAqApFNw4F24Dp4iiMGfYF+ohpoDNMIV9bYC9PpLeF1
 IsXo/vRsYQN9JtHZEHlICbw+W60jfTx4F1woQVuMM1sTIb65DVlHHEGKBFH4v+ys
 fXZWTIhMCnVrJvM26dU4YZ0uj3RbAZlzK5itOzIwaU6OLitc0XlFGH+zsIiHioNl
 wsfJJc5WzeJwCbanqsdiA+lAQ3oRhzns0bOSeTyf0xWS1HzKSMBhpkvGLa//5kmD
 I5HEtw46OvWtvZ8AaBVeHVlIGZ+00Yxs3ORFK/koGOFcTayh/7QjhS8/wSIW0yp8
 Nxwr8OXpHLicJceIm7/1OpfSbawnY0f93Cu2c6rzDLWz0JTzO6f5EmfFr8I/T+bB
 7gexysH3JoOYutsPD9EsEoaexFx4ZsYSoPQJ5Jf74pmMJUUkDwzSo2DQb34DM8Ja
 uRwka56ayuubhEX8jd5hru/X7Ikl2GYoMG/ZsZ09BfWhGA3F55R6cn0+UiEwj03M
 rn6/FSl8EHgAQ5W7JT85rucbBAT2HmuZWV2OFSM3ldlD1Tws/GucDRELn9q37YpS
 w7bq+hXd6sHEJnx1vtVnJoXx+0DJdZ00koj4h3xdNm936p7K9/w=
 =DySP
 -----END PGP SIGNATURE-----

Merge tags 'ib-mfd-clk-gpio-regulator-rtc-v5.13', 'ib-mfd-extcon-v5.13', 'ib-mfd-input-v5.13-1', 'ib-mfd-platform-x86-v5.13', 'ib-mfd-power-v5.13', 'ib-mfd-pwm-rtc-v5.13-1' and 'ib-regulator-list-ramp-helpers-v5.13' into ibs-for-mfd-merged

Immutable branch between MFD, Clock, GPIO, Regulator and RTC due for the v5.13 merge window

Immutable branch between MFD and Extcon due for the v5.13 merge window

Immutable branch between MFD and Input due for the v5.13 merge window

Immutable branch between MFD and Platform/x86 due for the v5.13 merge window

Immutable branch between MFD and Power due for the v5.13 merge window

Immutable branch between MFD, PWM and RTC due for the v5.13 merge window
2021-04-14 15:59:22 +01:00
Nico Pache
b5fb388da4
ASoC: topology: adhere to KUNIT formatting standard
Drop 'S' from end of SND_SOC_TOPOLOGY_KUNIT_TESTS inorder to adhear to
 the KUNIT *_KUNIT_TEST config name format.

Signed-off-by: Nico Pache <npache@redhat.com>
Link: https://lore.kernel.org/r/dcf79e592f9a7e14483dde32ac561f6af2632e50.1618388989.git.npache@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14 15:26:24 +01:00
Yang Li
e42b6e813f
ASoC: cs35l35: remove unused including <linux/version.h>
Fix the following versioncheck warning:
./sound/soc/codecs/cs35l35.c: 12 linux/version.h not needed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1618380883-114841-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14 15:24:18 +01:00
Shengjiu Wang
4d5d75ce2b
ASoC: ak5558: change function name to ak5558_reset
Change function name to ak5558_reset to match devicetree property
"reset-gpios".

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1618382024-31725-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14 15:24:17 +01:00
Shengjiu Wang
0b93bbc977
ASoC: ak5558: correct reset polarity
Reset (aka power off) happens when the reset gpio is made active.
The reset gpio is GPIO_ACTIVE_LOW

Fixes: 9208847774 ("ASoC: ak5558: Add support for AK5558 ADC driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1618382024-31725-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14 15:24:16 +01:00
Kuninori Morimoto
63346d3d2f
ASoC: rsnd: add usage for SRC
This patch add missing usage comment for SRC.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zgy9z9es.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14 15:24:14 +01:00
Kuninori Morimoto
15c57ce07c
ASoC: rsnd: add rsnd_ssi_busif_err_irq_enable/disable()
Current ssi.c has duplicated code to control BUSIF
over/under run interrupt.
This patch adds new rsnd_ssi_busif_err_irq_enable/disable()
and share the code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Yongbo Zhang <giraffesnn123@gmail.com>
Cc: Chen Li <licheng0822@thundersoft.com>
Link: https://lore.kernel.org/r/871rbl1jsb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14 15:24:13 +01:00
Kuninori Morimoto
691b379cbe
ASoC: rsnd: add rsnd_ssi_busif_err_status_clear()
Current ssi.c clears BUSIF error status at __rsnd_ssi_interrupt(),
but its code is verbose.
This patch off-load it to rsnd_ssi_busif_err_status_clear().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8735w11jso.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14 15:24:12 +01:00
Kuninori Morimoto
a4856e15e5
ASoC: rsnd: check all BUSIF status when error
commit 66c705d07d ("SoC: rsnd: add interrupt support for SSI BUSIF
buffer") adds __rsnd_ssi_interrupt() checks for BUSIF status,
but is using "break" at for loop.
This means it is not checking all status. Let's check all BUSIF status.

Fixes: commit 66c705d07d ("SoC: rsnd: add interrupt support for SSI BUSIF buffer")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874kgh1jsw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14 15:24:10 +01:00
Kuninori Morimoto
a122a116fc
ASoC: rsnd: call rsnd_ssi_master_clk_start() from rsnd_ssi_init()
Current rsnd needs to call .prepare (P) for clock settings,
.trigger for playback start (S) and stop (E).
It should be called as below from SSI point of view.

	P -> S -> E -> P -> S -> E -> ...

But, if you used MIXer, below case might happen

	              (2)
	1: P -> S ---> E -> ...
	2:         P ----> S -> ...
	          (1)     (3)

P(1) setups clock, but E(2) resets it. and starts playback (3).
In such case, it will reports "SSI parent/child should use same rate".

rsnd_ssi_master_clk_start() which is the main function at (P)
was called from rsnd_ssi_init() (= S) before,
but was moved by below patch to rsnd_soc_dai_prepare() (= P) to avoid
using clk_get_rate() which shouldn't be used under atomic context.

	commit 4d230d1271 ("ASoC: rsnd: fixup not to call clk_get/set
				under non-atomic")

Because of above patch, rsnd_ssi_master_clk_start() is now called at (P)
which is for non atomic context. But (P) is assuming that spin lock is
*not* used.
One issue now is rsnd_ssi_master_clk_start() is checking ssi->xxx
which should be protected by spin lock.

After above patch, adg.c had below patch for other reasons.

	commit 06e8f5c842 ("ASoC: rsnd: don't call clk_get_rate()
				under atomic context")

clk_get_rate() is used at probe() timing by this patch.
In other words, rsnd_ssi_master_clk_start() is no longer using
clk_get_rate() any more.

This means we can call it from rsnd_ssi_init() (= S) again which is
protected by spin lock.
This patch re-move it to under spin lock, and solves
1. checking ssi->xxx without spin lock issue.
2. clk setting / device start / device stop race condition.

Reported-by: Linh Phung T. Y. <linh.phung.jy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875z0x1jt5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-14 15:24:09 +01:00
Takashi Iwai
ebe8dc5afb ALSA: usb-audio: Apply implicit feedback mode for BOSS devices
During the recent rewrite of the implicit feedback support, we've
tested to apply the implicit fb on BOSS devices, but it failed, as the
capture stream didn't start without the playback.  As the end result,
it got another type of quirk for tying both streams but starts
playback always (commit 6234fdc1ce "ALSA: usb-audio: Quirk for BOSS
GT-001").

Meanwhile, Mike Oliphant has tested the real implicit feedback mode
for the playback again with the latest code, and found out that it
actually works if the initial feedback sync is skipped; that is, on
those BOSS devices, the playback stream has to be started at first
without waiting for the capture URB completions.  Otherwise it gets
stuck.  In the rest operations after the capture stream processed, we
can take them as the implicit feedback source.

This patch is an attempt to improve the support for BOSS devices with
the implicit feedback mode in the way described above.  It adds a new
flag to snd_usb_audio, playback_first, indicating that the playback
stream starts without sync with the initial capture completion.  This
flag is set in the quirk table with the new IMPLICIT_FB_BOTH type.

Reported-and-tested-by: Mike Oliphant <oliphant@nostatic.org>
Link: https://lore.kernel.org/r/20210414083255.9527-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-14 14:24:22 +02:00
Jaroslav Kysela
543f8d7808 ALSA: control_led - fix the stack usage (control element ops)
It's a bad idea to allocate big structures on the stack.
Mark the variables as static and add a note for the locking.

Fixes: 22d8de62f1 ("ALSA: control - add generic LED trigger module as the new control layer")
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210414105858.1937710-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-14 14:23:05 +02:00
Christophe JAILLET
cdf20c3ef0
ASoC: cs35l36: Fix an error handling path in 'cs35l36_i2c_probe()'
If 'devm_regmap_init_i2c()' fails, there is no need to goto err. We should
return directly as already done by the surrounding error handling paths.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/9fec48e75bc1d3c92626e6f6aca2344bda223379.1618145790.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 14:12:55 +01:00
Christophe JAILLET
38c694e98f
ASoC: cs35l35: Fix an error handling path in 'cs35l35_i2c_probe()'
If 'devm_regmap_init_i2c()' fails, there is no need to goto err. We should
return directly as already done by the surrounding error handling paths.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/15720439769ba94ffb65c90217392b0758b08f61.1618145369.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 14:12:54 +01:00
Mark Brown
637251bcfe
Merge series "ASoC: simple-card-utils: prepare for multi support" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

This patch-set is for v2 of Multi-CPU/Codec support,
and some cleanups.
v1 had patch-conflict on simple-card / audio-graph with below.
v2 was solved it.

	fa74c223b6
	("ASoC: simple-card: fix possible uninitialized single_cpu local variable")

I want to add new audio-graph-card2 driver which can support
not only DPCM, but also Multi-CPU/Codec, and Codec2Codec.
And it is also supporting audio-graph-card2 base custom driver.

But before supporting such driver, we need to cleanup existing
simple-card / audio-graph, because these and new driver are
sharing code.

Link: https://lore.kernel.org/r/87wntmod33.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/20210408141639.GA39604@sirena.org.uk

Kuninori Morimoto (12):
  ASoC: simple-card-utils: setup dai_props cpu_dai/codec_dai at initial timing
  ASoC: simple-card-utils: remove li->dais/li->conf
  ASoC: simple-card-utils: use for_each_prop_xxx()
  ASoC: simple-card-utils: remove asoc_simple_parse_xxx()
  ASoC: simple-card-utils: care multi DAI at asoc_simple_clean_reference()
  ASoC: simple-card-utils: indicate dai_fmt if exist
  ASoC: simple-card-utils: indicate missing CPU/Codec numbers for debug
  ASoC: simple-card-utils: add simple_props_to_xxx() macro
  ASoC: simple-card-utils: multi support at asoc_simple_canonicalize_cpu/platform()
  ASoC: simple-card-utils: tidyup debug info for clock
  ASoC: simple-card-utils: tidyup dev_dbg() to use 1 line
  ASoC: simple-card-utils: tidyup asoc_simple_parse_convert()

 include/sound/simple_card_utils.h     | 107 ++++++++++------
 sound/soc/generic/audio-graph-card.c  |  64 ++++------
 sound/soc/generic/simple-card-utils.c | 174 ++++++++++++++++----------
 sound/soc/generic/simple-card.c       |  70 ++++-------
 4 files changed, 226 insertions(+), 189 deletions(-)

--
2.25.1
2021-04-13 14:11:53 +01:00
Chen Lifu
462c47c2fc
ASoC: sti: sti_uniperif: add missing MODULE_DEVICE_TABLE
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Chen Lifu <chenlifu@huawei.com>
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Link: https://lore.kernel.org/r/20210409015953.259688-1-chenlifu@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 12:33:45 +01:00
Kuninori Morimoto
fcfd763bef
ASoC: simple-card-utils: tidyup asoc_simple_parse_convert()
dev is not used. This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eefgwf8j.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 12:32:56 +01:00
Kuninori Morimoto
c826ec0391
ASoC: simple-card-utils: multi support at asoc_simple_canonicalize_cpu/platform()
Current asoc_simple_canonicalize_cpu/platform() is assuming single CPU,
single Platform, but we want to support Multi support.
This patch is prepare for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87im4swf8y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 12:32:53 +01:00
Kuninori Morimoto
1cf6805700
ASoC: simple-card-utils: care multi DAI at asoc_simple_clean_reference()
ASoC is now supporting multi DAI, but, current
simple-card / audio-graph are assuming fixed single DAI.

This patch cares multi DAI at asoc_simple_clean_reference()
for of_node_put().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8ekwf9p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 12:32:49 +01:00
Kuninori Morimoto
e25704f84c
ASoC: simple-card-utils: remove asoc_simple_parse_xxx()
ASoC is now supporting multi DAI, but, current
simple-card / audio-graph are assuming fixed single DAI.

Now, asoc_simple_parse_xxx() macro is assuming single DAI.
To support multi-CPU/Codec, this patch unpack asoc_simple_parse_xxx()
macro, and uses "&dai_link->cpus[i]" instead of "dai_link->cpus".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmz0wf9u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 12:32:48 +01:00
Kuninori Morimoto
fafc05aadd
ASoC: simple-card-utils: use for_each_prop_xxx()
ASoC is now supporting multi DAI, but, current
simple-card / audio-graph are assuming fixed single DAI.

This patch uses for_each_prop_xxx() to support multi DAI.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1jgwf9y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 12:32:47 +01:00
Kuninori Morimoto
f899006d55
ASoC: simple-card-utils: remove li->dais/li->conf
li->dais is same as number of CPU + Codec,
li->conf is same as number of Codec when dummy-Codec.

li->dais/li->conf are no longer needed.
This patch removes these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sg3wwfa3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 12:32:46 +01:00
Kuninori Morimoto
59f5cd96e9
ASoC: simple-card-utils: setup dai_props cpu_dai/codec_dai at initial timing
We couldn't setup dai_props cpu_dai/codec_dai at the initial timing,
because "counting DAIs loop" and "detecting DAIs loop" were different.
But we can do it now, because these are using same loops.

This patch setups dai_props cpu_dai/codec_dai at the initial timing.
It can removes triky code from simple-card / audio-graph.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tuocwfa8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 12:32:45 +01:00
Jerome Brunet
858066864a
ASoC: meson: axg-frddr: fix fifo depth on g12 and sm1
Previous fifo depth patch was only tested on axg, not g12 or sm1.
Of course, while adding hw_params dai callback for the axg, I forgot to do
the same for g12 and sm1, leaving the depth unset and breaking playback on
these SoCs.

Add hw_params callback to the g12 dai_ops to fix the problem.

Fixes: 6f68accaa8 ("ASoC: meson: axg-frddr: set fifo depth according to the period")
Reported-by: Christian Hewitt <christianshewitt@gmail.com>
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210412132256.89920-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-13 12:31:51 +01:00
Takashi Iwai
d2e8f64125 ALSA: usb-audio: Explicitly set up the clock selector
In the current code, we have some assumption that the audio clock
selector has been set up implicitly and don't want to touch it unless
it's really needed for the fallback autoclock setup.  This works for
most devices but some seem having a problem.  Partially this was
covered for the devices with a single connector at the initialization
phase (commit 086b957cc1 "ALSA: usb-audio: Skip the clock selector
inquiry for single connections"), but also there are cases where the
wrong clock set up is kept silently.  The latter seems to be the cause
of the noises on Behringer devices.

In this patch, we explicitly set up the audio clock selector whenever
the appropriate node is found.

Reported-by: Geraldo Nascimento <geraldogabriel@gmail.com>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199327
Link: https://lore.kernel.org/r/CAEsQvcvF7LnO8PxyyCxuRCx=7jNeSCvFAd-+dE0g_rd1rOxxdw@mail.gmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210413084152.32325-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-13 12:05:12 +02:00
Mark Brown
13a9e21b80
Merge series "ASoC: SOF: Intel: descriptor corrections for TGL and ADL" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
One missed property for TigerLake and need for separate descriptors
between ADL-S and the other flavors.

Libin Yang (1):
  ASoC: SOF: Intel: add missing use_acpi_target_states for TGL platforms

Sathya Prakash M R (1):
  ASoC: SOF: Intel: Update ADL P to use its own descriptor

 sound/soc/sof/intel/pci-tgl.c | 20 +++++++++++++++++++-
 sound/soc/sof/intel/tgl.c     |  2 +-
 2 files changed, 20 insertions(+), 2 deletions(-)

--
2.25.1
2021-04-12 19:56:23 +01:00
Mark Brown
2976eef29e
Merge series "ASoC: SOF: simplify probe and report errors" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:
These patches simplify the sof_probe_complete handling and
address reporting of errors during probe.

Peter Ujfalusi (2):
  ASoC: SOF: core: Add missing error prints to device probe operation
  ASoC: SOF: Simplify sof_probe_complete handling for acpi/pci/of

 sound/soc/sof/core.c         |  9 +++++++--
 sound/soc/sof/sof-acpi-dev.c | 18 +++---------------
 sound/soc/sof/sof-of-dev.c   | 18 +++---------------
 sound/soc/sof/sof-pci-dev.c  | 20 ++++----------------
 4 files changed, 17 insertions(+), 48 deletions(-)

--
2.25.1
2021-04-12 19:56:22 +01:00
Mark Brown
6fede18b0c
Merge series "ASoC: SOF: simplify nocodec mode" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:
This set of patches simplify the implementation
of nocodec mode in SOF.

Pierre-Louis Bossart (6):
  ASoC: SOF: add Kconfig option for probe workqueues
  ASoC: soc-acpi: add new fields for mach_params
  ASoC: SOF: change signature of set_mach_params() callback
  ASoC: SOF: Intel: update set_mach_params()
  ASoC: SOF: pcm: export snd_pcm_dai_link_fixup
  ASOC: SOF: simplify nocodec mode

 include/sound/soc-acpi.h  |  4 ++++
 include/sound/sof.h       |  3 ---
 sound/soc/sof/Kconfig     | 11 +++++++++++
 sound/soc/sof/intel/bdw.c |  8 ++++++--
 sound/soc/sof/intel/byt.c | 22 +++++++++++++---------
 sound/soc/sof/intel/hda.c |  8 ++++++--
 sound/soc/sof/intel/hda.h |  2 +-
 sound/soc/sof/nocodec.c   | 39 +++++++++++++++++++++------------------
 sound/soc/sof/ops.h       |  6 ++----
 sound/soc/sof/pcm.c       |  1 +
 sound/soc/sof/sof-audio.c | 34 +++++++++++++++-------------------
 sound/soc/sof/sof-priv.h  |  2 +-
 12 files changed, 81 insertions(+), 59 deletions(-)

--
2.25.1
2021-04-12 19:56:21 +01:00
Sathya Prakash M R
4ad03f894b
ASoC: SOF: Intel: Update ADL P to use its own descriptor
ADL P has specific machines and hence having its own
table will help separate the machines and FW

Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Sathya Prakash M R <sathya.prakash.m.r@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210412161519.13508-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 18:03:22 +01:00
Libin Yang
1b9889974c
ASoC: SOF: Intel: add missing use_acpi_target_states for TGL platforms
All Intel TigerLake platforms should support the feature of getting
the system state from acpi to deal with S0ix support.

This was missed in previous commits, likely due to copy/paste from
older code.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210412161519.13508-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 18:03:21 +01:00
Ranjani Sridharan
7459f8b703
ASoC: SOF: topology: remove useless code
The patch "ASoC: SOF: Intel: hda: assign link DMA channel at run-time"
fixed the sof_link_hda_unload() to remove the call to the BE
hw_free op but left the rest of code that become redundant.

So, remove sof_link_hda_unload() along with the link_unload() op
entirely as it is not longer needed.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220522.1542865-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:06:45 +01:00
Libin Yang
b2fe85790d
ASoC: SOF: Kconfig: fix typo of SND_SOC_SOF_PCI
It should be 'endif ## SND_SOC_SOF_PCI' instead of
'endif ## SND_SOC_SOF_INTEL_PCI'

Signed-off-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409221308.1544000-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:06:44 +01:00
Pierre-Louis Bossart
4c1cc83fcc
ASOC: SOF: simplify nocodec mode
Replace ugly #if (!IS_ENABLED) by if (!IS_ENABLED), remove
cross-module dependencies and use classic mechanism to pass
information to the machine driver.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-7-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:55 +01:00
Pierre-Louis Bossart
f3f3af1743
ASoC: SOF: pcm: export snd_pcm_dai_link_fixup
In preparation of the nocodec refactoring, export the dai-link
fixup. This will also be required when we have more clients and
platform drivers.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-6-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:54 +01:00
Pierre-Louis Bossart
974cccf490
ASoC: SOF: Intel: update set_mach_params()
Add information for num_dai_drivers and dai_drivers[], which will be
used in the refactored nocodec implementation

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:53 +01:00
Pierre-Louis Bossart
17e9d6b0a3
ASoC: SOF: change signature of set_mach_params() callback
To set additional parameters, we need to have access to sdev, not the
plain vanilla struct device pointer.

No functionality change.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:52 +01:00
Pierre-Louis Bossart
e4330cae2a
ASoC: SOF: add Kconfig option for probe workqueues
The probe workqueue is currently used in the HDaudio case, following
the example of the snd-hda-intel driver.

For development and validation, it's useful to enable the probe
workqueue even with ACPI devices or NOCODEC mode.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:50 +01:00
Peter Ujfalusi
4d1284cd79
ASoC: SOF: Simplify sof_probe_complete handling for acpi/pci/of
Set the sof_data->sof_probe_complete callback unconditionally of
CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE.

The sof_probe_complete will be called when the sof_probe_continue()
function is successfully executed, called either directly from
snd_sof_device_probe() or from the scheduled work.

Since all error cases within the call chain of snd_sof_device_probe() have
error prints, there is no need to print again in the acpi/pci/of level.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220959.1543456-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:01 +01:00
Peter Ujfalusi
3bcae98e10
ASoC: SOF: core: Add missing error prints to device probe operation
Two error cases in snd_sof_device_probe() and sof_probe_continue() are
missing error prints.
If either of them happens it is not possible to identify the reason for the
failure.

Add dev_err() prints for the cases to aim debugging.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220959.1543456-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12 17:05:00 +01:00
Chen Huang
d91cbe83d3 ALSA: virtio: use module_virtio_driver() to simplify the code
module_virtio_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Chen Huang <chenhuang5@huawei.com>
Reviewed-by: Anton Yakovlev <anton.yakovlev@opensynergy.com>
Link: https://lore.kernel.org/r/20210408125429.1158703-1-chenhuang5@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-12 12:15:34 +02:00
Ranjani Sridharan
618fad3d92 ALSA: HDA: Add access description in __snd_hda_add_vmaster
Add description for access parameter in __snd_hda_add_vmaster()
to prevent the compilation warning:
warning: Function parameter or member 'access' not described in '__snd_hda_add_vmaster'

Fixes: e65bf99718 ("ALSA: HDA - remove the custom implementation for the audio LED trigger")
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409214616.1539685-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-10 08:46:03 +02:00
Vijendar Mukunda
26e33ed9f1
ASoC: amd: Add support for ALC1015P codec in acp3x machine driver
Add ALC1015p codec support for acp3x machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1617886984-9500-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 20:03:10 +01:00
Dan Carpenter
57b138dde3 ALSA: control - double free in snd_ctl_led_init()
"group - 1" was intended here instead of "group".  The current error
handling will double free the first item in the array and leak the last
item.

Fixes: cb17fe0045 ("ALSA: control - add sysfs support to the LED trigger module")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/YHBJ4frGxErWB182@mwanda
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-09 16:15:20 +02:00
Ye Bin
33e12dea13
ASoC: wcd9335: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062644.802988-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:55 +01:00
Ye Bin
81df40a080
ASoC: codecs: lpass-tx-macro: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062657.803668-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:54 +01:00
Ye Bin
4150cc7306
ASoC: amd: renoir: acp3x-pdm-dma: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062658.803724-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:53 +01:00
Ye Bin
a893a666b5
ASoC: codecs: lpass-wsa-macro: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062642.802846-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:52 +01:00
Jack Yu
4f3b0f8e36
ASoC: rt1019: remove registers to sync with rt1019 datasheet
Remove some registers to synchronize with the latest rt1019 datasheet.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/01e6409f0db0451aa1e45ca7d82cca9c@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:51 +01:00
Ye Bin
3cab801e8b
ASoC: rt711-sdca: Constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062647.803141-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:50 +01:00
Ye Bin
e994cf8268
ASoC: wcd934x: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062648.803227-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:49 +01:00
Ye Bin
1f34084cc8
ASoC: rt715-sdca: Constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062654.803538-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:48 +01:00
Ye Bin
a457dd92d1
ASoC: Intel: KMB: Constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062653.803478-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:47 +01:00
Ye Bin
857b602a34
ASoC: codecs: lpass-rx-macro: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062650.803309-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:45 +01:00
Gyeongtaek Lee
45475bf60c
ASoC: soc-compress: lock pcm_mutex to resolve lockdep error
If panic_on_warn=1 is added in bootargs and compress offload playback with
DPCM is started, kernel panic would be occurred because rtd->card->pcm_mutex
isn't held in soc_compr_open_fe() and soc_compr_free_fe() and it generates
lockdep warning in the following code.

void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,
			    int stream, int action)
{
	struct snd_soc_dai *dai;
	int i;

	lockdep_assert_held(&rtd->card->pcm_mutex);

To prevent lockdep warning but minimize side effect by adding mutex,
pcm_mutex is held just before snd_soc_runtime_activate() and
snd_soc_runtime_deactivate() and is released right after them.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Link: https://lore.kernel.org/r/1891546521.01617772502282.JavaMail.epsvc@epcpadp3
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:44 +01:00
Ye Bin
3e075e8428
ASoC: amd: raven: acp3x-i2s: Constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062651.803413-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-09 13:39:43 +01:00
Takashi Iwai
64f40f9be1 ALSA: usb-audio: Add MIDI quirk for Vox ToneLab EX
ToneLab EX guitar pedal device requires the same quirk like ToneLab ST
for supporting the MIDI.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212593
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210407144549.1530-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-09 09:58:13 +02:00
Takashi Iwai
d763145312 ALSA: usb-audio: Skip probe of UA-101 devices
UA-101 device and co are supported by another driver, snd-ua101, but
the USB audio class driver (snd-usb-audio) catches all and this
resulted in the lack of functionality like missing MIDI devices.

This patch introduces a sort of deny-listing for those devices to just
return -ENODEV at probe in snd-usb-audio driver, so that it falls back
to the probe by snd-ua101.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212477
Link: https://lore.kernel.org/r/20210408075656.30184-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-09 09:57:30 +02:00
Takashi Iwai
473d5ae82d Merge branch 'for-linus' into for-next
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-09 09:57:03 +02:00
Mark Brown
703fe25d11
Merge series "ASoC: simple-card-utils: prepare for multi support" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

I want to add new audio-graph-card2 driver which can support
not only DPCM, but also Multi-CPU/Codec, and Codec2Codec.
And it is also supporting audio-graph-card2 base custom driver.

But before supporting such driver, we need to cleanup existing
simple-card / audio-graph, because these and new driver are
sharing code.

This patch-set are for Multi-CPU/Codec support,
and some cleanups.

Kuninori Morimoto (14):
  ASoC: simple-card-utils: enable flexible CPU/Codec/Platform
  ASoC: simple-card-utils: share dummy DAI and reduce memory
  ASoC: simple-card-utils: setup dai_props cpu_dai/codec_dai at initial timing
  ASoC: simple-card-utils: remove li->dais/li->conf
  ASoC: simple-card-utils: use for_each_prop_xxx()
  ASoC: simple-card-utils: remove asoc_simple_parse_xxx()
  ASoC: simple-card-utils: care multi DAI at asoc_simple_clean_reference()
  ASoC: simple-card-utils: indicate dai_fmt if exist
  ASoC: simple-card-utils: indicate missing CPU/Codec numbers for debug
  ASoC: simple-card-utils: add simple_props_to_xxx() macro
  ASoC: simple-card-utils: multi support at asoc_simple_canonicalize_cpu/platform()
  ASoC: simple-card-utils: tidyup debug info for clock
  ASoC: simple-card-utils: tidyup dev_dbg() to use 1 line
  ASoC: simple-card-utils: tidyup asoc_simple_parse_convert()

 include/sound/simple_card_utils.h     | 116 +++++++----
 sound/soc/generic/audio-graph-card.c  |  90 ++++-----
 sound/soc/generic/simple-card-utils.c | 272 +++++++++++++++++---------
 sound/soc/generic/simple-card.c       | 104 +++++-----
 4 files changed, 352 insertions(+), 230 deletions(-)

--
2.25.1
2021-04-08 17:39:58 +01:00
Linus Torvalds
e0a472fffe sound fixes for 5.12-rc7
This batch became unexpectedly bigger due to the pending ASoC
 patches, but all look small and fine device-specific fixes.
 Many of the commits are for ASoC Intel drivers, while the rest
 are for ASoC small codec/platform fixes and HD-audio quirks.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmBu/dUOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+lDQ/8DnOBiDvUNnRGFqB3rRu/I5y91BqjZK2G/rVi
 2m2xE3XuqYnmAnGQ04tBJKcnKVWaZfMkXKL6fYX/EmssitNaN7iRph2piC/NtMwZ
 bxuiOGsckerObVzVln3QzmSUeXZoan2GTvGHOUkkhrAxF1Y/ounE39j5Pg4KVOZb
 KkpKIlNno32TmCLd56Wf9NOYUDS7Ug7qi/cvivJnwkDX2OrFGUuEzDKw6AGqQnXV
 bACnyunLshpEikzvuispOAAQmyHaJLt4xQLqIla0HFY62jbTF+8qTP0YTs1qqg5C
 F5zfZtprS7HadxlC916p4qNGCwvoQeSspQ+BQaRLQu040VgAnxtYOJYa/w3d01KV
 hDCts4/6fFxwzzIzoV0mX/gH8xNufCMOM8lGdEcRpSok+SvKpk2W/P2PIj2QqP59
 tuey3Gdfw1Ccagh/u3k4tMs1bKBV1GncWylWlv1yIPsX6mBS2UALm+6jS+sylda7
 mBlOKLdZkkW94+YTmlKUZrtJ/8CJAxs2if44ge3nTevN4yUQh5OAcs7Ox8o/fi81
 z/aAPtcYb7hrTuZ53kizte+xISjW4t9Q6LXkqWkc76xXK6z17q4evN7O/+7hqjjj
 kueCNNTBl33BFCPSzxdQAYZpN+5k4u5gz35H54nq9KhmHGkgFvVhqzyoP33SRE4z
 BuQUKQI=
 =NnhZ
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This batch became unexpectedly bigger due to the pending ASoC patches,
  but all look small and fine device-specific fixes.

  Many of the commits are for ASoC Intel drivers, while the rest are for
  ASoC small codec/platform fixes and HD-audio quirks"

* tag 'sound-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (21 commits)
  ALSA: hda/realtek: Fix speaker amp setup on Acer Aspire E1
  ALSA: aloop: Fix initialization of controls
  ALSA: hda/conexant: Apply quirk for another HP ZBook G5 model
  ASoC: fsl_esai: Fix TDM slot setup for I2S mode
  ASoC: codecs: lpass-rx-macro: set npl clock rate correctly
  ASoC: codecs: lpass-tx-macro: set npl clock rate correctly
  ASoC: sunxi: sun4i-codec: fill ASoC card owner
  ASoC: cygnus: fix for_each_child.cocci warnings
  ASoC: max98373: Added 30ms turn on/off time delay
  ASoC: max98373: Changed amp shutdown register as volatile
  ASoC: intel: atom: Remove 44100 sample-rate from the media and deep-buffer DAI descriptions
  ASoC: intel: atom: Stop advertising non working S24LE support
  ASoC: wm8960: Fix wrong bclk and lrclk with pll enabled for some chips
  ASoC: SOF: Intel: move ELH chip info
  ASoC: SOF: Intel: APL: set shutdown callback to hda_dsp_shutdown
  ASoC: SOF: Intel: CNL: set shutdown callback to hda_dsp_shutdown
  ASoC: SOF: Intel: ICL: set shutdown callback to hda_dsp_shutdown
  ASoC: SOF: Intel: TGL: set shutdown callback to hda_dsp_shutdown
  ASoC: SOF: Intel: TGL: fix EHL ops
  ASoC: SOF: core: harden shutdown helper
  ...
2021-04-08 09:01:30 -07:00
Ye Bin
f2ec1ebb25
ASoC: tas2770: Constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062646.803053-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:21:55 +01:00
Ye Bin
e9a216d8f1
ASoC: cx2072x: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062656.803606-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:21:54 +01:00
Ye Bin
5e71e9c14d
ASoC: rt1019: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062701.803865-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:21:53 +01:00
Muhammad Usama Anjum
a93799d55f
ASoC: fsl: sunxi: remove redundant dev_err call
devm_ioremap_resource() prints error message in itself. Remove the
dev_err call to avoid redundant error message.

Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
Link: https://lore.kernel.org/r/20210407095634.GA1379642@LEGION
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:21:52 +01:00
Ye Bin
b186e7c17d
ASoC: tas2764: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062643.802908-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:21:50 +01:00
Jiri Prchal
a0bc855ffd
ASoC: codecs: tlv320aic3x: add AIC3106
In DT binding is mentioned that this driver is compatible with 3106.
So added compatibility string and model number.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210408135908.125667-1-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:21:49 +01:00
Ye Bin
f985838003
ASoC: codecs: wsa881x: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062700.803792-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:21:49 +01:00
Kuninori Morimoto
205eb17edd
ASoC: simple-card-utils: share dummy DAI and reduce memory
Current simple-card / audio-graph creates 1xCPU + 1xCodec + 1xPlatform
for all dai_link, but some of them is not needed.
For example Platform is not needed for DPCM BE case.
Moreover, we can share snd-soc-dummy DAI for CPU-dummy / dummy-Codec
in DPCM.

This patch adds dummy DAI and share it when DPCM case,
I beliave it can contribute to reduce memory.

By this patch, CPU-dummy / dummy-CPU are set at asoc_simple_init_priv(),
thus, its settings are no longer needed at DPCM detecting timing
on simple-card / audio-graph.
Moreover, we can remove triky Platform settings code for DPCM BE,
because un-needed Platform is not created.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tuoqod22.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:18:03 +01:00
Kuninori Morimoto
f2138aed23
ASoC: simple-card-utils: enable flexible CPU/Codec/Platform
Current simple-card / audio-graph are assuming fixed
single-CPU/Codec/Platform.
This patch prepares multi-CPU/Codec/Platform support.

Note is that it is not yet full-multi-support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v996od2c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:18:02 +01:00
Dinghao Liu
7b3f5b207d
ASoC: codecs: Fix runtime PM imbalance in tas2552_probe
There is a rumtime PM imbalance between the error handling path
after devm_snd_soc_register_component() and all other error
handling paths. Add a PM runtime increment to balance refcount.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20210408064036.6691-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:08:50 +01:00
Jack Yu
44de8d80db
ASoC: rt1011: remove pack_id check in rt1011
For latest design, different package could use the same setting,
therefore the check of pack_id will no longer be used.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/4cbe1cd3b8664140889132464c7dee7b@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-08 15:08:49 +01:00
Takashi Sakamoto
66c6d1ef86 ALSA: control: Add memory consumption limit to user controls
ALSA control interface allows users to add arbitrary control elements
(called "user controls" or "user elements"), and its resource usage is
limited just by the max number of control sets (currently 32).  This
limit, however, is quite loose: each allocation of control set may
have 1028 elements, and each element may have up to 512 bytes (ILP32) or
1024 bytes (LP64) of value data. Moreover, each control set may contain
the enum strings and TLV data, which can be up to 64kB and 128kB,
respectively.  Totally, the whole memory consumption may go over 38MB --
it's quite large, and we'd rather like to reduce the size.

OTOH, there have been other requests even to increase the max number
of user elements; e.g. ALSA firewire stack require the more user
controls, hence we want to raise the bar, too.

For satisfying both requirements, this patch changes the management of
user controls: instead of setting the upper limit of the number of
user controls, we check the actual memory allocation size and set the
upper limit of the total allocation in bytes.  As long as the memory
consumption stays below the limit, more user controls are allowed than
the current limit 32. At the same time, we set the lower limit (8MB)
as default than the current theoretical limit, in order to lower the
risk of DoS.

As a compromise for lowering the default limit, now the actual memory
limit is defined as a module option, 'max_user_ctl_alloc_size', so that
user can increase/decrease the limit if really needed, too.

Link: https://lore.kernel.org/r/s5htur3zl5e.wl-tiwai@suse.de
Co-developed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210408103149.40357-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-08 13:31:03 +02:00
Takashi Iwai
c8426b2700 ALSA: hda/realtek: Fix speaker amp setup on Acer Aspire E1
We've got a report about Acer Aspire E1 (PCI SSID 1025:0840) that
loses the speaker output after resume.  With the comparison of COEF
dumps, it was identified that the COEF 0x0d bits 0x6000 corresponds to
the speaker amp.

This patch adds the specific quirk for the device to restore the COEF
bits at the codec (re-)initialization.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1183869
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210407095730.12560-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-08 10:04:05 +02:00
Mark Brown
8361c6da77
Merge series "Adds SPI support" from Jiri Prchal <jiri.prchal@aksignal.cz>:
Moved I2C stuff to separated file, shered thingk to header file.
Added SPI in separeted file.

Jiri Prchal (4):
  ASoC: codecs: tlv320aic3x: move model definitions
  ASoC: codecs: tlv320aic3x: rename probe function
  ASoC: codecs: tlv320aic3x: move I2C to separated file
  ASoC: codecs: tlv320aic3x: add SPI support

 sound/soc/codecs/Kconfig           |  16 ++++-
 sound/soc/codecs/Makefile          |   4 ++
 sound/soc/codecs/tlv320aic3x-i2c.c |  70 +++++++++++++++++++
 sound/soc/codecs/tlv320aic3x-spi.c |  76 ++++++++++++++++++++
 sound/soc/codecs/tlv320aic3x.c     | 108 ++++++++---------------------
 sound/soc/codecs/tlv320aic3x.h     |  12 ++++
 6 files changed, 204 insertions(+), 82 deletions(-)
 create mode 100644 sound/soc/codecs/tlv320aic3x-i2c.c
 create mode 100644 sound/soc/codecs/tlv320aic3x-spi.c

--
2.25.1
2021-04-07 21:07:29 +01:00
Jerome Brunet
9be701ec34
ASoC: meson: axg-fifo: add NO_PERIOD_WAKEUP support
On the AXG family, the fifo irq is not necessary for the HW to operate.
It is just used to notify that a period has elapsed. If userpace does not
care for these wakeups (such as pipewire), we are just wasting CPU cycles.

Add support for NO_PERIOD_WAKEUP and disable irq when they are no needed.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210407145914.311479-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-07 16:58:31 +01:00
Krzysztof Kozlowski
fa74c223b6
ASoC: simple-card: fix possible uninitialized single_cpu local variable
The 'single_cpu' local variable is assigned by asoc_simple_parse_dai()
and later used in a asoc_simple_canonicalize_cpu() call, assuming the
entire function did not exit on errors.

However the first function returns 0 if passed device_node is NULL,
thus leaving the variable uninitialized and reporting success.

Addresses-Coverity: Uninitialized scalar variable
Fixes: 8f7f298a33 ("ASoC: simple-card-utils: separate asoc_simple_card_parse_dai()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20210407092027.60769-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-07 16:58:30 +01:00
Ye Bin
af4b54127b
ASoC: codecs: lpass-va-macro: constify static struct snd_soc_dai_ops
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210407074218.3051979-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-07 16:58:29 +01:00
Jiri Prchal
fd4daab3b1
ASoC: codecs: tlv320aic3x: add SPI support
Added SPI support.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210406142439.102396-5-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-07 16:58:27 +01:00
Jiri Prchal
a96d2ba2d8
ASoC: codecs: tlv320aic3x: move I2C to separated file
Moved I2C related staff to separated source file.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210406142439.102396-4-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-07 16:58:26 +01:00
Jiri Prchal
b015df6ac0
ASoC: codecs: tlv320aic3x: rename probe function
Renamed function to have it free for generic probe.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210406142439.102396-3-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-07 16:58:25 +01:00
Jiri Prchal
73a4808892
ASoC: codecs: tlv320aic3x: move model definitions
Model definitions moved to header file.
Preparation for SPI and I2C separated files.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210406142439.102396-2-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-07 16:58:24 +01:00
Jerome Brunet
6f68accaa8
ASoC: meson: axg-frddr: set fifo depth according to the period
When the period is small, using all the FRDDR fifo depth increases the
latency of the playback because the following device won't start pulling
data until the fifo reaches the depth set. We can adjust this depth so trim
it down for small periods.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210407145714.311138-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-07 16:57:31 +01:00
Takashi Iwai
9c3195778c ASoC: Fixes for v5.12
A fairly small batch of driver specific fixes, mainly for various x86
 systems with the biggest set being fixes to power down DSPs properly on
 x86 SOF systems.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmBsoLcACgkQJNaLcl1U
 h9A+yAf+OvyzGS1gejvjZNs7KLfDs+ujjnVhPW+PX+1FOZmwcCQn+BirFL8iWUPG
 /8JxHDR87TZPk01mW1/o0m2MzmiwwE25IXoyH5qCr4h8azDloOcPz+AwEo7E/yBU
 pxY2m/GNeLRzQB4kXAs6XtA2HTK0pz4qtbLAVVfroXeOPx2sBN79jypN73nIDgku
 cLJAP5J+1e8BBZA0C8zupVRcs65nC7RN1AdaFYaEKCxyn/0Qd7LA+h7p5nJZvJmF
 v6vY0YUmA+cFOA9ExHW7Rt6QIn8iIwp53i3BrtEbuLkxUv+2GckDP//u9C0WnRJq
 BDPN9VXcmPRD3xjOdmkf79BJ7ptByw==
 =BzCL
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.12-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.12

A fairly small batch of driver specific fixes, mainly for various x86
systems with the biggest set being fixes to power down DSPs properly on
x86 SOF systems.
2021-04-07 15:00:33 +02:00
Takashi Iwai
884c7094a2 ALSA: usb-audio: Drop implicit fb quirk entries dubbed for capture
The implicit feedback quirk table contains the entries that also
appear in the capture quirks, and those are all handled to be
skipped.  For the code simplicity, drop the duped entries in the
playback quirk table, and check the match with the capture quirk table
instead.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212519
Link: https://lore.kernel.org/r/20210406113837.32041-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-07 12:00:08 +02:00
Takashi Iwai
5fb45414ae ALSA: usb-audio: Add error checks for usb_driver_claim_interface() calls
There are a few calls of usb_driver_claim_interface() but all of those
miss the proper error checks, as reported by Coverity.  This patch
adds those missing checks.

Along with it, replace the magic pointer with -1 with a constant
USB_AUDIO_IFACE_UNUSED for better readability.

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1475943 ("Error handling issues")
Addresses-Coverity-ID: 1475944 ("Error handling issues")
Addresses-Coverity-ID: 1475945 ("Error handling issues")
Fixes: b1ce7ba619 ("ALSA: usb-audio: claim autodetected PCM interfaces all at once")
Fixes: e5779998bf ("ALSA: usb-audio: refactor code")
Link: https://lore.kernel.org/r/202104051059.FB7F3016@keescook
Link: https://lore.kernel.org/r/20210406113534.30455-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-07 11:59:56 +02:00
Jonas Holmberg
168632a495 ALSA: aloop: Fix initialization of controls
Add a control to the card before copying the id so that the numid field
is initialized in the copy. Otherwise the numid field of active_id,
format_id, rate_id and channels_id will be the same (0) and
snd_ctl_notify() will not queue the events properly.

Signed-off-by: Jonas Holmberg <jonashg@axis.com>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210407075428.2666787-1-jonashg@axis.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-07 10:21:25 +02:00
Mark Brown
34c79fe9e2
Merge series "kbl_da7219_max9357a machine changes for wov and MST" from vamshi.krishna.gopal@intel.com
Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.corp-partner.google.com>:

From: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.corp-partner.google.com>

Hi all,

This patch series about creating dailink for Wake on voice functionality
and also adding MST route changes.

changes in v3:

-Remove DP from widgets
-Add MST support in other routing table for kbl_rt5663_max98927.c

v2 is here:

https://patchwork.kernel.org/project/alsa-devel/cover/20210325174325.31802-1-vamshi.krishna.gopal@intel.com/

v1 is here:

https://patchwork.kernel.org/project/alsa-devel/cover/20210324175200.44922-1-vamshi.krishna.gopal@intel.com/

Mac Chiang (1):
  ASoc: Intel: board: add BE DAI link for WoV

Vamshi Krishna Gopal (1):
  ASoC: Intel: kbl: Add MST route change to kbl machine drivers

 sound/soc/intel/boards/kbl_da7219_max98357a.c | 58 +++++++++++++++++--
 sound/soc/intel/boards/kbl_da7219_max98927.c  | 10 ++--
 sound/soc/intel/boards/kbl_rt5663_max98927.c  | 14 +++--
 3 files changed, 70 insertions(+), 12 deletions(-)

--
2.17.1
2021-04-06 18:33:13 +01:00
Steve Lee
e5870bd0e4
ASoC: max98390: Add support for tx slot configuration.
Update voltage/current tx slot configuration support.

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20210405143801.29770-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-06 17:13:28 +01:00
Shengjiu Wang
a43508995a
ASoC: ak5558: Fix s/show/slow/ typo
s/show/slow/

Fixes: 9208847774 ("ASoC: ak5558: Add support for AK5558 ADC driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1617458365-23393-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-06 17:13:27 +01:00
Mac Chiang
74ed9e9bfb
ASoc: Intel: board: add BE DAI link for WoV
create dai link in kbl_da7219_max98357a driver for wake on voice
functionality.

changes picked from broonie's tree
commit 0c7941a63a
("ASoC: Intel: Skylake: Use refcap device for mono recording")
commit 2154be362c
("ASoc: Intel: boards: Add WOV as sink for nau88l25_ssm4567 machine")

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Tested-by: Kaiyen Chang <kaiyen.chang@intel.corp-partner.google.com>
Tested-by: luke yang <luke_yang@compal.corp-partner.google.com>
Tested-by: Grace Kao <grace.kao@intel.com>
Tested-by: Kaiyen Chang <kaiyen.chang@intel.com>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210405124835.71247-3-vamshi.krishna.gopal@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-06 17:13:26 +01:00
Vamshi Krishna Gopal
c7c19ec098
ASoC: Intel: kbl: Add MST route change to kbl machine drivers
To support MST hdmi audio, modify the current routes to be
based on port in kbl_da7219_max98357a, kbl_da7219_max98927 &
kbl_rt5663_max98927.

Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210405124835.71247-2-vamshi.krishna.gopal@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-06 17:13:25 +01:00
Annaliese McDermond
1ca1156cfd
ASoC: tlv320aic32x4: Register clocks before registering component
Clock registration must be performed before the component is
registered.  aic32x4_component_probe attempts to get all the
clocks right off the bat.  If the component is registered before
the clocks there is a race condition where the clocks may not
be registered by the time aic32x4_componet_probe actually runs.

Fixes: d1c859d314 ("ASoC: codec: tlv3204: Increased maximum supported channels")
Cc: stable@vger.kernel.org
Signed-off-by: Annaliese McDermond <nh6z@nh6z.net>
Link: https://lore.kernel.org/r/0101017889850206-dcac4cce-8cc8-4a21-80e9-4e4bef44b981-000000@us-west-2.amazonses.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-06 17:12:34 +01:00
Annaliese McDermond
29654ed838
ASoC: tlv320aic32x4: Increase maximum register in regmap
AIC32X4_REFPOWERUP was added as a register, but the maximum register value
in the regmap and regmap range was not correspondingly increased.  This
caused an error when this register was attempted to be written.

Fixes: ec96690de8 ("ASoC: tlv320aic32x4: Enable fast charge")
Cc: stable@vger.kernel.org
Signed-off-by: Annaliese McDermond <nh6z@nh6z.net>
Link: https://lore.kernel.org/r/0101017889851cab-ce60cfdb-d88c-43d8-bbd2-7fbf34a0c912-000000@us-west-2.amazonses.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-06 17:12:33 +01:00
Takashi Iwai
c6423ed2da ALSA: hda/conexant: Apply quirk for another HP ZBook G5 model
There is another HP ZBook G5 model with the PCI SSID 103c:844f that
requires the same quirk for controlling the mute LED.  Add the
corresponding entry to the quirk table.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212407
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210401171314.667-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-06 13:40:13 +02:00
Dan Carpenter
53cc2643c1 ALSA: control - off by one in store_mode()
If count is 16 then this will put the NUL terminator one element beyond
the end of the array.

Fixes: cb17fe0045 ("ALSA: control - add sysfs support to the LED trigger module")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/YGcDOtrimR46vr0k@mwanda
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-04-06 11:30:53 +02:00
Greg Kroah-Hartman
9594408763 Merge 5.12-rc6 into tty-next
We need the serial/tty fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-05 08:59:21 +02:00
Alexander Shiyan
e7a48c710d
ASoC: fsl_esai: Fix TDM slot setup for I2S mode
When using the driver in I2S TDM mode, the fsl_esai_startup()
function rewrites the number of slots previously set by the
fsl_esai_set_dai_tdm_slot() function to 2.
To fix this, let's use the saved slot count value or, if TDM
is not used and the number of slots is not set, the driver will use
the default value (2), which is set by fsl_esai_probe().

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20210402081405.9892-1-shc_work@mail.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-02 16:24:16 +01:00
Hans de Goede
e992a51b1d
ASoC: Intel: cht_bsw_rt5672: Set card.components string
Set the card.components string using the new rt5670_components() helper
which returns a components string based on the DMI quirks inside the
rt5670 codec driver.

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/20210402140747.174716-7-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-02 16:13:24 +01:00
Hans de Goede
3d53453764
ASoC: rt5670: Add a rt5670_components() helper
The rt5670 codec driver uses DMI quirks to configure the DMIC data-pins,
which means that it knows which DMIC interface is used on a specific
device.

ATM we duplicate this DMI matching inside the UCM profiles to select
the right DMIC interface. Add a rt5670_components() helper which the
machine-driver can use to set the components string of the card so
that UCM can get the info from the components string.

This way we only need to add new DMI quirks in one place.

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/20210402140747.174716-6-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-02 16:13:23 +01:00
Hans de Goede
84cb0d5581
ASoC: rt5670: Add a quirk for the Dell Venue 10 Pro 5055
Add a quirk with the jack-detect and dmic settings necessary to make
jack-detect and the builtin mic work on Dell Venue 10 Pro 5055 tablets.

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/20210402140747.174716-5-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-02 16:13:22 +01:00
Hans de Goede
c9b3c63392
ASoC: Intel: cht_bsw_rt5672: Add support for Bay Trail CR / SSP0
The rt5672 codec is used on some Bay Trail CR boards, on these SoCs SSP2
is not available and SSP0 should be used instead. At support for this.

This has been tested on a Dell Venue 10 Pro 5055.

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/20210402140747.174716-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-02 16:13:22 +01:00
Hans de Goede
17d49b07a8
ASoC: Intel: Baytrail: Add quirk for the Dell Venue 10 Pro 5055 tablet
The Dell Venue 10 Pro 5055 tablet uses an ACPI HID of 10EC5640 while using
a rt5672 codec (instead of a rt5640 codec). Add a quirk for this.

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/20210402140747.174716-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-02 16:13:21 +01:00
Hans de Goede
ebbb165d2c
ASoC: Intel: Unify the thinkpad10 and aegex10 byt-match quirks
There is no reason to have separate quirk-handlers / byt_machine_id-s
for these.

These are both cases of BYT devices with a 10EC5640 ACPI HID while using
a rt5672 codec.

The Dell Venue 10 Pro 5055 is another example of such a device, instead
of adding a third byt_machine_id definition for this Dell model, make
change the 2 existing cases into a generic BYT_RT5672 byt_machine_id
in preparation for adding a quirk for the Dell Venue 10 Pro 5055.

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/20210402140747.174716-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-02 16:13:20 +01:00
Mac Chiang
628166c37c
ASoC: Intel: Boards: cml_da7219_max98390: add capture stream for echo reference
enable speaker capture dai link for feedback path

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1617285613-29457-1-git-send-email-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-01 19:36:45 +01:00
Linus Torvalds
ffd9fb546d sound fixes for 5.12-rc6
Things seem calming down, only usual device-specific fixes for
 HD-audio and USB-audio at this time.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmBly7oOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/XghAAueq7x3BoDukrwGjsJxUlo+Y7mZnbwDY4hiA0
 58G5o/k0q4uIpZ3FcimUa66qf7zNgIgppLqMAeoCDe8ZmycPPUPWOVn9Xg7+nHLx
 H9Vr1Vvy/sou4MDk8hjav+SBG06HnFFtxgjHg4CeSLNYB0zXF+U2BUyEGoXMWsP/
 Dh14BoOUvFGmfZO6SCzNxtkwl/6KnKzxTYkQ3ghKfTdFBXhfVohGoH/mmS2b/0Nr
 rucQJm6w7GyHxnfNaexSG4zcdAaQO0iRRHHHCeQP8/4vq4yBqgRErHT0ZDX2TT9e
 yAbEfRdT+UIHZBjzWfZHy483yI3tIF7psolqqM0lMzdrFwIjvz4qdoWd7QCymEcR
 Vm2th+z6vbwSntQw+yeGtpnYxpOzk/vTnExmqI1wEqqQbQiFpJqUHgp94JYmIk9r
 bEDJ4PWwpsL8BgNVtWBswO0Xwc/yZrJWDBgOTdGXNFPzuHqOigwQVwGLd510i/Kf
 BuUo9x8uI1hi/P9OdlWtuVH5FyAbH7rzeXi2larhcQo59X07S3FzdCx3qXvc+F0q
 +NWaRDe6pE94ZuI2l8xEV5HKQZAlblNBK/2PwFN5vDAvb+MPsPSp6ViTenpOjS8p
 +8V3rfx3R7yLgDiNMjKCoNaxfSaPcBUtd2K5tYk4orF9aDZ7fe4//9NTl6RPEB72
 IhQ9Mt0=
 =TYaf
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Things seem calming down, only usual device-specific fixes for
  HD-audio and USB-audio at this time"

* tag 'sound-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/realtek: fix mute/micmute LEDs for HP 640 G8
  ALSA: hda: Add missing sanity checks in PM prepare/complete callbacks
  ALSA: hda: Re-add dropped snd_poewr_change_state() calls
  ALSA: usb-audio: Apply sample rate quirk to Logitech Connect
  ALSA: hda/realtek: call alc_update_headset_mode() in hp_automute_hook
  ALSA: hda/realtek: fix a determine_headset_type issue for a Dell AIO
2021-04-01 10:09:31 -07:00
Bhaskar Chowdhury
ebf721fbbb
ASoC: Intel: Fix a typo
s/struture/structure/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Link: https://lore.kernel.org/r/20210322065238.151920-1-unixbhaskar@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-01 12:18:12 +01:00
Srinivas Kandagatla
adfc3ed7dc
ASoC: codecs: lpass-rx-macro: set npl clock rate correctly
NPL clock rate is twice the MCLK rate, so set this correctly to
avoid soundwire timeouts.

Fixes: af3d54b997 ("ASoC: codecs: lpass-rx-macro: add support for lpass rx macro")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210331171235.24824-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-01 12:18:09 +01:00