platform/kernel/linux-starfive.git
10 months agoMerge tag 'asoc-fix-v6.6-merge-window' of https://git.kernel.org/pub/scm/linux/kernel...
Takashi Iwai [Thu, 7 Sep 2023 12:10:36 +0000 (14:10 +0200)]
Merge tag 'asoc-fix-v6.6-merge-window' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.6

A bunch of fixes and new IDs that came in since the initial pull request
- all driver specific and nothing too exciting.

There's a trivial conflict in the AMD driver ID table due to the last
v6.5 fixes not having been merged up.

10 months agoALSA: hda/realtek - ALC287 I2S speaker platform support
Kailang Yang [Wed, 6 Sep 2023 08:50:41 +0000 (16:50 +0800)]
ALSA: hda/realtek - ALC287 I2S speaker platform support

0x17 was only speaker pin, DAC assigned will be 0x03. Headphone
assigned to 0x02.
Playback via headphone will get EQ filter processing. So,it needs to
swap DAC.

Tested-by: Mark Pearson <mpearson@lenovo.com>
Signed-off-by: Kailang Yang <kailang@realtek.com>
Link: https://lore.kernel.org/r/4e4cfa1b3b4c46838aecafc6e8b6f876@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: amd: yc: Fix a non-functional mic on Lenovo 82TL
Mario Limonciello [Wed, 6 Sep 2023 18:22:57 +0000 (13:22 -0500)]
ASoC: amd: yc: Fix a non-functional mic on Lenovo 82TL

Lenovo 82TL has DMIC connected like 82V2 does.  Also match
82TL.

Reported-by: wildjim@kiwinet.org
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217063
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20230906182257.45736-1-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: Intel: avs: Provide support for fallback topology
Amadeusz Sławiński [Tue, 5 Sep 2023 09:31:47 +0000 (11:31 +0200)]
ASoC: Intel: avs: Provide support for fallback topology

HDA and HDMI devices are simple enough that in case of user not having
topology tailored to their device, they can use fallback topology.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230905093147.1960675-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoALSA: seq: Fix snd_seq_expand_var_event() call to user-space
Takashi Iwai [Tue, 5 Sep 2023 08:12:10 +0000 (10:12 +0200)]
ALSA: seq: Fix snd_seq_expand_var_event() call to user-space

The recent fix to clear the padding bytes at
snd_seq_expand_var_event() broke the read to user-space with
in_kernel=0 parameter.  For user-space address, it has to use
clear_user() instead of memset().

Fixes: f80e6d60d677 ("ALSA: seq: Clear padded bytes at expanding events")
Reported-and-tested-by: Ash Holland <ash@sorrel.sh>
Closes: https://lore.kernel.org/r/8a555319-9f31-4ea2-878f-adc338bc40d4@sorrel.sh
Link: https://lore.kernel.org/r/20230905052631.18240-1-tiwai@suse.de
Link: https://lore.kernel.org/r/20230905081210.6731-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: usb-audio: Fix potential memory leaks at error path for UMP open
Takashi Iwai [Tue, 5 Sep 2023 05:45:11 +0000 (07:45 +0200)]
ALSA: usb-audio: Fix potential memory leaks at error path for UMP open

The allocation and initialization errors at alloc_midi_urbs() that is
called at MIDI 2.0 / UMP device are supposed to be handled at the
caller side by invoking free_midi_urbs().  However, free_midi_urbs()
loops only for ep->num_urbs entries, and since ep->num_entries wasn't
updated yet at the allocation / init error in alloc_midi_urbs(), this
entry won't be released.

The intention of free_midi_urbs() is to release the whole elements, so
change the loop size to NUM_URBS to scan over all elements for fixing
the missed releases.

Also, the call of free_midi_urbs() is missing at
snd_usb_midi_v2_open().  Although it'll be released later at
reopen/close or disconnection, it's better to release immediately at
the error path.

Fixes: ff49d1df79ae ("ALSA: usb-audio: USB MIDI 2.0 UMP support")
Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Closes: https://lore.kernel.org/r/fc275ed315b9157952dcf2744ee7bdb78defdb5f.1693746347.git.christophe.jaillet@wanadoo.fr
Link: https://lore.kernel.org/r/20230905054511.20502-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: hda/cirrus: Fix broken audio on hardware with two CS42L42 codecs.
Vitaly Rodionov [Mon, 4 Sep 2023 16:00:33 +0000 (17:00 +0100)]
ALSA: hda/cirrus: Fix broken audio on hardware with two CS42L42 codecs.

Recently in v6.3-rc1 there was a change affecting behaviour of hrtimers
(commit 0c52310f260014d95c1310364379772cb74cf82d) and causing
few issues on platforms with two CS42L42 codecs. Canonical/Dell
has reported an issue with Vostro-3910.
We need to increase this value by 15ms.

Link: https://bugs.launchpad.net/somerville/+bug/2031060
Fixes: 9fb9fa18fb50 ("ALSA: hda/cirrus: Add extra 10 ms delay to allow PLL settle and lock.")
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230904160033.908135-1-vitalyr@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: rt5645: NULL pointer access when removing jack
Brent Lu [Mon, 4 Sep 2023 10:40:46 +0000 (18:40 +0800)]
ASoC: rt5645: NULL pointer access when removing jack

Machine driver calls snd_soc_component_set_jack() function with NULL
jack and data parameters when removing jack in codec exit function.
Do not access data when jack is NULL.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20230904104046.4150208-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: amd: yc: Add DMI entries to support Victus by HP Gaming Laptop 15-fb0xxx (8A3E)
Shubh [Sat, 2 Sep 2023 15:08:07 +0000 (20:38 +0530)]
ASoC: amd: yc: Add DMI entries to support Victus by HP Gaming Laptop 15-fb0xxx (8A3E)

This model requires an additional detection quirk to
enable the internal microphone.

Signed-off-by: Shubh <shubhisroking@gmail.com>
Link: https://lore.kernel.org/r/20230902150807.133523-1-shubhisroking@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoMAINTAINERS: Update the MAINTAINERS enties for TEXAS INSTRUMENTS ASoC DRIVERS
Kevin-Lu [Sun, 3 Sep 2023 16:14:37 +0000 (00:14 +0800)]
MAINTAINERS: Update the MAINTAINERS enties for TEXAS INSTRUMENTS ASoC DRIVERS

Update the MAINTAINERS email for TEXAS INSTRUMENTS ASoC DRIVERS.

Signed-off-by: Kevin-Lu <kevin-lu@ti.com>
Link: https://lore.kernel.org/r/20230903161439.85-1-kevin-lu@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoALSA: sb: Fix wrong argument in commented code
Takashi Iwai [Sat, 2 Sep 2023 06:10:44 +0000 (08:10 +0200)]
ALSA: sb: Fix wrong argument in commented code

While rewriting the code from sockptr_t to iov_iter during the
development, I forgot to replace one place in emu8000-pcm code.  As
it's in the disabled area (with ifdef), it's never built and
overlooked.  Replace with the proper argument NULL.

Fixes: 9d0fdc602de9 ("ALSA: emu8000: Convert to generic PCM copy ops")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Closes: https://lore.kernel.org/r/20230902053646.GK3390869@ZenIV
Link: https://lore.kernel.org/r/20230902061044.19366-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: pcm: Fix error checks of default read/write copy ops
Takashi Iwai [Sat, 2 Sep 2023 06:10:43 +0000 (08:10 +0200)]
ALSA: pcm: Fix error checks of default read/write copy ops

copy_from/to_iter() returns the actually copied bytes, and the more
correct check should be to compare with the given bytes, instead of
zero-check.

