Commit graph

38194 commits

Author SHA1 Message Date
Lauri Kasanen
1448f8acf4 sound: Add n64 driver
This adds support for the Nintendo 64 console's sound.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2021-01-25 11:48:23 +01:00
Bard Liao
c5b5ff607d ALSA: hda: intel-dsp-config: add PCI id for TGL-H
Adding PCI id for TGL-H. Like for other TGL platforms, SOF is used if
Soundwire codecs or PCH-DMIC is detected.

Signed-off-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Xiuli Pan <xiuli.pan@intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210125083051.828205-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-25 10:37:37 +01:00
Jiapeng Zhong
62c2b4be0d ALSA: hda: Assign boolean values to a bool variable
Fix the following coccicheck warnings:

./sound/pci/hda/hda_intel.c:2309:3-23: WARNING: Assignment of
0/1 to bool variable.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
Link: https://lore.kernel.org/r/1611559047-106928-1-git-send-email-abaci-bugfix@linux.alibaba.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-25 08:57:12 +01:00
Jiapeng Zhong
d15f73315d ALSA: hda: boolean values to a bool variable
Fix the following coccicheck warnings:

./sound/pci/hda/patch_conexant.c:570:2-20: WARNING:
Assignment of 0/1 to bool variable.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
Link: https://lore.kernel.org/r/1610958469-65856-1-git-send-email-abaci-bugfix@linux.alibaba.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-24 09:12:31 +01:00
Takashi Iwai
fe773b8711 ALSA: usb-audio: workaround for iface reset issue
The recently introduced sample rate validation code seems causing a
problem on some devices; namely, after performing this, the bus gets
screwed and it influences even on other USB devices.
As a quick workaround, perform it only for the necessary devices;
currently MOTU devices are known to need the valid altset checks, so
filter out other devices.

Fixes: 93db51d06b ("ALSA: usb-audio: Check valid altsetting at parsing rates for UAC2/3")
Reported-by: Jamie Heilman <jamie@audible.transient.net>
BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1178203
Link: https://lore.kernel.org/r/20210123155842.22652-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-23 16:59:42 +01:00
Takashi Iwai
23b53d4417 ALSA: pcm: One more dependency for hw constraints
The fix for a long-standing USB-audio bug required one more dependency
variable to be added to the hw constraints.  Unfortunately I didn't
realize at debugging that the new addition may result in the overflow
of the dependency array of each snd_pcm_hw_rule (up to three plus a
sentinel), because USB-audio driver adds one more dependency only for
a certain device and bus, hence it works as is for many devices.  But
in a bad case, a simple open always results in -EINVAL (with kernel
WARNING if CONFIG_SND_DEBUG is set) no matter what is passed.

Since the dependencies are real and unavoidable (USB-audio restricts
the hw_params per looping over the format/rate/channels combos), the
only good solution seems to raise the bar for one more dependency for
snd_pcm_hw_rule -- so does this patch: now the hw constraint
dependencies can be up to four.

Fixes: 506c203cc3 ("ALSA: usb-audio: Fix hw constraints dependencies")
Reported-by: Jamie Heilman <jamie@audible.transient.net>
Link: https://lore.kernel.org/r/20210123155730.22576-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-23 16:59:24 +01:00
Jian-Hong Pan
5de3b94302 ALSA: hda/realtek: Enable headset of ASUS B1400CEPE with ALC256
ASUS B1400CEPE laptop's headset audio is not enabled until
ALC256_FIXUP_ASUS_HPE quirk is applied.

Here is the original pin node values:

0x12 0x40000000
0x13 0x411111f0
0x14 0x90170110
0x18 0x411111f0
0x19 0x411111f0
0x1a 0x411111f0
0x1b 0x411111f0
0x1d 0x40461b45
0x1e 0x411111f0
0x21 0x04211020

Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210122054705.48804-1-jhp@endlessos.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-22 09:53:54 +01:00
Ricardo Ribalda
1d8fe0648e
ASoC: Intel: Skylake: Zero snd_ctl_elem_value
Clear struct snd_ctl_elem_value before calling ->put() to avoid any data
leak.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210121171644.131059-2-ribalda@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 18:14:19 +00:00
Ricardo Ribalda
c1c3ba1f78
ASoC: Intel: Skylake: skl-topology: Fix OOPs ib skl_tplg_complete
If dobj->control is not initialized we end up in an OOPs during
skl_tplg_complete:

[   26.553358] BUG: kernel NULL pointer dereference, address:
0000000000000078
[   26.561151] #PF: supervisor read access in kernel mode
[   26.566897] #PF: error_code(0x0000) - not-present page
[   26.572642] PGD 0 P4D 0
[   26.575479] Oops: 0000 [#1] PREEMPT SMP PTI
[   26.580158] CPU: 2 PID: 2082 Comm: udevd Tainted: G         C
5.4.81 #4
[   26.588232] Hardware name: HP Soraka/Soraka, BIOS
Google_Soraka.10431.106.0 12/03/2019
[   26.597082] RIP: 0010:skl_tplg_complete+0x70/0x144 [snd_soc_skl]

Fixes: 2d744ecf2b ("ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHL")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Lukasz Majczak <lma@semihalf.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210121171644.131059-1-ribalda@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 18:14:18 +00:00
Mark Brown
c7a83edf9d
Merge series "Add sanity checks for topology API calls" from Amadeusz Sławiński<amadeuszx.slawinski@linux.intel.com>:
Topology API exposes just 2 function calls, to load and unload topology.
This adds sanity checks to make sure that it behaves well when some of
parameters are set incoorectly or not needed.

This makes developer live easier by failing early instead of proceeding
on and then failing in unexpected ways.

As loading and unloading topology usually happens one the overhead of
additional checks should be negligible.

Amadeusz Sławiński (2):
  ASoC: topology: Ensure that needed parameters are set
  ASoC: topology: Check if ops is set before dereference

 sound/soc/soc-topology.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

--
2.25.1
2021-01-21 18:13:27 +00:00
Mark Brown
ff385c1f4c
Merge series "ASoC: sync parameter naming : rate / sample_bits" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

snd_pcm_runtime / snd_soc_dai / snd_soc_dai_driver / snd_soc_dai_link
have related parameter which is similar but not same naming.

	struct snd_pcm_runtime {
		...
(A)		unsigned int rate;
		...
(B)		unsigned int sample_bits;
		...
	};

	struct snd_soc_dai {
		...
(A)		unsigned int rate;
(B)		unsigned int sample_bits;
		...
	};

	struct snd_soc_dai_driver {
		...
(A)		unsigned int symmetric_rates:1;
(B)		unsigned int symmetric_samplebits:1;
		...
	};

	struct snd_soc_dai_link {
		...
(A)		unsigned int symmetric_rates:1;
(B)		unsigned int symmetric_samplebits:1;
		...
	};

Because it is similar but not same naming rule,
code can be verbose / can't share macro.

This patch-set sync naming rule
to struct snd_pcm_runtime base.

	- xxx_rates;
	+ xxx_rate;

	- xxx_samplebits;
	+ xxx_sample_bits;

Kuninori Morimoto (44):
  ASoC: soc-pcm: revert soc_pcm_apply_symmetry()
  ASoC: sync parameter naming : rate / sample_bits
  ASoC: adi: sync parameter naming (rate/sample_bits)
  ASoC: atmel: sync parameter naming (rate/sample_bits)
  ASoC: au1x: sync parameter naming (rate/sample_bits)
  ASoC: bcm: sync parameter naming (rate/sample_bits)
  ASoC: cirrus: sync parameter naming (rate/sample_bits)
  ASoC: tegra: sync parameter naming (rate/sample_bits)
  ASoC: rockchip: sync parameter naming (rate/sample_bits)
  ASoC: samsung: sync parameter naming (rate/sample_bits)
  ASoC: sh: sync parameter naming (rate/sample_bits)
  ASoC: ti: sync parameter naming (rate/sample_bits)
  ASoC: pxa: sync parameter naming (rate/sample_bits)
  ASoC: mediatek: sync parameter naming (rate/sample_bits)
  ASoC: fsl: sync parameter naming (rate/sample_bits)
  ASoC: wm*: sync parameter naming (rate/sample_bits)
  ASoC: tlv*: sync parameter naming (rate/sample_bits)
  ASoC: rt*: sync parameter naming (rate/sample_bits)
  ASoC: nau*: sync parameter naming (rate/sample_bits)
  ASoC: tas*: sync parameter naming (rate/sample_bits)
  ASoC: da*: sync parameter naming (rate/sample_bits)
  ASoC: es*: sync parameter naming (rate/sample_bits)
  ASoC: max*: sync parameter naming (rate/sample_bits)
  ASoC: cs*: sync parameter naming (rate/sample_bits)
  ASoC: tscs*: sync parameter naming (rate/sample_bits)
  ASoC: ak*: sync parameter naming (rate/sample_bits)
  ASoC: adau*: sync parameter naming (rate/sample_bits)
  ASoC: jz4740: sync parameter naming (rate/sample_bits)
  ASoC: sunxi: sync parameter naming (rate/sample_bits)
  ASoC: zl38060: sync parameter naming (rate/sample_bits)
  ASoC: ssm2602: sync parameter naming (rate/sample_bits)
  ASoC: sgtl5000: sync parameter naming (rate/sample_bits)
  ASoC: mc13783: sync parameter naming (rate/sample_bits)
  ASoC: mt6660: sync parameter naming (rate/sample_bits)
  ASoC: lochnagar-sc: sync parameter naming (rate/sample_bits)
  ASoC: ab8500: sync parameter naming (rate/sample_bits)
  ASoC: alc5632: sync parameter naming (rate/sample_bits)
  ASoC: cx2072x: sync parameter naming (rate/sample_bits)
  ASoC: inno_rk3036: sync parameter naming (rate/sample_bits)
  ASoC: lm49453: sync parameter naming (rate/sample_bits)
  ASoC: ml26124: sync parameter naming (rate/sample_bits)
  ASoC: soc-dai.h: remove symmetric_rates/samplebits
  ASoC: soc-pcm: cleanup soc_pcm_apply_symmetry()
  ASoC: soc-pcm: cleanup soc_pcm_params_symmetry()

 include/sound/soc-dai.h                    |  4 +-
 include/sound/soc.h                        |  4 +-
 sound/soc/adi/axi-i2s.c                    |  2 +-
 sound/soc/atmel/atmel-i2s.c                |  2 +-
 sound/soc/atmel/mchp-i2s-mcc.c             |  4 +-
 sound/soc/au1x/i2sc.c                      |  2 +-
 sound/soc/bcm/bcm2835-i2s.c                |  4 +-
 sound/soc/bcm/bcm63xx-i2s-whistler.c       |  2 +-
 sound/soc/cirrus/ep93xx-i2s.c              |  2 +-
 sound/soc/codecs/ab8500-codec.c            |  4 +-
 sound/soc/codecs/adau1372.c                |  2 +-
 sound/soc/codecs/adau1373.c                |  6 +-
 sound/soc/codecs/adau1701.c                |  2 +-
 sound/soc/codecs/ak4554.c                  |  2 +-
 sound/soc/codecs/ak4613.c                  |  2 +-
 sound/soc/codecs/ak4641.c                  |  4 +-
 sound/soc/codecs/ak4642.c                  |  2 +-
 sound/soc/codecs/alc5632.c                 |  2 +-
 sound/soc/codecs/cs35l32.c                 |  2 +-
 sound/soc/codecs/cs35l33.c                 |  2 +-
 sound/soc/codecs/cs35l34.c                 |  2 +-
 sound/soc/codecs/cs35l35.c                 |  2 +-
 sound/soc/codecs/cs35l36.c                 |  2 +-
 sound/soc/codecs/cs4234.c                  |  2 +-
 sound/soc/codecs/cs4271.c                  |  2 +-
 sound/soc/codecs/cs42l73.c                 |  6 +-
 sound/soc/codecs/cs43130.c                 |  6 +-
 sound/soc/codecs/cs4341.c                  |  2 +-
 sound/soc/codecs/cs4349.c                  |  2 +-
 sound/soc/codecs/cs47l15.c                 | 12 ++--
 sound/soc/codecs/cs47l24.c                 | 12 ++--
 sound/soc/codecs/cs47l35.c                 | 12 ++--
 sound/soc/codecs/cs47l85.c                 | 16 ++---
 sound/soc/codecs/cs47l90.c                 | 16 ++---
 sound/soc/codecs/cs47l92.c                 | 12 ++--
 sound/soc/codecs/cs53l30.c                 |  2 +-
 sound/soc/codecs/cx2072x.c                 |  2 +-
 sound/soc/codecs/da7210.c                  |  2 +-
 sound/soc/codecs/da7213.c                  |  2 +-
 sound/soc/codecs/da7218.c                  |  4 +-
 sound/soc/codecs/da7219.c                  |  4 +-
 sound/soc/codecs/da9055.c                  |  2 +-
 sound/soc/codecs/es8316.c                  |  2 +-
 sound/soc/codecs/es8328.c                  |  2 +-
 sound/soc/codecs/inno_rk3036.c             |  2 +-
 sound/soc/codecs/jz4740.c                  |  2 +-
 sound/soc/codecs/lm49453.c                 |  2 +-
 sound/soc/codecs/lochnagar-sc.c            | 12 ++--
 sound/soc/codecs/max9860.c                 |  2 +-
 sound/soc/codecs/max9867.c                 |  2 +-
 sound/soc/codecs/mc13783.c                 |  2 +-
 sound/soc/codecs/ml26124.c                 |  2 +-
 sound/soc/codecs/mt6660.c                  |  4 +-
 sound/soc/codecs/nau8810.c                 |  2 +-
 sound/soc/codecs/nau8822.c                 |  2 +-
 sound/soc/codecs/rt274.c                   |  2 +-
 sound/soc/codecs/rt286.c                   |  4 +-
 sound/soc/codecs/rt298.c                   |  4 +-
 sound/soc/codecs/rt5670.c                  |  4 +-
 sound/soc/codecs/sgtl5000.c                |  2 +-
 sound/soc/codecs/ssm2602.c                 |  4 +-
 sound/soc/codecs/tas2764.c                 |  2 +-
 sound/soc/codecs/tas2770.c                 |  2 +-
 sound/soc/codecs/tlv320adcx140.c           |  2 +-
 sound/soc/codecs/tlv320aic31xx.c           |  4 +-
 sound/soc/codecs/tlv320aic32x4.c           |  2 +-
 sound/soc/codecs/tlv320aic3x.c             |  2 +-
 sound/soc/codecs/tscs42xx.c                |  4 +-
 sound/soc/codecs/tscs454.c                 | 12 ++--
 sound/soc/codecs/wm5102.c                  | 12 ++--
 sound/soc/codecs/wm5110.c                  | 12 ++--
 sound/soc/codecs/wm8510.c                  |  2 +-
 sound/soc/codecs/wm8731.c                  |  2 +-
 sound/soc/codecs/wm8770.c                  |  2 +-
 sound/soc/codecs/wm8804.c                  |  2 +-
 sound/soc/codecs/wm8903.c                  |  2 +-
 sound/soc/codecs/wm8904.c                  |  2 +-
 sound/soc/codecs/wm8940.c                  |  2 +-
 sound/soc/codecs/wm8960.c                  |  2 +-
 sound/soc/codecs/wm8962.c                  |  2 +-
 sound/soc/codecs/wm8974.c                  |  2 +-
 sound/soc/codecs/wm8978.c                  |  2 +-
 sound/soc/codecs/wm8983.c                  |  2 +-
 sound/soc/codecs/wm8985.c                  |  2 +-
 sound/soc/codecs/wm8988.c                  |  2 +-
 sound/soc/codecs/wm8993.c                  |  2 +-
 sound/soc/codecs/wm8994.c                  |  4 +-
 sound/soc/codecs/wm8997.c                  |  8 +--
 sound/soc/codecs/wm8998.c                  | 12 ++--
 sound/soc/codecs/wm9713.c                  |  2 +-
 sound/soc/codecs/zl38060.c                 |  4 +-
 sound/soc/fsl/fsl_esai.c                   |  4 +-
 sound/soc/fsl/fsl_sai.c                    |  8 +--
 sound/soc/fsl/fsl_ssi.c                    |  4 +-
 sound/soc/jz4740/jz4740-i2s.c              |  2 +-
 sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 10 +--
 sound/soc/mediatek/mt6797/mt6797-dai-pcm.c |  8 +--
 sound/soc/mediatek/mt8173/mt8173-afe-pcm.c |  2 +-
 sound/soc/mediatek/mt8183/mt8183-dai-pcm.c |  8 +--
 sound/soc/mediatek/mt8192/mt8192-dai-pcm.c |  8 +--
 sound/soc/pxa/pxa2xx-i2s.c                 |  2 +-
 sound/soc/rockchip/rockchip_i2s.c          |  4 +-
 sound/soc/rockchip/rockchip_pdm.c          |  2 +-
 sound/soc/samsung/i2s.c                    |  2 +-
 sound/soc/samsung/pcm.c                    |  2 +-
 sound/soc/sh/rcar/core.c                   |  4 +-
 sound/soc/soc-pcm.c                        | 80 +++++++---------------
 sound/soc/soc-topology.c                   |  8 +--
 sound/soc/sunxi/sun4i-i2s.c                |  2 +-
 sound/soc/sunxi/sun8i-codec.c              | 12 ++--
 sound/soc/tegra/tegra186_dspk.c            |  2 +-
 sound/soc/tegra/tegra20_i2s.c              |  2 +-
 sound/soc/tegra/tegra210_dmic.c            |  2 +-
 sound/soc/tegra/tegra210_i2s.c             |  2 +-
 sound/soc/tegra/tegra30_i2s.c              |  2 +-
 sound/soc/ti/davinci-mcasp.c               |  2 +-
 116 files changed, 253 insertions(+), 283 deletions(-)

--
2.25.1
2021-01-21 18:13:25 +00:00
Mark Brown
1e924131e9
Merge series "Add KUNIT tests for ASoC topology" from Amadeusz Sławiński<amadeuszx.slawinski@linux.intel.com>:
This series adds unit tests for ASoC topology.

First fix problems found when developing and running test cases and
then add tests implementation.

Tests themselves are quite simple and just call
snd_soc_tplg_component_load() with various parameters and check the
result. Tests themselves are described in more detail in commits
adding them.

Goal is to expand the amount of test cases in following patches.

Prerequisity for this patchset are 2 patches which have already been
sent:
https://lore.kernel.org/alsa-devel/20210114163602.911205-1-amadeuszx.slawinski@linux.intel.com/T/#t

Description on how typical test case itself works:

In order to load topology we need to have 3 things:
card, codec component & platform component.

In typical test case we register card and platform component and bind
to dummy codec. There are of course execeptions, when we want to
test behaviour of topology API when component or card is missing.
Note that this is bit different from typical scenario (in SOF and skylake
drivers) where card is registered by machine driver and component by
platform driver, as we register both when setting up test.

If you check the test case most of them have similar architecture of:
1.
	/* run test */
	ret = snd_soc_register_card(&kunit_comp->card);
	if (ret != 0 && ret != -EPROBE_DEFER)
		KUNIT_FAIL(test, "Failed to register card");

2.
	ret = snd_soc_component_initialize(&kunit_comp->comp, &test_component, test_dev);
	KUNIT_EXPECT_EQ(test, 0, ret);

3.
	ret = snd_soc_add_component(&kunit_comp->comp, NULL, 0);
	KUNIT_EXPECT_EQ(test, 0, ret);

Ad. 1.
First we register card, which in most tests returns -EPROBE_DEFER
(from snd_soc_bind_card()), as platform component is not yet created.
I test for both 0 and -EPROBE_DEFER, as it makes it easier to reshuffle
this code around if needed and there is one test case which does it in
different order.

Ad. 2.
Then we initialize platform component with structure pointing at proper
probe function, which calls snd_soc_tplg_component_load() with test
parameters and checks expected result.

Ad. 3.
And then in follow up we call snd_soc_add_component() which creates
platform component for us and calls snd_soc_try_rebind_card() which
if everything is bound properly calls previously set probe function.

Amadeusz Sławiński (5):
  ASoC: topology: Properly unregister DAI on removal
  Revert "ASoC: soc-devres: add devm_snd_soc_register_dai()"
  ASoC: topology: KUnit: Add KUnit tests passing various arguments to
    snd_soc_tplg_component_load
  ASoC: topology: KUnit: Add KUnit tests passing empty topology with
    variants to snd_soc_tplg_component_load
  ASoC: topology: KUnit: Add KUnit tests passing topology with PCM to
    snd_soc_tplg_component_load

 include/sound/soc.h           |   4 -
 sound/soc/Kconfig             |  17 +
 sound/soc/Makefile            |   5 +
 sound/soc/soc-devres.c        |  37 --
 sound/soc/soc-topology-test.c | 843 ++++++++++++++++++++++++++++++++++
 sound/soc/soc-topology.c      |   9 +-
 6 files changed, 870 insertions(+), 45 deletions(-)
 create mode 100644 sound/soc/soc-topology-test.c

--
2.25.1
2021-01-21 18:13:24 +00:00
Shuming Fan
06c8456753
ASoC: rt5682: remove connection with LDO2 in DAPM graph
The application circuit shall provide MICVDD power.
In default, the codec driver doesn't need to enable LDO2.
In case, a board wants to use VBAT for micbias,
it should add a DAPM route which IN1P connects with LDO2 in the machine driver.
e.g. { "IN1P", NULL, "LDO2" },

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20210121100353.6402-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:40:24 +00:00
Kuninori Morimoto
3a90672111
ASoC: soc-pcm: cleanup soc_pcm_params_symmetry()
soc_pcm_params_symmetry() checks rate/channel/sample_bits state.
These are very similar but different, thus, it needs to have very
verbose code.
This patch use macro for it and make code more simple.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878s8un6si.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:22 +00:00
Kuninori Morimoto
fac110cbcd
ASoC: soc-pcm: cleanup soc_pcm_apply_symmetry()
soc_pcm_apply_symmetry() want to call snd_pcm_hw_constraint_single()
for rate/channel/sample_bits, but, it needs many condition checks.
These are very similar but different, thus, it needs to have very
verbose code.
This patch use macro for it and make code more simple.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6tan6sm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:21 +00:00
Kuninori Morimoto
fa31a2c787
ASoC: soc-dai.h: remove symmetric_rates/samplebits
All drivers are using new name.
Let's remove old one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bldqn6sr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:20 +00:00
Kuninori Morimoto
6944db0ab8
ASoC: ml26124: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87czy6n6t0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:19 +00:00
Kuninori Morimoto
3b940ecd2e
ASoC: lm49453: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eeimn6t4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:19 +00:00
Kuninori Morimoto
d5d396c8b0
ASoC: inno_rk3036: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ft32n6t8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:18 +00:00
Kuninori Morimoto
15d27c2b12
ASoC: cx2072x: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7nin6tc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:17 +00:00
Kuninori Morimoto
278eacf3dc
ASoC: alc5632: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87im7yn6th.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:16 +00:00
Kuninori Morimoto
6058bcb497
ASoC: ab8500: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0sen6tl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:15 +00:00
Kuninori Morimoto
65ba325625
ASoC: lochnagar-sc: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfcun6tp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:14 +00:00
Kuninori Morimoto
852d4daa96
ASoC: mt6660: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mtxan6tt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:13 +00:00
Kuninori Morimoto
23df7f69ff
ASoC: mc13783: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8hqn6ty.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:12 +00:00
Kuninori Morimoto
bea17630c4
ASoC: sgtl5000: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pn26n6u4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:11 +00:00
Kuninori Morimoto
4735c8cadd
ASoC: ssm2602: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1mmn6ub.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:10 +00:00
Kuninori Morimoto
b33c088a9b
ASoC: zl38060: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sg72n6ug.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:09 +00:00
Kuninori Morimoto
8138570861
ASoC: sunxi: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87turin6uk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:09 +00:00
Kuninori Morimoto
0547dece8d
ASoC: jz4740: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v9byn6uo.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:08 +00:00
Kuninori Morimoto
f88f45861b
ASoC: adau*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnwen6v8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:07 +00:00
Kuninori Morimoto
870b76ea7d
ASoC: ak*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2gun6vc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:06 +00:00
Kuninori Morimoto
9b4488efde
ASoC: tscs*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zh1an6vh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:05 +00:00
Kuninori Morimoto
260b668cf3
ASoC: cs*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871remolg1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:04 +00:00
Kuninori Morimoto
cb40d1b458
ASoC: max*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8735z2olg5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:03 +00:00
Kuninori Morimoto
4060064e8b
ASoC: es*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874kjiolga.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:02 +00:00
Kuninori Morimoto
1c6d1c4f68
ASoC: da*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875z3yolgf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:01 +00:00
Kuninori Morimoto
fa056c0736
ASoC: tas*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877doeolgk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:00 +00:00
Kuninori Morimoto
42c9b5bec1
ASoC: nau*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878s8uolgo.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:59 +00:00
Kuninori Morimoto
bc03b3910e
ASoC: rt*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6taolgs.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:59 +00:00
Kuninori Morimoto
a9aef184f7
ASoC: tlv*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bldqolgw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:58 +00:00
Kuninori Morimoto
0769575294
ASoC: wm*: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87czy6olh0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:57 +00:00
Kuninori Morimoto
cb2f6927fa
ASoC: fsl: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eeimolh5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:56 +00:00
Kuninori Morimoto
4b7ead032e
ASoC: mediatek: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ft32olha.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:55 +00:00
Kuninori Morimoto
c658b21858
ASoC: pxa: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7niolhf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:54 +00:00
Kuninori Morimoto
c756316f00
ASoC: ti: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87im7yolhk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:53 +00:00
Kuninori Morimoto
f1cd5f3bbc
ASoC: sh: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0seolho.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:52 +00:00
Kuninori Morimoto
d11ff0bf6a
ASoC: samsung: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfcuolhu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:51 +00:00
Kuninori Morimoto
fadaed3023
ASoC: rockchip: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mtxaolhz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:50 +00:00
Kuninori Morimoto
c6d152a8de
ASoC: tegra: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8hqoli4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:49 +00:00
Kuninori Morimoto
f1e6b04bab
ASoC: cirrus: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pn26oli8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:48 +00:00
Kuninori Morimoto
a8e940222b
ASoC: bcm: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1mmolie.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:47 +00:00
Kuninori Morimoto
3470c2398c
ASoC: au1x: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sg72olij.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:46 +00:00
Kuninori Morimoto
ba471f8d16
ASoC: atmel: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87turiolio.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:45 +00:00
Kuninori Morimoto
55d0056ba6
ASoC: adi: sync parameter naming (rate/sample_bits)
This patch syncs naming rule.

 - xxx_rates;
 + xxx_rate;

 - xxx_samplebits;
 + xxx_sample_bits;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v9byolj1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:44 +00:00
Kuninori Morimoto
f14654ddf2
ASoC: sync parameter naming : rate / sample_bits
snd_pcm_runtime / snd_soc_dai / snd_soc_dai_driver / snd_soc_dai_link
have related parameter which is similar but not same naming.

	struct snd_pcm_runtime {
		...
(A)		unsigned int rate;
		...
(B)		unsigned int sample_bits;
		...
	};

	struct snd_soc_dai {
		...
(A)		unsigned int rate;
(B)		unsigned int sample_bits;
		...
	};

	struct snd_soc_dai_driver {
		...
(A)		unsigned int symmetric_rates:1;
(B)		unsigned int symmetric_samplebits:1;
		...
	};

	struct snd_soc_dai_link {
		...
(A)		unsigned int symmetric_rates:1;
(B)		unsigned int symmetric_samplebits:1;
		...
	};

Because it is similar but not same naming rule,
code can be verbose / can't share macro.

This patch sync naming rule for framework.
	- xxx_rates;
	+ xxx_rate;

	- xxx_samplebits;
	+ xxx_sample_bits;

old name will be removed if all drivers were switched
to new naming rule.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnweolj6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:43 +00:00
Kuninori Morimoto
80f454e283
ASoC: soc-pcm: revert soc_pcm_apply_symmetry()
commit a39748d03c ("ASoC: soc-pcm: cleanup soc_pcm_apply_symmetry()")
was applied by miscommunication.
To more cleanup code, and to be easy review, this patch reverts it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2guoljm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:43 +00:00
Amadeusz Sławiński
9c88a98383
ASoC: topology: Check if ops is set before dereference
Topology can be created without ops overrides, in that case trying to
assign any value would lead to dereferencing NULL pointer.

Other places in code have either checks for tplg->ops or loop using
*_count variables, hence they can't dereference NULL pointer and there
is no need to add more checks.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20210114163602.911205-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:05 +00:00
Amadeusz Sławiński
d40ab86f7d
ASoC: topology: Ensure that needed parameters are set
As snd_soc_tplg_component_load is exported function, which means it is
part of API, there should be checks if it is called with proper
parameters.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20210114163602.911205-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:04 +00:00
Amadeusz Sławiński
3ad8c8e9ef
ASoC: topology: KUnit: Add KUnit tests passing topology with PCM to snd_soc_tplg_component_load
In order to ensure correct behaviour of topology API, add unit tests
exercising topology functionality.

Add topology containing PCM template and tests for parsing it. Also
adds test cases simulating modules reloads in case of separate drivers
for card and component.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210120152846.1703655-6-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:36:26 +00:00
Amadeusz Sławiński
cec9128dfc
ASoC: topology: KUnit: Add KUnit tests passing empty topology with variants to snd_soc_tplg_component_load
In order to ensure correct behaviour of topology API, add unit tests
exercising topology functionality.

Add "empty" topology template and tests for parsing it. Also adds few
variants with bad magic numbers.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210120152846.1703655-5-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:36:25 +00:00
Amadeusz Sławiński
d52bbf747c
ASoC: topology: KUnit: Add KUnit tests passing various arguments to snd_soc_tplg_component_load
In order to ensure correct behaviour of topology API, add unit tests
exercising topology functionality.

Start with adding cases for passing various arguments to
snd_soc_tplg_component_load as it is part of exposed topology API.

First test case adds test passing NULL component as argument.
Following one adds test case for passing NULL ops as argument.
Finally add test case passing NULL fw as argument.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210120152846.1703655-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:36:24 +00:00
Stephen Boyd
7dfe20ee92
ASoC: qcom: Fix number of HDMI RDMA channels on sc7180
Suspending/resuming with an HDMI dongle attached leads to crashes from
an audio regmap.

 Unable to handle kernel paging request at virtual address ffffffc018068000
 Mem abort info:
   ESR = 0x96000047
   EC = 0x25: DABT (current EL), IL = 32 bits
   SET = 0, FnV = 0
   EA = 0, S1PTW = 0
 Data abort info:
   ISV = 0, ISS = 0x00000047
   CM = 0, WnR = 1
 swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000081b12000
 [ffffffc018068000] pgd=0000000275d14003, pud=0000000275d14003, pmd=000000026365d003, pte=0000000000000000
 Internal error: Oops: 96000047 [#1] PREEMPT SMP
 Call trace:
  regmap_mmio_write32le+0x2c/0x40
  regmap_mmio_write+0x48/0x6c
  _regmap_bus_reg_write+0x34/0x44
  _regmap_write+0x100/0x150
  regcache_default_sync+0xc0/0x138
  regcache_sync+0x188/0x26c
  lpass_platform_pcmops_resume+0x48/0x54 [snd_soc_lpass_platform]
  snd_soc_component_resume+0x28/0x40
  soc_resume_deferred+0x6c/0x178
  process_one_work+0x208/0x3c8
  worker_thread+0x23c/0x3e8
  kthread+0x144/0x178
  ret_from_fork+0x10/0x18
 Code: d503201f d50332bf f94002a8 8b344108 (b9000113)

I can reliably reproduce this problem by running 'tail' on the registers
file in debugfs for the hdmi regmap.

 # tail /sys/kernel/debug/regmap/62d87000.lpass-lpass_hdmi/registers
 [   84.658733] Unable to handle kernel paging request at virtual address ffffffd0128e800c

This crash happens because we're trying to read registers from the
regmap beyond the length of the mapping created by ioremap().

The number of hdmi_rdma_channels determines the size of the regmap via
this code in sound/soc/qcom/lpass-cpu.c:

  lpass_hdmi_regmap_config.max_register = LPAIF_HDMI_RDMAPER_REG(variant, variant->hdmi_rdma_channels);

According to debugfs the size of the regmap is 0x68010 but according to
the DTS file posted in [1] the size is only 0x68000 (see the first reg
property of the lpass_cpu node). Let's change the number of channels to
be 3 instead of 4 so the math works out to have a max register of
0x67010, nicely fitting inside of the region size of 0x68000.

Note: I tried to bump up the size of the register region to the next
page to include the 0x68010 register but then the tail command caused
SErrors with an async abort, implying that the register region doesn't
exist or it isn't clocked because the bus is telling us that the
register read failed. I reduce the number of channels and played audio
through the HDMI channel and it kept working so I think this is correct.

Fixes: 2ad63dc8df ("ASoC: qcom: sc7180: Add support for audio over DP")
Link: https://lore.kernel.org/r/1601448168-18396-2-git-send-email-srivasam@codeaurora.org [1]
Cc: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210115203329.846824-1-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:35:41 +00:00
Takashi Iwai
85db1cfb13 ALSA: usb-audio: Fix "RANGE setting not yet supported" errors
At probing a UAC2/UAC3 device like NUX MG-300 USB interface, we get
error messages "RANGE setting not yet supported".  It comes the place
where the driver tries to determine the resolution of mixer volumes
via SET_CUR_RES and GET_CUR_RES verbs.  Those verbs aren't supported
on UAC2 and UAC3, hence the driver warns like the above.  Although the
driver handles this error and works as expected, it's still ugly to
show such errors unnecessarily.

This patch papers over the errors by applying the resolution detection
only for UAC1 and skipping it for UAC2/UAC3.

Reported-by: Mike Oliphant <oliphant@nostatic.org>
Link: https://lore.kernel.org/r/20210120213932.1971-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-21 12:47:19 +01:00
Takashi Iwai
086b957cc1 ALSA: usb-audio: Skip the clock selector inquiry for single connections
The current USB-audio driver gets an error at probing NUX MG-300 about
parsing the clocks.  This is because the firmware doesn't return the
proper connection of the clock selector that is connected to a single
clock; it's likely that the firmware was lazy^w optimized and the
inquiry wasn't handled.  Actually it makes little sense to inquire and
set up the single connection explicitly.

This patch fixes the issue by simply skipping the clock selector
inquiry if it's a single connection.

Reported-by: Mike Oliphant <oliphant@nostatic.org>
Link: https://lore.kernel.org/r/20210120213932.1971-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-21 12:47:06 +01:00
Mark Brown
879a67e357
Merge series "ASoC: mediatek: mt8192-mt6359: support DP audio" from Tzung-Bi Shih <tzungbi@google.com>:
The 1st and 2nd patches refactor the machine driver.

The 3rd patch changes the platform driver to support TDM 8 channel output.

The 4th patch adds an optional DT property.

The 5th patch makes the machine driver support DP audio if the optional DT
property is specified.

Tzung-Bi Shih (5):
  ASoC: mediatek: mt8192-mt6359: move headset_jack to card specific data
  ASoC: mediatek: mt8192-mt6359: simplify mt8192_rt5682_init
  ASoC: mediatek: mt8192: change mclk_multiple of TDM from 128 to 512
  ASoC: dt-bindings: mt8192-mt6359: add hdmi-codec property
  ASoC: mediatek: mt8192-mt6359: support audio over DP

 .../sound/mt8192-mt6359-rt1015-rt5682.yaml    |  5 ++
 sound/soc/mediatek/mt8192/mt8192-dai-tdm.c    |  2 +-
 .../mt8192/mt8192-mt6359-rt1015-rt5682.c      | 54 ++++++++++++++++---
 3 files changed, 52 insertions(+), 9 deletions(-)

--
2.30.0.284.gd98b1dd5eaa7-goog
2021-01-21 00:00:58 +00:00
Mark Brown
55331b550f
Merge series "ASoC: remove obsolete drivers" from Arnd Bergmann <arnd@kernel.org>
Arnd Bergmann <arnd@arndb.de>:

From: Arnd Bergmann <arnd@arndb.de>

A few Arm platforms are getting removed in v5.12, this removes
the corresponding sound drivers.

Link: https://lore.kernel.org/linux-arm-kernel/20210120124812.2800027-1-arnd@kernel.org/T/

Arnd Bergmann (2):
  ASoC: remove sirf prima/atlas drivers
  ASoC: remove zte zx drivers

 .../bindings/sound/sirf-audio-codec.txt       |  17 -
 .../devicetree/bindings/sound/sirf-usp.txt    |  27 -
 .../devicetree/bindings/sound/zte,tdm.txt     |  30 -
 .../bindings/sound/zte,zx-aud96p22.txt        |  24 -
 .../devicetree/bindings/sound/zte,zx-i2s.txt  |  45 --
 .../bindings/sound/zte,zx-spdif.txt           |  27 -
 sound/soc/Kconfig                             |   2 -
 sound/soc/Makefile                            |   2 -
 sound/soc/codecs/Makefile                     |   4 -
 sound/soc/codecs/sirf-audio-codec.c           | 575 ------------------
 sound/soc/codecs/zx_aud96p22.c                | 401 ------------
 sound/soc/sirf/Kconfig                        |  21 -
 sound/soc/sirf/Makefile                       |   8 -
 sound/soc/sirf/sirf-audio-port.c              |  86 ---
 sound/soc/sirf/sirf-audio.c                   | 160 -----
 sound/soc/sirf/sirf-usp.c                     | 435 -------------
 sound/soc/sirf/sirf-usp.h                     | 292 ---------
 sound/soc/zte/Kconfig                         |  26 -
 sound/soc/zte/Makefile                        |   4 -
 sound/soc/zte/zx-i2s.c                        | 452 --------------
 sound/soc/zte/zx-spdif.c                      | 363 -----------
 sound/soc/zte/zx-tdm.c                        | 458 --------------
 22 files changed, 3459 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/sirf-audio-codec.txt
 delete mode 100644 Documentation/devicetree/bindings/sound/sirf-usp.txt
 delete mode 100644 Documentation/devicetree/bindings/sound/zte,tdm.txt
 delete mode 100644 Documentation/devicetree/bindings/sound/zte,zx-aud96p22.txt
 delete mode 100644 Documentation/devicetree/bindings/sound/zte,zx-i2s.txt
 delete mode 100644 Documentation/devicetree/bindings/sound/zte,zx-spdif.txt
 delete mode 100644 sound/soc/codecs/sirf-audio-codec.c
 delete mode 100644 sound/soc/codecs/zx_aud96p22.c
 delete mode 100644 sound/soc/sirf/Kconfig
 delete mode 100644 sound/soc/sirf/Makefile
 delete mode 100644 sound/soc/sirf/sirf-audio-port.c
 delete mode 100644 sound/soc/sirf/sirf-audio.c
 delete mode 100644 sound/soc/sirf/sirf-usp.c
 delete mode 100644 sound/soc/sirf/sirf-usp.h
 delete mode 100644 sound/soc/zte/Kconfig
 delete mode 100644 sound/soc/zte/Makefile
 delete mode 100644 sound/soc/zte/zx-i2s.c
 delete mode 100644 sound/soc/zte/zx-spdif.c
 delete mode 100644 sound/soc/zte/zx-tdm.c

--
2.29.2
2021-01-21 00:00:56 +00:00
Mark Brown
411fc208eb
Merge series "ASoC: qcom: Fix broken lpass driver" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
LPASS driver is partially broken on DragonBoard DB410c on 5.10 and
its totally broken on other Supported Qualcomm SoCs.

This was due to DAI ids being over written by the SoC specific header files
in the dt-bindings.

Idea of having SoC specific headers is not doable when we are dealing with
a common driver. So this patchset attempts to fix this properly by creating
a common dt-bindings header for lpass which can be updated with new entries
if required. This patchset also add an simple of_xlate function to resolve
the dai names and different SoCs might not have 1:1 mapping for the
dai_driver array with dai ids.

Changes since v1:
	- removed array indexes as suggested by Stephan G.
	- rebased to sound/for-next branch
	- collected Srinivasa tested-by tag for sc7180 platform.

Thanks,
srini

Srinivas Kandagatla (2):
  ASoC: dt-bindings: lpass: Fix and common up lpass dai ids
  ASoC: qcom: Fix broken support to MI2S TERTIARY and QUATERNARY

 include/dt-bindings/sound/apq8016-lpass.h |  7 +++----
 include/dt-bindings/sound/qcom,lpass.h    | 15 +++++++++++++++
 include/dt-bindings/sound/sc7180-lpass.h  |  6 ++----
 sound/soc/qcom/lpass-cpu.c                | 22 ++++++++++++++++++++++
 sound/soc/qcom/lpass-platform.c           | 12 ++++++++++++
 sound/soc/qcom/lpass-sc7180.c             |  9 +++------
 sound/soc/qcom/lpass.h                    |  2 +-
 7 files changed, 58 insertions(+), 15 deletions(-)
 create mode 100644 include/dt-bindings/sound/qcom,lpass.h

--
2.21.0
2021-01-21 00:00:54 +00:00
Mark Brown
d146c7b0fe
Merge series "ASoC: mediatek: mt8183: ignore TDM DAI link by by default" from Tzung-Bi Shih <tzungbi@google.com>:
hdmi-codec is an optional property.  The 2 patches fix DAI link binding
error when the property doesn't exist in DTS.

Tzung-Bi Shih (2):
  ASoC: mediatek: mt8183-mt6358: ignore TDM DAI link by default
  ASoC: mediatek: mt8183-da7219: ignore TDM DAI link by default

 sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c         | 5 ++++-
 sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

--
2.30.0.284.gd98b1dd5eaa7-goog
2021-01-21 00:00:53 +00:00
Mark Brown
29be3f0263
Merge series "Add KUNIT tests for ASoC topology" from Amadeusz Sławiński<amadeuszx.slawinski@linux.intel.com>:
This series adds unit tests for ASoC topology.

First fix problems found when developing and running test cases and
then add tests implementation.

Tests themselves are quite simple and just call
snd_soc_tplg_component_load() with various parameters and check the
result. Tests themselves are described in more detail in commits
adding them.

Goal is to expand the amount of test cases in following patches.

Prerequisity for this patchset are 2 patches which have already been
sent:
https://lore.kernel.org/alsa-devel/20210114163602.911205-1-amadeuszx.slawinski@linux.intel.com/T/#t

Description on how typical test case itself works:

In order to load topology we need to have 3 things:
card, codec component & platform component.

In typical test case we register card and platform component and bind
to dummy codec. There are of course execeptions, when we want to
test behaviour of topology API when component or card is missing.
Note that this is bit different from typical scenario (in SOF and skylake
drivers) where card is registered by machine driver and component by
platform driver, as we register both when setting up test.

If you check the test case most of them have similar architecture of:
1.
	/* run test */
	ret = snd_soc_register_card(&kunit_comp->card);
	if (ret != 0 && ret != -EPROBE_DEFER)
		KUNIT_FAIL(test, "Failed to register card");

2.
	ret = snd_soc_component_initialize(&kunit_comp->comp, &test_component, test_dev);
	KUNIT_EXPECT_EQ(test, 0, ret);

3.
	ret = snd_soc_add_component(&kunit_comp->comp, NULL, 0);
	KUNIT_EXPECT_EQ(test, 0, ret);

Ad. 1.
First we register card, which in most tests returns -EPROBE_DEFER
(from snd_soc_bind_card()), as platform component is not yet created.
I test for both 0 and -EPROBE_DEFER, as it makes it easier to reshuffle
this code around if needed and there is one test case which does it in
different order.

Ad. 2.
Then we initialize platform component with structure pointing at proper
probe function, which calls snd_soc_tplg_component_load() with test
parameters and checks expected result.

Ad. 3.
And then in follow up we call snd_soc_add_component() which creates
platform component for us and calls snd_soc_try_rebind_card() which
if everything is bound properly calls previously set probe function.

Amadeusz Sławiński (5):
  ASoC: topology: Properly unregister DAI on removal
  Revert "ASoC: soc-devres: add devm_snd_soc_register_dai()"
  ASoC: topology: KUnit: Add KUnit tests passing various arguments to
    snd_soc_tplg_component_load
  ASoC: topology: KUnit: Add KUnit tests passing empty topology with
    variants to snd_soc_tplg_component_load
  ASoC: topology: KUnit: Add KUnit tests passing topology with PCM to
    snd_soc_tplg_component_load

 include/sound/soc.h           |   4 -
 sound/soc/Kconfig             |  17 +
 sound/soc/Makefile            |   5 +
 sound/soc/soc-devres.c        |  37 --
 sound/soc/soc-topology-test.c | 843 ++++++++++++++++++++++++++++++++++
 sound/soc/soc-topology.c      |   9 +-
 6 files changed, 870 insertions(+), 45 deletions(-)
 create mode 100644 sound/soc/soc-topology-test.c

--
2.25.1
2021-01-21 00:00:52 +00:00
Arnd Bergmann
dc98f1d655
ASoC: remove zte zx drivers
The zte zx platform is getting removed, so this driver is no
longer needed.

Cc: Jun Nie <jun.nie@linaro.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210120162553.21666-3-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 21:23:31 +00:00
Arnd Bergmann
61fbeb5dcb
ASoC: remove sirf prima/atlas drivers
The CSR SiRF prima2/atlas platforms are getting removed, so this driver
is no longer needed.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Barry Song <baohua@kernel.org>
Link: https://lore.kernel.org/r/20210120162553.21666-2-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 21:23:21 +00:00
Takashi Iwai
506c203cc3 ALSA: usb-audio: Fix hw constraints dependencies
Since the recent refactoring, it's been reported that some USB-audio
devices (typically webcams) are no longer detected properly by
PulseAudio.  The debug session revealed that it's failing at probing
by PA to try the sample rate 44.1kHz while the device has discrete
sample rates other than 44.1kHz.  But the puzzle was that arecord
works as is, and some other devices with the discrete rates work,
either.

After all, this turned out to be the lack of the dependencies in a few
hw constraint rules: snd_pcm_hw_rule_add() has the (variable)
arguments specifying the dependent parameters, and some functions
didn't set the target parameter itself as the dependencies.  This
resulted in an invalid parameter that could be generated only in a
certain call pattern.  This bug itself has been present in the code,
but it didn't trigger errors just because the rules were casually
avoiding such a corner case.  After the recent refactoring and
cleanup, however, the hw constraints work "as expected", and the
problem surfaced now.

For fixing the problem above, this patch adds the missing dependent
parameters to each snd_pcm_hw_rule() call.

Fixes: bc4e94aa8e ("ALSA: usb-audio: Handle discrete rates properly in hw constraints")
BugLink: http://bugzilla.opensuse.org/show_bug.cgi?id=1181014
Link: https://lore.kernel.org/r/20210120204554.30177-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-20 21:46:45 +01:00
Fabio Estevam
4e63b56593
ASoC: fsl_spdif: Remove of_device_get_match_data() error check
The only way this driver can be probed is via devicetree, which always
provides driver data.

Remove the unneeded of_device_get_match_data() error check, as it
can never fail.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210118123815.1630882-6-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:47:35 +00:00
Fabio Estevam
1ccf6e6ef9
ASoC: fsl_esai: Remove of_device_get_match_data() error check
The only way this driver can be probed is via devicetree, which always
provides driver data.

Remove the unneeded of_device_get_match_data() error check, as it
can never fail.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210118123815.1630882-5-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:47:34 +00:00
Fabio Estevam
214172a9ca
ASoC: fsl_asrc: Remove of_device_get_match_data() error check
The only way this driver can be probed is via devicetree, which always
provides driver data.

Remove the unneeded of_device_get_match_data() error check, as it
can never fail.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210118123815.1630882-4-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:47:33 +00:00
Fabio Estevam
42450175a3
ASoC: fsl_xcvr: Remove unused of_id variable
The of_id variable is not used, so just remove it.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210118123815.1630882-3-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:47:32 +00:00
Fabio Estevam
d7388718d4
ASoC: fsl_micfil: Use of_device_get_match_data()
The retrieval of driver data via of_device_get_match_data() can make
the code simpler.

Use of_device_get_match_data() to simplify the code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210118123815.1630882-2-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:47:31 +00:00
Fabio Estevam
9ce63203eb
ASoC: fsl_ssi: Use of_device_get_match_data()
The retrieval of driver data via of_device_get_match_data() can make
the code simpler.

Use of_device_get_match_data() to simplify the code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210118123815.1630882-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:47:30 +00:00
Tzung-Bi Shih
0d80c48c84
ASoC: mediatek: mt8192-mt6359: support audio over DP
If the DTS property is specified, the DP bridge should populate a
"hdmi-codec" platform device (sound/soc/codecs/hdmi-codec.c).

The "hdmi-codec" device is the communication relayer between the ASoC
machine driver and the DP bridge.  For example:
- Notifies DP bridge when setting hw_param.
- Notifies ASoC when jack detection events.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210120080850.699354-6-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:46:51 +00:00
Tzung-Bi Shih
df369921d7
ASoC: mediatek: mt8192: change mclk_multiple of TDM from 128 to 512
mclk = rate * mclk_multiple
bclk = rate * channel * sample_width

If TDM outputs 8 channels and 32 bits, bclk will be greater than mclk.

Changes the ratio from 128 to 512.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210120080850.699354-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:46:50 +00:00
Tzung-Bi Shih
12295ef970
ASoC: mediatek: mt8192-mt6359: simplify mt8192_rt5682_init
Returns snd_soc_component_set_jack() directly in mt8192_rt5682_init.
No need to have another block to check the return value.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210120080850.699354-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:46:49 +00:00
Tzung-Bi Shih
4e37528a97
ASoC: mediatek: mt8192-mt6359: move headset_jack to card specific data
Moves headset_jack to card specific data.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210120080850.699354-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:46:48 +00:00
Tzung-Bi Shih
4d36ed8eb0
ASoC: mediatek: mt8183-da7219: ignore TDM DAI link by default
hdmi-codec is an optional property.  Ignore to bind TDM DAI link
if the property isn't specified.

Fixes: 5bdbe97711 ("ASoC: mediatek: mt8183-da7219: use hdmi-codec")
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210120092237.1553938-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:45:34 +00:00
Tzung-Bi Shih
5ac154443e
ASoC: mediatek: mt8183-mt6358: ignore TDM DAI link by default
hdmi-codec is an optional property.  Ignore to bind TDM DAI link
if the property isn't specified.

Fixes: f2024dc55f ("ASoC: mediatek: mt8183: use hdmi-codec")
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210120092237.1553938-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:45:33 +00:00
Amadeusz Sławiński
fc4cb1e15f
ASoC: topology: Properly unregister DAI on removal
DAIs need to be removed when topology unload function is called (usually
done when component is being removed). We can't do this when device is
being removed, as structures we operate on when removing DAI can already
be freed.

Fixes: 6ae4902f2f ("ASoC: soc-topology: use devm_snd_soc_register_dai()")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210120152846.1703655-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 18:44:52 +00:00
Dan Carpenter
543466ef35
ASoC: topology: Fix memory corruption in soc_tplg_denum_create_values()
The allocation uses sizeof(u32) when it should use sizeof(unsigned long)
so it leads to memory corruption later in the function when the data is
initialized.

Fixes: 5aebe7c7f9 ("ASoC: topology: fix endianness issues")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YAf+8QZoOv+ct526@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 16:46:48 +00:00
Srinivas Kandagatla
1e066a23e7
ASoC: qcom: lpass-ipq806x: fix bitwidth regmap field
BIT_WIDTH field in I2S_CTL register is two bits wide, however
recent regmap field conversion patch trimmed it down to one bit.
Fix this by correcting the bit range!

Fixes: b5022a36d2 ("ASoC: qcom: lpass: Use regmap_field for i2sctl and dmactl registers")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210119174700.32639-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 16:46:47 +00:00
Jaroslav Kysela
40caffd66c
ASoC: AMD Renoir - refine DMI entries for some Lenovo products
Apparently, the DMI board name LNVNB161216 is also used also
for products with the digital microphones connected to the AMD's
audio bridge. Refine the DMI table - use product name identifiers
extracted from https://bugzilla.redhat.com/show_bug.cgi?id=1892115 .

The report for Lenovo Yoga Slim 7 14ARE05 (82A2) is in buglink.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211299
Cc: <stable@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210120144211.817937-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 16:46:46 +00:00
Srinivas Kandagatla
cd3484f7f1
ASoC: qcom: Fix broken support to MI2S TERTIARY and QUATERNARY
lpass hdmi support patch totally removed support for MI2S TERTIARY
and QUATERNARY.

One of the major issue was spotted with the design of having
separate SoC specific header files for the common lpass driver.
This design is prone to break as an when new SoC header is added
as the common DAI ids of other SoCs will be overwritten by the
new ones.

Having a common header qcom,lpass.h should fix the issue and any new
DAI ids should be added to the common header.

With this change lpass also needs a new of_xlate function to resolve
dai name.

Fixes: 7cb37b7bd0 ("ASoC: qcom: Add support for lpass hdmi driver")
Reported-by: Jun Nie <jun.nie@linaro.org>
Reported-by: Stephan Gerhold <stephan@gerhold.net>
Tested-by: Srinivasa Rao <srivasam@codeaurora.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210119171527.32145-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20 16:46:45 +00:00
Mark Brown
6b050d45a6
Merge series "Tegra210 audio graph card" from Sameer Pujar <spujar@nvidia.com>:
This series adds audio graph based sound card support for Tegra210
platforms like Jetson-TX1 an Jetson-Nano. The following preparatory
audio graph enhancement series is already merged.
 * https://patchwork.kernel.org/project/alsa-devel/list/?series=375629&state=*

Following are the summary of changes:
 * Add graph/audio-graph based schemas or schema updates for Tegra210
   component and machine drivers.
 * Add Tegra audio graph machine driver.
 * Add required DT support for Jetson-TX1/Nano.

This work is based on earlier discussion of DPCM usage for Tegra
and simple card driver updates.
 * https://lkml.org/lkml/2020/4/30/519
 * https://lkml.org/lkml/2020/6/27/4

Original v6 series was sent about 6-7 weeks back. The dependency commit,
https://lore.kernel.org/alsa-devel/1610948585-16286-1-git-send-email-spujar@nvidia.com/
is now merged. Resending this now to appear in the top of the mail list.

Changelog
=========

v5 -> v6
--------
 * Added ports or port description in YAML docs for Tegra AHUB
   devices and graph card in patch 1/6 and 2/6. Reference of
   audio-graph-port.yaml is used for AHUB devices.
 * Dropped redundant NULL check return for of_device_get_match_data()
   in patch 3/6.
 * Added 'Reviewed-by' tag from Jon Hunter.
 * No changes in remaining patches.

v4 -> v5
--------
 * Audio graph related changes were sent in separate v5 series as
   mentioned above and are dropped from current series.
 * Graph and audio graph doc patches are dropped from this series
   and are sent separately as mentioned above.
 * Minor change with phandle label for TX1 and Nano platform DT files.
 * No changes in other patches.

v3 -> v4
--------
 * Added new patches to convert graph.txt and audio-graph-card.txt
   to corresponding json-schema files. Later these references
   are used in Tegra audio graph schema.

 * AHUB component binding docs are updated to reflect the usage
   of ports/port/endpoint

 * More common stuff is moved into graph_parse_of() and this is
   used by both generic and Tegra audio graph.

 * DT binding for Tegra audio graph is updated to included "ports { }"

 * As per the suggestion 'void *data' member is dropped from
   'asoc_simple_priv' and instead container method is used to
   maintain required custom data internal to Tegra audio graph.

v2 -> v3
--------
 * Dropped new compatible addition in generic graph driver
   after reviewing it with Morimoto-san. Instead added Tegra
   audio graph driver and new compatibles are added in the same.
 * Added new patches to expose new members for customization
   in audio graph driver.
 * Added new patch for Tegra audio graph driver and related
   documentation.
 * Minor change in below commit where mutex version of helper is used
   "ASoC: audio-graph: Identify 'no_pcm' DAI links for DPCM"
 * DT binding is updated to use the newly exposed compatibles
 * No changes in other patches

v1 -> v2
--------
 * Re-organized ports/endpoints description for ADMAIF and XBAR.
   Updated DT patches accordingly.
 * After above change, multiple Codec endpoint support is not
   required and hence dropped for now. This will be considered
   separately if at all required in future.
 * Re-ordered patches in the series.

Sameer Pujar (6):
  ASoC: dt-bindings: tegra: Add graph bindings
  ASoC: dt-bindings: tegra: Add json-schema for Tegra audio graph card
  ASoC: tegra: Add audio graph based card driver
  arm64: defconfig: Enable Tegra audio graph card driver
  arm64: tegra: Audio graph header for Tegra210
  arm64: tegra: Audio graph sound card for Jetson Nano and TX1

 .../sound/nvidia,tegra-audio-graph-card.yaml       | 187 +++++++++++++++
 .../bindings/sound/nvidia,tegra186-dspk.yaml       |  18 +-
 .../bindings/sound/nvidia,tegra210-admaif.yaml     |  13 +-
 .../bindings/sound/nvidia,tegra210-ahub.yaml       |  13 +-
 .../bindings/sound/nvidia,tegra210-dmic.yaml       |  18 +-
 .../bindings/sound/nvidia,tegra210-i2s.yaml        |  18 +-
 .../boot/dts/nvidia/tegra210-audio-graph.dtsi      | 153 ++++++++++++
 arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 262 +++++++++++++++++++++
 arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 146 ++++++++++++
 arch/arm64/configs/defconfig                       |   1 +
 sound/soc/tegra/Kconfig                            |   9 +
 sound/soc/tegra/Makefile                           |   2 +
 sound/soc/tegra/tegra_audio_graph_card.c           | 251 ++++++++++++++++++++
 13 files changed, 1085 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml
 create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi
 create mode 100644 sound/soc/tegra/tegra_audio_graph_card.c

--
2.7.4
2021-01-19 16:20:13 +00:00
Mark Brown
9769243240
Merge series "ASoC: Simplify with dma_set_mask_and_coherent()" from Takashi Iwai <tiwai@suse.de>:
Simple conversions from two dma_set_mask*() calls into the single
dma_set_mask_and_coherent().

Just a minor code refactoring, no functional changes.

Takashi

===

Takashi Iwai (3):
  ASoC: intel: skl: Simplify with dma_set_mask_and_coherent()
  ASoC: SOF: intel: Simplify with dma_set_mask_and_coherent()
  ASoC: tegra: Simplify with dma_set_mask_and_coherent()

 sound/soc/intel/skylake/skl.c | 8 ++------
 sound/soc/sof/intel/hda.c     | 8 ++------
 sound/soc/tegra/tegra_pcm.c   | 6 +-----
 3 files changed, 5 insertions(+), 17 deletions(-)

--
2.26.2
2021-01-19 16:20:12 +00:00
Kai-Heng Feng
2b73649cee ALSA: hda: Balance runtime/system PM if direct-complete is disabled
After hibernation, HDA controller can't be runtime-suspended after
commit 215a22ed31 ("ALSA: hda: Refactor codjc PM to use
direct-complete optimization"), which enables direct-complete for HDA
codec.

The HDA codec driver didn't expect direct-complete will be disabled
after it returns a positive value from prepare() callback. However,
there are some places that PM core can disable direct-complete. For
instance, system hibernation or when codec has subordinates like LEDs.

So if the codec is prepared for direct-complete but PM core still calls
codec's suspend or freeze callback, partially revert the commit and take
the original approach, which uses pm_runtime_force_*() helpers to
ensure PM refcount are balanced. Meanwhile, still keep prepare() and
complete() callbacks to enable direct-complete and request a resume for
jack detection, respectively.

Reported-by: Kenneth R. Crudup <kenny@panix.com>
Fixes: 215a22ed31 ("ALSA: hda: Refactor codec PM to use direct-complete optimization")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20210119152145.346558-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-19 16:42:39 +01:00
Tony Lindgren
0dedbde506
ASoC: cpcap: Implement set_tdm_slot for voice call support
ASoC: cpcap: Implement set_tdm_slot for voice call support

For using cpcap for voice calls, we need to route audio directly from
the modem to cpcap for TDM (Time Division Multiplexing). The voice call
is direct data between the modem and cpcap with no CPU involvment. In
this mode, the cpcap related audio mixer controls work for the speaker
selection and volume though.

To do this, we need to implement standard snd_soc_dai_set_tdm_slot()
for cpcap. Then the modem codec driver can use snd_soc_dai_set_sysclk(),
snd_soc_dai_set_fmt(), and snd_soc_dai_set_tdm_slot() to configure a
voice call.

Let's add cpcap_voice_set_tdm_slot() for this, and cpcap_voice_call()
helper to configure the additional registers needed for voice call.

Let's also clear CPCAP_REG_VAUDIOC on init in case we have the bit for
CPCAP_BIT_VAUDIO_MODE0 set on init.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Link: https://lore.kernel.org/r/20210112174704.GA13496@duo.ucw.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-19 14:09:24 +00:00
Yu-Hsuan Hsu
7f1f7ae102
ASoC: cros_ec_codec: Reset I2S RX when probing
It is not guaranteed that I2S RX is disabled when the kernel booting.
For example, if the kernel crashes while it is enabled, it will keep
enabled until the next time EC reboots. Reset I2S RX when probing to
fix this issue.

Signed-off-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210115075301.47995-2-yuhsuan@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-19 14:09:23 +00:00
Sameer Pujar
202e2f7745
ASoC: tegra: Add audio graph based card driver
Add Tegra audio machine driver which is based on generic audio graph card
driver. It re-uses most of the common stuff from audio graph driver and
uses the same DT binding. Required Tegra specific customizations are done
in the driver and additional DT bindings are required for clock handling.

Details on the customizations done:

 - Update PLL rates at runtime: Tegra HW supports multiple sample rates
   (multiples of 8x and 11.025x) and both of these groups require different
   PLL rates. Hence there is a requirement to update this at runtime.
   This is achieved by providing a custom 'snd_soc_ops' and in hw_param()
   callback PLL rate is updated as per the sample rate.

 - Internal structure 'tegra_audio_graph_data' is used to maintain clock
   handles of PLL.

 - The 'force_dpcm' flag is set to use DPCM for all DAI links.

 - The 'component_chaining' flag is set to use DPCM with component model.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/1611048496-24650-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-19 14:09:21 +00:00
Takashi Iwai
7cc206bff6
ASoC: tegra: Simplify with dma_set_mask_and_coherent()
ASoC tegra PCM code still has explicit calls of dma_set_mask() and
dma_set_coherent_mask().

Let's simplify with dma_set_mask_and_coherent().

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210114133337.1039-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-19 14:06:12 +00:00
Takashi Iwai
ab152afa24
ASoC: SOF: intel: Simplify with dma_set_mask_and_coherent()
ASoC Intel SOF driver still has explicit calls of dma_set_mask() and
dma_set_coherent_mask().

Let's simplify with dma_set_mask_and_coherent().

Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210114133337.1039-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-19 14:06:11 +00:00
Takashi Iwai
d3afb00220
ASoC: intel: skl: Simplify with dma_set_mask_and_coherent()
ASoC Intel Skylake driver still has explicit calls of dma_set_mask()
and dma_set_coherent_mask().

Let's simplify with dma_set_mask_and_coherent().

Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210114133337.1039-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-19 14:06:10 +00:00
Takashi Iwai
c23010ffb2 ASoC: Fixes for v5.11
A few more fixes for v5.11, mostly around HDA jack detection, plus
 a couple of updates to the MAINTAINERS entries.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmAFySkACgkQJNaLcl1U
 h9B0Igf/dSyq+7vms1sxYUMxLEN0TYjk+JmAuGx8ZjoZKvCCMB7hGKuhRhlwfodE
 TmO5R0dxwkeNuDVADCh8PtGUebUfhxGpsbOAQazfrmeLKSeTka8YgEY/JM0p5GPy
 FxOIOCKxUyD9HGtpgmpRKxWqLPDrEuwmvxpY4BGWkoglOKaAgZLDBFWPoMQVNYfX
 XI52nGgVNHVrVnLRaRsU+qrwnBku+JHJJhZxwwklVup85FMExNKDeTAyEZ4Y9Rjx
 Cr/Oc/wi3rmf88U+y4ZBwKlbPjKJ5+Rt7V94a/OCtjg516GNztho8qh6luh+9zIZ
 Sn//tmS57+emudk6LEZISvZhm29Cjg==
 =cv6S
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.11

A few more fixes for v5.11, mostly around HDA jack detection, plus
a couple of updates to the MAINTAINERS entries.
2021-01-18 19:51:49 +01:00
Olivia Mackintosh
b952ac76a2 ALSA: usb-audio: Add support for Pioneer DJM-750
This adds the Pioneer DJ DJM-750 to the quirks table and ensures
skip_pioneer_sync_ep() is (also) called: this device uses the vendor
ID of 0x08e4 (I'm not sure why they use multiple vendor IDs but many
just like to be awkward it seems).

Playback on all 8 channels works. I'll likely keep this working in the
future and submit futher patches and improvements as necessary.

Signed-off-by: Olivia Mackintosh <livvy@base.nu>
Link: https://lore.kernel.org/r/20210118130621.77miiie47wp7mump@base.nu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-18 17:39:42 +01:00
Takashi Iwai
c09e28cd12 Merge branch 'for-linus' into for-next
Back-merge of 5.11 devel branch for more works on USB-audio.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-18 17:39:23 +01:00
Kai Vehmanen
39860fe070
ASoC: SOF: Intel: initial support to AlderLake-P
Add PCI id for the AlderLake-P.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210114115558.52699-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-18 14:02:51 +00:00
James Schulman
a8939f2e13
ASoC: wm_adsp: Fix control name parsing for multi-fw
When switching between firmware types, the wrong control
can be selected when requesting control in kernel API.
Use the currently selected DSP firwmare type to select
the proper mixer control.

Signed-off-by: James Schulman <james.schulman@cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210115201105.14075-1-james.schulman@cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-18 14:02:47 +00:00
Takashi Iwai
532a208ad6 ALSA: usb-audio: Avoid implicit feedback on Pioneer devices
For addressing the regression on Pioneer devices, we recently
corrected the quirk code to enable the implicit feedback mode on those
devices properly.  However, the devices still showed problems with the
full duplex operations with JACK, and after debug sessions, we figured
out that the older kernels that had worked with JACK also didn't use
the implicit feedback mode at all although they had the quirk code to
enable it; instead, the old code worked just to skip the normal sync
endpoint setup that would have been detected without it.  IOW, what
broke without the implicit-fb quirk in the past was the application of
the normal sync endpoint that is actually the capture data endpoint on
these devices.

This patch covers the overseen piece: it modifies the quirk code again
not to enable the implicit feedback mode but just to make the driver
skipping the sync endpoint detection.  This made the driver working
with JACK full-duplex mode again.

Still it's not quite clear why the implicit feedback doesn't work on
those devices yet; maybe it's about some issues in the URB setup.  But
at least, with this patch, the driver should work in the level of the
older kernels again.

Fixes: 167c9dc84e ("ALSA: usb-audio: Fix implicit feedback sync setup for Pioneer devices")
Link: https://lore.kernel.org/r/20210118075816.25068-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-18 09:38:13 +01:00
Takashi Iwai
3784d449d7 ALSA: usb-audio: Set sample rate for all sharing EPs on UAC1
The UAC2/3 sample rate setup is based on the clock node, which is
usually shared in the interface, and can't be re-setup without
deselecting the interface once, and that's how the current code
behaves.  OTOH, the sample rate setup of UAC1 is per endpoint, hence
we basically need to call for each endpoint usage even if those share
the same interface.

This patch fixes the behavior of UAC1 to call always
snd_usb_init_sample_rate() in snd_usb_endpoint_configure().

Fixes: bf6313a0ff ("ALSA: usb-audio: Refactor endpoint management")
Link: https://lore.kernel.org/r/20210118075816.25068-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-18 09:38:03 +01:00
Takashi Iwai
87cb9af9f8 ALSA: usb-audio: Fix UAC1 rate setup for secondary endpoints
The current sample rate setup function for UAC1 assumes only the first
endpoint retrieved from the interface:altset pair, but the rate set up
may be needed also for the secondary endpoint.  Also, retrieving the
endpoint number from the interface descriptor is redundant; we have
already the target endpoint in the given audioformat object.

This patch simplifies the code and corrects the target endpoint as
described in the above.  It simply refers to fmt->endpoint directly.

Also, this patch drops the pioneer_djm_set_format_quirk() that is
caleld from snd_usb_set_format_quirk(); this function does the sample
rate setup but for the capture endpoint (0x82), and that's exactly
what the change above fixes.

Link: https://lore.kernel.org/r/20210118075816.25068-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-18 09:37:53 +01:00
Mark Brown
574b813ae5
Merge series "ASoC/SoundWire: fix timeout values" from Bard Liao <yung-chuan.liao@linux.intel.com>:
The timeout for an individual transaction w/ the Cadence IP is the same as
the entire resume operation for codecs.
This doesn't make sense, we need to have at least one order of magnitude
between individual transactions and the entire resume operation.

Set the timeout on the Cadence side to 500ms and 5s for the codec resume.

Both ASoC and SoundWire trees are fine for this series.

Pierre-Louis Bossart (2):
  ASoC: codecs: soundwire: increase resume timeout
  soundwire: cadence: reduce timeout on transactions

 drivers/soundwire/cadence_master.c | 2 +-
 sound/soc/codecs/max98373-sdw.c    | 4 +++-
 sound/soc/codecs/rt1308-sdw.c      | 2 +-
 sound/soc/codecs/rt5682.h          | 2 +-
 sound/soc/codecs/rt700-sdw.c       | 2 +-
 sound/soc/codecs/rt711-sdw.c       | 2 +-
 sound/soc/codecs/rt715-sdw.c       | 2 +-
 7 files changed, 9 insertions(+), 7 deletions(-)

--
2.17.1
2021-01-15 17:13:13 +00:00
Mark Brown
42dc604051
Merge series "ASoC: qcom: Minor code cleanups for lpass-cpu" from Stephen Boyd <swboyd@chromium.org>:
Here's some minor code cleanups for the lpass-cpu driver. I noticed that
it casts away const from the driver data from DT. That's not great but
fixing it is a little more involved. I'll get to it later. There's also
some questionable clk_get() usage that should probably be
clk_get_optional(). For now this should help a little.

Cc: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>

Stephen Boyd (4):
  ASoC: qcom: Remove useless debug print
  ASoC: qcom: Add some names to regmap configs
  ASoC: qcom: Stop casting away __iomem for error pointers
  ASoC: qcom: Remove duplicate error messages on ioremap

 sound/soc/qcom/lpass-cpu.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

base-commit: 5c8fe583cc
--
https://chromeos.dev
2021-01-15 17:13:12 +00:00
Pierre-Louis Bossart
7ef8c9edc8
ASoC: codecs: soundwire: increase resume timeout
The resume operation relies on multiple transactions to synchronize
the regmap state, make sure the timeout is one order of magnitude
larger than an individual transaction, so that timeouts of failed
transactions are detected first.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210115061651.9740-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-15 14:15:29 +00:00
Stephen Boyd
4e15f5060d
ASoC: qcom: Remove duplicate error messages on ioremap
We don't need to print an error message when these ioremap operations
fail. The function that returns an error already prints an error message
and properly attributes it to the device. Drop them to save some code.

Cc: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210115034327.617223-5-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-15 14:14:43 +00:00
Stephen Boyd
e697df6687
ASoC: qcom: Stop casting away __iomem for error pointers
We don't need to cast away __iomem when testing with IS_ERR() or
converting with PTR_ERR(). Modern sparse can handle this just fine.
Drop it.

Cc: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210115034327.617223-4-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-15 14:14:42 +00:00
Stephen Boyd
03b49bf9a9
ASoC: qcom: Add some names to regmap configs
This device can sometimes have multiple regmaps. Let's add a name so
that we can differentiate in debugfs more easily.

Cc: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210115034327.617223-3-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-15 14:14:41 +00:00
Stephen Boyd
16117beb16
ASoC: qcom: Remove useless debug print
This looks like a left over debug print that tells us that HDMI is
enabled. Let's remove it as that's definitely not an error to have HDMI
enabled.

Cc: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Fixes: 7cb37b7bd0 ("ASoC: qcom: Add support for lpass hdmi driver")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210115034327.617223-2-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-15 14:14:40 +00:00
Takashi Iwai
915183b622 ALSA: x86: Simplify with dma_set_mask_and_coherent()
LPE driver still has explicit calls of dma_set_mask() and
dma_set_coherent_mask().

Let's simplify with dma_set_mask_and_coherent().

Link: https://lore.kernel.org/r/20210114125412.993-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-15 11:17:19 +01:00
Takashi Iwai
669f65eaeb ALSA: pci: Simplify with dma_set_mask_and_coherent()
Many PCI drivers still have two explicit calls of dma_set_mask() and
dma_set_coherent_mask().

Let's simplify with dma_set_mask_and_coherent().

Link: https://lore.kernel.org/r/20210114125412.993-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-15 11:17:00 +01:00
Kai-Chuan Hsieh
f84d3a1ec3 ALSA: hda: Add Cometlake-R PCI ID
Add HD Audio Device PCI ID for the Intel Cometlake-R platform

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
Link: https://lore.kernel.org/r/20210115031515.13100-1-kaichuan.hsieh@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-15 11:15:53 +01:00
Takashi Sakamoto
9a08676fc5 ALSA: dice: add support for Lexicon I-ONIX FW810s
I-ONIX FW810s was shipped in Lexicon brand of HARMAN International
industries, Inc 2009. The model uses TCD2220 ASIC as its communication
engine. TCAT general protocol is supported, its extension isn't.

This patch adds support for the model with hard-coded stream formats.

$ python3 ~/git/linux-firewire-utils/src/crpp < /sys/bus/firewire/devices/fw1/config_rom
               ROM header and bus information block
               -----------------------------------------------------------------
400  04042b91  bus_info_length 4, crc_length 4, crc 11153
404  31333934  bus_name "1394"
408  e0008102  irmc 1, cmc 1, isc 1, bmc 0, cyc_clk_acc 0, max_rec 8 (512)
40c  000fd720  company_id 000fd7     |
410  007d7ecf  device_id 20007d7ecf  | EUI-64 000fd720007d7ecf

               root directory
               -----------------------------------------------------------------
414  00064c2d  directory_length 6, crc 19501
418  03000fd7  vendor
41c  8100000a  --> descriptor leaf at 444
420  17000001  model
424  8100000d  --> descriptor leaf at 458
428  0c0087c0  node capabilities per IEEE 1394
42c  d1000001  --> unit directory at 430

               unit directory at 430
               -----------------------------------------------------------------
430  000438f2  directory_length 4, crc 14578
434  12000fd7  specifier id
438  13000001  version
43c  17000001  model
440  8100000d  --> descriptor leaf at 474

               descriptor leaf at 444
               -----------------------------------------------------------------
444  000489d5  leaf_length 4, crc 35285
448  00000000  textual descriptor
44c  00000000  minimal ASCII
450  4c657869  "Lexi"
454  636f6e00  "con"

               descriptor leaf at 458
               -----------------------------------------------------------------
458  0006594b  leaf_length 6, crc 22859
45c  00000000  textual descriptor
460  00000000  minimal ASCII
464  492d4f4e  "I-ON"
468  49585f46  "IX_F"
46c  57383130  "W810"
470  53000000  "S"

               descriptor leaf at 474
               -----------------------------------------------------------------
474  0006594b  leaf_length 6, crc 22859
478  00000000  textual descriptor
47c  00000000  minimal ASCII
480  492d4f4e  "I-ON"
484  49585f46  "IX_F"
488  57383130  "W810"
48c  53000000  "S"

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210115035623.148580-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-15 11:13:33 +01:00
Takashi Iwai
42ef170d57 ALSA: usb-audio: Convert the last strlcpy() usage
The last remaining usage of strlcpy() in USB-audio driver is the setup
of the card longname string.  Basically we need to know whether any
non-empty string is set or not, and no real length is needed.
Refactor the code and use strscpy() instead.  After this change,
strlcpy() is gone from all sound/* code.

Link: https://lore.kernel.org/r/20210115100437.20906-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-15 11:05:26 +01:00
Takashi Iwai
e8afdfdc81 ALSA: usb-audio: Convert remaining strlcpy() to strscpy()
USB-audio driver still contains two calls of strlcpy() because the
return size is evaluated.  Basically it just checks whether the string
is copied or not, but since strcpy() may return a negative error code,
we should check the negative value and treat as filled.

Link: https://lore.kernel.org/r/20210115095758.19707-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-15 11:05:20 +01:00
Takashi Iwai
217bfbb8b0 ALSA: seq: oss: Fix missing error check in snd_seq_oss_synth_make_info()
snd_seq_oss_synth_make_info() didn't check the error code from
snd_seq_oss_midi_make_info(), and this leads to the call of strlcpy()
with the uninitialized string as the source, which may lead to the
access over the limit.

Add the proper error check for avoiding the failure.

Reported-by: syzbot+e42504ff21cff05a595f@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210115093428.15882-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-15 10:35:17 +01:00
Takashi Iwai
67ea698c39 ALSA: hda/via: Add minimum mute flag
It turned out that VIA codecs also mute the sound in the lowest mixer
level.  Turn on the dac_min_mute flag to indicate the mute-as-minimum
in TLV like already done in Conexant and IDT codecs.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210559
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210114072453.11379-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-14 15:11:15 +01:00
Chris Chiu
495dc7637c ALSA: hda/realtek - Limit int mic boost on Acer Aspire E5-575T
The Acer Apire E5-575T laptop with codec ALC255 has a terrible
background noise comes from internal mic capture. And the jack
sensing dose not work for headset like some other Acer laptops.

This patch limits the internal mic boost on top of the existing
ALC255_FIXUP_ACER_MIC_NO_PRESENCE quirk for Acer Aspire E5-575T.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210114082728.74729-1-chiu@endlessos.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-14 12:58:02 +01:00
Takashi Iwai
e4ea77f8e5 ALSA: usb-audio: Always apply the hw constraints for implicit fb sync
Since the commit 5a6c3e11c9 ("ALSA: usb-audio: Add hw constraint for
implicit fb sync"), we apply the hw constraints for the implicit
feedback sync to make the secondary open aligned with the already
opened stream setup.  This change assumed that the secondary open is
performed after the first stream has been already set up, and adds the
hw constraints to sync with the first stream's parameters only when
the EP setup for the first stream was confirmed at the open time.
However, most of applications handling the full-duplex operations do
open both playback and capture streams at first, then set up both
streams.  This results in skipping the additional hw constraints since
the counter-part stream hasn't been set up yet at the open of the
second stream, and it eventually leads to "incompatible EP" error in
the end.

This patch corrects the behavior by always applying the hw constraints
for the implicit fb sync.  The hw constraint rules are defined so that
they check the sync EP dynamically at each invocation, instead.  This
covers the concurrent stream setups better and lets the hw refine
calls resolving to the right configuration.

Also this patch corrects a minor error that has existed in the debug
print that isn't built as default.

Fixes: 5a6c3e11c9 ("ALSA: usb-audio: Add hw constraint for implicit fb sync")
Link: https://lore.kernel.org/r/20210111081611.12790-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-13 22:25:27 +01:00
Mark Brown
2d446c98cd Linux 5.11-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl/7gQoeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiG2UUH/0Yxo20aF/bv+580
 tP/Itt5R7nN5xXNgmpZ1kVOaAjcn1qg2lf5az0vHjjwUaWGvWyXdHmT7d6BObuFe
 S7dHUpIsAswfMmSL2Vfnj1brsRGHJqBVP82QJT/XXH5sgY4hjXFCQbAlJ/H0vUR1
 6TawXUrugbgQQxVNjQyfFPxHBvyx1VJ0dGL1aM/XsLLEXUITTDALrVg6T0wyQQ0B
 DBlSKMQxCViDUf0NjzAuXWKMmqnmoQnyRJseb//r9TgCIyDF+lIc1tzLJ0iFGKQl
 XMCvTXT+Owvc2M7a5eV44a18VtvXsmOKDXVKmHqqPcqRrJGX+zXqhsnUJNVEiVrS
 WbZ+Ef8=
 =oNTQ
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl//NGsACgkQJNaLcl1U
 h9Burwf8C00NIfxUvrrZY559SHTYGLz9W7Xkw/9ZujhY+e/DOWmf2HwaQyztqmPL
 1294QPyPTdYtKXSLM46roFwsuoaW1oqSooWv5zEh+q1ZGOcy904X5GH242K0ReKr
 Ztcy679IuS3d5alJfetfBATPeAyQHDuQcqMWwppeMsx4j4DgTc2ZTDLHrGzTqjNW
 EVLem+t3VOC6RBfO3xxmFMp6uY0qI8aj+CDbLcneglY6FYL++aA3wFs4TXqF6at9
 +O0qlMJXm53U5i736TZv5gPmqw1qk77ufrkqYKmSIYXXkdg1I53NywdJp2fp9xWk
 ALHIYBzqnO7wvRbEG7CdEafAJuslJw==
 =brpb
 -----END PGP SIGNATURE-----

Merge v5.11-rc3
2021-01-13 17:56:59 +00:00
Mark Brown
cea06d9bf0 Linux 5.11-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl/7gQoeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiG2UUH/0Yxo20aF/bv+580
 tP/Itt5R7nN5xXNgmpZ1kVOaAjcn1qg2lf5az0vHjjwUaWGvWyXdHmT7d6BObuFe
 S7dHUpIsAswfMmSL2Vfnj1brsRGHJqBVP82QJT/XXH5sgY4hjXFCQbAlJ/H0vUR1
 6TawXUrugbgQQxVNjQyfFPxHBvyx1VJ0dGL1aM/XsLLEXUITTDALrVg6T0wyQQ0B
 DBlSKMQxCViDUf0NjzAuXWKMmqnmoQnyRJseb//r9TgCIyDF+lIc1tzLJ0iFGKQl
 XMCvTXT+Owvc2M7a5eV44a18VtvXsmOKDXVKmHqqPcqRrJGX+zXqhsnUJNVEiVrS
 WbZ+Ef8=
 =oNTQ
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl//NGkACgkQJNaLcl1U
 h9DuFQf+Oj64lKP7Tiui+8RcUcEjot4GQWlX/U9TJj37NHwxjwlCQh4dVCihKtoc
 wXPynOh6sxdE+So6jyEsD5t14UCXs/aeu+ShMBEFJjBLqWOl8rhwiFRAwVeLj8jg
 OQ4zFLyY+kh2g+WA1yq4R1htBElED06IBnE/vogsIqjuyfdY4qjhNGshpEaY/1PA
 1JPAYJPBTQwoRTbFny9ZNMV1mjBwxP6Odp/zQtEQ8jDez37WWEGEtjKE9unaCGkO
 ExDrvwYTTqy+nDpj8SzhL1Szch8j1Hu5fXTMODxq8h8iUmPehFchcgSaRxVDihGN
 jfEvRQutL30CxpcaCXrEE74hXzgcRA==
 =pfyh
 -----END PGP SIGNATURE-----

Merge v5.11-rc3
2021-01-13 17:56:56 +00:00
Keyon Jie
44a4cfad8d
ASoC: SOF: Intel: tgl: do thorough remove at .shutdown() callback
Invoke hda_dsp_remove() as the .shutdown() callback. This will help to
perform shutdown of the DSP safely on TGL platforms before shutting down
or rebooting the system.

BugLink: https://github.com/thesofproject/linux/issues/2571
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210113152617.4048541-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 16:33:44 +00:00
Keyon Jie
3475b44c76
ASoC: SOF: sof-pci-dev: add .shutdown() callback
Add the .shutdown() callback to the sof-pci-dev driver, to help to
handle shutting down specific tasks for SOF PCI platforms.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210113152617.4048541-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 16:33:43 +00:00
Keyon Jie
daff7f1478
ASoC: SOF: add snd_sof_device_shutdown() helper for shutdown
Add helper snd_sof_device_shutdown() to wrap the platform specific
.shutdown callbacks for SOF platforms.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210113152617.4048541-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 16:33:42 +00:00
Keyon Jie
7edb3051f1
ASoC: SOF: add .shutdown() callback to snd_sof_dsp_ops
Add .shutdown() callback to the struct snd_sof_dsp_ops, for
doing platform specific actions at shutdown.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210113152617.4048541-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 16:33:41 +00:00
Kai Vehmanen
9c25af2502
ASoC: SOF: Intel: fix page fault at probe if i915 init fails
The earlier commit to fix runtime PM in case i915 init fails,
introduces a possibility to hit a page fault.

snd_hdac_ext_bus_device_exit() is designed to be called from
dev.release(). Calling it outside device reference counting, is
not safe and may lead to calling the device_exit() function
twice. Additionally, as part of ext_bus_device_init(), the device
is also registered with snd_hdac_device_register(). Thus before
calling device_exit(), the device must be removed from device
hierarchy first.

Fix the issue by rolling back init actions by calling
hdac_device_unregister() and then releasing device with put_device().
This matches with existing code in hdac-ext module.

To complete the fix, add handling for the case where
hda_codec_load_module() returns -ENODEV, and clean up the hdac_ext
resources also in this case.

In future work, hdac-ext interface should be extended to allow clients
more flexibility to handle the life-cycle of individual devices, beyond
just the current snd_hdac_ext_bus_device_remove(), which removes all
devices.

BugLink: https://github.com/thesofproject/linux/issues/2646
Reported-by: Jaroslav Kysela <perex@perex.cz>
Fixes: 6c63c954e1 ("ASoC: SOF: fix a runtime pm issue in SOF when HDMI codec doesn't work")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Link: https://lore.kernel.org/r/20210113150715.3992635-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 16:33:40 +00:00
Kai Vehmanen
5e941fc033 ALSA: hda: Add AlderLake-P PCI ID and HDMI codec vid
Add HD Audio PCI ID and HDMI codec vendor ID for Intel AlderLake-P.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20210113155629.4097057-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-13 17:02:43 +01:00
Mark Brown
342c3bc515
Merge series "ASoC: soc-pcm: cleanup code" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

These are not so important, but for
soc-pcm cleanup patches.

Kuninori Morimoto (6):
  ASoC: soc-pcm: move dpcm_set_fe_update_state()
  ASoC: soc-pcm: add dpcm_set_be_update_state()
  ASoC: soc-pcm: add soc_pcm_set_dai_params()
  ASoC: soc-pcm: cleanup soc_pcm_apply_symmetry()
  ASoC: soc-pcm: cleanup soc_pcm_params_symmetry()
  ASoC: soc-pcm: setup pcm at one place in soc_new_pcm()

 sound/soc/soc-pcm.c | 231 +++++++++++++++++---------------------------
 1 file changed, 90 insertions(+), 141 deletions(-)

--
2.25.1

Thank you for your help !!

Best regards
---
Kuninori Morimoto
2021-01-13 15:24:15 +00:00
Kai-Heng Feng
ef4d764c99
ASoC: SOF: Intel: hda: Avoid checking jack on system suspend
System takes a very long time to suspend after commit 215a22ed31
("ALSA: hda: Refactor codec PM to use direct-complete optimization"):
[   90.065964] PM: suspend entry (s2idle)
[   90.067337] Filesystems sync: 0.001 seconds
[   90.185758] Freezing user space processes ... (elapsed 0.002 seconds) done.
[   90.188713] OOM killer disabled.
[   90.188714] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[   90.190024] printk: Suspending console(s) (use no_console_suspend to debug)
[   90.904912] intel_pch_thermal 0000:00:12.0: CPU-PCH is cool [49C], continue to suspend
[  321.262505] snd_hda_codec_realtek ehdaudio0D0: Unable to sync register 0x2b8000. -5
[  328.426919] snd_hda_codec_realtek ehdaudio0D0: Unable to sync register 0x2b8000. -5
[  329.490933] ACPI: EC: interrupt blocked

That commit keeps the codec suspended during the system suspend. However,
mute/micmute LED will clear codec's direct-complete flag by
dpm_clear_superiors_direct_complete().

This doesn't play well with SOF driver. When its runtime resume is
called for system suspend, hda_codec_jack_check() schedules
jackpoll_work which uses snd_hdac_is_power_on() to check whether codec
is suspended. Because the direct-complete path isn't taken,
pm_runtime_disable() isn't called so snd_hdac_is_power_on() returns
false and jackpoll continues to run, and snd_hda_power_up_pm() cannot
power up an already suspended codec in multiple attempts, causes the
long delay on system suspend:

if (dev->power.direct_complete) {
	if (pm_runtime_status_suspended(dev)) {
		pm_runtime_disable(dev);
		if (pm_runtime_status_suspended(dev)) {
			pm_dev_dbg(dev, state, "direct-complete ");
			goto Complete;
		}

		pm_runtime_enable(dev);
	}
	dev->power.direct_complete = false;
}

When direct-complete path is taken, snd_hdac_is_power_on() returns true
and hda_jackpoll_work() is skipped by accident. So this is still not
correct.

If we were to use snd_hdac_is_power_on() in system PM path,
pm_runtime_status_suspended() should be used instead of
pm_runtime_suspended(), otherwise pm_runtime_{enable,disable}() may
change the outcome of snd_hdac_is_power_on().

Because devices suspend in reverse order (i.e. child first), it doesn't
make much sense to resume an already suspended codec from audio
controller. So avoid the issue by making sure jackpoll isn't used in
system PM process.

Fixes: 215a22ed31 ("ALSA: hda: Refactor codec PM to use direct-complete optimization")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210112181128.1229827-3-kai.heng.feng@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 15:24:07 +00:00
Kai-Heng Feng
31ba0c0776
ASoC: SOF: Intel: hda: Modify existing helper to disable WAKEEN
Modify hda_codec_jack_wake_enable() to also support disable WAKEEN.
In addition, this patch also moves the WAKEEN disablement call out of
hda_codec_jack_check() into hda_codec_jack_wake_enable().

This is a preparation for next patch.

No functional change intended.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20210112181128.1229827-2-kai.heng.feng@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 15:24:06 +00:00
Kai-Heng Feng
bcd7059abc
ASoC: SOF: Intel: hda: Resume codec to do jack detection
Instead of queueing jackpoll_work, runtime resume the codec to let it
use different jack detection methods based on jackpoll_interval.

This partially matches SOF driver's behavior with commit a6e7d0a4bd
("ALSA: hda: fix jack detection with Realtek codecs when in D3"), the
difference is SOF unconditionally resumes the codec.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20210112181128.1229827-1-kai.heng.feng@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 15:24:05 +00:00
Lars-Peter Clausen
b3c0ae75f5
ASoC: kirkwood: Use managed DMA buffer allocation
Instead of manually managing its DMA buffers using
dma_{alloc,free}_coherent() lets the sound core take care of this using
managed buffers.

On one hand this reduces the amount of boiler plate code, but the main
motivation for the change is to use the shared code where possible. This
makes it easier to argue about correctness and that the code does not
contain subtle bugs like data leakage or similar.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210106133650.13509-3-lars@metafoo.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:36:16 +00:00
Lars-Peter Clausen
5ac813c834
ASoC: bcm: cygnus: Use managed DMA buffer allocation
Instead of manually managing its DMA buffers using
dma_{alloc,free}_coherent() lets the sound core take care of this using
managed buffers.

On one hand this reduces the amount of boiler plate code, but the main
motivation for the change is to use the shared code where possible. This
makes it easier to argue about correctness and that the code does not
contain subtle bugs like data leakage or similar.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210106133650.13509-2-lars@metafoo.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:36:16 +00:00
Lars-Peter Clausen
22eee4d3ef
ASoC: atmel-pdc: Use managed DMA buffer allocation
Instead of manually managing its DMA buffers using
dma_{alloc,free}_coherent() lets the sound core take care of this using
managed buffers.

On one hand this reduces the amount of boiler plate code, but the main
motivation for the change is to use the shared code where possible. This
makes it easier to argue about correctness and that the code does not
contain subtle bugs like data leakage or similar.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20210106133650.13509-1-lars@metafoo.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:36:15 +00:00
Stephan Gerhold
6fd8d2d275
ASoC: qcom: qdsp6: Move frontend AIFs to q6asm-dai
At the moment it is necessary to set up the DAPM routes between
front-end AIF<->DAI explicitly in the device tree, e.g. using

	audio-routing =
		"MM_DL1", "MultiMedia1 Playback",
		"MM_DL3", "MultiMedia3 Playback",
		"MM_DL4", "MultiMedia4 Playback",
		"MultiMedia2 Capture", "MM_UL2";

This is prone to mistakes and (sadly) there is no clear error if one
of these routes is missing. :(

Actually, this should not be necessary because the ASoC core normally
automatically links AIF<->DAI within snd_soc_dapm_link_dai_widgets().
This is done using the "stname" parameter of SND_SOC_DAPM_AIF_IN/OUT.

For SND_SOC_DAPM_AIF_IN("MM_DL1", "MultiMedia1 Playback", 0, 0, 0, 0),
it should create the route from above: MM_DL1 <-> MultiMedia1 Playback.

This does not work at the moment because the AIF widget (MM_DL1)
and the DAI widget (MultiMedia1 Playback) belong to different
DAPM contexts (q6routing / q6asm-dai).

Fix this by declaring the AIF widgets in the same driver as the DAIs
(q6asm-dai). Now the routes above are created automatically
and no longer need to be specified in the device tree.

This is also more consistent with the back-end AIFs which are already
declared in q6afe-dais instead of q6routing. q6routing should only link
the components together using mixers.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Fixes: 2a9e92d371 ("ASoC: qdsp6: q6asm: Add q6asm dai driver")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20201211203255.148246-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:36:14 +00:00
Dan Carpenter
856fe64da8
ASoC: cs42l56: fix up error handling in probe
There are two issues with this code.  The first error path forgot to set
the error code and instead returns success.  The second error path
doesn't clean up.

Fixes: 272b5edd3b ("ASoC: Add support for CS42L56 CODEC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X9NE/9nK9/TuxuL+@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:36:13 +00:00
Kuninori Morimoto
a39748d03c
ASoC: soc-pcm: cleanup soc_pcm_apply_symmetry()
soc_pcm_apply_symmetry() want to call snd_pcm_hw_constraint_single()
for rate/channel/sample_bits, but, it needs many condition check.
These are very similar but different, thus, it needs to have very
verbose code.
This patch use macro for it and make code more simple.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnxo7uyq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:33:12 +00:00
Kuninori Morimoto
2805b8bd3e
ASoC: soc-pcm: add soc_pcm_set_dai_params()
Getting rate/channels/sample_bits from param needs fixed method.
This patch adds new soc_pcm_set_dai_params() and replace existing code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2i47uyw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:33:11 +00:00
Kuninori Morimoto
a7e20444ef
ASoC: soc-pcm: add dpcm_set_be_update_state()
soc-pcm has dpcm_set_fe_update_state() to update FE's runtime_update
(except dpcm_fe_dai_do_trigger() which needs to update it without it).
OTOH, it doesn't have BE's update function.

	O: dpcm_set_fe_update_state()
	X: dpcm_set_be_update_state()

This patch add BE's dpcm_set_fe_update_state()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zh2k7uz1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:33:10 +00:00
Kuninori Morimoto
9c6d7f9346
ASoC: soc-pcm: move dpcm_set_fe_update_state()
This patch moves dpcm_set_fe_update_state() to top side.
This is prepare for cleanup soc-pcm.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871rfw99jn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:33:10 +00:00
Mark Brown
43fb2919d4
Merge series "ASoC: Intel: bytcr_rt5640: Add support for devices with only a headphone jack (no speakers/mic)" from Hans de Goede <hdegoede@redhat.com>:
Hi All,

This series adds support for devices with only a headphone jack
(no speakers/internal mic). Specifically this adds support for the
Mele PCG03 Mini PC. But the new no-speakers and no-internal-mic quirks
will likely be useful on other devices too.

Regards,

Hans
2021-01-12 16:40:28 +00:00
Keyon Jie
8b66d7c58c
ASoC: SOF: add mutex to protect the dsp_power_state access
There could be more than one thread read/write the dsp_power_state
simultaneously (e.g. hda_dsp_d0i3_work and sof_ipc_tx_message), add a
mutex power_state_access to make sure the access to it is mutually
exclusive.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210105155640.3725238-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-12 16:40:23 +00:00
Alex Deucher
20c7842ed8 ALSA: hda/hdmi - enable runtime pm for CI AMD display audio
We are able to power down the GPU and audio via the GPU driver
so flag these asics as supporting runtime pm.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20210105175245.963451-1-alexander.deucher@amd.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-12 16:06:01 +01:00
Hans de Goede
f2973a1de9
ASoC: es8316: Fix possible NULL pointer deref in es8316_disable_jack_detect()
sound/soc/soc-core.c: soc_remove_component() unconditionally calls
snd_soc_component_set_jack(component, NULL, NULL); on any components
being removed.

This means that on machines where the machine-driver does not provide
a jack through snd_soc_component_set_jack() es8316_disable_jack_detect()
will still get called and at this time es8316->jack will be NULL and
the es8316->jack->status check in es8316_disable_jack_detect() will
lead to a NULL pointer deref.

Fix this by checking for es8316->jack bein NULL at the start of
es8316_disable_jack_detect() and turn the function into a no-op in
that case.

Cc: russianneuromancer <russianneuromancer@ya.ru>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210112101725.44200-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-12 14:12:02 +00:00
Xu Wang
554a1b0095
ASoC: adau17x1: Remove redundant null check before clk_disable_unprepare
Because clk_disable_unprepare() already checked NULL clock parameter,
so the additional check is unnecessary, just remove it.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Link: https://lore.kernel.org/r/20210108084456.6603-1-vulab@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-12 14:12:00 +00:00
Hans de Goede
780b1a02c1
ASoC: Intel: cht_bsw_nau8824: Move snd_soc_dai_set_tdm_slot call to cht_codec_fixup
Move the snd_soc_dai_set_tdm_slot() call from cht_codec_init() to
cht_codec_fixup(). There are 2 reasons for doing this:

1. This aligns the cht_bsw_nau8824 with all the other BYT/CHT machine
drivers which also do this from their codec_fixup function.

2. When using the SOF driver, things like the TDM info is set from the
topology file. Moving the call to the codec_fixup function, which gets
skipped when using the SOF driver avoids the call interfering with the
settings when using the SOF 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/20210107115324.11602-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-12 14:11:59 +00:00
Hans de Goede
df33032146
ASoC: Intel: bytcr_rt5640: Add quirk for the Mele PCG03 Mini PC
Add a quirk for the Mele PCG03 Mini PC, being a Mini PC this device
has no speakers and no internal microphone.

To make matters worse the speaker output pins are shorted (to gnd or
to each other?) and SPKVDD is provided. So trying to output sound on the
speakers leads to shorting SPKVDD, this leads to a power dip after
which the codec is an unknown state. Sometimes it drops of the i2c
bus, sometimes it does still respond to i2c transfers, but is otherwise
not functional. TL;DR: trying to use the speaker outputs on this model
is BAD.

Besides not having speakers / an internal mic, this is a Bay Trail CR
device without a CHAN package in ACPI, so we default to SSP0-AIF2 as
codec connection. But the device is actually using SSP0-AIF1, so we
need to quirk that too.

Cc: Rasmus Porsager <rasmus@beat.dk>
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/20210109210119.159032-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-12 14:11:57 +00:00
Hans de Goede
46466ab68e
ASoC: Intel: bytcr_rt5640: Add new BYT_RT5640_NO_INTERNAL_MIC_MAP input-mapping
Some devices, like mini PCs/media/top-set boxes do not have an internal
microphone at all, an example of the is the Mele PCG03 Mini PC.

Add a new BYT_RT5640_NO_INTERNAL_MIC_MAP input-mapping for this,
which does not add any internal-mic routes and modifies the components
and the (optional) long_name strings to reflect this.

Cc: Rasmus Porsager <rasmus@beat.dk>
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/20210109210119.159032-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-12 14:11:56 +00:00
Hans de Goede
1851ccf9e1
ASoC: Intel: bytcr_rt5640: Add new BYT_RT5640_NO_SPEAKERS quirk-flag
Some devices, like mini PCs/media/top-set boxes do not have any speakers
at all, an example of the is the Mele PCG03 Mini PC.

Add a new BYT_RT5640_NO_SPEAKERS quirk-flag which when sets does not add
speaker routes and modifies the components and the (optional) long_name
strings to reflect that there are no speakers.

Cc: Rasmus Porsager <rasmus@beat.dk>
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/20210109210119.159032-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-12 14:11:55 +00:00
Geert Uytterhoeven
9f65df9c58 ALSA: firewire-tascam: Fix integer overflow in midi_port_work()
As snd_fw_async_midi_port.consume_bytes is unsigned int, and
NSEC_PER_SEC is 1000000000L, the second multiplication in

    port->consume_bytes * 8 * NSEC_PER_SEC / 31250

always overflows on 32-bit platforms, truncating the result.  Fix this
by precalculating "NSEC_PER_SEC / 31250", which is an integer constant.

Note that this assumes port->consume_bytes <= 16777.

Fixes: 531f471834 ("ALSA: firewire-lib/firewire-tascam: localize async midi port")
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210111130251.361335-3-geert+renesas@glider.be
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-12 14:57:38 +01:00
Geert Uytterhoeven
e7c22eeaff ALSA: fireface: Fix integer overflow in transmit_midi_msg()
As snd_ff.rx_bytes[] is unsigned int, and NSEC_PER_SEC is 1000000000L,
the second multiplication in

    ff->rx_bytes[port] * 8 * NSEC_PER_SEC / 31250

always overflows on 32-bit platforms, truncating the result.  Fix this
by precalculating "NSEC_PER_SEC / 31250", which is an integer constant.

Note that this assumes ff->rx_bytes[port] <= 16777.

Fixes: 1917429578 ("ALSA: fireface: add transaction support")
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210111130251.361335-2-geert+renesas@glider.be
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-12 14:57:29 +01:00
Peter Geis
615d435400 ALSA: hda/tegra: fix tegra-hda on tegra30 soc
Currently hda on tegra30 fails to open a stream with an input/output error.

For example:
speaker-test -Dhw:0,3 -c 2

speaker-test 1.2.2

Playback device is hw:0,3
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 16384
Period size range from 32 to 8192
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
 0 - Front Left
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
Transfer failed: Input/output error

The tegra-hda device was introduced in tegra30 but only utilized in
tegra124 until recent chips. Tegra210/186 work only due to a hardware
change. For this reason it is unknown when this issue first manifested.
Discussions with the hardware team show this applies to all current tegra
chips. It has been resolved in the tegra234, which does not have hda
support at this time.

The explanation from the hardware team is this:
Below is the striping formula referenced from HD audio spec.
   { ((num_channels * bits_per_sample) / number of SDOs) >= 8 }

The current issue is seen because Tegra HW has a problem with boundary
condition (= 8) for striping. The reason why it is not seen on
Tegra210/Tegra186 is because it uses max 2SDO lines. Max SDO lines is
read from GCAP register.

For the given stream (channels = 2, bps = 16);
ratio = (channels * bps) / NSDO = 32 / NSDO;

On Tegra30,      ratio = 32/4 = 8  (FAIL)
On Tegra210/186, ratio = 32/2 = 16 (PASS)
On Tegra194,     ratio = 32/4 = 8  (FAIL) ==> Earlier workaround was
applied for it

If Tegra210/186 is forced to use 4SDO, it fails there as well. So the
behavior is consistent across all these chips.

Applying the fix in [1] universally resolves this issue on tegra30-hda.
Tested on the Ouya game console and the tf201 tablet.

[1] commit 60019d8c65 ("ALSA: hda/tegra: workaround playback failure on
Tegra194")

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Ion Agorria <ion@agorria.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20210108135913.2421585-3-pgwipeout@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-12 14:44:47 +01:00
Mark Brown
1675cdd3d7
Merge series "ASoC: rt5645: Enable internal mic and headset on ECS EF20" from Chris Chiu <chiu@endlessos.org>:
These patches are trying to fix the jack detection and internal
microphone problems on ECS EF20 series laptops which are empowered
by Intel Atom x5-Z8350 CPU (CherryTrail) with Realtek rt5645 audio
codec.

---
  v2 -> v3:
	Restore the accidentally removed terminator of the
	dmi_platform_data[].

  v1 -> v2:
        Invoke callback() of the DMI quirk if it exists, because
        the dmi_first_match() doesn't.
---

Chris Chiu (4):
  ASoC: rt5645: Introduce mapping for ACPI-defined GPIO
  ASoC: rt5645: Add ACPI-defined GPIO for ECS EF20 series
  ASoC: rt5645: add inv_hp_det flag
  ASoC: rt5645: Enable internal microphone and JD on ECS EF20

 include/sound/rt5645.h    |  2 ++
 sound/soc/codecs/rt5645.c | 45 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

--
2.20.1
2021-01-11 16:22:26 +00:00
Mark Brown
f3ddced14b
Merge series "Enable DMA mode on Intel Keem Bay platform" from Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>:
v2: Update patch to align with latest kernel release.
v1: Initial patch version, to enable DMA mode on Intel Keembay platform.

Michael Sit Wei Hong (2):
  dt-bindings: sound: intel, keembay-i2s: Add info for device to use DMA
  ASoC: Intel: KMB: Enable DMA transfer mode

 .../bindings/sound/intel,keembay-i2s.yaml     |  14 ++
 sound/soc/intel/Kconfig                       |   2 +
 sound/soc/intel/keembay/kmb_platform.c        | 157 ++++++++++++++++--
 sound/soc/intel/keembay/kmb_platform.h        |   9 +
 4 files changed, 167 insertions(+), 15 deletions(-)

--
2.17.1
2021-01-11 16:22:25 +00:00
Dan Carpenter
e91b65b36f
ASoC: soc-pcm: Fix an uninitialized error code
The error path here doesn't set "ret" so it returns uninitialized data
instead of a negative error code.

Fixes: 2c1382840c ("ASoC: soc-pcm: disconnect BEs if the FE is not ready")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X/wfXQFxeMLvpO+1@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:55 +00:00
Richard Fitzgerald
fe9989fb25
ASoC: wm_adsp: Fix uninitialized variable warnings
wm_adsp_read_data_word() used if (ret) to check for an error from
wm_adsp_read_raw_data_block(). While this is perfectly valid,
wm_adsp_read_raw_data_block() itself uses if (ret < 0) and three
calls to wm_adsp_read_data_word() also use if (ret < 0).

This creates an error check chain like this:

  1st) if (ret < 0) return ret;
  2nd) if (ret) return ret;
  3rd) if (ret < 0) ...

This can confuse the compiler into thinking that there are possible
returns > 0 from the middle if() that are not handled by the final
if(). If this was true it would lead to using uninitialized variables
later in the outer function.

Fix this by changing the test in wm_adsp_read_data_word() to be
if (ret < 0).

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210111133825.8758-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:53 +00:00
Souptick Joarder
4eeed5f403
ASoC: soc-pcm: return correct -ERRNO in failure path
Kernel test robot throws below error ->

sound/soc/soc-pcm.c:2523 dpcm_run_update_startup() error: uninitialized
symbol 'ret'.

Initializing ret = 0 and returning correct -ERRNO in failure path.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Link: https://lore.kernel.org/r/1610163901-5523-1-git-send-email-jrdr.linux@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:52 +00:00
Shuming Fan
5a15cd7fce
ASoC: rt5682: enable fast discharge for headset unplugging
To avoid the pop noise, this patch enables the feature of fast discharge.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20210111092544.9064-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:51 +00:00
Shuming Fan
867f8d18df
ASoC: rt5682: fix getting the wrong device id when the suspend_stress_test
This patch will be the workaround to fix getting the wrong device ID on the rare chance.
It seems like something unstable when the system resumes. e.g. the bus clock
This patch tries to read the device ID to check several times.
After the test, the driver will get the correct device ID the second time.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20210111092740.9128-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:51 +00:00
Chris Chiu
3ac2bfd52b
ASoC: rt5645: Enable internal microphone and JD on ECS EF20
On ECS EF20 series laptops, the internal mic is on DMIC2/IN2P.
And they need the inv_hp_det to make jack detection to work as
exoected.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Link: https://lore.kernel.org/r/20210111054141.4668-5-chiu@endlessos.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:10 +00:00
Chris Chiu
28c988492c
ASoC: rt5645: add inv_hp_det flag
The ECS EF20EA laptop use gpio for jack detection instead of rt5645
rt5645 JD. However, the GPIO polarity is inverse for hp-detect based
on the _DSD property of the RTK2 device.

Name (_DSD, Package () {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
        Package () {"hp-detect-gpio", Package() {^RTK2, 0, 0, 1 }},
    }
})

This flag will invert the hp-detect gpio polarity.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Link: https://lore.kernel.org/r/20210111054141.4668-4-chiu@endlessos.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:09 +00:00
Chris Chiu
a4dae468cf
ASoC: rt5645: Add ACPI-defined GPIO for ECS EF20 series
Add the hp-detect gpio for ECS EF20 series laptops based on the
_CRS defined in DSDT table.

Method (_CRS, 0, NotSerialized)
{
  Name (SBUF, ResourceTemplate ()
  {
    I2cSerialBusV2 (0x001A, ControllerInitiated, 0x00061A80,
        AddressingMode7Bit, "\\_SB.PCI0.I2C2",
        0x00, ResourceConsumer, , Exclusive,
        )
    GpioInt (Edge, ActiveBoth, SharedAndWake, PullNone, 0x0000,
        "\\_SB.GPO3", 0x00, ResourceConsumer, ,
        )
        {   // Pin list
            0x004F
        }
    GpioIo (Shared, PullDefault, 0x0000, 0x0000, IoRestrictionInputOnly,
        "\\_SB.GPO3", 0x00, ResourceConsumer, ,
        )
        {   // Pin list
            0x004F
        }
  })
  Return (SBUF) /* \_SB_.PCI0.I2C2.RTK2._CRS.SBUF */
}

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Link: https://lore.kernel.org/r/20210111054141.4668-3-chiu@endlessos.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:08 +00:00
Chris Chiu
21f603482a
ASoC: rt5645: Introduce mapping for ACPI-defined GPIO
On at least one laptop (ECS EF20EA) the 'hp-detect' GPIO is defined in
the DSDT table by the ACPI GpioIo resources in _CRS. The GPIO related
information should be mapped to the rt5645 driver to enable the jack
detection also on non-DT platforms.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Link: https://lore.kernel.org/r/20210111054141.4668-2-chiu@endlessos.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:07 +00:00
Takashi Iwai
167c9dc84e ALSA: usb-audio: Fix implicit feedback sync setup for Pioneer devices
Pioneer devices have both playback and capture streams sharing the
same iface/altsetting, and those need to be paired as implicit
feedback.  Instead of a half-baked (and broken) static quirk entry,
set up more generically for those devices by checking the number of
endpoints and the attribute of the secondary EP.

Fixes: bf6313a0ff ("ALSA: usb-audio: Refactor endpoint management")
Reported-by: František Kučera <konference@frantovo.cz>
Link: https://lore.kernel.org/r/20210108075219.21463-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08 23:43:39 +01:00
Takashi Iwai
eae4d054f9 ALSA: usb-audio: Annotate the endpoint index in audioformat
There are devices that have multiple endpoints sharing the same
iface/altset not only for sync but also for the actual streams, and
the audioformat for such an endpoint needs to be handled with the
proper endpoint index; otherwise it confuses the endpoint management.

This patch extends the audioformat to annotate the endpoint index, and
put the proper ep_idx=1 to Pioneer device quirk entries accordingly.

Fixes: bf6313a0ff ("ALSA: usb-audio: Refactor endpoint management")
Link: https://lore.kernel.org/r/20210108075219.21463-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08 23:43:38 +01:00
Takashi Iwai
00272c6182 ALSA: usb-audio: Avoid unnecessary interface re-setup
The current endpoint handling assumed (more or less) a unique 1:1
relation between the endpoint and the iface/altset.  The exception was
the sync EP without the implicit feedback which has usually the
secondary EP of the same altset.  This works fine for most devices,
but it turned out that some unusual devices like Pinoeer's ones have
both playback and capture endpoints in the same iface/altsetting and
use both for the implicit feedback mode.  For handling such a case, we
need to extend the endpoint management to take the shared interface
into account.

This patch does that: it adds a new object snd_usb_iface_ref for
managing the reference counts of the each USB interface that is used
by each endpoint.  The interface setup is performed only once for the
(sharing) endpoints, and the doubly initialization is avoided.

Along with this, the resource release of endpoints and interface
refcounts are put into a single function, snd_usb_endpoint_free_all()
instead of looping in the caller side.

Fixes: bf6313a0ff ("ALSA: usb-audio: Refactor endpoint management")
Link: https://lore.kernel.org/r/20210108075219.21463-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08 23:43:37 +01:00
Takashi Iwai
5d15f1eb45 ALSA: usb-audio: Choose audioformat of a counter-part substream
The implicit feedback mode needs to handle two endpoints and the
choice of the audioformat object for the sync EP is important since
this determines the compatibility of the hw_params.  The current code
uses the same audioformat object if both the main EP and the sync EP
point to the same iface/altsetting.  This was done in consideration of
the non-implicit-fb sync EP handling, and it doesn't match well with
the cases where actually to endpoints are defined in the sameiface /
altsetting like a few Pioneer devices.

Modify snd_usb_find_implicit_fb_sync_format() to pick up the
audioformat that is assigned in the counter-part substreams primarily,
so that the actual capture stream can be opened properly.  We keep the
same audioformat object only as a fallback in case nothing found,
though.

Fixes: 9fddc15e80 ("ALSA: usb-audio: Factor out the implicit feedback quirk code")
Link: https://lore.kernel.org/r/20210108075219.21463-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08 23:43:36 +01:00
Takashi Iwai
b2345a8a43 ALSA: usb-audio: Fix the missing endpoints creations for quirks
The recent change in the endpoint management moved the endpoint object
creation from the stream open time to the parser of the audio
descriptor.  It works fine for the standard audio, but it overlooked
the other places that create audio streams via quirks
(QUIRK_AUDIO_FIXED_ENDPOINT) like the reported a few Pioneer devices;
those call snd_usb_add_audio_stream() manually, hence they miss the
endpoints, eventually resulting in the error at opening streams.
Moreover, now the sync EP setup was moved to the explicit call of
snd_usb_audioformat_set_sync_ep(), and this needs to be added for
those places, too.

This patch addresses those regressions for quirks.  It adds a local
helper function add_audio_stream_from_fixed_fmt(), which does the all
needed tasks, and replaces the calls of snd_usb_add_audio_stream()
with this new function.

Fixes: 54cb31901b ("ALSA: usb-audio: Create endpoint objects at parsing phase")
Reported-by: František Kučera <konference@frantovo.cz>
Link: https://lore.kernel.org/r/20210108075219.21463-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08 23:43:35 +01:00
Michael Sit Wei Hong
11b943c06a
ASoC: Intel: KMB: Enable DMA transfer mode
Enable DMA transfer mode for Intel Keem Bay ASoC platform driver.

The driver will search the device tree for DMA resources at boot
time to enable DMA transfer mode, and will proceed to use DMA
transfer if the resource is available, otherwise the default PIO
mode will be used.

Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210108031248.20520-6-michael.wei.hong.sit@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-08 18:23:41 +00:00
Xu Wang
31c51a424f
ASoC: es8328: Remove redundant null check before clk_disable_unprepare
Because clk_disable_unprepare() already checked NULL clock parameter,
so the additional check is unnecessary, just remove it.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Link: https://lore.kernel.org/r/20210108085834.7168-1-vulab@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-08 14:00:43 +00:00
Stephan Gerhold
2a0435df96
ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()
Sound is broken on the DragonBoard 410c (apq8016_sbc) since 5.10:

  hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: error at snd_soc_component_set_jack on hdmi-audio-codec.1.auto: -95
  qcom-apq8016-sbc 7702000.sound: Failed to set jack: -95
  ADV7533: ASoC: error at snd_soc_link_init on ADV7533: -95
  hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: error at snd_soc_component_set_jack on hdmi-audio-codec.1.auto: -95
  qcom-apq8016-sbc: probe of 7702000.sound failed with error -95

This happens because apq8016_sbc calls snd_soc_component_set_jack() on
all codec DAIs and attempts to ignore failures with return code -ENOTSUPP.
-ENOTSUPP is also excluded from error logging in soc_component_ret().

However, hdmi_codec_set_jack() returns -E*OP*NOTSUPP if jack detection
is not supported, which is not handled in apq8016_sbc and soc_component_ret().
Make it return -ENOTSUPP instead to fix sound and silence the errors.

Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Fixes: 55c5cc63ab ("ASoC: hdmi-codec: Use set_jack ops to set jack")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20210107165131.2535-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-08 14:00:42 +00:00
Joe Perches
75b1a8f9d6 ALSA: Convert strlcpy to strscpy when return value is unused
strlcpy is deprecated.  see: Documentation/process/deprecated.rst

Change the calls that do not use the strlcpy return value to the
preferred strscpy.

Done with cocci script:

@@
expression e1, e2, e3;
@@

-	strlcpy(
+	strscpy(
	e1, e2, e3);

This cocci script leaves the instances where the return value is
used unchanged.

After this patch, sound/ has 3 uses of strlcpy() that need to be
manually inspected for conversion and changed one day.

$ git grep -w strlcpy sound/
sound/usb/card.c:               len = strlcpy(card->longname, s, sizeof(card->longname));
sound/usb/mixer.c:      return strlcpy(buf, p->name, buflen);
sound/usb/mixer.c:                      return strlcpy(buf, p->names[index], buflen);

Miscellenea:

o Remove trailing whitespace in conversion of sound/core/hwdep.c

Link: https://lore.kernel.org/lkml/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/22b393d1790bb268769d0bab7bacf0866dcb0c14.camel@perches.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08 09:30:05 +01:00
Takashi Iwai
6dcb8bf9a1 Merge branch 'for-linus' into for-next
Back-merge of 5.11-devel branch for syncing the result changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-07 18:52:58 +01:00
Takashi Iwai
7b62275507 ASoC: Fixes for v5.11
A collection of mostly driver specific fixes, plus a maintainership
 update for TI and a fix for DAPM driver removal paths.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl/3QCQACgkQJNaLcl1U
 h9CEUQf+JN4fp9kFpnZCa0x+o3TMsqG1GKyighefLZPdhW5PkSwNXgidUGkQ1ke1
 RG2uOU7sxEirI2FWtxTDnjho75Sai5lolVNtUSDKQgSU/jjVFJd22PybKXe9SmFK
 BhagMzV0g747xUp4P7DVEqbw0h8wAAeFf1jH4DfTD6C/oxz7VFmxO9YSpW0twF1B
 D+ARFE1MHtSArdtL4mHW4g/fWHppP4ShjQloygpYjPodvppdSH7sUsXLlrhhzLfR
 TwmbPyXbPqHbj6q4FCJMb/5i4HgjkVcAUuhaeGBA+ze3gLp6x7siP2bctKxpWl5e
 GULk8hAkuvWEvwwp494O4r9B3k+WnA==
 =l1VS
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.11

A collection of mostly driver specific fixes, plus a maintainership
update for TI and a fix for DAPM driver removal paths.
2021-01-07 18:51:39 +01:00
朱灿灿
2c1382840c
ASoC: soc-pcm: disconnect BEs if the FE is not ready
FE is connected to two BEs, BE1 is active, BE2 is deactive.
When closing BE1, FE/BE1 is in HW_FREE state, then BE2 is
startup by mixer runtime update.

For FE is in HW_FREE state, dpcm_run_update_startup() will skip
BE2's startup because FE's state is HW_FREE, BE2 stays in FE's
be_clients list.

During FE's closed, the dpcm_fe_dai_close() will close all related
BEs, BE2 will be closed. This will lead to BE2's dpcm[stream].users
mismatch.

We need disconnet all pending BEs in the corner case.

Signed-off-by: zhucancan <zhucancan@vivo.com>
Link: https://lore.kernel.org/r/AAoArwDfDnoefyxzy2wyiaqm.1.1608885766936.Hmail.zhucancan@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-07 16:14:13 +00:00
Hans de Goede
aac568269b
ASoC: Intel: bytcht_es8316: Remove comment about SSP0 being untested
Remove a stale comment about SSP0 being untested, the
bytcht_es8316 has supported SSP0 for a while now and this has
been successfully tested on a GP electrinic T701 tablet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210107120757.12051-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-07 16:14:12 +00:00
Jeremy Szu
91bc156817 ALSA: hda/realtek: fix right sounds and mute/micmute LEDs for HP machines
* The HP ZBook Fury 15/17 G7 Mobile Workstation are using ALC285 codec
   which is using 0x04 to control mute LED and 0x01 to control micmute LED.

 * The right channel speaker is no sound and it needs to expose GPIO1 for
   initialing AMP.

Add quirks to support them.

Signed-off-by: Jeremy Szu <jeremy.szu@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210106130549.100532-1-jeremy.szu@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-07 11:40:39 +01:00
Thomas Bogendoerfer
a8644292ea
ASoC: txx9: Remove driver
CPU support for TX49xx is getting removed, so remove sound support for it.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Link: https://lore.kernel.org/r/20210105140305.141401-11-tsbogend@alpha.franken.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-06 13:08:00 +00:00
Linus Torvalds
1d011777cd sound fixes for 5.11-rc3
Here is a collection of USB- and HD-audio fixes: most of them are
 device-specific quirks while one fix is for a regression by the
 incorrect mutex unlock introduced in 5.11-rc1.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl/0SIcOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE8ogBAA1Il8zJP0HIq4cfqxYJloGzfmNbqCCozGc7Ka
 EDyKr0eX6JYOgamPxPYhbKJdoK3t9cye6fpXgAEuwmviJCF3kQ9ixrCyJStOQ5X0
 xaaMKhszVsBGVpVfU1371huH9GZ+HlvmjwTlfdJmVj6hCq+t6BJqwAw7xD7A+Tyc
 0CQB9tYcMOiucvJhN4rw+QCZl+nIDraW65R8LkxSm+oYsPHW35R9kZQ+EgZfvZj4
 tAC86UoLC06WXq1921mUhD+uZ4WnCF054jLsWVQdepT10vARb9QvE16nyOovsta9
 W5OYX4YSAVhdLeGH7NhrXOz3pRr39eyRHllRhfErQh8LJUgGTGa4GgOYxoZpK0/Y
 PF44aXgm5jBf7ik0fFxZzQCKDaJOdrvlieVKdNhYw7C6V66Xvwy5Y9OQbeByzfrH
 YvhQim1wB9Nj2KyU080VzjWt67pCFy/vT+J1iE6412aLkppF1nkb+D6OgagLAdVl
 yOHk7FPTanjAQnizNQjgG0fbeeqv8fjYDuJewDJb9tRoVbEFD8tWG80HlTM97HaN
 /Fjudp5h2jN+WrSHaRCj8QrKB3gU8yNImoI3Z7CFc8SQ0zd6uKbHwYt3Sc145PJH
 E3z9XHBRTJoNxTLidudwXrguJzAqO3Bpt4Gc+w6t1pzwMKeQ3Cx1M7Cx5r1d2QTp
 Ey1U4ao=
 =2WUV
 -----END PGP SIGNATURE-----

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

Pull sound fixes from Takashi Iwai:
 "Here is a collection of USB- and HD-audio fixes.

  Most of them are device-specific quirks while one fix is for a
  regression due to an incorrect mutex unlock introduced in this merge
  window"

* tag 'sound-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/via: Fix runtime PM for Clevo W35xSS
  ALSA: usb-audio: Add quirk for RC-505
  ALSA: hda/hdmi: Fix incorrect mutex unlock in silent_stream_disable()
  ALSA: hda/realtek: Enable mute and micmute LED on HP EliteBook 850 G7
  ALSA: hda/realtek: Add two "Intel Reference board" SSID in the ALC256.
  ALSA: hda/realtek: Add mute LED quirk for more HP laptops
  ALSA: hda/conexant: add a new hda codec CX11970
  ALSA: usb-audio: Add quirk for BOSS AD-10
  ALSA: usb-audio: Fix UBSAN warnings for MIDI jacks
  ALSA: hda/realtek - Modify Dell platform name
  ALSA: hda/realtek - Fix speaker volume control on Lenovo C940
2021-01-05 13:25:49 -08:00
Tzung-Bi Shih
81a6320da7
ASoC: rt1015: remove bclk_ratio
bclk_ratio is unused.  Removes bclk_ratio and .set_bclk_ratio callback.

Removes snd_soc_dai_set_bclk_ratio() in a few machine drivers which are
obviously using rt1015.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201224101854.3024823-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-05 14:34:18 +00:00
Tzung-Bi Shih
d750570e04
ASoC: rt1015: re-calibrate again when resuming
Assuming the calibration state gets lost after system suspend.
Re-calibrates again when resuming.

The rt1015_priv is alloced by kzalloc.  No need to initialize cali_done
to 0 in component probe callback.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201225030845.4138497-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-05 14:34:17 +00:00
Takashi Iwai
4bfd6247fa ALSA: hda/via: Fix runtime PM for Clevo W35xSS
Clevo W35xSS_370SS with VIA codec has had the runtime PM problem that
looses the power state of some nodes after the runtime resume.  This
was worked around by disabling the default runtime PM via a denylist
entry.  Since 5.10.x made the runtime PM applied (casually) even
though it's disabled in the denylist, this problem was revisited.  The
result was that disabling power_save_node feature suffices for the
runtime PM problem.

This patch implements the disablement of power_save_node feature in
VIA codec for the device.  It also drops the former denylist entry,
too, as the runtime PM should work in the codec side properly now.

Fixes: b529ef2464 ("ALSA: hda: Add Clevo W35xSS_370SS to the power_save blacklist")
Reported-by: Christian Labisch <clnetbox@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210104153046.19993-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-04 16:34:43 +01:00
Arnd Bergmann
a1f31cc4e9
ASoC: fsl_aud2htx: select SND_SOC_IMX_PCM_DMA
The newly added driver requires DMA support and fails to build
when that is disabled:

aarch64-linux-ld: sound/soc/fsl/fsl_aud2htx.o: in function `fsl_aud2htx_probe':
fsl_aud2htx.c:(.text+0x3e0): undefined reference to `imx_pcm_dma_init'

Fixes: 8a24c834c0 ("ASoC: fsl_aud2htx: Add aud2htx module driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20210103135327.3630973-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-04 14:25:00 +00:00
Timon Reinold
b0e1306302 ALSA: usb-audio: Add quirk for RC-505
BOSS RC-505 (shown by lsusb as "Roland Corp. RC-505") does require the
same quirk as these other BOSS devices.

Without this quirk it is neither possible to capture audio from nor to
write audio to the RC-505. Both just result in an empty audio
stream. With these changes both capture and playback seem to work
quite fine. MIDI funtionality was not tested.

Tested-by: Harry Reinold <harry.reinold@posteo.de>
Signed-off-by: Timon Reinold <tirei@agon.one>
Link: https://lore.kernel.org/r/20210102210835.21268-1-tirei@agon.one
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-03 08:58:39 +01:00
Takashi Iwai
3d5c5fdcee ALSA: hda/hdmi: Fix incorrect mutex unlock in silent_stream_disable()
The silent_stream_disable() function introduced by the commit
b1a5039759 ("ALSA: hda/hdmi: fix silent stream for first playback to
DP") takes the per_pin->lock mutex, but it unlocks the wrong one,
spec->pcm_lock, which causes a deadlock.  This patch corrects it.

Fixes: b1a5039759 ("ALSA: hda/hdmi: fix silent stream for first playback to DP")
Reported-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Cc: <stable@vger.kernel.org>
Acked-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210101083852.12094-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-01 21:08:53 +01:00
Arnd Bergmann
c1cbbea9c4
ASoC: mediatek: add MTK_PMIC_WRAP dependency
Randconfig builds often show harmless warnings like

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

Add a dependency to avoid that.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201230154345.639122-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-31 13:26:25 +00:00
Richard Fitzgerald
f6212e0ab3
ASoC: wm_adsp: Use snd_ctl_elem_type_t for control types
Sparse will complain about trying to convert between values declared
as snd_ctl_elem_type_t and other types. This patch converts to
consistently use snd_ctl_elem_type_t for control type values. A __force
cast is needed in a couple of cases where the control type value is
parsed out of a DSP data block.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20201230172427.13865-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-31 13:26:24 +00:00
Richard Fitzgerald
a0b653e89a
ASoC: wm_adsp: Only use __be32 for big-endian data
This fixes some minor cases where u32 or unsigned int types were used
to store big-endian data, and __be32 types used to store both big-endian
and cpu-endian data. This was producing sparse warnings.

Most cases resulted from using the same variable to hold the big-endian
value and its converted cpu-endian value. These can be simply fixed by
introducing another local variable, or avoiding storing the intermediate
value back into the original variable.

One special case is the raw_buf used in the compressed streams to transfer
data from DSP to user-side. The endian conversion happens in-place (as
there's no point introducing another buffer) so a cast to (__be32 *) is
added when passing it to wm_adsp_read_raw_data_block().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20201230172427.13865-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-31 13:26:23 +00:00
Kai-Heng Feng
a598098cc9 ALSA: hda/realtek: Enable mute and micmute LED on HP EliteBook 850 G7
HP EliteBook 850 G7 uses the same GPIO pins as ALC285_FIXUP_HP_GPIO_LED
to enable mute and micmute LED. So apply the quirk to enable the LEDs.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201230125636.45028-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-31 11:59:17 +01:00
PeiSen Hou
ce2e79b223 ALSA: hda/realtek: Add two "Intel Reference board" SSID in the ALC256.
Add two "Intel Reference boad" SSID in the alc256.
Enable "power saving mode" and Enable "headset jack mode".

Signed-off-by: PeiSen Hou <pshou@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/5978d2267f034c28973d117925ec9c63@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-31 11:57:48 +01:00
Manuel Jiménez
484229585a ALSA: hda/realtek: Add mute LED quirk for more HP laptops
HP Pavilion 13-bb0000 (SSID 103c:87c8) needs the same
quirk as other models with ALC287.

Signed-off-by: Manuel Jiménez <mjbfm99@me.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/X+s/gKNydVrI6nLj@HP-Pavilion-13
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-31 11:55:34 +01:00
bo liu
744a11abc5 ALSA: hda/conexant: add a new hda codec CX11970
The current kernel does not support the cx11970 codec chip.
Add a codec configuration item to kernel.

[ Minor coding style fix by tiwai ]

Signed-off-by: bo liu <bo.liu@senarytech.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201229035226.62120-1-bo.liu@senarytech.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-31 11:40:21 +01:00
Oder Chiou
e9141c1aaa
ASoC: rt5645: Remove the redundant delay time
This patch removes the redundant delay time to speed up from the cold start
of headphone playback.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20201230080235.12698-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-30 13:53:19 +00:00
Mark Brown
89ffd36a9e
Merge series "ASoC: rt1015: apply some refactors" from Tzung-Bi Shih <tzungbi@google.com>:
The series refactors rt1015.c.

The 1st patch sorts header inclusions alphabetically.

The 2nd and 3rd patch improve error handling for kcontrols.

The 4th patch enhances readability.

The 5th patch removes unused variables in rt1015_priv.

Tzung-Bi Shih (5):
  ASoC: rt1015: sort header inclusions
  ASoC: rt1015: save boost_mode only if valid
  ASoC: rt1015: return error if any when setting bypass_boost
  ASoC: rt1015: refactor retry loop and rt1015_priv allocation
  ASoC: rt1015: remove unneeded variables in rt1015_priv

 sound/soc/codecs/rt1015.c | 49 ++++++++++++++++++++-------------------
 sound/soc/codecs/rt1015.h |  4 ----
 2 files changed, 25 insertions(+), 28 deletions(-)

--
2.29.2.729.g45daf8777d-goog
2020-12-29 14:28:58 +00:00
Tzung-Bi Shih
a5db2ca513
ASoC: rt1015: remove unneeded variables in rt1015_priv
- `lrck' is only used in .hw_params callback so that it can be local.
- `bclk' is unused.
- `id' is unused.
- `amp_ver' is unused.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201224100607.3006171-6-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29 13:18:48 +00:00
Tzung-Bi Shih
3128f1c3b5
ASoC: rt1015: refactor retry loop and rt1015_priv allocation
Refactors retry loop in flush DAC work.  It is more clear to use a
for-loop here.

Uses !rt1015 to check if NULL.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201224100607.3006171-5-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29 13:18:47 +00:00
Tzung-Bi Shih
e48b41e903
ASoC: rt1015: return error if any when setting bypass_boost
Returns -EBUSY if DAC is using when setting bypass_boost.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201224100607.3006171-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29 13:18:46 +00:00
Tzung-Bi Shih
bf1eb056ac
ASoC: rt1015: save boost_mode only if valid
Saves boost_mode only if valid.  Also returns -EINVAL if it is invalid.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201224100607.3006171-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29 13:18:46 +00:00
Tzung-Bi Shih
4ac275eda0
ASoC: rt1015: sort header inclusions
Sorts header inclusions.  ASCII value of 'r' is less than 's'.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201224100607.3006171-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29 13:18:45 +00:00
Christophe JAILLET
49d411f2c9
ASoC: Intel: common: Fix some typos
s/apci/acpi/

Turn an ICL into a TGL because it is likely a cut'n'paste error

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20201229085103.192715-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-29 12:37:03 +00:00
Takashi Iwai
3deba4d8f0 ALSA: usb-audio: Add quirk for BOSS AD-10
BOSS AD-10 requires the very same quirk like other BOSS devices to
enable the special implicit feedback mode.

Reported-and-tested-by: Martin Passing <martin@passing.name>
Link: https://lore.kernel.org/r/20201229083428.20467-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-29 09:34:59 +01:00
Jaroslav Kysela
1f092d1c88
ASoC: AMD Renoir - add DMI entry for Lenovo ThinkPad X395
The ThinkPad X395 latop does not have the internal digital
microphone connected to the AMD's ACP bridge, but it's advertised
via BIOS. The internal microphone is connected to the HDA codec.

Use DMI to block the microphone PCM device for this platform.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1892115
Cc: <stable@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20201227164109.269973-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 14:22:44 +00:00
Ravulapati Vishnu vardhan rao
a523e1538f
ASoC: amd: Replacing MSI with Legacy IRQ model
When we try to play and capture simultaneously we see that
interrupts are genrated but our handler is not being acknowledged,
After investigating further more in detail on this issue we found
that IRQ delivery via MSI from the ACP IP is unreliable and so sometimes
interrupt generated will not be acknowledged so MSI model shouldn't be used
and using legacy IRQs will resolve interrupt handling issue.

This patch replaces MSI interrupt handling with legacy IRQ model.

Issue can be reproduced easily by running below python script:

import subprocess
import time
import threading

def do2():
  cmd = 'aplay -f dat -D hw:2,1 /dev/zero -d 1'
    subprocess.call(cmd, stdin=subprocess.PIPE,
			stderr=subprocess.PIPE, shell=True)
    print('Play Done')

def run():
	for i in range(1000):
		do2()

def do(i):
    cmd = 'arecord -f dat -D hw:2,2 /dev/null -d 1'
    subprocess.call(cmd, stdout=subprocess.PIPE,
			stderr=subprocess.PIPE, shell=True)
    print(datetime.datetime.now(), i)

t = threading.Thread(target=run)
t.start()
for i in range(1000):
	do(i)

t.join()

After applying this patch issue is resolved.

Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com>
Link: https://lore.kernel.org/r/20201222115929.11222-1-Vishnuvardhanrao.Ravulapati@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 14:22:27 +00:00
Jaroslav Kysela
275565997a
ASoC: AMD Renoir - add DMI entry for Lenovo ThinkPad E14 Gen 2
The ThinkPad E14 Gen 2 latop does not have the internal digital
microphone connected to the AMD's ACP bridge, but it's advertised
via BIOS. The internal microphone is connected to the HDA codec.

Use DMI to block the microphone PCM device for this platform.

Reported-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20201227164037.269893-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 14:20:43 +00:00
Mark Brown
f81325a05e Linux 5.11-rc1
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl/pGQ4eHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGSCsH/AmJzlif2P7bMT12
 2SiVnl/BfK4iHVdGMQPaLZNJVrjFLzhRUj1WiOye0rKq0jp21IVJgwpshiWZeqEg
 8BfT4UEMfdl5uaYIX/7G9AhD2JUy9UHs0VhQEf4oueDAmNl+q2btlXZh/tayqjqc
 DOqLtyJKYRswfBTh260w8/W5EPXJq5IlWf/vOpgGphFWMwolqIAgIlCTulE8pcO6
 EiPuC3tOxBg8zkEkjV94Bvu4+73Hgr8O6beCbbqZlvuTpWci/X1hcVyA+IsGFvL8
 h0YpMrEzvQoroJAVFh7u2KKrU6pObQWsjRb1F7LQIBIGC7hvnzXSzwH2IZQfyFJd
 p/ASNk8=
 =564c
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl/p6NoACgkQJNaLcl1U
 h9BhOQf/QwH0VD/ZPl6Y/P+LzXVBBdwIF9F8bwfzr/czFY22Eb1Pf57vJmZmaz6J
 YHH6Tbdn7A/ROvZGbyp5DKPCu19gvPRyw1E0YdOwS6m4JdxXxCWvVFl3NGiBWkuL
 8HB8PvM8fkR1ix1+OW5vvKt5rItPcAfp17P1Iao34GxqTj/gHox65TRWKynCAhht
 uBgfuMXcwMRIV+6KRUIhTkocba1BDUZC3apnWq0k59A1r3j/niKpED26FWlZIzhN
 +DiDAgQQIe9iZ+T+MB6cYiu3nWsg03g5sPpLlFJuXwTUmgtJqfBlji7ysc5yQmVE
 ezjJdJ5FQll/Ddg953QV+42GSy+3hQ==
 =Sr/M
 -----END PGP SIGNATURE-----

Merge tag 'v5.11-rc1' into asoc-5.11

Linux 5.11-rc1
2020-12-28 14:16:53 +00:00
Lars-Peter Clausen
e05cde84ea
ASoC: meson: Use managed DMA buffer allocation
Using a managed buffer will pre-allocate the buffer using
snd_pcm_lib_preallocate_pages() and automatically free it when the PCM is
destroyed.

In addition it will call snd_pcm_lib_malloc_pages() before the driver's
hw_params() callback and snd_pcm_lib_free_pages() after the driver's
hw_free() callback.

This slightly reduces the boilerplate code of the driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Tested-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20201218154544.25513-1-lars@metafoo.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 12:24:46 +00:00
Andy Shevchenko
57fc2bbc62
ASoC: sprd: Switch to use list_entry_is_head() helper
Since we got list_entry_is_head() helper in the generic header,
we may switch driver to use it. This eliminates the need
in additional variable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20201208111805.6989-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 12:24:45 +00:00
Jack Yu
6bdd75a1f6
ASoC: rt1015: modify calibration sequence for better performance
New calibration sequence to fix power issue in idle state.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/ec66399502514edbb1de3cf9bff08b1d@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 12:24:44 +00:00
Richard Fitzgerald
7726e49837
ASoC: wm_adsp: Improve handling of raw byte streams
As the register map is 16-bit or 32-bit big-endian, the 24-bit
DSP words appear padded and with the bytes swapped. When reading a
raw stream of bytes, the pad bytes must be removed and the data bytes
swapped back to their original order.

The previous implementation of this assumed that the be32_to_cpu() in
wm_adsp_read_data_block() would swap back to little-endian. But this is
obviously only true on a little-endian CPU. It also made two walks
through the data, once to endian-swap and again to strip the pad bytes.

This patch re-works the code so that the endian-swap and unpad are done
together in a single walk, and it is not dependent on the endianness of
the CPU. The data_word_size argument to wm_adsp_remove_padding() has been
dropped because currently this is always 3.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20201216112512.26503-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 12:24:43 +00:00
Andy Shevchenko
a9830fc388
catpt: Switch to use list_entry_is_head() helper
Since we got list_entry_is_head() helper in the generic header,
we may switch catpt to use it. It removes the need in additional variable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20201214172138.44267-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-28 12:24:42 +00:00
Mark Brown
984fcd3f4e
Merge existing fixes from asoc/for-5.11 2020-12-28 12:24:15 +00:00
Lars-Peter Clausen
64062869f0 ALSA: maestro: Use DIV_ROUND_CLOSEST() instead of open-coding it
Use DIV_ROUND_CLOSEST() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@r1@
expression x;
constant C1;
constant C2;
@@
 ((x) + C1) / C2

@script:python@
C1 << r1.C1;
C2 << r1.C2;
@@
try:
	if int(C1) * 2 != int(C2):
		cocci.include_match(False)
except:
	cocci.include_match(False)

@@
expression r1.x;
constant r1.C1;
constant r1.C2;
@@
-(((x) + C1) / C2)
+DIV_ROUND_CLOSEST(x, C2)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-18-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:57 +01:00
Lars-Peter Clausen
e08eaf4003 ALSA: sis7019: Use DIV_ROUND_CLOSEST() instead of open-coding it
Use DIV_ROUND_CLOSEST() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@r1@
expression x;
constant C1;
constant C2;
@@
 ((x) + C1) / C2

@script:python@
C1 << r1.C1;
C2 << r1.C2;
@@
try:
	if int(C1) * 2 != int(C2):
		cocci.include_match(False)
except:
	cocci.include_match(False)

@@
expression r1.x;
constant r1.C1;
constant r1.C2;
@@
-(((x) + C1) / C2)
+DIV_ROUND_CLOSEST(x, C2)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-17-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:56 +01:00
Lars-Peter Clausen
db43394690 ALSA: ens1370: Use DIV_ROUND_CLOSEST() instead of open-coding it
Use DIV_ROUND_CLOSEST() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@r1@
expression x;
constant C1;
constant C2;
@@
 ((x) + C1) / C2

@script:python@
C1 << r1.C1;
C2 << r1.C2;
@@
try:
	if int(C1) * 2 != int(C2):
		cocci.include_match(False)
except:
	cocci.include_match(False)

@@
expression r1.x;
constant r1.C1;
constant r1.C2;
@@
-(((x) + C1) / C2)
+DIV_ROUND_CLOSEST(x, C2)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-16-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:56 +01:00
Lars-Peter Clausen
a8667a3f15 ALSA: trident: Use DIV_ROUND_CLOSEST() instead of open-coding it
Use DIV_ROUND_CLOSEST() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-((x) + ((y) / 2)) / (y)
+DIV_ROUND_CLOSEST(x, y)

@r1@
expression x;
constant C1;
constant C2;
@@
 ((x) + C1) / C2

@script:python@
C1 << r1.C1;
C2 << r1.C2;
@@
try:
	if int(C1) * 2 != int(C2):
		cocci.include_match(False)
except:
	cocci.include_match(False)

@@
expression r1.x;
constant r1.C1;
constant r1.C2;
@@
-(((x) + C1) / C2)
+DIV_ROUND_CLOSEST(x, C2)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-15-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:55 +01:00
Lars-Peter Clausen
4743feb9f4 ALSA: sonicvibes: Use DIV_ROUND_CLOSEST() instead of open-coding it
Use DIV_ROUND_CLOSEST() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-((x) + ((y) / 2)) / (y)
+DIV_ROUND_CLOSEST(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-14-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:55 +01:00
Lars-Peter Clausen
6b5edf1dcc ALSA: oss: Use DIV_ROUND_CLOSEST() instead of open-coding it
Use DIV_ROUND_CLOSEST() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-((x) + ((y) / 2)) / (y)
+DIV_ROUND_CLOSEST(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-13-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:54 +01:00
Lars-Peter Clausen
af102a88ad ALSA: vx: Use roundup() instead of open-coding it
Use roundup() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-((((x) + (y) - 1) / (y)) * y)
+roundup(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-12-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:53 +01:00
Lars-Peter Clausen
e4d8aef214 ALSA: usb: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-(((x) + (y) - 1) / (y))
+DIV_ROUND_UP(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-11-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:52 +01:00
Lars-Peter Clausen
a434713bfe ALSA: lola: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@r1@
expression x;
constant C1;
constant C2;
@@
 (x + C1) / C2

@script:python@
C1 << r1.C1;
C2 << r1.C2;
@@
try:
	if int(C1) != int(C2) - 1:
		cocci.include_match(False)
except:
	cocci.include_match(False)

@@
expression r1.x;
constant r1.C1;
constant r1.C2;
@@
-(((x) + C1) / C2)
+DIV_ROUND_UP(x, C2)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-10-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:52 +01:00
Lars-Peter Clausen
81d0ec4349 ALSA: hda: Use DIV_ROUND_UP()/roundup() instead of open-coding it
Use DIV_ROUND_UP() and roundup() instead of open-coding them. This
documents intent and makes it more clear what is going on for the casual
reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-((((x) + (y) - 1) / (y)) * y)
+roundup(x, y)

@r1@
expression x;
constant C1;
constant C2;
@@
 (x + C1) / C2

@script:python@
C1 << r1.C1;
C2 << r1.C2;
@@
print C1, C2
try:
	if int(C1) != int(C2) - 1:
		cocci.include_match(False)
except:
	cocci.include_match(False)

@@
expression r1.x;
constant r1.C1;
constant r1.C2;
@@
-(((x) + C1) / C2)
+DIV_ROUND_UP(x, C2)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-9-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:51 +01:00
Lars-Peter Clausen
483548a26f ALSA: emu10k1: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-(((x) + (y) - 1) / (y))
+DIV_ROUND_UP(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-8-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:51 +01:00
Lars-Peter Clausen
7095be6d2c ALSA: dummy: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-(((x) + (y) - 1) / (y))
+DIV_ROUND_UP(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-7-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:50 +01:00
Lars-Peter Clausen
7ca4282ade ALSA: ctxfi: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-(((x) + (y) - 1) / (y))
+DIV_ROUND_UP(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-6-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:49 +01:00
Lars-Peter Clausen
636c46c51c ALSA: cx46xx: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-(((x) + (y) - 1) / (y))
+DIV_ROUND_UP(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-5-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:49 +01:00
Lars-Peter Clausen
e02e198e88 ALSA: bt87x: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@r1@
expression x;
constant C1;
constant C2;
@@
 (x + C1) / C2

@script:python@
C1 << r1.C1;
C2 << r1.C2;
@@
try:
	if int(C1) != int(C2) - 1:
		cocci.include_match(False)
except:
	cocci.include_match(False)

@@
expression r1.x;
constant r1.C1;
constant r1.C2;
@@
-(((x) + C1) / C2)
+DIV_ROUND_UP(x, C2)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-4-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:48 +01:00
Lars-Peter Clausen
af787b2e83 ALSA: asihpi: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-(((x) + (y) - 1) / (y))
+DIV_ROUND_UP(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-3-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:48 +01:00
Lars-Peter Clausen
7ef74bdc0d ALSA: aloop: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-(((x) + (y) - 1) / (y))
+DIV_ROUND_UP(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-2-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:47 +01:00
Lars-Peter Clausen
afcfbcb39f ALSA: core: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-(((x) + (y) - 1) / (y))
+DIV_ROUND_UP(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-1-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:46 +01:00
Linus Torvalds
58cf05f597 sound fixes for 5.11-rc1
A collection of small fixes that came up recently for 5.11.
 Majority of fixes are usual HD-audio and USB-audio quirks, while
 a few PCM core fixes for addressing the information leak and yet
 more UBSAN fixes in the core side.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl/i9TYOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+jBg/6Al8JBgYALZkDOFS1fdeihm7i2keRbkI16OIt
 dRv1sIr3rctuLk/oCwj0pTjBNJHfhUX2UfGxcYXIz0m32O1S13t4aBKPJ7BqUi/m
 x0CHYy4v8JDeJGuWm8txzdedJIA3m69m/2TZZ+pFe7p3vIl51vXekklALuLQ+JTw
 tz98CaXMQxJQq+/ddlukLOKSTNI1gb/Q+T4R/ZuMYXrfn0+/WjaP3OED/a4uPvvQ
 0SpLTNS1zzTbS8wK2yys90SK9uR4Y0b0lcNZ5gES1rmYR9ZLwcp0jdHFXKc1HJnJ
 x3YmMHQ+qtP/tFTJz1TCEmYl0ofL6axKEb55urm3NY6Nr/xDei5teT+nuBdum4O8
 tMAui110hVoD4BRz9lCLnvGARVa9MDKj4Znp7QXu1YsUmATuAN4fEzCar9ojIvOV
 rv73LmotPeymeSnLkFKI4DhbesxjJa4/eQkwPGFXsbjwt/E9N4zFpSxyTcWzYK1q
 wl1jyPE6TuMD6nm/Ef2G5h6XIlnZD+AeSSNkVQSsd97Ttvp6kCU5Aidc+IQpQ1b5
 tWRhM8dphiiO+Y2j4pbJNDQMWarXVMp2deXIZzohVNluWM1t/0k76bWa+wATodFJ
 okuZE4knHCUXJ+HO+oTt+85t/H+qgIx0I9VzyQBCwvbJ03xRHYbj0+06YDgTp272
 q6zhW5g=
 =Ihh7
 -----END PGP SIGNATURE-----

Merge tag 'sound-fix-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes that came up recently for 5.11.

  The majority of fixes are usual HD-audio and USB-audio quirks, with a
  few PCM core fixes for addressing the information leak and yet more
  UBSAN fixes in the core side"

* tag 'sound-fix-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA/hda: apply jack fixup for the Acer Veriton N4640G/N6640G/N2510G
  ALSA: hda/realtek: Apply jack fixup for Quanta NL3
  ALSA: usb-audio: Add implicit feeback support for the BOSS GT-1
  ALSA: usb-audio: Add alias entry for ASUS PRIME TRX40 PRO-S
  ALSA: core: Remove redundant comments
  ALSA: hda/realtek: Add quirk for MSI-GP73
  ALSA: pcm: oss: Fix a few more UBSAN fixes
  ALSA: pcm: Clear the full allocated memory at hw_params
  ALSA: memalloc: Align buffer allocations in page size
  ALSA: usb-audio: Disable sample read check if firmware doesn't give back
  ALSA: pcm: Remove snd_pcm_lib_preallocate_dma_free()
  ALSA: usb-audio: Add VID to support native DSD reproduction on FiiO devices
  ALSA: core: memalloc: add page alignment for iram
  ALSA: hda/realtek - Supported Dell fixed type headset
  ALSA: hda/realtek: Remove dummy lineout on Acer TravelMate P648/P658
2020-12-23 15:11:08 -08:00
Takashi Iwai
c06ccf3ebb ALSA: usb-audio: Fix UBSAN warnings for MIDI jacks
The calculation of in_cables and out_cables bitmaps are done with the
bit shift by the value from the descriptor, which is an arbitrary
value, and can lead to UBSAN shift-out-of-bounds warnings.

Fix it by filtering the bad descriptor values with the check of the
upper bound 0x10 (the cable bitmaps are 16 bits).

Reported-by: syzbot+92e45ae45543f89e8c88@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201223174557.10249-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-23 18:46:54 +01:00
Kailang Yang
c1e8952395 ALSA: hda/realtek - Modify Dell platform name
Dell platform SSID:0x0a58 change platform name.
Use the generic name instead for avoiding confusion.

Fixes: 150927c367 ("ALSA: hda/realtek - Supported Dell fixed type headset")
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/efe7c196158241aa817229df7835d645@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-23 15:28:29 +01:00
Kailang Yang
f86de9b1c0 ALSA: hda/realtek - Fix speaker volume control on Lenovo C940
Cannot adjust speaker's volume on Lenovo C940.
Applying the alc298_fixup_speaker_volume function can fix the issue.

[ Additional note: C940 has I2S amp for the speaker and this needs the
  same initialization as Dell machines.
  The patch was slightly modified so that the quirk entry is moved
  next to the corresponding Dell quirk entry. -- tiwai ]

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/ea25b4e5c468491aa2e9d6cb1f2fced3@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-23 15:27:46 +01:00
Chris Chiu
13be30f156 ALSA/hda: apply jack fixup for the Acer Veriton N4640G/N6640G/N2510G
This Acer Veriton N4640G/N6640G/N2510G desktops have 2 headphone
jacks(front and rear), and a separate Mic In jack.

The rear headphone jack is actually a line out jack but always silent
while playing audio. The front 'Mic In' also fails the jack sensing.
Apply the ALC269_FIXUP_LIFEBOOK to have all audio jacks to work as
expected.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201222150459.9545-2-chiu@endlessos.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-22 16:13:49 +01:00
Chris Chiu
6ca653e3f7 ALSA: hda/realtek: Apply jack fixup for Quanta NL3
The Quanta NL3 laptop has both a headphone output jack and a headset
jack, on the right edge of the chassis.

The pin information suggests that both of these are at the Front.
The PulseAudio is confused to differentiate them so one of the jack
can neither get the jack sense working nor the audio output.

The ALC269_FIXUP_LIFEBOOK chained with ALC269_FIXUP_QUANTA_MUTE can
help to differentiate 2 jacks and get the 'Auto-Mute Mode' working
correctly.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201222150459.9545-1-chiu@endlessos.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-22 16:13:27 +01:00
Mike Oliphant
4387722682 ALSA: usb-audio: Add implicit feeback support for the BOSS GT-1
The BOSS GT-1 (USB ID 0582:01d6) requires implicit feedback
like other similar BOSS devices. This patch adds this support.

[ rearranged the table entry in the ID order -- tiwai ]

Signed-off-by: Mike Oliphant <oliphant@nostatic.org>
Link: https://lore.kernel.org/r/20201221215533.2511-1-oliphant@nostatic.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-22 09:25:14 +01:00
Takashi Iwai
525d9c57d0 ALSA: usb-audio: Add alias entry for ASUS PRIME TRX40 PRO-S
ASUS PRIME TRX40 PRO-S mobo with 0b05:1918 needs the same quirk alias
for another ASUS mobo (0b05:1917) for the proper mixer mapping, etc.
Add the corresponding entry.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210783
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201221080159.24468-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-21 09:02:33 +01:00
YangHui
8b7c764e06 ALSA: core: Remove redundant comments
Remove redundant comments

Signed-off-by: YangHui <yanghui.def@gmail.com>
Link: https://lore.kernel.org/r/1608531727-5433-1-git-send-email-yanghui.def@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-21 08:55:15 +01:00
Takashi Iwai
09926202e9 ALSA: hda/realtek: Add quirk for MSI-GP73
MSI-GP73 (with SSID 1462:1229) requires yet again
ALC1220_FIXUP_CLEVO_P950 quirk like other MSI models.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210793
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201220080943.24839-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-20 09:10:07 +01:00
Takashi Iwai
11cb881bf0 ALSA: pcm: oss: Fix a few more UBSAN fixes
There are a few places that call round{up|down}_pow_of_two() with the
value zero, and this causes undefined behavior warnings.  Avoid
calling those macros if such a nonsense value is passed; it's a minor
optimization as well, as we handle it as either an error or a value to
be skipped, instead.

Reported-by: syzbot+33ef0b6639a8d2d42b4c@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201218161730.26596-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-18 17:31:02 +01:00
Takashi Iwai
618de0f4ef ALSA: pcm: Clear the full allocated memory at hw_params
The PCM hw_params core function tries to clear up the PCM buffer
before actually using for avoiding the information leak from the
previous usages or the usage before a new allocation.  It performs the
memset() with runtime->dma_bytes, but this might still leave some
remaining bytes untouched; namely, the PCM buffer size is aligned in
page size for mmap, hence runtime->dma_bytes doesn't necessarily cover
all PCM buffer pages, and the remaining bytes are exposed via mmap.

This patch changes the memory clearance to cover the all buffer pages
if the stream is supposed to be mmap-ready (that guarantees that the
buffer size is aligned in page size).

Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201218145625.2045-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-18 17:09:28 +01:00
Takashi Iwai
5c1733e33c ALSA: memalloc: Align buffer allocations in page size
Currently the standard memory allocator (snd_dma_malloc_pages*())
passes the byte size to allocate as is.  Most of the backends
allocates real pages, hence the actual allocations are aligned in page
size.  However, the genalloc doesn't seem assuring the size alignment,
hence it may result in the access outside the buffer when the whole
memory pages are exposed via mmap.

For avoiding such inconsistencies, this patch makes the allocation
size always to be aligned in page size.

Note that, after this change, snd_dma_buffer.bytes field contains the
aligned size, not the originally requested size.  This value is also
used for releasing the pages in return.

Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201218145625.2045-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-18 17:09:10 +01:00
Takashi Iwai
9df28edce7 ALSA: usb-audio: Disable sample read check if firmware doesn't give back
Some buggy firmware don't give the current sample rate but leaves
zero.  Handle this case more gracefully without warning but just skip
the current rate verification from the next time.

Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201218145858.2357-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-18 17:08:24 +01:00
Lars-Peter Clausen
f2283366c2 ALSA: pcm: Remove snd_pcm_lib_preallocate_dma_free()
Since commit d4cfb30fce ("ALSA: pcm: Set per-card upper limit of PCM
buffer allocations") snd_pcm_lib_preallocate_dma_free() is a single line
function that has one caller, which is another single line function.

Clean this up a bit and remove snd_pcm_lib_preallocate_dma_free() and
directly call do_free_pages() from snd_pcm_lib_preallocate_free(). This is
a bit less boilerplate.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201218153400.18394-1-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-18 17:07:04 +01:00
Linus Torvalds
8a5be36b93 powerpc updates for 5.11
- Switch to the generic C VDSO, as well as some cleanups of our VDSO
    setup/handling code.
 
  - Support for KUAP (Kernel User Access Prevention) on systems using the hashed
    page table MMU, using memory protection keys.
 
  - Better handling of PowerVM SMT8 systems where all threads of a core do not
    share an L2, allowing the scheduler to make better scheduling decisions.
 
  - Further improvements to our machine check handling.
 
  - Show registers when unwinding interrupt frames during stack traces.
 
  - Improvements to our pseries (PowerVM) partition migration code.
 
  - Several series from Christophe refactoring and cleaning up various parts of
    the 32-bit code.
 
  - Other smaller features, fixes & cleanups.
 
 Thanks to:
   Alan Modra, Alexey Kardashevskiy, Andrew Donnellan, Aneesh Kumar K.V, Ard
   Biesheuvel, Athira Rajeev, Balamuruhan S, Bill Wendling, Cédric Le Goater,
   Christophe Leroy, Christophe Lombard, Colin Ian King, Daniel Axtens, David
   Hildenbrand, Frederic Barrat, Ganesh Goudar, Gautham R. Shenoy, Geert
   Uytterhoeven, Giuseppe Sacco, Greg Kurz, Harish, Jan Kratochvil, Jordan
   Niethe, Kaixu Xia, Laurent Dufour, Leonardo Bras, Madhavan Srinivasan, Mahesh
   Salgaonkar, Mathieu Desnoyers, Nathan Lynch, Nicholas Piggin, Oleg Nesterov,
   Oliver O'Halloran, Oscar Salvador, Po-Hsu Lin, Qian Cai, Qinglang Miao, Randy
   Dunlap, Ravi Bangoria, Sachin Sant, Sandipan Das, Sebastian Andrzej Siewior ,
   Segher Boessenkool, Srikar Dronamraju, Tyrel Datwyler, Uwe Kleine-König,
   Vincent Stehlé, Youling Tang, Zhang Xiaoxu.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAl/bURITHG1wZUBlbGxl
 cm1hbi5pZC5hdQAKCRBR6+o8yOGlgEzBEAC1Vwibcog2P9rkJPb0q3UGWSYSx25V
 h/LwwxtM9Tm14j/LZsSgkOgIsfMaWEBIw/8D4efQ7AX9aFo+R0c2DdQMx1MG5MXz
 gZk58+l3LwId6h9+OrwurpEW+ZmURLAtGMSyFdkeiZ3/XTnkbf1XnewC0QWQe56a
 EGLmjx1MFl45jspoy7UIUXsXoNJIfflEKhrgUzSUh8X2eLmvB9ws6A4BXxbVzyZl
 lZv3+uWimU2pFgdkB9jOCxoG4zFEr2o5ovLHG7zCCVo5JoXmTPQ5cMVBraH206ms
 +5vCmu4qI8uP5UlZW/mZfhrtDiMdHdQqqFOaQwVlOmoUbU6L6E6rxm3iVnov2Bbi
 iUgxoeJDxAb2cM2EWFK6oWVgr7+NkwvXM1IG8xtprhHrCdnC9r+psQr/dswb3LSg
 MJ7u/RCq3uixy2kWP8E0NEHw7ngQZ/ZKPqzfnmIWOC7tYUxgaL02I8Ff9/ZXAI2J
 CnmqFYOjrimHkcwXGOtKkXNvfU0DiL97qpK2AQNWElE8+bUUmpw+ltUrsdSycYmv
 Afc4WIcVrTA+a9laSLgjdZbolbNSa3p+cMIYdPrVx9g+xqygbxIKv+EDGNv1WHfD
 GU1gmohMY+ZkMOvFRMi8LAsEm0DH/etWE0py/8uyxDYKnGyD1Ur6452DStkmgGb2
 azmcaOyLdb+HXA==
 =Ga3K
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc updates from Michael Ellerman:

 - Switch to the generic C VDSO, as well as some cleanups of our VDSO
   setup/handling code.

 - Support for KUAP (Kernel User Access Prevention) on systems using the
   hashed page table MMU, using memory protection keys.

 - Better handling of PowerVM SMT8 systems where all threads of a core
   do not share an L2, allowing the scheduler to make better scheduling
   decisions.

 - Further improvements to our machine check handling.

 - Show registers when unwinding interrupt frames during stack traces.

 - Improvements to our pseries (PowerVM) partition migration code.

 - Several series from Christophe refactoring and cleaning up various
   parts of the 32-bit code.

 - Other smaller features, fixes & cleanups.

Thanks to: Alan Modra, Alexey Kardashevskiy, Andrew Donnellan, Aneesh
Kumar K.V, Ard Biesheuvel, Athira Rajeev, Balamuruhan S, Bill Wendling,
Cédric Le Goater, Christophe Leroy, Christophe Lombard, Colin Ian King,
Daniel Axtens, David Hildenbrand, Frederic Barrat, Ganesh Goudar,
Gautham R. Shenoy, Geert Uytterhoeven, Giuseppe Sacco, Greg Kurz,
Harish, Jan Kratochvil, Jordan Niethe, Kaixu Xia, Laurent Dufour,
Leonardo Bras, Madhavan Srinivasan, Mahesh Salgaonkar, Mathieu
Desnoyers, Nathan Lynch, Nicholas Piggin, Oleg Nesterov, Oliver
O'Halloran, Oscar Salvador, Po-Hsu Lin, Qian Cai, Qinglang Miao, Randy
Dunlap, Ravi Bangoria, Sachin Sant, Sandipan Das, Sebastian Andrzej
Siewior , Segher Boessenkool, Srikar Dronamraju, Tyrel Datwyler, Uwe
Kleine-König, Vincent Stehlé, Youling Tang, and Zhang Xiaoxu.

* tag 'powerpc-5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (304 commits)
  powerpc/32s: Fix cleanup_cpu_mmu_context() compile bug
  powerpc: Add config fragment for disabling -Werror
  powerpc/configs: Add ppc64le_allnoconfig target
  powerpc/powernv: Rate limit opal-elog read failure message
  powerpc/pseries/memhotplug: Quieten some DLPAR operations
  powerpc/ps3: use dma_mapping_error()
  powerpc: force inlining of csum_partial() to avoid multiple csum_partial() with GCC10
  powerpc/perf: Fix Threshold Event Counter Multiplier width for P10
  powerpc/mm: Fix hugetlb_free_pmd_range() and hugetlb_free_pud_range()
  KVM: PPC: Book3S HV: Fix mask size for emulated msgsndp
  KVM: PPC: fix comparison to bool warning
  KVM: PPC: Book3S: Assign boolean values to a bool variable
  powerpc: Inline setup_kup()
  powerpc/64s: Mark the kuap/kuep functions non __init
  KVM: PPC: Book3S HV: XIVE: Add a comment regarding VP numbering
  powerpc/xive: Improve error reporting of OPAL calls
  powerpc/xive: Simplify xive_do_source_eoi()
  powerpc/xive: Remove P9 DD1 flag XIVE_IRQ_FLAG_EOI_FW
  powerpc/xive: Remove P9 DD1 flag XIVE_IRQ_FLAG_MASK_FW
  powerpc/xive: Remove P9 DD1 flag XIVE_IRQ_FLAG_SHIFT_BUG
  ...
2020-12-17 13:34:25 -08:00
Jerome Brunet
671ee4db95
ASoC: meson: axg-tdm-interface: fix loopback
When the axg-tdm-interface was introduced, the backend DAI was marked as an
endpoint when DPCM was walking the DAPM graph to find a its BE.

It is no longer the case since this
commit 8dd26dff00 ("ASoC: dapm: Fix handling of custom_stop_condition on DAPM graph walks")
Because of this, when DPCM finds a BE it does everything it needs on the
DAIs but it won't power up the widgets between the FE and the BE if there
is no actual endpoint after the BE.

On meson-axg HWs, the loopback is a special DAI of the tdm-interface BE.
It is only linked to the dummy codec since there no actual HW after it.
>From the DAPM perspective, the DAI has no endpoint. Because of this, the TDM
decoder, which is a widget between the FE and BE is not powered up.

>From the user perspective, everything seems fine but no data is produced.

Connecting the Loopback DAI to a dummy DAPM endpoint solves the problem.

Fixes: 8dd26dff00 ("ASoC: dapm: Fix handling of custom_stop_condition on DAPM graph walks")
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20201217150812.3247405-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-17 17:11:42 +00:00
Jerome Brunet
a84dfb3d55
ASoC: meson: axg-tdmin: fix axg skew offset
The signal captured on from tdm decoder of the AXG SoC is incorrect. It
appears amplified. The skew offset of the decoder is wrong.

Setting the skew offset to 3, like the g12 and sm1 SoCs, solves and gives
correct data.

Fixes: 13a22e6a98 ("ASoC: meson: add tdm input driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20201217150834.3247526-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-17 17:11:42 +00:00
Mark Brown
cda91206dc
Merge series "Platform driver update to support playback recover after resume" from Srinivasa Rao Mandadapu <srivasam@codeaurora.org>:
This patch set is to add support for playback recover after hard suspend and resume.
It includes:
1. Reverting part of previous commit, which is for handling registers invalid state
after hard suspend.
2. Adding pm ops in component driver and do regcache sync.
Changes Since v1 and v2:
  -- Subject lines changed
Changes Since v3:
  -- Patch is splitted into 2 patches
Changes Since v4:
  -- Subject lines changed
Changes Since v5:
  -- Removed redundant initialization of map variable in lpass-platform.c

Srinivasa Rao Mandadapu (2):
  ASoC: qcom: Fix incorrect volatile registers
  ASoC: qcom: Add support for playback recover after resume

 sound/soc/qcom/lpass-cpu.c      | 20 ++---------------
 sound/soc/qcom/lpass-platform.c | 50 ++++++++++++++++++++++++++++-------------
 2 files changed, 37 insertions(+), 33 deletions(-)

--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
2020-12-17 17:05:48 +00:00
Bard Liao
349dd23931
ASoC: max98373: don't access volatile registers in bias level off
We will set regcache_cache_only true in suspend. As a result,
regmap_read will return error when we try to read volatile
registers in suspend. Besides, it doesn't make sense to read
feedback data when codec is not active. To make userspace
happy, this patch returns a cached value shich should be a
valid value.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20201217074556.32370-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-17 14:24:45 +00:00
Shuming Fan
6108f990c0
ASoC: rt711: mutex between calibration and power state changes
To avoid calibration time-out, this patch adds the mutex between calibration and power state changes

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20201217085651.24580-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-17 14:24:44 +00:00
Cezary Rojewski
bb224c3e3e
ASoC: Intel: haswell: Add missing pm_ops
haswell machine board is missing pm_ops what prevents it from undergoing
suspend-resume procedure successfully. Assign default snd_soc_pm_ops so
this is no longer the case.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20201217105401.27865-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-17 14:24:43 +00:00
Kuninori Morimoto
61c7dbec33
ASoC: rsnd: don't call clk_disable_unprepare() if can't use
We need to care clock accessibility,
because we might can't use clock for some reasons.

It sets clk_rate for each clocks when enabled.
This means it doesn't have clk_rate if we can't use.
We can avoid to call clk_disable_unprepare() in such case.

Link: https://lore.kernel.org/r/CAMuHMdWvB+p=2JqTsO7bR8uJqKqO5A2XgXFXsVAjHk3hcxgcTw@mail.gmail.com
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/87eejpgoi9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-17 14:24:42 +00:00
Srinivasa Rao Mandadapu
8d1bfc04c9
ASoC: qcom: Add support for playback recover after resume
To support playback continuation after hard suspend(bypass powerd)
and resume do regcache sync with component driver pm ops.

Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Link: https://lore.kernel.org/r/1608192514-29695-3-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-17 14:24:41 +00:00
Srinivasa Rao Mandadapu
315fbe4cef
ASoC: qcom: Fix incorrect volatile registers
MI2S and DMA control registers are not volatile, so remove these from volatile registers list.
Registers reset state check by reading non volatile registers makes no use,
so remove error check from cpu and platform trigger callbacks.
Initialized map variable two times in lpass platform trigger API,
so remove redundant initialization.

Fixes commit b182496822 ("ASoC: qcom: Fix enabling BCLK and LRCLK in LPAIF invalid state")

Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Link: https://lore.kernel.org/r/1608192514-29695-2-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-17 14:24:40 +00:00
Amadej Kastelic
725124d10d ALSA: usb-audio: Add VID to support native DSD reproduction on FiiO devices
Add VID to support native DSD reproduction on FiiO devices.

Tested-by: Amadej Kastelic <amadejkastelic7@gmail.com>
Signed-off-by: Emilio Moretti <emilio.moretti@gmail.com>
Signed-off-by: Amadej Kastelic <amadejkastelic7@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/X9j7wdXSr4XyK7Bd@ryzen.localdomain
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-17 10:40:25 +01:00
Robin Gong
74c64efa15 ALSA: core: memalloc: add page alignment for iram
Since mmap for userspace is based on page alignment, add page alignment
for iram alloc from pool, otherwise, some good data located in the same
page of dmab->area maybe touched wrongly by userspace like pulseaudio.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1608221747-3474-1-git-send-email-yibin.gong@nxp.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-17 10:38:12 +01:00
Kailang Yang
150927c367 ALSA: hda/realtek - Supported Dell fixed type headset
This platform only supported iphone type headset.
It can't support Dell headset mode.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/b97e971978034bc9b772a08ec91265e8@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-17 10:35:44 +01:00
Chris Chiu
34cdf405aa ALSA: hda/realtek: Remove dummy lineout on Acer TravelMate P648/P658
Acer TravelMate laptops P648/P658 series with codec ALC282 only have
one physical jack for headset but there's a confusing lineout pin on
NID 0x1b reported. Audio applications hence misunderstand that there
are a speaker and a lineout, and take the lineout as the default audio
output.

Add a new quirk to remove the useless lineout and enable the pin 0x18
for jack sensing and headset microphone.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201216125200.27053-1-chiu@endlessos.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-16 16:35:58 +01:00
Colin Ian King
1373377532
ASoC: atmel: fix spelling mistake in Kconfig "programable" -> "programmable"
There are a couple of spelling mistakes in the Kconfig help text. Fix them.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20201216112608.11385-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-16 13:53:53 +00:00
shengjiu wang
acd894aee3
ASoC: imx-hdmi: Fix warning of the uninitialized variable ret
When condition ((hdmi_out && hdmi_in) || (!hdmi_out && !hdmi_in))
is true, then goto fail, the uninitialized variable ret will be
returned.

Signed-off-by: shengjiu wang <shengjiu.wang@nxp.com>
Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Fixes: 6a5f850aa8 ("ASoC: fsl: Add imx-hdmi machine driver")
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1608115464-18710-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-16 13:53:52 +00:00
Colin Ian King
e49037ad12
ASoC: SOF: Fix spelling mistake in Kconfig "ond" -> "and"
There is a spelling mistake in the Kconfig help text. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201216125913.16041-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-16 13:53:51 +00:00
Colin Ian King
4ad2d3cf2a
ASoC: codecs: fix spelling mistake in Kconfig "comunicate" -> "communicate"
There is a spelling mistake in the Kconfig help text. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20201216112859.11564-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-16 13:53:50 +00:00
Linus Torvalds
aab7ce2b09 ACPI updates for 5.11-rc1
- Update ACPICA code in the kernel to upstream revision 20201113
    with changes as follows:
 
    * Add 5 new UUIDs to the known UUID table (Bob Moore).
    * Remove extreaneous "the" in comments (Colin Ian King).
    * Add function trace macros to improve debugging (Erik Kaneda).
    * Fix interpreter memory leak (Erik Kaneda).
    * Handle "orphan" _REG for GPIO OpRegions (Hans de Goede).
 
  - Introduce resource_union() and resource_intersection() helpers
    and clean up some resource-manipulation code with the help of
    them (Andy Shevchenko).
 
  - Revert problematic commit related to the handling of resources
    in the ACPI core (Daniel Scally).
 
  - Extend the ACPI device enumeration documentation and the
    gpio-line-names _DSD property documentation, clean up the
    latter (Flavio Suligoi).
 
  - Clean up _DEP handling during device enumeration, modify the list
    of _DEP exceptions and the handling of it and fix up terminology
    related to _DEP (Hans de Goede, Rafael Wysocki).
 
  - Eliminate in_interrupt() usage from the ACPI EC driver (Sebastian
    Andrzej Siewior).
 
  - Clean up the advance_transaction() routine and related code in
    the ACPI EC driver (Rafael Wysocki).
 
  - Add new backlight quirk for GIGABYTE GB-BXBT-2807 (Jasper
    St. Pierre).
 
  - Make assorted janitorial changes in several ACPI-related pieces
    of code (Hanjun Guo, Jason Yan, Punit Agrawal).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl/Y80sSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxLnsP/0B+6dSTqLp7S1UJbScta1gKnDwyFGAi
 eA3MqyMfF08DiwWocJoDDjttxo5d+0NV2g9LdcScdwGrKB9ddWuhA6/IT83B7YA8
 K4Yie4Gm1StLR+rs+zLJy9GBQE3P/Ya058WJJ+mvaTkn4SlI1qf8ZhOEzlCArWpM
 0g9+Y7n16A8/9dTTd8eVf80UrPLOuxPPIZuSsCdZCDEOLGPH+zJive0X0wEqsXvU
 hiq8DymH2ooIcscYXu3wEKtAfcxUjGhmrK8/M7dJ1j9Mh7JxQsIIcQIQogG2uE53
 Gm71E1LkQg3FYzFCYmtSNgOnjMMDfV3r/WH4f49kK1Hajn2erYvEv5kXpF+J+Q6X
 rXXRk17puszq5/gvrebDFpUou7MmV4smOeXPQIobJuXnc9c48QEBqx8tshuJXsVv
 5EzD6tITGl/iLu3bqH5M9G5BjIZYB9kjUPzxJ3ezl9rtJXsiMN21MkM4j3KR1rnW
 g3JYMuw1hwa9wVNFraMyCOtcfncCPJNzdi9TT3ZzMDLHTKbd0jmpyBKws+dI5G1z
 y7utKOi65utX6mTtOwhITVbSu7Gura7FRXkxo3K7kG8WViYXhDvB1mLylrpipNDl
 ZWgX6XMYEtRhSvvTwZM0Wcgs9p2JIgfQvbz1Q9pv5FLbf1nceRMaiiGrJTPiGYZD
 /maVvuddxEWM
 =5LZe
 -----END PGP SIGNATURE-----

Merge tag 'acpi-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to upstream revision
  20201113, fix and clean up some resources manipulation code, extend
  the enumeration and gpio-line-names property documentation, clean up
  the handling of _DEP during device enumeration, add a new backlight
  DMI quirk, clean up transaction handling in the EC driver and make
  some assorted janitorial changes.

  Specifics:

   - Update ACPICA code in the kernel to upstream revision 20201113 with
     changes as follows:
       * Add 5 new UUIDs to the known UUID table (Bob Moore)
       * Remove extreaneous "the" in comments (Colin Ian King)
       * Add function trace macros to improve debugging (Erik Kaneda)
       * Fix interpreter memory leak (Erik Kaneda)
       * Handle "orphan" _REG for GPIO OpRegions (Hans de Goede)

   - Introduce resource_union() and resource_intersection() helpers and
     clean up some resource-manipulation code with the help of them
     (Andy Shevchenko)

   - Revert problematic commit related to the handling of resources in
     the ACPI core (Daniel Scally)

   - Extend the ACPI device enumeration documentation and the
     gpio-line-names _DSD property documentation, clean up the latter
     (Flavio Suligoi)

   - Clean up _DEP handling during device enumeration, modify the list
     of _DEP exceptions and the handling of it and fix up terminology
     related to _DEP (Hans de Goede, Rafael Wysocki)

   - Eliminate in_interrupt() usage from the ACPI EC driver (Sebastian
     Andrzej Siewior)

   - Clean up the advance_transaction() routine and related code in the
     ACPI EC driver (Rafael Wysocki)

   - Add new backlight quirk for GIGABYTE GB-BXBT-2807 (Jasper St
     Pierre)

   - Make assorted janitorial changes in several ACPI-related pieces of
     code (Hanjun Guo, Jason Yan, Punit Agrawal)"

* tag 'acpi-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (40 commits)
  ACPI: scan: Fix up _DEP-related terminology with supplier/consumer
  ACPI: scan: Drop INT3396 from acpi_ignore_dep_ids[]
  ACPI: video: Add DMI quirk for GIGABYTE GB-BXBT-2807
  Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks"
  ACPI: scan: Add PNP0D80 to the _DEP exceptions list
  ACPI: scan: Call acpi_get_object_info() from acpi_add_single_object()
  ACPI: scan: Add acpi_info_matches_hids() helper
  ACPICA: Update version to 20201113
  ACPICA: Interpreter: fix memory leak by using existing buffer
  ACPICA: Add function trace macros to improve debugging
  ACPICA: Also handle "orphan" _REG methods for GPIO OpRegions
  ACPICA: Remove extreaneous "the" in comments
  ACPICA: Add 5 new UUIDs to the known UUID table
  resource: provide meaningful MODULE_LICENSE() in test suite
  ASoC: Intel: catpt: Replace open coded variant of resource_intersection()
  ACPI: processor: Drop duplicate setting of shared_cpu_map
  ACPI: EC: Clean up status flags checks in advance_transaction()
  ACPI: EC: Untangle error handling in advance_transaction()
  ACPI: EC: Simplify error handling in advance_transaction()
  ACPI: EC: Rename acpi_ec_is_gpe_raised()
  ...
2020-12-15 16:39:06 -08:00
Linus Torvalds
a45f1d4331 regmap: Updates for v5.11
This is quite a busy release for regmap with two substantial features
 being added:
 
  - Support for register maps Soundwire 1.2 multi-byte operations,
    allowing atomic support for registers larger than a single byte.
  - Support for relaxed I/O without barriers in MMIO regmaps, allowing
    them to be used efficiently on systems where default MMIO operations
    include barriers.
 
 There was also an addition and revert of use of the new Soundwire
 support for RT715 due to build issues with the driver built in, my tests
 only covered building it as a module, the patch wasn't just dropped as
 it had already been merged elsewhere.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl/XdOYACgkQJNaLcl1U
 h9DKWwf7BVgrH1vcgOdZ/8xbVnu2pmNGJzHydfV2XD2fHuEgkuVN1dv756HFCzBj
 XpHGa+XRGt1j39KsBqhcBOGuCLiTmjmoxWXq4MnBFVHcXBNRk1z6YFtkeZBkRi0j
 ZxZNlrrCCaFp8KmqyqMeIU9DbiQ/ITTH/1VBcffnprYI1J9gK4JQE0iisaMIap90
 XwKx4VUwT63yVZQGJPW4t65uMUbPTRqcZQzfj3DGhjmkhNI/EvpPU44K11I+op/6
 7J9enekMlbOR5t7606h9gAapW1Qt+YrvTwciT9mzGNsmO8MmyUIRQUYuZAzp5RIT
 BH5aIRfTUb6lYuktSKI8STrbOUdi/A==
 =194Y
 -----END PGP SIGNATURE-----

Merge tag 'regmap-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap updates from Mark Brown:
 "This is quite a busy release for regmap with two substantial features
  being added:

    - Support for register maps Soundwire 1.2 multi-byte operations,
      allowing atomic support for registers larger than a single byte.

    - Support for relaxed I/O without barriers in MMIO regmaps, allowing
      them to be used efficiently on systems where default MMIO
      operations include barriers.

  There was also an addition and revert of use of the new Soundwire
  support for RT715 due to build issues with the driver built in, my
  tests only covered building it as a module, the patch wasn't just
  dropped as it had already been merged elsewhere"

* tag 'regmap-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  ASoC: rt715: Fix build
  regmap: sdw: add required header files
  regmap: Remove duplicate `type` field from regmap `regcache_sync` trace event
  regmap: Fix order of regmap write log
  regmap: mmio: add config option to allow relaxed MMIO accesses
2020-12-15 15:34:38 -08:00
Linus Torvalds
3db1a3fa98 Staging / IIO driver patches for 5.11-rc1
Here is the big staging and IIO driver pull request for 5.11-rc1
 
 Lots of different things in here:
   - loads of driver updates
   - so many coding style cleanups
   - new IIO drivers
   - Android ION code is finally removed from the tree
   - wimax drivers are moved to staging on their way out of the kernel
 
 Nothing really exciting, just the constant grind of kernel development :)
 
 All have been in linux-next for a while with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCX9iCdw8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yn44QCguVCsIkhxYmnuTAkrPQP74CbJoJwAoLVoPM5K
 LJRbMYjGfRc4gZehlrIV
 =clR4
 -----END PGP SIGNATURE-----

Merge tag 'staging-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging / IIO driver updates from Greg KH:
 "Here is the big staging and IIO driver pull request for 5.11-rc1

  Lots of different things in here:

   - loads of driver updates

   - so many coding style cleanups

   - new IIO drivers

   - Android ION code is finally removed from the tree

   - wimax drivers are moved to staging on their way out of the kernel

  Nothing really exciting, just the constant grind of kernel development :)

  All have been in linux-next for a while with no reported issues"

* tag 'staging-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (341 commits)
  staging: olpc_dcon: Do not call platform_device_unregister() in dcon_probe()
  staging: most: Fix spelling mistake "tranceiver" -> "transceiver"
  staging: qlge: remove duplicate word in comment
  staging: comedi: mf6x4: Fix AI end-of-conversion detection
  staging: greybus: Add TODO item about modernizing the pwm code
  pinctrl: ralink: add a pinctrl driver for the rt2880 family
  dt-bindings: pinctrl: rt2880: add binding document
  staging: rtl8723bs: remove ELEMENT_ID enum
  staging: rtl8723bs: remove unused macros
  staging: rtl8723bs: replace EID_EXTCapability
  staging: rtl8723bs: replace EID_BSSIntolerantChlReport
  staging: rtl8723bs: replace EID_BSSCoexistence
  staging: rtl8723bs: replace _MME_IE_
  staging: rtl8723bs: replace _WAPI_IE_
  staging: rtl8723bs: replace _EXT_SUPPORTEDRATES_IE_
  staging: rtl8723bs: replace _ERPINFO_IE_
  staging: rtl8723bs: replace _CHLGETXT_IE_
  staging: rtl8723bs: replace _COUNTRY_IE_
  staging: rtl8723bs: replace _IBSS_PARA_IE_
  staging: rtl8723bs: replace _TIM_IE_
  ...
2020-12-15 14:18:40 -08:00
Linus Torvalds
c367caf1a3 sound updates for 5.11-rc1
Lots of changes (slightly more code increase than usual) at this
 time, while most of code changes are ASoC driver-specific.
 Here goes some highlight:
 
 Core:
 * The new auxiliary bus implementation for Intel DSP, which will
   be used by other drivers as well
 * Lots of ASoC core cleanups and refactoring
 * UBSAN and KCSAN fixes in rawmidi, sequencer and a few others
 * Compress-offload API enhancement for the pause during draining
 
 HD- and USB-audio:
 * Enhancements of the USB-audio implicit feedback support,
   including better full-duplex operations
 * Continued CA0132 improvements and fixes
 * A few new quirk entries, HDMI audio fixes
 
 ASoC:
 * Support for boot time selection of Intel DSP firmware, which
   should help distros/users testing new stuff more easily;
   the kconfig was moved to boot time option, too
 * Some basic DPCM support in audio graph card
 * Removal of old pre-DT Freescale drivers
 * Support for Allwinner H6 I2S, Analog Devices ADAU1372, Intel
   Alderlake-S, GMediatek MT8192, NXP i.MX HDMI and XCVR, Realtek
   RT715, Qualcomm SM8250 and simple GPIO based muxes
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl/YhGcOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE8O1RAAhuRnJZXDXOPXIG9OchsYlHI3wK4eaSiyNe+i
 sI5yoAdLFYBxBY3OQ4kQCvhjzlLziUvfIfv5YZZMGGAxx9rxsb73F1zH4ttFi1qA
 6ipbhk7SVgK3AQk74lWB2JRYrdBko8Y3z9HKNVqaXWnTubyV4EinoC4hzNLuNDI9
 JsgyrsCL5Bzl9rlD3vs5mwPwIfiD4hw1KKSQa9f1qnOtXCcbRtL3T4iZZsF5sIph
 veKrS0R1MZmXpMQoyhyMnTls1GvmW5N3mhIgw9rR1PgeVof8q8klKd2WfroKKz6s
 Dek3IrgPXfvTdr2ZjNxI29x4NItIayGkbe1DFLZcHQ08yn9JrP9EKQ3Gnv7S9pVT
 2gIdSOZV4XYA4OF04ubNU1Ve0n5kP4pX/LvN+cuSgyfgCE+V6HsvTF5nVyrunrM/
 0bdjdWrc1dkb59GuLGOxI0M68lou7J14ZjCzeevuuQm9dNN5x62LDf3+0vDTFBEs
 t9DaqoqUMZKFfaMLWG8UK04kvw3rhAHap+tQ9HOpz86VK6Qy54RBSfv43p2UK1SO
 TDHRYIQxQ1GfPlHEy6XFfKOPw15VPDMJWoMPzFfoB+C6dzNKKSAgivFPnERsw88X
 9T81MeLhCqqTdRLlZPnGM3S6L1btZhkZcLvyusT0WGGVg8KLgSmn4OwY2wITDebM
 zIUgHTM=
 =j9El
 -----END PGP SIGNATURE-----

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

Pull sound updates from Takashi Iwai:
 "Lots of changes (slightly more code increase than usual) at this time,
  while most of code changes are ASoC driver-specific.

  Here are some highlights:

  Core:

   - The new auxiliary bus implementation for Intel DSP, which will be
     used by other drivers as well

   - Lots of ASoC core cleanups and refactoring

   - UBSAN and KCSAN fixes in rawmidi, sequencer and a few others

   - Compress-offload API enhancement for the pause during draining

  HD- and USB-audio:

   - Enhancements of the USB-audio implicit feedback support, including
     better full-duplex operations

   - Continued CA0132 improvements and fixes

   - A few new quirk entries, HDMI audio fixes

  ASoC:

   - Support for boot time selection of Intel DSP firmware, which should
     help distros/users testing new stuff more easily; the kconfig was
     moved to boot time option, too

   - Some basic DPCM support in audio graph card

   - Removal of old pre-DT Freescale drivers

   - Support for Allwinner H6 I2S, Analog Devices ADAU1372, Intel
     Alderlake-S, GMediatek MT8192, NXP i.MX HDMI and XCVR, Realtek
     RT715, Qualcomm SM8250 and simple GPIO based muxes"

* tag 'sound-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (445 commits)
  ALSA: pcm: oss: Fix potential out-of-bounds shift
  ALSA: usb-audio: Fix potential out-of-bounds shift
  ALSA: hda/ca0132 - Add ZxR surround DAC setup.
  ALSA: hda/ca0132 - Add 8051 PLL write helper functions.
  ALSA: hda/hdmi: packet buffer index must be set before reading value
  ASoC: SOF: imx: update kernel-doc description
  ASoC: mediatek: mt8183: delete some unreachable code
  ASoC: mediatek: mt8183: add PM ops to machine drivers
  ASoC: topology: Fix wrong size check
  ASoC: topology: Add missing size check
  ASoC: SOF: Intel: hda: fix the condition passed to sof_dev_dbg_or_err
  ASoC: SOF: modify the SOF_DBG flags
  ASoC: SOF: Intel: hda: remove duplicated status dump
  ASoC: rt1015p: delay 300ms after SDB pulling high for calibration
  ASoC: rt1015p: move SDB control from trigger to DAPM
  ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
  ALSA: usb-audio: Fix control 'access overflow' errors from chmap
  ALSA: hda/hdmi: always print pin NIDs as hexadecimal
  ALSA: hda/realtek - Add supported for more Lenovo ALC285 Headset Button
  ALSA: hda/ca0132 - Remove now unnecessary DSP setup functions.
  ...
2020-12-15 13:43:47 -08:00
Linus Torvalds
ac73e3dc8a Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton:

 - a few random little subsystems

 - almost all of the MM patches which are staged ahead of linux-next
   material. I'll trickle to post-linux-next work in as the dependents
   get merged up.

Subsystems affected by this patch series: kthread, kbuild, ide, ntfs,
ocfs2, arch, and mm (slab-generic, slab, slub, dax, debug, pagecache,
gup, swap, shmem, memcg, pagemap, mremap, hmm, vmalloc, documentation,
kasan, pagealloc, memory-failure, hugetlb, vmscan, z3fold, compaction,
oom-kill, migration, cma, page-poison, userfaultfd, zswap, zsmalloc,
uaccess, zram, and cleanups).

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (200 commits)
  mm: cleanup kstrto*() usage
  mm: fix fall-through warnings for Clang
  mm: slub: convert sysfs sprintf family to sysfs_emit/sysfs_emit_at
  mm: shmem: convert shmem_enabled_show to use sysfs_emit_at
  mm:backing-dev: use sysfs_emit in macro defining functions
  mm: huge_memory: convert remaining use of sprintf to sysfs_emit and neatening
  mm: use sysfs_emit for struct kobject * uses
  mm: fix kernel-doc markups
  zram: break the strict dependency from lzo
  zram: add stat to gather incompressible pages since zram set up
  zram: support page writeback
  mm/process_vm_access: remove redundant initialization of iov_r
  mm/zsmalloc.c: rework the list_add code in insert_zspage()
  mm/zswap: move to use crypto_acomp API for hardware acceleration
  mm/zswap: fix passing zero to 'PTR_ERR' warning
  mm/zswap: make struct kernel_param_ops definitions const
  userfaultfd/selftests: hint the test runner on required privilege
  userfaultfd/selftests: fix retval check for userfaultfd_open()
  userfaultfd/selftests: always dump something in modes
  userfaultfd: selftests: make __{s,u}64 format specifiers portable
  ...
2020-12-15 12:53:37 -08:00
Bartosz Golaszewski
64f0bd1169 ALSA: pcm: use krealloc_array()
Use the helper that checks for overflows internally instead of manually
calculating the size of the new array.

Link: https://lkml.kernel.org/r/20201109110654.12547-4-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Christian Knig <christian.koenig@amd.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: David Rientjes <rientjes@google.com>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: James Morse <james.morse@arm.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: "Michael S . Tsirkin" <mst@redhat.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Robert Richter <rric@kernel.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-12-15 12:13:37 -08:00
Rafael J. Wysocki
5e2cde03da Merge branches 'acpi-resources' and 'acpi-docs'
* acpi-resources:
  Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks"
  resource: provide meaningful MODULE_LICENSE() in test suite
  ASoC: Intel: catpt: Replace open coded variant of resource_intersection()
  ACPI: watchdog: Replace open coded variant of resource_union()
  PCI/ACPI: Replace open coded variant of resource_union()
  resource: Add test cases for new resource API
  resource: Introduce resource_intersection() for overlapping resources
  resource: Introduce resource_union() for overlapping resources
  resource: Group resource_overlaps() with other inline helpers
  resource: Simplify region_intersects() by reducing conditionals

* acpi-docs:
  Documentation: ACPI: enumeration: add PCI hierarchy representation
  Documentation: ACPI: _DSD: enable hyperlink in final references
  Documentation: ACPI: explain how to use gpio-line-names
2020-12-15 15:30:03 +01:00
Thomas Hebb
5c6679b5cb
ASoC: dapm: remove widget from dirty list on free
A widget's "dirty" list_head, much like its "list" list_head, eventually
chains back to a list_head on the snd_soc_card itself. This means that
the list can stick around even after the widget (or all widgets) have
been freed. Currently, however, widgets that are in the dirty list when
freed remain there, corrupting the entire list and leading to memory
errors and undefined behavior when the list is next accessed or
modified.

I encountered this issue when a component failed to probe relatively
late in snd_soc_bind_card(), causing it to bail out and call
soc_cleanup_card_resources(), which eventually called
snd_soc_dapm_free() with widgets that were still dirty from when they'd
been added.

Fixes: db432b414e ("ASoC: Do DAPM power checks only for widgets changed since last run")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/f8b5f031d50122bf1a9bfc9cae046badf4a7a31a.1607822410.git.tommyhebb@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-15 13:29:01 +00:00
Linus Torvalds
9e4b0d55d8 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu:
 "API:
   - Add speed testing on 1420-byte blocks for networking

  Algorithms:
   - Improve performance of chacha on ARM for network packets
   - Improve performance of aegis128 on ARM for network packets

  Drivers:
   - Add support for Keem Bay OCS AES/SM4
   - Add support for QAT 4xxx devices
   - Enable crypto-engine retry mechanism in caam
   - Enable support for crypto engine on sdm845 in qce
   - Add HiSilicon PRNG driver support"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (161 commits)
  crypto: qat - add capability detection logic in qat_4xxx
  crypto: qat - add AES-XTS support for QAT GEN4 devices
  crypto: qat - add AES-CTR support for QAT GEN4 devices
  crypto: atmel-i2c - select CONFIG_BITREVERSE
  crypto: hisilicon/trng - replace atomic_add_return()
  crypto: keembay - Add support for Keem Bay OCS AES/SM4
  dt-bindings: Add Keem Bay OCS AES bindings
  crypto: aegis128 - avoid spurious references crypto_aegis128_update_simd
  crypto: seed - remove trailing semicolon in macro definition
  crypto: x86/poly1305 - Use TEST %reg,%reg instead of CMP $0,%reg
  crypto: x86/sha512 - Use TEST %reg,%reg instead of CMP $0,%reg
  crypto: aesni - Use TEST %reg,%reg instead of CMP $0,%reg
  crypto: cpt - Fix sparse warnings in cptpf
  hwrng: ks-sa - Add dependency on IOMEM and OF
  crypto: lib/blake2s - Move selftest prototype into header file
  crypto: arm/aes-ce - work around Cortex-A57/A72 silion errata
  crypto: ecdh - avoid unaligned accesses in ecdh_set_secret()
  crypto: ccree - rework cache parameters handling
  crypto: cavium - Use dma_set_mask_and_coherent to simplify code
  crypto: marvell/octeontx - Use dma_set_mask_and_coherent to simplify code
  ...
2020-12-14 12:18:19 -08:00
Dan Carpenter
f373a811fd
ASoC: Intel: fix error code cnl_set_dsp_D0()
Return -ETIMEDOUT if the dsp boot times out instead of returning
success.

Fixes: cb6a552846 ("ASoC: Intel: cnl: Add sst library functions for cnl platform")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/X9NEvCzuN+IObnTN@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-14 17:29:59 +00:00
Takashi Iwai
598100be30 ASoC: Updates for v5.11
There's a lot of changes here but mostly cleanups and driver specific
 things, the most user visible change is the support for boot time
 selection of Intel DSP firmware which will make it easier for people to
 move over to the preferred modern implementations in distros and other
 large scale deployments.
 
 This also includes a merge of the new auxillary bus which was done in
 anticipation of use by the Intel DSP drivers which didn't quite make it.
 
  - Lots more cleanups and simplifications from Morimoto-san.
  - Support for some basic DPCM systems in the audio graph card from
    Sameer Pujar.
  - Remove some old pre-DT Freescale drivers for platforms that are now
    DT only.
  - Move selection of which Intel DSP implementation to use to boot time
    rather than requiring it to be selected at build time.
  - Support for Allwinner H6 I2S, Analog Devices ADAU1372, Intel
    Alderlake-S, GMediatek MT8192, NXP i.MX HDMI and XCVR, Realtek RT715,
    Qualcomm SM8250 and simple GPIO based muxes.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl/XcxYACgkQJNaLcl1U
 h9ApEgf/ZkKxj1Nq6RCfUqhyGK2u1ktzCpnugvjHebutXV1LD0y+y0/CnjdN5Vou
 8r+BsX6izfEx6JuZyu1ryQcz+Rsp6VH6uK9e/vRPExIkkAw+JQzEGVzQRyrnREoA
 eV8BO92YKrRtJM1HoIBnQOhoWMc/4Kqi7hklaiXDhHRDGpLcbTyeVK8ROarORLcy
 aupt7WinLvbhP++xjs9YR/RffjpwxyxOkmkIaM9TpkKqADays+sBDCZXSVgFjQik
 1rFLQ8jYAb/EOPNdCXrMEILrSaNMCz719vh2gZkm1yYQ3Tp5dH9WGqLROq9Oy/D4
 FaCGJoxX0HUe7MWbJeI97PFZB8i2gQ==
 =iCuN
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v5.11

There's a lot of changes here but mostly cleanups and driver specific
things, the most user visible change is the support for boot time
selection of Intel DSP firmware which will make it easier for people to
move over to the preferred modern implementations in distros and other
large scale deployments.

This also includes a merge of the new auxillary bus which was done in
anticipation of use by the Intel DSP drivers which didn't quite make it.

 - Lots more cleanups and simplifications from Morimoto-san.
 - Support for some basic DPCM systems in the audio graph card from
   Sameer Pujar.
 - Remove some old pre-DT Freescale drivers for platforms that are now
   DT only.
 - Move selection of which Intel DSP implementation to use to boot time
   rather than requiring it to be selected at build time.
 - Support for Allwinner H6 I2S, Analog Devices ADAU1372, Intel
   Alderlake-S, GMediatek MT8192, NXP i.MX HDMI and XCVR, Realtek RT715,
   Qualcomm SM8250 and simple GPIO based muxes.
2020-12-14 15:57:14 +01:00
Takashi Iwai
175b8d89fe ALSA: pcm: oss: Fix potential out-of-bounds shift
syzbot spotted a potential out-of-bounds shift in the PCM OSS layer
where it calculates the buffer size with the arbitrary shift value
given via an ioctl.

Add a range check for avoiding the undefined behavior.
As the value can be treated by a signed integer, the max shift should
be 30.

Reported-by: syzbot+df7dc146ebdd6435eea3@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201209084552.17109-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-14 09:10:39 +01:00
Takashi Iwai
43d5ca88df ALSA: usb-audio: Fix potential out-of-bounds shift
syzbot spotted a potential out-of-bounds shift in the USB-audio format
parser that receives the arbitrary shift value from the USB
descriptor.

Add a range check for avoiding the undefined behavior.

Reported-by: syzbot+df7dc146ebdd6435eea3@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201209084552.17109-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-14 09:10:25 +01:00
Takashi Iwai
e5fab13a7c Merge branch 'for-linus' into for-next
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-14 09:05:29 +01:00
Connor McAdams
d84489e374 ALSA: hda/ca0132 - Add ZxR surround DAC setup.
Add pre-dsp download initialization for the DAC's used in the surround
sound configuration. Fixes issues of no audio on surround channels.

Fixes: 2e492b8ee5 ("ALSA: hda/ca0132 - Add ZxR init commands")
Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20201211225504.4508-2-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-12 11:09:52 +01:00
Connor McAdams
c1d8aeed83 ALSA: hda/ca0132 - Add 8051 PLL write helper functions.
Add helper functions for the 8051 PLL PMU write verbs.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20201211225504.4508-1-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-12 11:09:37 +01:00
Mark Brown
460aa020f5
Merge remote-tracking branch 'asoc/for-5.11' into asoc-next 2020-12-11 17:48:04 +00:00
Mark Brown
84de089e77
Merge series "ASoC: SOF: Intel: fix to dsp state dump trace levels" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:
Small series that addresses a problem where DSP status dump
for a failure case, ends up being printed as as debug print. This
is important information for any bug report. While at it, the series
contains a few cleanups to related code.

Ranjani Sridharan (3):
  ASoC: SOF: Intel: hda: remove duplicated status dump
  ASoC: SOF: modify the SOF_DBG flags
  ASoC: SOF: Intel: hda: fix the condition passed to sof_dev_dbg_or_err

 sound/soc/sof/debug.c            |  2 +-
 sound/soc/sof/intel/byt.c        |  2 +-
 sound/soc/sof/intel/hda-loader.c | 19 +++++++++++++------
 sound/soc/sof/intel/hda.c        | 10 ++++------
 sound/soc/sof/loader.c           |  4 ++--
 sound/soc/sof/ops.c              |  2 +-
 sound/soc/sof/sof-priv.h         | 13 ++++++++-----
 7 files changed, 30 insertions(+), 22 deletions(-)

--
2.29.2
2020-12-11 17:46:27 +00:00
Mark Brown
51e325f7f8
Merge series "ASoC: rt1015p: delay 300ms for waiting calibration" from Tzung-Bi Shih <tzungbi@google.com>:
The 1st patch moves SDB control from DAI ops trigger to DAPM event
(per review comments in v1).

The 2nd patch adds the 300ms delay for waiting calibration.

Changes from v2:
- Use gpiod_set_value_cansleep() instead of gpiod_set_value().
(https://patchwork.kernel.org/project/alsa-devel/patch/20201210033617.79300-2-tzungbi@google.com/)
- Assuming the calibration state gets lost after system suspend.
(https://patchwork.kernel.org/project/alsa-devel/patch/20201210033617.79300-3-tzungbi@google.com/)

Changes from v1:
(https://patchwork.kernel.org/project/alsa-devel/patch/20201209033742.3825973-1-tzungbi@google.com/)
- Move the delay from trigger to DAPM event.

Tzung-Bi Shih (2):
  ASoC: rt1015p: move SDB control from trigger to DAPM
  ASoC: rt1015p: delay 300ms after SDB pulling high for calibration

 sound/soc/codecs/rt1015p.c | 69 ++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 37 deletions(-)

--
2.29.2.684.gfbc64c5ab5-goog
2020-12-11 17:46:26 +00:00
Kai Vehmanen
46c3bbd982 ALSA: hda/hdmi: packet buffer index must be set before reading value
The check for infoframe transmit status in hdmi_infoframe_uptodate()
makes the assumption that packet buffer index is set to zero.

Align code with specification and explicitly set the index before
AC_VERB_GET_HDMI_DIP_XMIT. The packet index setting affects both
DIP-Data and DIP-XmitCtrl verbs.

There are no known cases where the old implementation has caused driver
to work incorrectly. This change is purely based on code review against
the specification (HDA spec rev1.0a).

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201211131613.3271407-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11 14:25:44 +01:00
Pierre-Louis Bossart
45c29d9ae9
ASoC: SOF: imx: update kernel-doc description
Add missing parameters to avoid W=1 error

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201211102255.3189589-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:23:03 +00:00
Dan Carpenter
1688dbe7a7
ASoC: mediatek: mt8183: delete some unreachable code
This has a goto followed by an unreachable return statement.  The goto
is correct because it cleans up so the current runtime behavior is fine.
Let's delete the unreachable return statement.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X9NFg3KVm16Gx6Io@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:23:02 +00:00
Tzung-Bi Shih
de96bd7b7e
ASoC: mediatek: mt8183: add PM ops to machine drivers
Adds PM ops to machine drivers so that they notify components in the
sound card when system suspend.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201211051334.2313899-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:23:01 +00:00
Amadeusz Sławiński
631c78ed72
ASoC: topology: Fix wrong size check
Dan reported that smatch reports wrong size check and after analysis it
is confirmed that we are comparing wrong value: pointer size instead of
array size. However the check itself is problematic as in UAPI header
there are two fields:

struct snd_soc_tplg_enum_control {
    (...)
    char texts[SND_SOC_TPLG_NUM_TEXTS][SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    __le32 values[SND_SOC_TPLG_NUM_TEXTS * SNDRV_CTL_ELEM_ID_NAME_MAXLEN / 4];

the texts field is for names and the values one for values assigned to
those named fields, after analysis it becomes clear that there is quite
a lot overhead values than we may possibly name. So instead of changing
check to ARRAY_SIZE(ec->values), as it was first suggested, use
hardcoded value of SND_SOC_TPLG_NUM_TEXTS.

Link: https://lore.kernel.org/alsa-devel/X9B0eDcKy+9B6kZl@mwanda/
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20201210152541.191728-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:23:01 +00:00
Amadeusz Sławiński
f5824e5ce1
ASoC: topology: Add missing size check
When we parse "values" we perform check if there is correct number of
them. However similar check is missing in case of "texts", add it.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20201210152541.191728-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:23:00 +00:00
Ranjani Sridharan
8f7ef6fca0
ASoC: SOF: Intel: hda: fix the condition passed to sof_dev_dbg_or_err
The condition boot_iteration == HDA_FW_BOOT_ATTEMPTS to determine
the log level for the DSP status dump would only work in the case of DSP
init failure after maximum number of attempts to initialize the DSP. If
DSP init succeeds in less than HDA_FW_BOOT_ATTEMPTS attempts and FW
loading fails, the ROM status dump would end up getting logged as debug
instead of an error.

So, add a new flag, SOF_DBG_DUMP_LOG_ERROR, to explicitly specify
the log level for DSP status dump.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201211100743.3188821-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:22:58 +00:00
Ranjani Sridharan
fbfa22ec4b
ASoC: SOF: modify the SOF_DBG flags
The SOF_DBG_* macros are used for dual purposes right now, for the
sof_core_debug module parameter and for the dbg_dump() ops. So, separate
these two types of flags into different types to avoid confusion.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201211100743.3188821-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:22:57 +00:00
Ranjani Sridharan
b278fc55b4
ASoC: SOF: Intel: hda: remove duplicated status dump
Remove the duplicate status dump in case DSP init fails. The core will
be powered down in this case and the status dump will be invalid anyway.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201211100743.3188821-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:22:56 +00:00
Tzung-Bi Shih
f102d0d173
ASoC: rt1015p: delay 300ms after SDB pulling high for calibration
RT1015p needs 300ms delay after SDB pulling high for internal
calibration during the power on sequence.

Delays 300ms right before data sends out to avoid data truncated.

Assuming the calibration state gets lost after system suspend.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201211051224.2307349-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:22:18 +00:00
Tzung-Bi Shih
4ab9301710
ASoC: rt1015p: move SDB control from trigger to DAPM
Moves SDB control from DAI ops trigger to DAPM.  As long as BCLK
and LRCLK are ready, SDB can be toggled earlier.

Changes from using gpiod_set_value() to gpiod_set_value_cansleep()
because it executes in non-atomic context.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201211051224.2307349-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:22:18 +00:00
Dan Carpenter
85a7555575
ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
The error handling frees "ctl" but it's still on the "dsp->ctl_list"
list so that could result in a use after free.  Remove it from the list
before returning.

Fixes: 2323736dca ("ASoC: wm_adsp: Add basic support for rev 1 firmware file format")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/X9B0keV/02wrx9Xs@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11 13:21:35 +00:00
Takashi Iwai
c6dde8ffd0 ALSA: usb-audio: Fix control 'access overflow' errors from chmap
The current channel-map control implementation in USB-audio driver may
lead to an error message like
  "control 3:0:0:Playback Channel Map:0: access overflow"
when CONFIG_SND_CTL_VALIDATION is set.  It's because the chmap get
callback clears the whole array no matter which count is set, and
rather the false-positive detection.

This patch fixes the problem by clearing only the needed array range
at usb_chmap_ctl_get().

Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201211130048.6358-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11 14:03:55 +01:00
Kai Vehmanen
13b1f8aa65 ALSA: hda/hdmi: always print pin NIDs as hexadecimal
The debug prints from patch_hdmi.c are not aligned with HDA common code
in hda_codec.c nor with other HDA codec drivers.

To align with rest of the codebase, use hexadecimal formatting whenever
printing value of a HDA NID. Also refer to NIDs with capital letters in
traces as is done other modules. This presentation is also aligned with
the formatting used in HDA codec procfs entry.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201211124547.3243871-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11 14:02:47 +01:00
Kailang Yang
607184cb16 ALSA: hda/realtek - Add supported for more Lenovo ALC285 Headset Button
Add supported for more Lenovo ALC285 Headset Button.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/bb1f1da1526d460885aa4257be81eb94@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11 09:55:21 +01:00
Connor McAdams
19b5926b68 ALSA: hda/ca0132 - Remove now unnecessary DSP setup functions.
Now that the DSP's audio configuration is understood, remove previous
hacky methods of trying to properly configure it.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20201210160658.461739-6-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11 09:53:11 +01:00
Connor McAdams
8cb12b94c2 ALSA: hda/ca0132 - Ensure DSP is properly setup post-firmware download.
Make sure that the DSP has no DMA channels allocated once the firmware
is downloaded, and that the default audio streams in use by the DSP are
setup in the correct order.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20201210160658.461739-5-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11 09:53:01 +01:00
Connor McAdams
799c70639c ALSA: hda/ca0132 - Add 8051 exram helper functions.
Add functions for both reading and writing to the 8051's exram. Also,
add a little bit of documentation on how the addresses are segmented.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20201210160658.461739-4-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11 09:52:53 +01:00
Connor McAdams
aedeb64211 ALSA: hda/ca0132 - Add stream port remapping function.
Add function for remapping a ChipIO stream's ports. Also include some
documentation as to how this works.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20201210160658.461739-3-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11 09:52:44 +01:00
Connor McAdams
4a6d3b4e7a ALSA: hda/ca0132 - Reset codec upon initialization.
Reset the codec upon initialization to clear out anything that may have
been setup on a previous boot into Windows, or in case of an improper
shutdown.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20201210160658.461739-2-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11 09:52:34 +01:00
Kai Vehmanen
b1a5039759 ALSA: hda/hdmi: fix silent stream for first playback to DP
A problem exists in enabling silent stream when connection type is
DisplayPort. Silent stream programming is completed when a new DP
receiver is connected, but infoframe transmission does not actually
start until PCM is opened for the first time. This can result in audible
gap of multiple seconds. This only affects the first PCM open.

Fix the issue by properly assigning a converter to the silent stream,
and modifying the required stream ID programming sequence.

This change only affects Intel display audio codecs.

BugLink: https://github.com/thesofproject/linux/issues/2468
Fixes: 951894cf30 ("ALSA: hda/hdmi: Add Intel silent stream support")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201210174445.3134104-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-10 19:57:21 +01:00
Connor McAdams
7079f785b5 ALSA: hda/ca0132 - Change Input Source enum strings.
Change the Input Source enumerated control's strings to make it play
nice with pulseaudio.

Fixes: 7cb9d94c05 ("ALSA: hda/ca0132: add alt_select_in/out for R3Di + SBZ")
Cc: <stable@kernel.org>
Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20201208195223.424753-2-conmanx360@gmail.com
Link: https://lore.kernel.org/r/20201210173550.2968-2-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-10 19:57:01 +01:00
Connor McAdams
c697ba85a9 ALSA: hda/ca0132 - Fix AE-5 rear headphone pincfg.
The Windows driver sets the pincfg for the AE-5's rear-headphone to
report as a microphone. This causes issues with Pulseaudio mistakenly
believing there is no headphone plugged in. In Linux, we should instead
set it to be a headphone.

Fixes: a6b0961b39 ("ALSA: hda/ca0132 - fix AE-5 pincfg")
Cc: <stable@kernel.org>
Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20201208195223.424753-1-conmanx360@gmail.com
Link: https://lore.kernel.org/r/20201210173550.2968-1-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-10 19:56:38 +01:00
Takashi Iwai
c9a867fd84 ALSA: usb-audio: Add implicit fb support for Steinberg UR22
Steinberg UR22 (with USB ID 0499:1509) requires the implicit feedback
for the proper playback, otherwise it causes occasional cracks.
This patch adds the corresponding the quirk table entry with the
recently added generic implicit fb support.

Reported-and-tested-by: Kilian <meschi@posteo.de>
Link: https://lore.kernel.org/r/20201209161835.13625-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-10 19:55:35 +01:00
Takashi Iwai
2506318e38 ALSA: hda: Fix regressions on clear and reconfig sysfs
It seems that the HD-audio clear and reconfig sysfs don't work any
longer after the recent driver core change.  There are multiple issues
around that: the linked list corruption and the dead device handling.
The former issue is fixed by another patch for the driver core itself,
while the latter patch needs to be addressed in HD-audio side.

This patch corresponds to the latter, it recovers those broken
functions by replacing the device detach and attach actions with the
standard core API functions, which are almost equivalent with unbind
and bind actions.

Fixes: 654888327e ("driver core: Avoid binding drivers to dead devices")
Cc: <stable@vger.kernel.org>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209207
Link: https://lore.kernel.org/r/20201209150119.7705-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-10 19:55:35 +01:00
Alexandre Belloni
342fbb7578
ASoC: add simple-mux
Add a driver for simple mux driven by gpios. It currently only supports one
gpio, muxing one of two inputs to a single output.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201205001508.346439-2-alexandre.belloni@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 17:00:33 +00:00
Kai Vehmanen
ac6b7bd33a
ASoC: SOF: Intel: add SoundWire support for ADL-S
Expand SOF support for Alder Lake by adding ACPI machine tables
for ADL-S systems with SoundWire codecs. Modify kernel config
to choose SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE for these
platforms.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20201209153102.3028310-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 16:52:05 +00:00
Kai Vehmanen
4c8a4cab33
ASoC: Intel: common: add ACPI matching tables for Alder Lake
Initial support for ADL w/ RT711

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20201209153102.3028310-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 16:52:04 +00:00
Jaroslav Kysela
718c406e1f
ASoC: AMD Renoir - add DMI table to avoid the ACP mic probe (broken BIOS)
Users reported that some Lenovo AMD platforms do not have ACP microphone,
but the BIOS advertises it via ACPI.

This patch create a simple DMI table, where those machines with the broken
BIOS can be added. The DMI description for Lenovo IdeaPad 5 and
IdeaPad Flex 5 devices are added there.

Also describe the dmic_acpi_check kernel module parameter in a more
understandable way.

Cc: <stable@kernel.org>
Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20201208171200.2737620-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 14:45:58 +00:00
Mark Brown
52feed4c1b
Merge series "ASoC: soc-pcm: trigger cleanup" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

These are focusing to trigger function,
which can be cleanup, tidyup.

Kuninori Morimoto (2):
  ASoC: soc-pcm: remove dpcm_do_trigger()
  ASoC: soc-pcm: care trigger rollback

 include/sound/soc-component.h |  3 +-
 include/sound/soc-dai.h       |  4 +-
 include/sound/soc-link.h      |  3 +-
 include/sound/soc.h           |  1 +
 sound/soc/soc-component.c     | 45 ++++++++++++++++++----
 sound/soc/soc-dai.c           | 44 +++++++++++++++++----
 sound/soc/soc-link.c          | 30 ++++++++++++++-
 sound/soc/soc-pcm.c           | 72 ++++++++++++++++++++---------------
 8 files changed, 152 insertions(+), 50 deletions(-)

--
2.25.1
2020-12-09 14:45:06 +00:00
Derek Fang
397e089bda
ASoC: rt1015: check the return value of regmap_read during i2c probe
In some projects, the device ID register is not read correctly.
This patch helps to verify the issue is caused from i2c host or client.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20201209091308.2823-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:13:44 +00:00
Paul Cercueil
e648e3f116
ASoC: codecs/jz4770: Add DAPM widget to set HP out to cap-less mode
Cap-less mode is useful e.g. if the headphones are used as an antenna
for a FM radio, so that the signal is not altered. For everything else,
we want the cap-couple mode.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20201207125338.119397-5-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:13:43 +00:00
Paul Cercueil
4f293dfea9
ASoC: codecs/jz4770: Don't change cap-couple setting in HP PMU/PMD
There is simply no reason to do that.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20201207125338.119397-4-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:13:42 +00:00
Christophe Branchereau
6b4da5374b
ASoC: codecs/jz4770: Adjust timeouts for cap-coupled outputs
When using cap-coupled outputs, the RUP/RDO can take much longer than
the 100ms timeout we used to have. Increase that timeout to one second.

Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20201207125338.119397-3-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:13:42 +00:00
Christophe Branchereau
a346c77836
ASoC: codecs/jz4770: Reset interrupt flags in bias PREPARE
In case a poll for RUP times out, we might be left with some IRQ flags
that should be cleared before the next power on.

Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20201207125338.119397-2-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:13:41 +00:00
Paul Cercueil
ad13c83544
ASoC: codecs/jz47xx: Use regmap_{set,clear}_bits
Use regmap_{set,clear}_bits instead of regmap_update_bits, when
applicable.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20201207125338.119397-1-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:13:40 +00:00
Kuninori Morimoto
6374f493d9
ASoC: soc-pcm: care trigger rollback
soc_pcm_trigger() calls DAI/Component/Link trigger,
but some of them might be failed.

	static int soc_pcm_trigger(...)
	{
		...
		switch (cmd) {
		case SNDRV_PCM_TRIGGER_START:
		case SNDRV_PCM_TRIGGER_RESUME:
		case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
			ret = snd_soc_link_trigger(substream, cmd);
			if (ret < 0)
				break;

(*)			ret = snd_soc_pcm_component_trigger(substream, cmd);
			if (ret < 0)
				break;

			ret = snd_soc_pcm_dai_trigger(substream, cmd);
			break;
		case SNDRV_PCM_TRIGGER_STOP:
		case SNDRV_PCM_TRIGGER_SUSPEND:
		case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
			ret = snd_soc_pcm_dai_trigger(substream, cmd);
			if (ret < 0)
				break;

			ret = snd_soc_pcm_component_trigger(substream, cmd);
			if (ret < 0)
				break;

			ret = snd_soc_link_trigger(substream, cmd);
			break;
		}
		...
	}

For example, if soc_pcm_trigger() failed at (*) point,
we need to rollback previous succeeded trigger.

This patch adds trigger mark for DAI/Component/Link,
and do STOP if START/RESUME/PAUSE_RELEASE were failed.

Because it need to use new rollback parameter,
we need to modify DAI/Component/Link trigger functions in the same time.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6uycssd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:13:38 +00:00
Kuninori Morimoto
a9faca15a6
ASoC: soc-pcm: remove dpcm_do_trigger()
dpcm_be_dai_trigger() is calling dpcm_do_trigger()
at each SNDRV_PCM_TRIGGER_xxx (1).

	int dpcm_be_dai_trigger(...)
	{
		for_each_dpcm_be(fe, stream, dpcm) {
(B)			...
			switch (cmd) {
			case SNDRV_PCM_TRIGGER_START:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			case SNDRV_PCM_TRIGGER_RESUME:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			case SNDRV_PCM_TRIGGER_STOP:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			case SNDRV_PCM_TRIGGER_SUSPEND:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			}
		}
	}

But it is just very verbose and duplicated function.
Because We can indicate dev_dbg() (A) at dpcm_be_dai_trigger() (B).
And dev_err() (C) is not needed because soc_pcm_trigger() itself
indicates error message when error.

	static int dpcm_do_trigger(...)
	{
		int ret;

(A)		dev_dbg(...);

		ret = soc_pcm_trigger(substream, cmd);
		if (ret < 0)
(C)			dev_err(...);

		return ret;
	}

This patch replace dpcm_do_trigger() to soc_pcm_trigger().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blfecssk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:13:37 +00:00
Jaroslav Kysela
55d8e6a85b
ASoC: AMD Raven/Renoir - fix the PCI probe (PCI revision)
The Raven and Renoir ACP can be distinguished by the PCI revision.
Let's do the check very early, otherwise the wrong probe code
can be run.

Link: https://lore.kernel.org/alsa-devel/2e4587f8-f602-cf23-4845-fd27a32b1cfc@amd.com/
Cc: <stable@kernel.org>
Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20201208181233.2745726-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:12:59 +00:00
Dan Carpenter
3cea33b6f2
ASoC: max98390: Fix error codes in max98390_dsm_init()
These error paths return success but they should return -EINVAL.

Fixes: 97ed3e509e ("ASoC: max98390: Fix potential crash during param fw loading")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X9B0uz4svyNTqeMb@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:12:58 +00:00
Chris Chiu
1bea2256aa
ASoC: Intel: bytcr_rt5640: Add quirk for ARCHOS Cesium 140
Tha ARCHOS Cesium 140 tablet has problem with the jack-sensing,
thus the heaset functions are not working.

Add quirk for this model to select the correct input map, jack-detect
options and channel map to enable jack sensing and headset microphone.
This device uses IN1 for its internal MIC and JD2 for jack-detect.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20201208060414.27646-1-chiu@endlessos.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:12:57 +00:00
Chris Chiu
7e41352847 ALSA: hda/realtek - Enable headset mic of ASUS Q524UQK with ALC255
The ASUS laptop Q524UQK with ALC255 codec can't detect the headset
microphone until ALC255_FIXUP_ASUS_MIC_NO_PRESENCE quirk applied.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201209045730.9972-1-chiu@endlessos.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-09 09:26:52 +01:00
Kai Vehmanen
19bb4f78c9 ALSA: hda/proc - print DP-MST connections
To help in debugging issues with DisplayPort Multi-Stream Transport (aka
DP-MST) support, print information of active connections for each device
of a display audio pin widget.

Example output with the patch with two monitors connected to a DP-MST hub:

Devices: 4
     Dev 00: PD = 0, ELDV = 0, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
     Dev 01: PD = 1, ELDV = 1, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
    *Dev 02: PD = 1, ELDV = 1, IA = 0, Connections [ 0x03 0x05* 0x07 0x09 ]
     Dev 03: PD = 0, ELDV = 0, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
Connection: 4
     0x03 0x05* 0x07 0x09

Format of existing "Connection:" entry is left intact to keep
compatibility.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201208185736.2877541-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-08 20:04:33 +01:00
Mark Brown
474e3abb91
Merge series "ASoC: Intel: cht_bsw_nau8824: 2 fixes for usage with sof-audio-acpi" from Hans de Goede <hdegoede@redhat.com>:
Hi All,

Here are 2 simple fixes which are necessary to make the
cht_bsw_nau8824 machine driver work together with the
sof-audio-acpi driver.

Note that atm the sof topology files are missing a .tplg
file for this setup. Simply copying over the standard
sof-byte-codec.tplg file does the trick, but then some
mixer setting changes are necessary to fix the right
speaker/headphones channel not working; and those mixer
settings break the right channel when used with the
sst-acpi driver.

I've been trying to fix this at the tplg level so that
we do not need to change the mixer settings, but no luck
sofar. I'll post a RFC with the topology changes which
I have and we can discuss this further there.

These 2 simple fixes are necessary to make the sof-audio-acpi
driver work regardless of the topology issue.

Regards,

Hans
2020-12-08 17:06:41 +00:00
Chuhong Yuan
95d3befbc5
ASoC: amd: change clk_get() to devm_clk_get() and add missed checks
cz_da7219_init() does not check the return values of clk_get(),
while da7219_clk_enable() calls clk_set_rate() to dereference
the pointers.
Add checks to fix the problems.
Also, change clk_get() to devm_clk_get() to avoid data leak after
failures.

Fixes: bb24a31ed5 ("ASoC: AMD: Configure wclk and bclk of master codec")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20201204063610.513556-1-hslester96@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-08 17:06:36 +00:00
Takashi Iwai
0d024a8bec
ASoC: cx2072x: Fix doubly definitions of Playback and Capture streams
The cx2072x codec driver defines multiple DAIs with the same stream
name "Playback" and "Capture".  Although the current code works more
or less as is as the secondary streams are never used, it still leads
the error message like:
 debugfs: File 'Playback' in directory 'dapm' already present!
 debugfs: File 'Capture' in directory 'dapm' already present!

Fix it by renaming the secondary streams to unique names.

Fixes: a497a43637 ("ASoC: Add support for Conexant CX2072X CODEC")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20201208135154.9188-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-08 14:20:36 +00:00
Shengjiu Wang
6a5f850aa8
ASoC: fsl: Add imx-hdmi machine driver
The driver is initially designed for sound card using HDMI
interface on i.MX platform. There is internal HDMI IP or
external HDMI modules connect with SAI or AUD2HTX interface.
It supports both transmitter and receiver devices.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1607251319-5821-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-08 14:20:35 +00:00
Hans de Goede
748e72e869
ASoC: Intel: cht_bsw_nau8824: Change SSP2-Codec DAI id to 0
The snd-soc-sst-acpi driver does not care about the id specified for
the SSP2-Codec DAI, but it does matter for the snd-sof-acpi driver;
and when it is not 0 then the snd-sof-acpi driver does not work.

Set the SSP2-Codec DAI id to 0, fixing the snd-sof-acpi driver not
working on devices using the cht_bsw_nau8824 machine-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/20201206122436.13553-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-08 14:20:33 +00:00
Hans de Goede
e60ffc48fa
ASoC: Intel: cht_bsw_nau8824: Drop compress-cpu-dai bits
When using the snd-soc-sst-acpi driver then the compress-cpu-dai bits are
not used, the cht_bsw_nau8824 machine-driver is the only BYT/CHT driver
defining them.

When using the snd-sof-acpi driver then the presence of the
compress-cpu-dai bits breaks things because the sof topology file for
by/cht devices does not contain routing info for them.

Drop the compress-cpu-dai bits, fixing the snd-sof-acpi driver not
working on devices using the cht_bsw_nau8824 machine-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/20201206122436.13553-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-08 14:20:32 +00:00
Karol Trzcinski
8f6cfbb6d4
ASoC: SOF: trace: Add runtime trace filtering mechanism
The "filter" debugfs file defines the log levels used by
the firmware and reported by sof-logger.

The file contains the formatted entry list, where each entry
follows the following syntax in plain text:
log_level uuid_id pipe_id comp_id;

This file may be updated by userspace applications such sof-logger,
or directly by the user during debugging process.

An unused (wildcard) pipe_id or comp_id value should be set to -1,
uuid_id is hexadecimal value, so when unused then should be set to 0.

When the file is modified, an IPC command is sent to FW with new
trace levels for selected components in filter elements list.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201204165014.2697903-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-07 14:22:05 +00:00
Ranjani Sridharan
bb9dd3ce61
ASoC: pcm: send DAPM_STREAM_STOP event in dpcm_fe_dai_shutdown
A recent change removed the call to send the DAPM_STREAM_STOP
event in dpcm_fe_dai_shutdown. But this causes a regression
when a PCM prepare is not paired with a hw_free. So, add
the DAPM_STREAM_STOP event back to dpcm_fe_dai_shutdown()
to fix this.

The new sequence would be:
soc_pcm_prepare()
    -> SND_SOC_DAPM_STREAM_START

soc_pcm_hw_free()
    -> soc_pcm_hw_free()
	-> SND_SOC_DAPM_STREAM_STOP

dpcm_fe_dai_shutdown()
    -> SND_SOC_DAPM_STREAM_STOP

Note that the DAPM_STREAM_STOP will be called twice but it seems
harmless.

Fixes: a27b421f1d ('ASoC: pcm: call snd_soc_dapm_stream_stop() in soc_pcm_hw_clean')

Reported-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20201202193343.912942-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-07 14:18:02 +00:00
Chris Chiu
5cfca59604 ALSA: hda/realtek - Enable headset mic of ASUS X430UN with ALC256
The ASUS laptop X430UN with ALC256 can't detect the headset microphone
until ALC256_FIXUP_ASUS_MIC_NO_PRESENCE quirk applied.

Signed-off-by: Chris Chiu <chiu@endlessos.org>
Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201207072755.16210-1-chiu@endlessos.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-07 09:37:00 +01:00
Takashi Iwai
88a06d6fd6 ALSA: rawmidi: Access runtime->avail always in spinlock
The runtime->avail field may be accessed concurrently while some
places refer to it without taking the runtime->lock spinlock, as
detected by KCSAN.  Usually this isn't a big problem, but for
consistency and safety, we should take the spinlock at each place
referencing this field.

Reported-by: syzbot+a23a6f1215c84756577c@syzkaller.appspotmail.com
Reported-by: syzbot+3d367d1df1d2b67f5c19@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20201206083527.21163-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-06 09:36:10 +01:00
Takashi Iwai
4ebd470370 ALSA: seq: Use bool for snd_seq_queue internal flags
The snd_seq_queue struct contains various flags in the bit fields.
Those are categorized to two different use cases, both of which are
protected by different spinlocks.  That implies that there are still
potential risks of the bad operations for bit fields by concurrent
accesses.

For addressing the problem, this patch rearranges those flags to be
a standard bool instead of a bit field.

Reported-by: syzbot+63cbe31877bb80ef58f5@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20201206083456.21110-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-06 09:35:53 +01:00
Hui Wang
c72b9bfe0f ALSA: hda/realtek: make bass spk volume adjustable on a yoga laptop
This change could fix 2 issues on this machine:
 - the bass speaker's output volume can't be adjusted, that is because
   the bass speaker is routed to the DAC (Nid 0x6) which has no volume
   control.
 - after plugging a headset with vol+, vol- and pause buttons on it,
   press those buttons, nothing happens, this means those buttons
   don't work at all. This machine has alc287 codec, need to add the
   codec id to the disable/enable_headset_jack_key(), then the headset
   button could work.

The quirk of ALC285_FIXUP_THINKPAD_HEADSET_JACK could fix both of these
2 issues.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20201205051130.8122-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-05 08:39:13 +01:00
Arnd Bergmann
b1b8eb1283
ASoC: qcom: fix QDSP6 dependencies, attempt #3
The previous fix left another warning in randconfig builds:

WARNING: unmet direct dependencies detected for SND_SOC_QDSP6
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_QCOM [=y] && QCOM_APR [=y] && COMMON_CLK [=n]
  Selected by [y]:
  - SND_SOC_MSM8996 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_QCOM [=y] && QCOM_APR [=y]

Add one more dependency for this one.

Fixes: 2bc8831b13 ("ASoC: qcom: fix SDM845 & QDSP6 dependencies more")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201203231443.1483763-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-04 23:26:37 +00:00
Arnd Bergmann
7b15376051
ASoC: fsl_aud2htx: mark PM functions as __maybe_unused
When CONFIG_PM is disabled, we get a warning for unused functions:

sound/soc/fsl/fsl_aud2htx.c:261:12: error: unused function 'fsl_aud2htx_runtime_suspend' [-Werror,-Wunused-function]
static int fsl_aud2htx_runtime_suspend(struct device *dev)
sound/soc/fsl/fsl_aud2htx.c:271:12: error: unused function 'fsl_aud2htx_runtime_resume' [-Werror,-Wunused-function]
static int fsl_aud2htx_runtime_resume(struct device *dev)

Mark these as __maybe_unused to avoid the warning without adding
an #ifdef.

Fixes: 8a24c834c0 ("ASoC: fsl_aud2htx: Add aud2htx module driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20201203222900.1042578-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-04 23:26:36 +00:00
Brent Lu
aa6cc97c0a
ASoC: intel: sof_rt5682: Add support for tgl_rt1011_rt5682
This patch adds the driver data for two rt1011 speaker amplifiers on
SSP1 and rt5682 on SSP0 for TGL platform. DAI format for rt1011 is
leveraged from cml_rt1011_rt5682 which is 4-slot tdm with 100fs bclk.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20201203154010.29464-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-04 23:26:35 +00:00
Arnd Bergmann
29275309b0
ASoC: atmel: mchp-spdifrx needs COMMON_CLK
Compile-testing this driver on an older platform without CONFIG_COMMON_CLK fails with

ERROR: modpost: "clk_set_min_rate" [sound/soc/atmel/snd-soc-mchp-spdifrx.ko] undefined!

Make this is a strict dependency.

Fixes: ef265c55c1 ("ASoC: mchp-spdifrx: add driver for SPDIF RX")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20201203223815.1353451-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-04 23:26:34 +00:00
Arnd Bergmann
7061b8a522
ASoC: cros_ec_codec: fix uninitialized memory read
gcc points out a memory area that is copied to a device
but not initialized:

sound/soc/codecs/cros_ec_codec.c: In function 'i2s_rx_event':
arch/x86/include/asm/string_32.h:83:20: error: '*((void *)&p+4)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   83 |   *((int *)to + 1) = *((int *)from + 1);

Initialize all the unused fields to zero.

Fixes: 727f1c71c7 ("ASoC: cros_ec_codec: refactor I2S RX")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201203225458.1477830-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-04 23:26:33 +00:00
Pierre-Louis Bossart
518a760cc3
ASoC: SOF: control: fix cppcheck warning in snd_sof_volume_info()
Fix cppcheck warning:

sound/soc/sof/control.c:117:82: style:inconclusive: Function
'snd_sof_volume_info' argument 2 names different: declaration
'ucontrol' definition 'uinfo'. [funcArgNamesDifferent]

Fixes: fca18e6298 ("ASoC: SOF: control: override volume info callback")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201204170313.2704499-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-04 23:26:32 +00:00
Mark Brown
4ecc08b2f5 Auxiliary Bus support tag for 5.11-rc1
This is a signed tag for other subsystems to be able to pull in the
 auxiliary bus support into their trees for the 5.11-rc1 merge.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCX8oseA8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ylqGQCdF2TND5jjcETWHIrunPAX6iEDLecAnjyIMc4q
 cIr5piwCq+m6/S2gSCpA
 =t7EL
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl/KnpUACgkQJNaLcl1U
 h9CWvQf9EdHZFlsDiP8PbbSLtMzpkqaJOlmg3A1Rn6XOYjztDEDQQp12vYC9jOmJ
 PkBz8kh+0dohTt6TIx5IEt+r1pbYWAzFOkX7v3QzYp8+nrmd1bT/RDRglOrmydLH
 ntd9XNE1BA8k9n4YQQBWrspDEnwnpCygSw4lP/QXz7OyyhnZ7fYGOG3hPXKw+Sdj
 gQugmSAnUYaVti4d7K6Cuhj08HT13FvGFqrkLYljTmsnnVw0T4kXNFtiODMe1QMq
 YYeKiHCFI8ysk2hK0sYdmwr5rz5eWT5mGnSXPGsD3o876NF1uw+Q5iTX57uydDrp
 GijjnCOGz+yZ7dfBi2MAflP5Xsw4ew==
 =SVwj
 -----END PGP SIGNATURE-----

Merge tag 'auxbus-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core into asoc-5.11

Auxiliary Bus support tag for 5.11-rc1

This is a signed tag for other subsystems to be able to pull in the
auxiliary bus support into their trees for the 5.11-rc1 merge.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-04 20:39:45 +00:00
Srinivas Kandagatla
7e20ae1208
ASoC: q6afe-clocks: Add missing parent clock rate
setting clock rate on child clocks without a parent clock rate will
result in zero clk rate for child. This also means that when audio
is started dsp will attempt to access registers without enabling
clock resulting in board boot up.

Fix this by adding the missing parent clock rate.

Fixes: 520a1c396d ("ASoC: q6afe-clocks: add q6afe clock controller")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201204164228.1826-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-04 17:46:07 +00:00
Chuhong Yuan
1c1fb2653a
ASoC: jz4740-i2s: add missed checks for clk_get()
jz4740_i2s_set_sysclk() does not check the return values of clk_get(),
while the file dereferences the pointers in clk_put().
Add the missed checks to fix it.

Fixes: 11bd3dd1b7 ("ASoC: Add JZ4740 ASoC support")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20201203144227.418194-1-hslester96@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-04 17:46:06 +00:00