Fixes: cf393babb37a ("ALSA: pcm: Add copy ops with iov_iter")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Closes: https://lore.kernel.org/r/20230902053044.GJ3390869@ZenIV
Link: https://lore.kernel.org/r/20230902061044.19366-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: Name iov_iter argument as iterator instead of buffer
Takashi Iwai [Thu, 31 Aug 2023 13:04:57 +0000 (15:04 +0200)]
ASoC: Name iov_iter argument as iterator instead of buffer

While transitioning ASoC code for iov_iter usages, I kept the argument
name as "buf" as the original code.  But, iov_iter is an iterator, and
using the name "buf" may be misleading: the crucial difference is that
iov_iter can be proceeded after the operation, hence it can't be
passed twice, while a simple "buffer" sounds as if reusable.

To make the usage clearer, rename the argument from "buf" to "iter".
There is no functional changes, just names.

Fixes: 66201cacc33d ("ASoC: component: Add generic PCM copy ops")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/CAHk-=wje+VkXjjfVTmK-uJdG_M5=ar14QxAwK+XDiq07k_pzBg@mail.gmail.com
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230831130457.8180-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: dmaengine: Drop unused iov_iter for process callback
Takashi Iwai [Thu, 31 Aug 2023 13:04:56 +0000 (15:04 +0200)]
ASoC: dmaengine: Drop unused iov_iter for process callback

Passing the iov_iter to the process callback is rather buggy, as the
iterator has been already processed for playback.  Similarly, it makes
the copy for capture buggy after the process callback reading the
iterator out.  Moreover, all existing process callbacks don't refer to
the passed iterator at all.  So, it's better to drop the argument from
the process callback.

Fixes: 9bebd65443c1 ("ASoC: dmaengine: Use iov_iter for process callback, too")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/CAHk-=wje+VkXjjfVTmK-uJdG_M5=ar14QxAwK+XDiq07k_pzBg@mail.gmail.com
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230831130457.8180-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: hda/tas2781: Use standard clamp() macro
Takashi Iwai [Thu, 31 Aug 2023 12:36:20 +0000 (14:36 +0200)]
ALSA: hda/tas2781: Use standard clamp() macro

Instead of the home-made clamp() function, use the standard macro().

Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Link: https://lore.kernel.org/r/20230831123620.23064-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: cs35l56: Waiting for firmware to boot must be tolerant of I/O errors
Simon Trimmer [Tue, 29 Aug 2023 16:04:33 +0000 (17:04 +0100)]
ASoC: cs35l56: Waiting for firmware to boot must be tolerant of I/O errors

Ignore failure to read from the cs35l56 when polling as the device will
NAK i2c accesses until it has booted and this would terminate the poll
of regmap_read_poll_timeout().

Fixes: 8a731fd37f8b ("ASoC: cs35l56: Move utility functions to shared file")
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com
Link: https://lore.kernel.org/r/20230829160433.2647889-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoALSA: pcm: Fix missing fixup call in compat hw_refine ioctl
Takashi Iwai [Tue, 29 Aug 2023 13:43:44 +0000 (15:43 +0200)]
ALSA: pcm: Fix missing fixup call in compat hw_refine ioctl

The update of rate_num/den and msbits were factored out to
fixup_unreferenced_params() function to be called explicitly after the
hw_refine or hw_params procedure.  It's called from
snd_pcm_hw_refine_user(), but it's forgotten in the PCM compat ioctl.
This ended up with the incomplete rate_num/den and msbits parameters
when 32bit compat ioctl is used.

This patch adds the missing call in snd_pcm_ioctl_hw_params_compat().

Reported-by: Meng_Cai@novatek.com.cn
Fixes: f9a076bff053 ("ALSA: pcm: calculate non-mask/non-interval parameters always when possible")
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230829134344.31588-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: dt-bindings: fsl_easrc: Add support for imx8mp-easrc
Adam Ford [Sun, 27 Aug 2023 02:31:53 +0000 (21:31 -0500)]
ASoC: dt-bindings: fsl_easrc: Add support for imx8mp-easrc

The i.MX8MP appears to have the same easrc support as the Nano, so
add imx8mp as an option with a fallback to imx8mn.

Signed-off-by: Adam Ford <aford173@gmail.com
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Acked-by: Conor Dooley <conor.dooley@microchip.com
Link: https://lore.kernel.org/r/20230827023155.467807-1-aford173@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoASoC: cs42l43: Fix missing error code in cs42l43_codec_probe()
Harshit Mogalapalli [Tue, 29 Aug 2023 07:36:35 +0000 (00:36 -0700)]
ASoC: cs42l43: Fix missing error code in cs42l43_codec_probe()

When clk_get_optional() fails, the error handling code does a 'goto
err_pm' with ret = 0, which is resturning success on a failure path.

Fix this by assigning the PTR_ERR(priv-mclk) to ret variable.

Fixes: fc918cbe874e ("ASoC: cs42l43: Add support for the cs42l43")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com
Link: https://lore.kernel.org/r/20230829073635.1877367-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoASoC: cs35l45: Rename DACPCM1 Source control
Vlad Karpovich [Mon, 28 Aug 2023 17:05:23 +0000 (12:05 -0500)]
ASoC: cs35l45: Rename DACPCM1 Source control

Rename control to "DACPCM Source" for backward compatibility
with previous implementation.

Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com
Link: https://lore.kernel.org/r/20230828170525.335671-5-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoASoC: cs35l45: Fix "Dead assigment" warning
Vlad Karpovich [Mon, 28 Aug 2023 17:05:20 +0000 (12:05 -0500)]
ASoC: cs35l45: Fix "Dead assigment" warning

Value stored to 'ret' is never read. Remove it.

Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com
Link: https://lore.kernel.org/r/20230828170525.335671-2-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoASoC: cs35l45: Add support for Chip ID 0x35A460
Vlad Karpovich [Mon, 28 Aug 2023 17:05:19 +0000 (12:05 -0500)]
ASoC: cs35l45: Add support for Chip ID 0x35A460

The 0x35A460 chip is a different variant of the cs35l45.

Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com
Link: https://lore.kernel.org/r/20230828170525.335671-1-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoMerge tag 'asoc-fix-v6.5-merge-window' of https://git.kernel.org/pub/scm/linux/kernel...
Takashi Iwai [Mon, 28 Aug 2023 14:56:54 +0000 (16:56 +0200)]
Merge tag 'asoc-fix-v6.5-merge-window' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes that got left after v6.4

These were some changes in my v6.4 branch that never got sent as fixes,
none of them super urgent thankfully.

10 months agoASoC: dwc: i2s: Fix unused functions
Takashi Iwai [Mon, 28 Aug 2023 11:35:37 +0000 (13:35 +0200)]
ASoC: dwc: i2s: Fix unused functions

A few newly added functions aren't built unless CONFIG_OF is set,
which result in the build failure due to defined-but-not-used errors.

Put "#ifdef CONFIG_OF" around those functions to suppress the build
error.

Fixes: 52ea7c0543f8 ("ASoC: dwc: i2s: Add StarFive JH7110 SoC support")
Link: https://lore.kernel.org/r/20230828113537.27600-1-tiwai@suse.de
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: codecs: wcd93xx: fix object added to multiple drivers
Krzysztof Kozlowski [Mon, 28 Aug 2023 13:23:16 +0000 (15:23 +0200)]
ASoC: codecs: wcd93xx: fix object added to multiple drivers

Three Qualcomm audio codecs (WCD9355, WCD934x and WCD938x) use the same
object file wcd-clsh-v2.o leading to warnings:

  Makefile: wcd-clsh-v2.o is added to multiple modules: snd-soc-wcd9335 snd-soc-wcd934x snd-soc-wcd938x

Convert the wcd-clsh-v2.o to a module to solve it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Link: https://lore.kernel.org/r/20230828132316.190386-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoMerge tag 'asoc-v6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Mon, 28 Aug 2023 14:13:03 +0000 (16:13 +0200)]
Merge tag 'asoc-v6.6' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v6.6

The rest of the updates for v6.6, some of the highlights include:

 - A big API cleanup from Morimoto-san, rationalising the places we put
   functions.
 - Lots of work on the SOF framework, AMD and Intel drivers, including a
   lot of cleanup and new device support.
 - Standardisation of the presentation of jacks from drivers.
 - Provision of some generic sound card DT properties.
 - Conversion oof more drivers to the maple tree register cache.
 - New drivers for AMD Van Gogh, AWInic AW88261, Cirrus Logic cs42l43,
   various Intel platforms, Mediatek MT7986, RealTek RT1017 and StarFive
   JH7110.

10 months agoALSA: usb-audio: Don't try to submit URBs after disconnection
Takashi Iwai [Mon, 28 Aug 2023 10:19:24 +0000 (12:19 +0200)]
ALSA: usb-audio: Don't try to submit URBs after disconnection

USB-audio driver can still submit URBs while the device is being
disconnected, and it may result in spurious error messages like:
  usb 1-2: cannot submit urb (err = -19)
  usb 1-2: Unable to submit urb #0: -19 at snd_usb_queue_pending_output_urbs
  usb 1-2: cannot submit urb 0, error -19: no device
Although those are harmless, they are just ugly.

This patch tries to avoid spewing such error messages when the device
is already at the disconnected state.  It also skips the superfluous
xfer notification, too.

Link: https://lore.kernel.org/r/20230828101924.27107-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoMerge branch 'for-next' into for-linus
Takashi Iwai [Mon, 28 Aug 2023 09:56:39 +0000 (11:56 +0200)]
Merge branch 'for-next' into for-linus

Pull materials for 6.5 merge window.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: emu10k1: add separate documentation for E-MU cards
Oswald Buddenhagen [Fri, 25 Aug 2023 22:21:57 +0000 (00:21 +0200)]
ALSA: emu10k1: add separate documentation for E-MU cards

They are sufficiently different from Sound Blasters.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230825222157.170978-3-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: emu10k1: more documentation updates
Oswald Buddenhagen [Fri, 25 Aug 2023 22:21:56 +0000 (00:21 +0200)]
ALSA: emu10k1: more documentation updates

- Clarify the data flows. For SB Live! I fixed only the most obvious
  point ("from" vs. "for").
- Mention 7.1 side channels on Audigy.
- Be unspecific about the output DACs on Audigy, as lots of variants
  actually exist (see emu_chip_details table).

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230825222157.170978-2-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: emu10k1: de-duplicate audigy-mixer.rst vs. sb-live-mixer.rst
Oswald Buddenhagen [Fri, 25 Aug 2023 22:21:55 +0000 (00:21 +0200)]
ALSA: emu10k1: de-duplicate audigy-mixer.rst vs. sb-live-mixer.rst

Let the MANUALS/PATENTS section of the former simply refer to the latter
- there is no point in duplicating this information with little value to
end users.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230825222157.170978-1-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: ump: Fix -Wformat-truncation warnings
Takashi Iwai [Sat, 26 Aug 2023 07:21:51 +0000 (09:21 +0200)]
ALSA: ump: Fix -Wformat-truncation warnings

Filling the rawmidi name and substream name can be truncated, and this
leads to spurious compiler warnings due to -Wformat-truncation.
Although the truncation is the expected behavior, it'd be better to
truncate the string within "(...)"

This patch puts the precision specifies to each %s for fitting the
words within the size-limited strings.

Fixes: 5f11dd938fe7 ("ALSA: usb-audio: Attach legacy rawmidi after probing all UMP EPs")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308251844.1FuQYsql-lkp@intel.com/
Link: https://lore.kernel.org/r/20230826072151.23408-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: hda: Add missing dependency on CONFIG_EFI for Cirrus/TI sub-codecs
Takashi Iwai [Fri, 25 Aug 2023 09:28:19 +0000 (11:28 +0200)]
ALSA: hda: Add missing dependency on CONFIG_EFI for Cirrus/TI sub-codecs

The CS35L41 and TAS2781 sub-codecs depend on CONFIG_EFI, as they have
the code accessing efi variable directly.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308250621.1lwt7PtZ-lkp@intel.com/
Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Link: https://lore.kernel.org/r/20230825092819.12340-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: doc: Fix missing backquote in midi-2.0.rst
Takashi Iwai [Fri, 25 Aug 2023 09:23:51 +0000 (11:23 +0200)]
ALSA: doc: Fix missing backquote in midi-2.0.rst

Fix the missing  missing backquote that caused a sphinx warning:
  Documentation/sound/designs/midi-2.0.rst:517: WARNING: Inline interpreted text or phrase reference start-string without end-string.

Fixes: e240cff9e6e9 ("ALSA: documentation: Add description for USB MIDI 2.0 gadget driver")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/r/20230825152957.18c54ae2@canb.auug.org.au
Link: https://lore.kernel.org/r/20230825092351.11780-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: hda/realtek: Add quirk for mute LEDs on HP ENVY x360 15-eu0xxx
Fabian Vogt [Thu, 24 Aug 2023 18:39:48 +0000 (20:39 +0200)]
ALSA: hda/realtek: Add quirk for mute LEDs on HP ENVY x360 15-eu0xxx

The LED for the mic mute button is controlled by GPIO2.
The mute button LED is slightly more complex, it's controlled by two bits
in coeff 0x0b.

Signed-off-by: Fabian Vogt <fabian@ritter-vogt.de>
Link: https://lore.kernel.org/r/2693091.mvXUDI8C0e@fabians-envy
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: hda/tas2781: Switch back to use struct i2c_driver's .probe()
Uwe Kleine-König [Thu, 24 Aug 2023 20:02:19 +0000 (22:02 +0200)]
ALSA: hda/tas2781: Switch back to use struct i2c_driver's .probe()

struct i2c_driver::probe_new is about to go away. Switch the driver to
use the probe callback with the same prototype.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Link: https://lore.kernel.org/r/20230824200219.9569-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoMerge tag 'asoc-fix-v6.5-rc7-2' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Fri, 25 Aug 2023 07:43:49 +0000 (09:43 +0200)]
Merge tag 'asoc-fix-v6.5-rc7-2' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Quirk for v6.5

One additional fix for v6.5, an additional quirk.  As with the other
fixes this could wait for the merge window.

10 months agoASoC: soc-core.c: Do not error if a DAI link component is not found
Cristian Ciocaltea [Thu, 24 Aug 2023 19:38:37 +0000 (22:38 +0300)]
ASoC: soc-core.c: Do not error if a DAI link component is not found

A recent cleanup of soc_dai_link_sanity_check() is responsible for
generating lots of confusing errors before returning -EPROBE_DEFER:

  acp5x_mach acp5x_mach.0: ASoC: Component acp5x_i2s_dma.0 not found for link acp5x-8821-play
  [...]
  acp5x_mach acp5x_mach.0: ASoC: Component spi-VLV1776:00 not found for link acp5x-CS35L41-Stereo
  [...]
  acp5x_mach acp5x_mach.0: ASoC: Component spi-VLV1776:01 not found for link acp5x-CS35L41-Stereo

Switch back to the initial behaviour of logging those messages on
KERN_DEBUG level instead of KERN_ERR.

While at it, use the correct form of the verb in 'component_not_find'
label.

Fixes: 0e66a2c69409 ("ASoC: soc-core.c: cleanup soc_dai_link_sanity_check()")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com
Link: https://lore.kernel.org/r/20230824193837.369761-1-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoASoC: codecs: Fix error code in aw88261_i2c_probe()
Harshit Mogalapalli [Thu, 24 Aug 2023 19:17:10 +0000 (12:17 -0700)]
ASoC: codecs: Fix error code in aw88261_i2c_probe()

Passing zero to dev_err_probe is a success which is incorrect when
i2c_check_functionality() fails.

Fix this by passing -ENXIO instead of zero to dev_err_probe().

Fixes: 028a2ae25691 ("ASoC: codecs: Add aw88261 amplifier driver")
Reported-by: kernel test robot <lkp@intel.com
Reported-by: Dan Carpenter <error27@gmail.com
Closes: https://lore.kernel.org/r/202308150315.CvOTIOKm-lkp@intel.com/
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com
Link: https://lore.kernel.org/r/20230824191722.2701215-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoASoC: audio-graph-card.c: move audio_graph_parse_of()
Kuninori Morimoto [Thu, 24 Aug 2023 02:02:49 +0000 (02:02 +0000)]
ASoC: audio-graph-card.c: move audio_graph_parse_of()

Current audio-graph-card functions definition are like below

(A)' static int graph_get_dais_count();

(B) int audio_graph_parse_of(...)
{
...
(A) ret = graph_get_dais_count();
...
}

(A) static int graph_get_dais_count(...)
{
...
}
(C)

We don't need to have (A)' definition if audio_graph_parse_of() (B) was
defined at (C). This patch moves (B) to (C).

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87r0ntmc3c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoASoC: cs42l43: Use new-style PM runtime macros
Charles Keepax [Thu, 24 Aug 2023 10:39:02 +0000 (11:39 +0100)]
ASoC: cs42l43: Use new-style PM runtime macros

Update to the newer style PM runtime macros, no functional change.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com
Link: https://lore.kernel.org/r/20230824103902.1606288-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoASoC: amd: yc: Fix a non-functional mic on Lenovo 82SJ
Mario Limonciello [Thu, 24 Aug 2023 01:11:49 +0000 (20:11 -0500)]
ASoC: amd: yc: Fix a non-functional mic on Lenovo 82SJ

Lenovo 82SJ doesn't have DMIC connected like 82V2 does.  Narrow
the match down to only cover 82V2.

Reported-by: prosenfeld@Yuhsbstudents.org
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217063
Fixes: 2232b2dd8cd4 ("ASoC: amd: yc: Add Lenovo Yoga Slim 7 Pro X to quirks table")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com
Link: https://lore.kernel.org/r/20230824011149.1395-1-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org
10 months agoALSA: documentation: Add description for USB MIDI 2.0 gadget driver
Takashi Iwai [Thu, 24 Aug 2023 07:51:08 +0000 (09:51 +0200)]
ALSA: documentation: Add description for USB MIDI 2.0 gadget driver

The USB MIDI 2.0 gadget driver is now supported for 6.6 kernel, and
here we show a brief instruction how to enable and use it.

Link: https://lore.kernel.org/r/20230824075108.29958-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: ump: Don't create unused substreams for static blocks
Takashi Iwai [Thu, 24 Aug 2023 07:51:07 +0000 (09:51 +0200)]
ALSA: ump: Don't create unused substreams for static blocks

When the UMP Endpoint is declared as "static", that is, no dynamic
reassignment of UMP Groups, it makes little sense to expose always all
16 groups with 16 substreams.  Many of those substreams are disabled
groups, hence they are useless, but applications don't know it and try
to open / access all those substreams unnecessarily.

This patch limits the number of UMP legacy rawmidi substreams only to
the active groups.  The behavior is changed only for the static
endpoint (i.e. devices without UMP v1.1 feature implemented or with
the static block flag is set).

Fixes: 0b5288f5fe63 ("ALSA: ump: Add legacy raw MIDI support")
Link: https://lore.kernel.org/r/20230824075108.29958-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: ump: Fill group names for legacy rawmidi substreams
Takashi Iwai [Thu, 24 Aug 2023 07:51:06 +0000 (09:51 +0200)]
ALSA: ump: Fill group names for legacy rawmidi substreams

To make it clearer which legacy substream corresponds to which UMP
group, fill the subname field of each substream object with the group
number and the endpoint name, e.g. "Group 1 (My Device)".

Ideally speaking, we should have some better link information to the
derived UMP, but it's another feature extension.

Fixes: 0b5288f5fe63 ("ALSA: ump: Add legacy raw MIDI support")
Link: https://lore.kernel.org/r/20230824075108.29958-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: usb-audio: Attach legacy rawmidi after probing all UMP EPs
Takashi Iwai [Thu, 24 Aug 2023 07:51:05 +0000 (09:51 +0200)]
ALSA: usb-audio: Attach legacy rawmidi after probing all UMP EPs

The legacy rawmidi devices are the shadows of the main UMP devices,
hence it's better to initialize them after all UMP Endpoints are
parsed.  Then, at the moment the legacy rawmidi is created, we already
know the static flag or the proper EP name string, and we can fill
those information at UMP core side instead of fiddling the attributes
at a later point.

Fixes: ec362b63c4b5 ("ALSA: usb-audio: Enable the legacy raw MIDI support")
Link: https://lore.kernel.org/r/20230824075108.29958-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: ac97: Fix possible error value of *rac97
Su Hui [Wed, 23 Aug 2023 02:52:13 +0000 (10:52 +0800)]
ALSA: ac97: Fix possible error value of *rac97

Before committing 79597c8bf64c, *rac97 always be NULL if there is
an error. When error happens, make sure *rac97 is NULL is safer.

For examble, in snd_vortex_mixer():
err = snd_ac97_mixer(pbus, &ac97, &vortex->codec);
vortex->isquad = ((vortex->codec == NULL) ?
0 : (vortex->codec->ext_id&0x80));
If error happened but vortex->codec isn't NULL, this may cause some
problems.

Move the judgement order to be clearer and better.

Fixes: 79597c8bf64c ("ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer")
Suggested-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20230823025212.1000961-1-suhui@nfschina.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: pcmtest: Add support for pcm pausing
Ivan Orlov [Tue, 22 Aug 2023 15:05:41 +0000 (19:05 +0400)]
ALSA: pcmtest: Add support for pcm pausing

Add pause push/release support to the virtual PCM test driver. Add
'suspend' boolean field to the pcmtst_buf_iter structure, so we can
pause the timer without shutting it down. Update the trigger callback
handler correspondingly. Extract buffer initialization to the
'reset_buf_iterator' function since it is used in multiple places now.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230822150541.8450-1-ivan.orlov0322@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: hda/realtek: Add quirk for HP Victus 16-d1xxx to enable mute LED
SungHwan Jung [Wed, 23 Aug 2023 11:40:51 +0000 (20:40 +0900)]
ALSA: hda/realtek: Add quirk for HP Victus 16-d1xxx to enable mute LED

This quirk enables mute LED on HP Victus 16-d1xxx (8A25) laptops, which
use ALC245 codec.

Signed-off-by: SungHwan Jung <onenowy@gmail.com>
Link: https://lore.kernel.org/r/20230823114051.3921-1-onenowy@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct boost type
Stefan Binding [Wed, 23 Aug 2023 14:39:56 +0000 (15:39 +0100)]
ALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct boost type

CS35L41 HDA driver requires ACPI to contain correct _DSD properties to
correctly configure the device. Whilst the HP Zbook Fury 17 G9 contains
valid _DSD properties, the boost type has been configured incorrectly
in the _DSD for this laptop. We can override these properties to fix
the boost type.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230823143956.755758-1-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoMerge branch 'for-linus' into for-next
Takashi Iwai [Thu, 24 Aug 2023 07:27:21 +0000 (09:27 +0200)]
Merge branch 'for-linus' into for-next

Back-merge the 6.5-devel branch for the clean patch application for
6.6 and resolving merge conflicts.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoMerge tag 'asoc-fix-v6.5-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Thu, 24 Aug 2023 07:20:36 +0000 (09:20 +0200)]
Merge tag 'asoc-fix-v6.5-rc7' of https://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.5

A relatively large but generally not super urgent set of fixes for ASoC,
including some quirks and a MAINTAINERS update.  There's also an update
to cs35l56 to change the firmware ABI, there are no current shipping
systems which use the current interface and the sooner we get the new
interface in the less likely it is that something will start.

It'd be nice if these landed for v6.5 but not the end of the world if
they wait till v6.6.

10 months agoASoC: cs42l43: Initialize ret in default case in cs42l43_pll_ev()
Nathan Chancellor [Wed, 23 Aug 2023 16:32:50 +0000 (09:32 -0700)]
ASoC: cs42l43: Initialize ret in default case in cs42l43_pll_ev()

clang warns (or errors with CONFIG_WERROR=y):

  sound/soc/codecs/cs42l43.c:1371:2: error: variable 'ret' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
   1371 |         default:
        |         ^~~~~~~
  sound/soc/codecs/cs42l43.c:1377:9: note: uninitialized use occurs here
   1377 |         return ret;
        |                ^~~
  sound/soc/codecs/cs42l43.c:1349:9: note: initialize the variable 'ret' to silence this warning
   1349 |         int ret;
        |                ^
        |                 = 0
  1 error generated.

Initialize ret to 0 in the default case, as there was nothing to do for
other event types.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1922
Fixes: fc918cbe874e ("ASoC: cs42l43: Add support for the cs42l43")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20230823-cs42l43_pll_ev-init-ret-v1-1-5836f1ad5dad@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoAdd I2S support for the StarFive JH7110 SoC
Mark Brown [Wed, 23 Aug 2023 18:54:51 +0000 (19:54 +0100)]
Add I2S support for the StarFive JH7110 SoC

Merge series from Xingyu Wu <xingyu.wu@starfivetech.com>:

This patch series adds I2S support for the StarFive JH7110 RISC-V
SoC based on Designware I2S controller. There has three I2S channels
(RX/TX0/TX1) on the JH7110 SoC, one of which is for record(RX) and
two for playback(TX).

The first patch adds support for the StarFive JH7110 SoC in the
Designware I2S bindings.
The second patch adds the ops to get data from platform bus in the
I2S driver.
The third patch adds support for the StarFive JH7110 SoC in
the Designware I2S driver.
The fourth patch fixes the name of I2STX1 pinmux.
The last patch adds device node of I2S RX/TX0/TX1 in JH7110 dts.

This patch series is based on Linux-next(20230818) which is merge
clock, syscon and dma nodes for the StarFive JH7110 SoC.

The series has been tested and works normally on the VisionFive 2
board by plugging an audio expansion board.

10 months agoASoC: rsnd: tidyup ADG
Mark Brown [Wed, 23 Aug 2023 18:54:43 +0000 (19:54 +0100)]
ASoC: rsnd: tidyup ADG

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Renesas Sound has ADG for clock control. Basically it needs
accurately divisible external input clock. But sometimes
sometimes it doesn't have to be accurate for some reason.

We can use ADG clk_i for such case. It came from CPG as
very high rate clock, but is not accurately divisible for
48kHz/44.1kHz rate, but enough for approximate rate.

This patch set support such use case.

10 months agoASoC: audio-graph-card2: add comment for format property
Kuninori Morimoto [Wed, 23 Aug 2023 00:19:42 +0000 (00:19 +0000)]
ASoC: audio-graph-card2: add comment for format property

We don't need to have "format" property on DT any more if
CPU/Codec driver has .auto_selectable_formats settings
on snd_soc_dai_ops. The sample dtsi doesn't have it.
To avoid user confusion, this patch indicates it on comment.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edjuzk2p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoALSA: ymfpci: Fix the missing snd_card_free() call at probe error
Takashi Iwai [Wed, 23 Aug 2023 16:16:25 +0000 (18:16 +0200)]
ALSA: ymfpci: Fix the missing snd_card_free() call at probe error

Like a few other drivers, YMFPCI driver needs to clean up with
snd_card_free() call at an error path of the probe; otherwise the
other devres resources are released before the card and it results in
the UAF.

This patch uses the helper for handling the probe error gracefully.

Fixes: f33fc1576757 ("ALSA: ymfpci: Create card with device-managed snd_devm_card_new()")
Cc: <stable@vger.kernel.org>
Reported-and-tested-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Closes: https://lore.kernel.org/r/20230823135846.1812-1-takashi.yano@nifty.ne.jp
Link: https://lore.kernel.org/r/20230823161625.5807-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: dwc: i2s: Add StarFive JH7110 SoC support
Xingyu Wu [Mon, 21 Aug 2023 14:41:49 +0000 (22:41 +0800)]
ASoC: dwc: i2s: Add StarFive JH7110 SoC support

Add StarFive JH7110(TX0/TX1/RX channels) SoC support in the
designware I2S driver and a flag to check if it is on the JH7110 SoC.

These channels need to enable clocks, resets and syscon register on the
JH7110 SoC. So add init ops in platform data for the JH7110 SoC to do this.

Their resets should be deassert before changing the parent of clocks so
these are done in the init ops of platform data.

The I2S controllers use DMA controller by platform data on the JH7110
and their settings about snd_dmaengine_dai_dma_data() should be added
in the dw_configure_dai_by_pd(). And use dmaengine PCM registration if
these do not have IRQ on the JH7110 SoC.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Link: https://lore.kernel.org/r/20230821144151.207339-4-xingyu.wu@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: dwc: Use ops to get platform data
Xingyu Wu [Mon, 21 Aug 2023 14:41:48 +0000 (22:41 +0800)]
ASoC: dwc: Use ops to get platform data

Use of_device_get_match_data() to get platform data.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Link: https://lore.kernel.org/r/20230821144151.207339-3-xingyu.wu@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: dt-bindings: snps,designware-i2s: Add StarFive JH7110 SoC support
Xingyu Wu [Mon, 21 Aug 2023 14:41:47 +0000 (22:41 +0800)]
ASoC: dt-bindings: snps,designware-i2s: Add StarFive JH7110 SoC support

Add the StarFive JH7110 (TX0/TX1/RX channel) SoC support in the bindings
of Designware I2S controller. The I2S controller needs two reset items
to work properly on the JH7110 SoC. And TX0 channel as master mode needs
5 clock items and TX1/RX channels as slave mode need 9 clock items on
the JH7110 SoC. The RX channel needs System Register Controller property
to enable it and other platforms do not need it.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230821144151.207339-2-xingyu.wu@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: rsnd: setup BRGCKR/BRRA/BRRB on rsnd_adg_clk_control()
Kuninori Morimoto [Tue, 22 Aug 2023 23:51:02 +0000 (23:51 +0000)]
ASoC: rsnd: setup BRGCKR/BRRA/BRRB on rsnd_adg_clk_control()

Current adg.c will configure BRGCKR/BRRA/BRRB to output clock
when it start sound. OTAH, rsnd_adg_clk_enable() will enables
clk_a/b/c when driver was probed.
But it is strange, these should be set in the same time.
This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h6oqzlei.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: rsnd: remove default division of clock out
Kuninori Morimoto [Tue, 22 Aug 2023 23:50:54 +0000 (23:50 +0000)]
ASoC: rsnd: remove default division of clock out

Current adg has default division for BRRA/BRRB, but it was created at
very beginning of the driver implementation, and is now an unnecessary
settings.

Because it has this default division, unexpected clockout might
be selected. For example if it requests only 44.1kHz base clockout,
unrequested 48kHz base clockout also will be selected.

This patch remove default division of clock out

Reported-by: Vincenzo De Michele <vincenzo.michele@davinci.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87il96zlep.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: rsnd: tidyup brga/brgb default value
Kuninori Morimoto [Tue, 22 Aug 2023 23:50:48 +0000 (23:50 +0000)]
ASoC: rsnd: tidyup brga/brgb default value

default value for brga/brgb should be 0xff instead of 0x2.
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87jztmzlew.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: rsnd: setup clock-out only when all conditions are right
Kuninori Morimoto [Tue, 22 Aug 2023 23:50:36 +0000 (23:50 +0000)]
ASoC: rsnd: setup clock-out only when all conditions are right

Current adg.c doesn't assume that requested clock out divide condition
doesn't match. In such case, it will indicate strange message, and will
register NULL clock, etc. It is just a DT setting miss, but is
confusable. This patch check all conditions for it.

Reported-by: Vincenzo De Michele <vincenzo.michele@davinci.de>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lee2zlf7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: rsnd: enable clk_i approximate rate usage
Kuninori Morimoto [Tue, 22 Aug 2023 23:50:31 +0000 (23:50 +0000)]
ASoC: rsnd: enable clk_i approximate rate usage

Basically Renesas sound ADG is assuming that it has accurately
divisible input clock. But sometimes / some board might not have it.
The clk_i from CPG is used for such case. It can't calculate accurate
division, but can be used as approximate rate.
This patch enable clk_i for such case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Adnan Ali <adnan.ali@bp.renesas.com>
Tested-by: Vincenzo De Michele <vincenzo.michele@davinci.de>
Tested-by: Patrick Keil <patrick.keil@conti-engineering.com>
Link: https://lore.kernel.org/r/87msyizlfd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: nau8821: Improve AMIC recording performance.
Seven Lee [Wed, 23 Aug 2023 07:12:44 +0000 (15:12 +0800)]
ASoC: nau8821: Improve AMIC recording performance.

Since the hardware may be designed as a single-ended input, the headset mic
record only supports single-ended input on the left side. This patch
will enhance microphone recording performance for single-end.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20230823071244.1861487-2-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: dt-bindings: nau8821: Add single-ended input feature
Seven Lee [Wed, 23 Aug 2023 07:12:43 +0000 (15:12 +0800)]
ASoC: dt-bindings: nau8821: Add single-ended input feature

Add input with single-ended control.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20230823071244.1861487-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: Delete UDA134x/L3 audio codec
Linus Walleij [Tue, 22 Aug 2023 20:55:44 +0000 (22:55 +0200)]
ASoC: Delete UDA134x/L3 audio codec

This codec was used by the deleted S3C board
sound/soc/samsung/s3c24xx_uda134x.c.

Fixes: 503278c12701 ("ASoC: samsung: remove unused drivers")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230822-delete-l3-v2-1-b3ffc07348af@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: amd: clear dsp to host interrupt status
Vijendar Mukunda [Wed, 23 Aug 2023 07:33:39 +0000 (13:03 +0530)]
ASoC: SOF: amd: clear dsp to host interrupt status

DSP_SW_INTR_STAT_OFFSET is a common interrupt register which will be
accessed by both ACP firmware and driver. This register contains register
bits corresponds to host to dsp interrupts and vice versa.

when dsp to host interrupt is reported, only clear dsp to host
interrupt bit in DSP_SW_INTR_STAT_OFFSET.

Fixes: 2e7c6652f9b8 ("ASoC: SOF: amd: Fix for handling spurious interrupts from DSP")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: amd: clear panic mask status when panic occurs
Vijendar Mukunda [Wed, 23 Aug 2023 07:33:38 +0000 (13:03 +0530)]
ASoC: SOF: amd: clear panic mask status when panic occurs

Due to scratch memory persistence, Once the DSP panic is reported, need to
clear the panic mask after handling DSP panic. Otherwise, It results in DSP
panic on next reboot.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: amd: add conditional check for acp_clkmux_sel register
Vijendar Mukunda [Wed, 23 Aug 2023 07:33:37 +0000 (13:03 +0530)]
ASoC: SOF: amd: add conditional check for acp_clkmux_sel register

Few AMD platforms require ACP ACLK as clock source.
Add conditional check for clock mux selection register for
switching between internal clock and ACP ACLK.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: amd: remove redundant clock mux selection register write
Vijendar Mukunda [Wed, 23 Aug 2023 07:33:36 +0000 (13:03 +0530)]
ASoC: SOF: amd: remove redundant clock mux selection register write

ACP clock mux selection register is already programmed during acp init
sequence.
Remove the redundant register write.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: amd: add module parameter for firmware debug
Vijendar Mukunda [Wed, 23 Aug 2023 07:33:35 +0000 (13:03 +0530)]
ASoC: SOF: amd: add module parameter for firmware debug

Add module parameter for firmware debug. If firmware debug
flag is enabled, clear the fusion stall bit which is required
for enabling firmware debugging through JTAG.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: amd: enable ACP external global interrupt
Vijendar Mukunda [Wed, 23 Aug 2023 07:33:34 +0000 (13:03 +0530)]
ASoC: SOF: amd: enable ACP external global interrupt

Previously ACP SOF firmware used to enable the ACP external
global interrupt register.
This will restrict to report ACP host interrupts only after
firmware loading is successful.
This register needs to be set from host driver to handle
other ACP interrupts(SoundWire Interrupts) before loading
the ACP firmware.

Add field for external interrupt enable register in acp descriptor
structure and enable the external interrupt enable register.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: amd: remove unused sha dma interrupt code
Vijendar Mukunda [Wed, 23 Aug 2023 07:33:33 +0000 (13:03 +0530)]
ASoC: SOF: amd: remove unused sha dma interrupt code

During initial development time for RN platform, when SHA
dma gets completed, SHA DMA engine used to raise the ACP interrupt.
In ACP interrupt handler, SHA DMA interrupt got handled.
Currently SHA DMA compleition is verified by checking
transfer count using read poll time out logic.
Remove unused SHA dma interrupt handling code.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230823073340.2829821-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: cs35l41: Correct amp_gain_tlv values
Charles Keepax [Wed, 23 Aug 2023 08:53:08 +0000 (09:53 +0100)]
ASoC: cs35l41: Correct amp_gain_tlv values

The current analog gain TLV seems to have completely incorrect values in
it. The gain starts at 0.5dB, proceeds in 1dB steps, and has no mute
value, correct the control to match.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230823085308.753572-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: fsl: merge DAI call back functions into ops
Kuninori Morimoto [Tue, 22 Aug 2023 01:10:59 +0000 (01:10 +0000)]
ASoC: fsl: merge DAI call back functions into ops

ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308152047.psX1QNDh-lkp@intel.com/
Cc: Randy Dunlap <rdunlap@infradead.org>
Fixes: 446b31e89493 ("ASoC: soc-dai.h: remove unused call back functions")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Link: https://lore.kernel.org/r/87a5ujubj0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: ipc4-topology: Add module parameter to ignore the CPC value
Peter Ujfalusi [Tue, 22 Aug 2023 06:54:19 +0000 (09:54 +0300)]
ASoC: SOF: ipc4-topology: Add module parameter to ignore the CPC value

Add a new module parameter ipc4_ignore_cpc which can be used to force the
kernel to ignore the queried CPC value for all firmware modules and use 0
instead.

The CPC lookup is still done to report missing configurations and the
debug print is going to be different to be explicit that the CPC is ignored
and what was the value we would have used.

The CPC value is sent to the firmware with the MOD_INIT_INSTANCE message
and it is used by the firmware as a parameter for clock scaling.

The flag is intended to be used only when there is a need to validate the
firmware behavior regarding to clock scaling since the 0 CPC value will
force the DSP to run in full speed, disabling the scaling and provides
additional counter point to rule out clock management related issues.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822065419.24374-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: pxa: merge DAI call back functions into ops
Kuninori Morimoto [Tue, 22 Aug 2023 01:11:23 +0000 (01:11 +0000)]
ASoC: pxa: merge DAI call back functions into ops

ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308151142.hoM5o9LV-lkp@intel.com/
Fixes: 446b31e89493 ("ASoC: soc-dai.h: remove unused call back functions")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878ra3ubid.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: ipc4-topology: Fixes for pipelines with SRC
Mark Brown [Tue, 22 Aug 2023 11:48:16 +0000 (12:48 +0100)]
ASoC: SOF: ipc4-topology: Fixes for pipelines with SRC

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

The SRC component in a pipeline provides flexibility on the sampling
rate which was not handled previously.  This series will improve the
kernel side with the needed logic to be able to deal with the SRC type
of components in pipelines.

10 months agoAdd cs42l43 PC focused SoundWire CODEC
Mark Brown [Tue, 22 Aug 2023 11:48:04 +0000 (12:48 +0100)]
Add cs42l43 PC focused SoundWire CODEC

Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

This patch chain adds support for the Cirrus Logic cs42l43 PC focused
SoundWire CODEC. The chain is currently based of Lee's for-mfd-next
branch.

This series is mostly just a resend keeping pace with the kernel under
it, except for a minor fixup in the ASoC stuff.

Thanks,
Charles

Charles Keepax (4):
  dt-bindings: mfd: cirrus,cs42l43: Add initial DT binding
  mfd: cs42l43: Add support for cs42l43 core driver
  pinctrl: cs42l43: Add support for the cs42l43
  ASoC: cs42l43: Add support for the cs42l43

Lucas Tanure (2):
  soundwire: bus: Allow SoundWire peripherals to register IRQ handlers
  spi: cs42l43: Add SPI controller support

 .../bindings/sound/cirrus,cs42l43.yaml        |  313 +++
 MAINTAINERS                                   |    4 +
 drivers/mfd/Kconfig                           |   23 +
 drivers/mfd/Makefile                          |    3 +
 drivers/mfd/cs42l43-i2c.c                     |   98 +
 drivers/mfd/cs42l43-sdw.c                     |  239 ++
 drivers/mfd/cs42l43.c                         | 1188 +++++++++
 drivers/mfd/cs42l43.h                         |   28 +
 drivers/pinctrl/cirrus/Kconfig                |   11 +
 drivers/pinctrl/cirrus/Makefile               |    2 +
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c      |  609 +++++
 drivers/soundwire/bus.c                       |   32 +
 drivers/soundwire/bus_type.c                  |   12 +
 drivers/spi/Kconfig                           |    7 +
 drivers/spi/Makefile                          |    1 +
 drivers/spi/spi-cs42l43.c                     |  284 ++
 include/linux/mfd/cs42l43-regs.h              | 1184 +++++++++
 include/linux/mfd/cs42l43.h                   |  102 +
 include/linux/soundwire/sdw.h                 |    9 +
 include/sound/cs42l43.h                       |   17 +
 sound/soc/codecs/Kconfig                      |   16 +
 sound/soc/codecs/Makefile                     |    4 +
 sound/soc/codecs/cs42l43-jack.c               |  946 +++++++
 sound/soc/codecs/cs42l43-sdw.c                |   74 +
 sound/soc/codecs/cs42l43.c                    | 2278 +++++++++++++++++
 sound/soc/codecs/cs42l43.h                    |  131 +
 26 files changed, 7615 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs42l43.yaml
 create mode 100644 drivers/mfd/cs42l43-i2c.c
 create mode 100644 drivers/mfd/cs42l43-sdw.c
 create mode 100644 drivers/mfd/cs42l43.c
 create mode 100644 drivers/mfd/cs42l43.h
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs42l43.c
 create mode 100644 drivers/spi/spi-cs42l43.c
 create mode 100644 include/linux/mfd/cs42l43-regs.h
 create mode 100644 include/linux/mfd/cs42l43.h
 create mode 100644 include/sound/cs42l43.h
 create mode 100644 sound/soc/codecs/cs42l43-jack.c
 create mode 100644 sound/soc/codecs/cs42l43-sdw.c
 create mode 100644 sound/soc/codecs/cs42l43.c
 create mode 100644 sound/soc/codecs/cs42l43.h

--
2.30.2

10 months agoASoC: rt5640: fix typos
Senhong Liu [Sat, 19 Aug 2023 13:33:45 +0000 (06:33 -0700)]
ASoC: rt5640: fix typos

I noticed typos and i fixed them.

Signed-off-by: Senhong Liu <liusenhong2022@email.szu.edu.cn>
Link: https://lore.kernel.org/r/20230819133345.39961-1-liusenhong2022@email.szu.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: amd: Enable signed firmware image loading for Vangogh platform
Venkata Prasad Potturu [Wed, 9 Aug 2023 12:35:22 +0000 (18:05 +0530)]
ASoC: SOF: amd: Enable signed firmware image loading for Vangogh platform

Enable signed firmware loading for Vangogh platform using dmi quirks.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230809123534.287707-3-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: amd: Add support for signed fw image loading
Venkata Prasad Potturu [Wed, 9 Aug 2023 12:35:21 +0000 (18:05 +0530)]
ASoC: SOF: amd: Add support for signed fw image loading

Add support for signed firmware code bin and data bin
loading for amd platforms.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230809123534.287707-2-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: amd: Add sof support for vangogh platform
Venkata Prasad Potturu [Wed, 9 Aug 2023 12:35:20 +0000 (18:05 +0530)]
ASoC: SOF: amd: Add sof support for vangogh platform

Add pci driver and platform driver to enable SOF support
on ACP5x architecture based Vangogh platform.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230809123534.287707-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoALSA: hda/tas2781: Fix PM refcount unbalance at tas2781_hda_bind()
Takashi Iwai [Sun, 20 Aug 2023 17:26:35 +0000 (19:26 +0200)]
ALSA: hda/tas2781: Fix PM refcount unbalance at tas2781_hda_bind()

The error path of tas2781_hda_bind() needs to release PM refcount as
well.  Modify the code flow to handle properly.

Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Closes: https://lore.kernel.org/r/9f910785-e856-1539-e3e4-c9817af5fe67@linux.intel.com
Link: https://lore.kernel.org/r/20230820172635.22236-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: hda/tas2781: Fix acpi device refcount leak at tas2781_read_acpi()
Takashi Iwai [Sun, 20 Aug 2023 17:26:34 +0000 (19:26 +0200)]
ALSA: hda/tas2781: Fix acpi device refcount leak at tas2781_read_acpi()

The error path at tas2781_read_acpi() doesn't release the acpi_device
adev but releases another device physdev instead.  This results in a
refcount leak.  Fix it by replacing with the right object.

Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Closes: https://lore.kernel.org/r/9f910785-e856-1539-e3e4-c9817af5fe67@linux.intel.com
Link: https://lore.kernel.org/r/20230820172635.22236-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoALSA: usb-audio: Fix init call orders for UAC1
Takashi Iwai [Mon, 21 Aug 2023 11:18:57 +0000 (13:18 +0200)]
ALSA: usb-audio: Fix init call orders for UAC1

There have been reports of USB-audio driver spewing errors at the
probe time on a few devices like Jabra and Logitech.  The suggested
fix there couldn't be applied as is, unfortunately, because it'll
likely break other devices.

But, the patch suggested an interesting point: looking at the current
init code in stream.c, one may notice that it does initialize
differently from the device setup in endpoint.c.  Namely, for UAC1, we
should call snd_usb_init_pitch() and snd_usb_init_sample_rate() after
setting the interface, while the init sequence at parsing calls them
before setting the interface blindly.

This patch changes the init sequence at parsing for UAC1 (and other
devices that need a similar behavior) to be aligned with the rest of
the code, setting the interface at first.  And, this fixes the
long-standing problems on a few UAC1 devices like Jabra / Logitech,
as reported, too.

Reported-and-tested-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Closes: https://lore.kernel.org/r/202bbbc0f51522e8545783c4c5577d12a8e2d56d.camel@infinera.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230821111857.28926-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: SOF: ipc4-topology: Modify the reference output valid_bits for copier
Ranjani Sridharan [Mon, 21 Aug 2023 11:36:29 +0000 (14:36 +0300)]
ASoC: SOF: ipc4-topology: Modify the reference output valid_bits for copier

If the copier has only output valid_bits across all its output
formats, the reference for selecting the output format must be set that
instead of the valid_bits from the selected input format.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230821113629.5017-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: ipc4-topology: Fix pipeline params at the output of copier
Ranjani Sridharan [Mon, 21 Aug 2023 11:36:28 +0000 (14:36 +0300)]
ASoC: SOF: ipc4-topology: Fix pipeline params at the output of copier

When we walk the list of connected widgets from the source to the sink
to prepare all widgets, the pipeline_params must be modified to reflect
the output audio format at each widget. But, the copier only modifies
the sample format in the pipeline_params. So, fix it to also modify the
rate and channels.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230821113629.5017-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: ipc4-topology: Fix the output reference params for SRC
Ranjani Sridharan [Mon, 21 Aug 2023 11:36:27 +0000 (14:36 +0300)]
ASoC: SOF: ipc4-topology: Fix the output reference params for SRC

For playback, the SRC sink rate must be configured based on the requested
output format which is restricted to only handle DAI's that support a
single audio format for now. For capture, the SRC module should convert
the rate to match the rate requested by the PCM hw_params.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230821113629.5017-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: SOF: ipc4-topology: Modify pipeline params based on SRC output format
Ranjani Sridharan [Mon, 21 Aug 2023 11:36:26 +0000 (14:36 +0300)]
ASoC: SOF: ipc4-topology: Modify pipeline params based on SRC output format

Modify the pipeline_params based on the SRC output format and set the
sink_rate in the IPC data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230821113629.5017-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoALSA: hda/realtek: Fix spelling mistake "powe" -> "power"
Colin Ian King [Mon, 21 Aug 2023 08:00:03 +0000 (09:00 +0100)]
ALSA: hda/realtek: Fix spelling mistake "powe" -> "power"

There is a spelling mistake in a quirk entry. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Fixes: 3babae915f4c ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Link: https://lore.kernel.org/r/20230821080003.16678-1-colin.i.king@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: cs42l43: Add support for the cs42l43
Charles Keepax [Fri, 4 Aug 2023 10:46:02 +0000 (11:46 +0100)]
ASoC: cs42l43: Add support for the cs42l43

The CS42L43 is an audio CODEC with integrated MIPI SoundWire interface
(Version 1.2.1 compliant), I2C, SPI, and I2S/TDM interfaces designed
for portable applications. It provides a high dynamic range, stereo
DAC for headphone output, two integrated Class D amplifiers for
loudspeakers, and two ADCs for wired headset microphone input or
stereo line input. PDM inputs are provided for digital microphones.

The ASoC component provides the majority of the functionality of the
device, all the audio functions.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230804104602.395892-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: amd: yc: Add VivoBook Pro 15 to quirks list for acp6x
BrenoRCBrito [Fri, 18 Aug 2023 21:14:16 +0000 (18:14 -0300)]
ASoC: amd: yc: Add VivoBook Pro 15 to quirks list for acp6x

VivoBook Pro 15 Ryzen Edition uses Ryzen 6800H processor, and adding to
 quirks list for acp6x will enable internal mic.

Signed-off-by: BrenoRCBrito <brenorcbrito@gmail.com>
Link: https://lore.kernel.org/r/20230818211417.32167-1-brenorcbrito@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agomfd: Immutable branch between MFD, Pinctrl and soundwire due for the v6.6 merge window
Mark Brown [Fri, 18 Aug 2023 16:37:08 +0000 (17:37 +0100)]
mfd: Immutable branch between MFD, Pinctrl and soundwire due for the v6.6 merge window

Merge tag 'ib-mfd-pinctrl-soundwire-v6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into tmp

Immutable branch between MFD, Pinctrl and soundwire due for the v6.6 merge window

10 months agoALSA: asihpi: Remove unused declarations
Yue Haibing [Fri, 18 Aug 2023 12:48:52 +0000 (20:48 +0800)]
ALSA: asihpi: Remove unused declarations

These are not implemented, so can remove them.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20230818124852.51468-1-yuehaibing@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
10 months agoASoC: amd: acp: Add kcontrols and widgets per-codec in common code
Alper Nebi Yasak [Fri, 18 Aug 2023 08:03:14 +0000 (11:03 +0300)]
ASoC: amd: acp: Add kcontrols and widgets per-codec in common code

Commit 7ac3404c2e21 ("ASoC: amd: acp: Map missing jack kcontrols") adds
card kcontrols and DAPM widgets corresponding to jacks for Headphone and
Headset Mic. But these were already being added in acp-legacy-mach.c and
acp-sof-mach.c, so this causes a probe error:

  sof_mach rt5682s-hs-rt1019: control 2:0:0:Headphone Jack Switch:0 is already present
  sof_mach rt5682s-hs-rt1019: ASoC: Failed to add Headphone Jack Switch: -16
  sof_mach rt5682s-hs-rt1019: devm_snd_soc_register_card(sof-rt5682s-hs-rt1019) failed: -16
  sof_mach: probe of rt5682s-hs-rt1019 failed with error -16

Removing the new duplicates from the common code might be enough to fix
the issue. But some of the codecs use different kcontrols and widgets.
NAU8821 alone has an "Int Mic". MAX98360A has a single "Spk", while
RT1019 has "Left Spk" and "Right Spk" (and two codec instances with name
prefixes).

Since there are per-codec differences, add the kcontrols and widgets
in the common code as each dai-link is being initialized, instead of in
the two machine drivers' probe().

Also, MAX98388 has Left and Right instances, but uses a single "SPK"
widget. That seems weird, so normalize it to use two widgets (one per
each instance like RT1019) while we're adding controls.

Fixes: 7ac3404c2e21 ("ASoC: amd: acp: Map missing jack kcontrols")
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230818080314.32991-1-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoASoC: rt5645: improve the depop sequences of CBJ detection
Shuming Fan [Fri, 18 Aug 2023 02:37:32 +0000 (02:37 +0000)]
ASoC: rt5645: improve the depop sequences of CBJ detection

This patch will improve the depop function of CBJ detection before the headphone playback
when the system resumes.
We also want to complete the CBJ detection in the system-level resume function.
It could avoid triggering the detection at the playing state of headphones.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20230818023732.2153170-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
10 months agoALSA: pcm: Drop obsoleted PCM copy_user and copy_kernel ops
Takashi Iwai [Tue, 15 Aug 2023 19:01:36 +0000 (21:01 +0200)]
ALSA: pcm: Drop obsoleted PCM copy_user and copy_kernel ops

Finally all users have been converted to the new PCM copy ops, let's
drop the obsoleted copy_kernel and copy_user ops completely.

Link: https://lore.kernel.org/r/20230815190136.8987-26-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>