]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/log
mirror_ubuntu-jammy-kernel.git
3 years agoALSA: core: timer: clarify operator precedence
Pierre-Louis Bossart [Wed, 2 Sep 2020 21:21:20 +0000 (16:21 -0500)]
ALSA: core: timer: clarify operator precedence

fix cppcheck warning:

sound/core/timer.c:1286:9: style: Clarify calculation precedence for
'&' and '?'. [clarifyCalculation]
        ? "running" : "stopped");
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902212133.30964-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: core: timer: remove redundant assignment
Pierre-Louis Bossart [Wed, 2 Sep 2020 21:21:19 +0000 (16:21 -0500)]
ALSA: core: timer: remove redundant assignment

Cppcheck complains about a possible NULL pointer dereference but it
actually looks like the NULL assignment is not needed (same loop is
used in other parts of the file without it).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902212133.30964-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: core: pcm_memory: dereference pointer after NULL checks
Pierre-Louis Bossart [Wed, 2 Sep 2020 21:21:18 +0000 (16:21 -0500)]
ALSA: core: pcm_memory: dereference pointer after NULL checks

Fix cppcheck warnings:

sound/core/pcm_memory.c:380:26: warning: Either the condition
'!substream' is redundant or there is possible null pointer
dereference: substream. [nullPointerRedundantCheck]
 struct snd_card *card = substream->pcm->card;
                         ^
sound/core/pcm_memory.c:384:6: note: Assuming that condition
'!substream' is not redundant
 if (PCM_RUNTIME_CHECK(substream))
     ^
sound/core/pcm_memory.c:380:26: note: Null pointer dereference
 struct snd_card *card = substream->pcm->card;
                         ^
sound/core/pcm_memory.c:433:26: warning: Either the condition
'!substream' is redundant or there is possible null pointer
dereference: substream. [nullPointerRedundantCheck]
 struct snd_card *card = substream->pcm->card;
                         ^
sound/core/pcm_memory.c:436:6: note: Assuming that condition
'!substream' is not redundant
 if (PCM_RUNTIME_CHECK(substream))
     ^
sound/core/pcm_memory.c:433:26: note: Null pointer dereference
 struct snd_card *card = substream->pcm->card;
                         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902212133.30964-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: core: memalloc: fix fallthrough position
Pierre-Louis Bossart [Wed, 2 Sep 2020 21:21:17 +0000 (16:21 -0500)]
ALSA: core: memalloc: fix fallthrough position

Fix cppcheck, the fallthrough only makes sense within the conditional
block

sound/core/memalloc.c:161:3: style:inconclusive: Statements following
return, break, continue, goto or throw will never be
executed. [unreachableCode]
  fallthrough;
  ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902212133.30964-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: core: pcm: simplify locking for timers
Pierre-Louis Bossart [Wed, 2 Sep 2020 21:21:16 +0000 (16:21 -0500)]
ALSA: core: pcm: simplify locking for timers

Fix sparse warning:

sound/core/pcm.c:999:9: warning: context imbalance in
'snd_pcm_detach_substream' - different lock contexts for basic block

There's no real reason to test the same thing twice, and it's simpler
have linear sequences.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902212133.30964-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add AE-7 exit commands.
Connor McAdams [Tue, 25 Aug 2020 20:10:39 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add AE-7 exit commands.

Add exit commands for the AE-7.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-21-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add AE-7 custom controls.
Connor McAdams [Tue, 25 Aug 2020 20:10:38 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add AE-7 custom controls.

Add headphone gain and DAC filter controls, which use the same commands
as the AE-5. Also, change input source enumerated control item count to
exclude front microphone.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-20-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add AE-7 microphone selection commands.
Connor McAdams [Tue, 25 Aug 2020 20:10:37 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add AE-7 microphone selection commands.

Add AE-7 quirk data for setting of microphone. The AE-7 has no front
panel connector, so only rear-mic/line-in have new commands.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-19-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add output selection for SoundBlaster AE-7.
Connor McAdams [Tue, 25 Aug 2020 20:10:36 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add output selection for SoundBlaster AE-7.

Add output selection quirk table information for SoundBlaster AE-7, and
slightly modify the AE-5's ca0113 command table to accommodate the AE-7.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-18-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add DSP setup functions for AE-7.
Connor McAdams [Tue, 25 Aug 2020 20:10:35 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add DSP setup functions for AE-7.

Add DSP setup functions for the Sound Blaster AE-7 post DSP download.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-17-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add init data for SoundBlaster AE-7.
Connor McAdams [Tue, 25 Aug 2020 20:10:34 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add init data for SoundBlaster AE-7.

Add initialization data for the SoundBlaster AE-7 card.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-16-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add pre-init function for SoundBlaster AE-7.
Connor McAdams [Tue, 25 Aug 2020 20:10:33 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add pre-init function for SoundBlaster AE-7.

Add pre DSP initialization function for the AE-7.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-15-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add ca0132_mmio_init data for SoundBlaster AE-7.
Connor McAdams [Tue, 25 Aug 2020 20:10:32 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add ca0132_mmio_init data for SoundBlaster AE-7.

Modify the AE-5 ca0132_mmio_init function to add AE-7 specific writes.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-14-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Set AE-7 bools and select mixer.
Connor McAdams [Tue, 25 Aug 2020 20:10:31 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Set AE-7 bools and select mixer.

Set the boolean values used for desktop cards, and select the desktop
mixer.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-13-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add SoundBlaster AE-7 pincfg.
Connor McAdams [Tue, 25 Aug 2020 20:10:30 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add SoundBlaster AE-7 pincfg.

Add AE-7 pincfg, based on the values set within Windows.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-12-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add new quirk ID for SoundBlaster AE-7.
Connor McAdams [Tue, 25 Aug 2020 20:10:29 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add new quirk ID for SoundBlaster AE-7.

Add a new PCI subsystem ID for the SoundBlaster AE-7 card.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-11-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Fix Recon3D Center/LFE output.
Connor McAdams [Tue, 25 Aug 2020 20:10:28 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Fix Recon3D Center/LFE output.

Properly set the GPIO pin to un-mute the Center/LFE channel on the
Recon3D.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-10-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add quirk output selection structures.
Connor McAdams [Tue, 25 Aug 2020 20:10:27 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add quirk output selection structures.

Add structures containing the changes that need to happen on output
selection for each quirk. This should streamline the addition of new
quirks.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-9-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Clean up ca0132_alt_out_select.
Connor McAdams [Tue, 25 Aug 2020 20:10:26 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Clean up ca0132_alt_out_select.

Remove the output structures that were in use before and instead set the
DSP commands line by line. Now that the commands use is known, it makes
the functionality more clear this way.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-8-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Remove surround output selection.
Connor McAdams [Tue, 25 Aug 2020 20:10:25 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Remove surround output selection.

Remove the surround output selection and merge it with the speaker
output selection. Now that the extra commands that were being run on
surround output setting are known, there's no need to have it be
separate.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-7-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add bass redirection controls.
Connor McAdams [Tue, 25 Aug 2020 20:10:24 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add bass redirection controls.

Add bass redirection controls for surround outputs. This uses the DSP to
redirect audio below the bass redirection crossover frequency to the LFE
channel from the front/rear L/R speakers. This only goes into effect if
the speakers aren't set as full range, and only if the surround
configuration has an LFE channel.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-6-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add full-range speaker selection controls.
Connor McAdams [Tue, 25 Aug 2020 20:10:23 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add full-range speaker selection controls.

Add functions for setting full-range speakers and controls to
enable/disable the setting. Setting a speaker to full-range means that
the channels won't have their bass redirected to the LFE channel.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-5-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add surround channel config control.
Connor McAdams [Tue, 25 Aug 2020 20:10:22 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add surround channel config control.

Add a surround channel configuration enumeration control. Setting up
different channel configurations allows the DSP to upmix stereo audio
into multi-channel audio, and allows for redirection of bass to a
subwoofer.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-4-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add speaker tuning initialization commands.
Connor McAdams [Tue, 25 Aug 2020 20:10:21 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Add speaker tuning initialization commands.

Add speaker tuning initialization DSP commands, and also define
previously unknown DSP command values.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-3-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Cleanup ca0132_mmio_init function.
Connor McAdams [Tue, 25 Aug 2020 20:10:20 +0000 (16:10 -0400)]
ALSA: hda/ca0132 - Cleanup ca0132_mmio_init function.

Cleanup the ca0132_mmio_init function, separating into two separate
functions, one for Sound Blaster Z/ZxR/Recon3D, and another for the
AE-5.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Link: https://lore.kernel.org/r/20200825201040.30339-2-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: Correct wrongly matching entries with audio class
Takashi Iwai [Sun, 23 Aug 2020 11:32:51 +0000 (13:32 +0200)]
ALSA: usb-audio: Correct wrongly matching entries with audio class

The commit 51ab5d77dcb8 ("ALSA: usb-audio: Properly match with audio
interface class") converted the quirk entries that have both vid/pid
pair and bInterface fields to match with all those with a new macro
USB_AUDIO_CLASS().  However, it turned out that those are false
conversions; all those (but the unknown KeithMcMillen device) are
actually with vendor-specific interface class, hence the conversions
broke the matching.

This patch corrects those entries to the right one,
USB_DEVICE_VENDOR_SPEC() (and USB_DEVICE() for KeithMcMillen to be
sure), and drop the unused USB_AUDIO_CLASS macro again.

Fixes: 51ab5d77dcb8 ("ALSA: usb-audio: Properly match with audio interface class")
Reported-by: Alexander Tsoy <alexander@tsoy.me>
Link: https://lore.kernel.org/r/20200823113251.10175-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoMerge branch 'for-linus' into for-next
Takashi Iwai [Sun, 23 Aug 2020 11:19:20 +0000 (13:19 +0200)]
Merge branch 'for-linus' into for-next

Correct quirk table entries for Lenovo ThinkStation P620, too.
The name and profile strings are now set from a different table, hence
removed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: Disable autosuspend for Lenovo ThinkStation P620
Kai-Heng Feng [Sun, 23 Aug 2020 10:58:50 +0000 (18:58 +0800)]
ALSA: usb-audio: Disable autosuspend for Lenovo ThinkStation P620

If USB autosuspend is enabled, both front and rear panel can no longer
detect jack insertion.

Enable USB remote wakeup, i.e. needs_remote_wakeup = 1, doesn't help
either.

So disable USB autosuspend to prevent missing jack detection event.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200823105854.26950-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-digi00x: exclude Avid Adrenaline from detection
Takashi Sakamoto [Sun, 23 Aug 2020 07:55:45 +0000 (16:55 +0900)]
ALSA: firewire-digi00x: exclude Avid Adrenaline from detection

Avid Adrenaline is reported that ALSA firewire-digi00x driver is bound to.
However, as long as he investigated, the design of this model is hardly
similar to the one of Digi 00x family. It's better to exclude the model
from modalias of ALSA firewire-digi00x driver.

This commit changes device entries so that the model is excluded.

$ python3 crpp < ~/git/am-config-rom/misc/avid-adrenaline.img
               ROM header and bus information block
               -----------------------------------------------------------------
400  04203a9c  bus_info_length 4, crc_length 32, crc 15004
404  31333934  bus_name "1394"
408  e064a002  irmc 1, cmc 1, isc 1, bmc 0, cyc_clk_acc 100, max_rec 10 (2048)
40c  00a07e01  company_id 00a07e     |
410  00085257  device_id 0100085257  | EUI-64 00a07e0100085257

               root directory
               -----------------------------------------------------------------
414  0005d08c  directory_length 5, crc 53388
418  0300a07e  vendor
41c  8100000c  --> descriptor leaf at 44c
420  0c008380  node capabilities
424  8d000002  --> eui-64 leaf at 42c
428  d1000004  --> unit directory at 438

               eui-64 leaf at 42c
               -----------------------------------------------------------------
42c  0002410f  leaf_length 2, crc 16655
430  00a07e01  company_id 00a07e     |
434  00085257  device_id 0100085257  | EUI-64 00a07e0100085257

               unit directory at 438
               -----------------------------------------------------------------
438  0004d6c9  directory_length 4, crc 54985
43c  1200a02d  specifier id: 1394 TA
440  13014001  version: Vender Unique and AV/C
444  17000001  model
448  81000009  --> descriptor leaf at 46c

               descriptor leaf at 44c
               -----------------------------------------------------------------
44c  00077205  leaf_length 7, crc 29189
450  00000000  textual descriptor
454  00000000  minimal ASCII
458  41766964  "Avid"
45c  20546563  " Tec"
460  686e6f6c  "hnol"
464  6f677900  "ogy"
468  00000000

               descriptor leaf at 46c
               -----------------------------------------------------------------
46c  000599a5  leaf_length 5, crc 39333
470  00000000  textual descriptor
474  00000000  minimal ASCII
478  41647265  "Adre"
47c  6e616c69  "nali"
480  6e650000  "ne"

Reported-by: Simon Wood <simon@mungewell.org>
Fixes: 9edf723fd858 ("ALSA: firewire-digi00x: add skeleton for Digi 002/003 family")
Cc: <stable@vger.kernel.org> # 4.4+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20200823075545.56305-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA; firewire-tascam: exclude Tascam FE-8 from detection
Takashi Sakamoto [Sun, 23 Aug 2020 07:55:37 +0000 (16:55 +0900)]
ALSA; firewire-tascam: exclude Tascam FE-8 from detection

Tascam FE-8 is known to support communication by asynchronous transaction
only. The support can be implemented in userspace application and
snd-firewire-ctl-services project has the support. However, ALSA
firewire-tascam driver is bound to the model.

This commit changes device entries so that the model is excluded. In a
commit 53b3ffee7885 ("ALSA: firewire-tascam: change device probing
processing"), I addressed to the concern that version field in
configuration differs depending on installed firmware. However, as long
as I checked, the version number is fixed. It's safe to return version
number back to modalias.

Fixes: 53b3ffee7885 ("ALSA: firewire-tascam: change device probing processing")
Cc: <stable@vger.kernel.org> # 4.4+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20200823075537.56255-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: Properly match with audio interface class
Takashi Iwai [Mon, 17 Aug 2020 08:21:40 +0000 (10:21 +0200)]
ALSA: usb-audio: Properly match with audio interface class

There are a few entries in the quirk table that set the device ID with
USB_DEVICE() macro while having an extra bInterfaceClass field.  But
bInterfaceClass field is never checked unless the proper match_flags
is set, so those may match incorrectly with all interfaces.

Introduce another macro to match with the vid/pid pair and the audio
class interface, and apply it to such entries, so that they can match
properly.

Link: https://lore.kernel.org/r/20200817082140.20232-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: Simplify quirk entries with a macro
Takashi Iwai [Mon, 17 Aug 2020 08:21:39 +0000 (10:21 +0200)]
ALSA: usb-audio: Simplify quirk entries with a macro

Introduce a new macro USB_AUDIO_DEVICE() for the entries matching with
the pid/vid pair and the class/subclass, and remove the open-code.

Link: https://lore.kernel.org/r/20200817082140.20232-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: Move device rename and profile quirks to an internal table
Takashi Iwai [Mon, 17 Aug 2020 08:21:38 +0000 (10:21 +0200)]
ALSA: usb-audio: Move device rename and profile quirks to an internal table

So far we've added the devices that need vendor/product string renames
or the profile setup into the standard quirk table in quirks-table.h.
This table is imported into the primary USB audio device entry, hence
it's all exported for the probing so that udev and co can take a look
at it.  OTOH, for renaming or profile setup, we don't need to expose
those explicit entries because the probe itself follows the standard
way.  That said, we're exposing unnecessarily too many entries.

This patch moves such internal quirk entries into the own table, and
reduces the exported device table size.  Along with the moving items,
re-arrange the entries in the proper order.

Link: https://lore.kernel.org/r/20200817082140.20232-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda: avoid reset of sdo_limit
Sameer Pujar [Wed, 19 Aug 2020 15:32:10 +0000 (21:02 +0530)]
ALSA: hda: avoid reset of sdo_limit

By default 'sdo_limit' is initialized with a default value of '8'
as per spec. This is overridden in cases where a different value is
required. However this is getting reset when snd_hdac_bus_init_chip()
is called again, which happens during runtime PM cycle.

Avoid this reset by moving 'sdo_limit' setup to 'snd_hdac_bus_init()'
function which would be called only once.

Fixes: 67ae482a59e9 ("ALSA: hda: add member to store ratio for stripe control")
Cc: <stable@vger.kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1597851130-6765-1-git-send-email-spujar@nvidia.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/realtek: Add quirk for Samsung Galaxy Book Ion
Mike Pozulp [Tue, 18 Aug 2020 16:54:44 +0000 (09:54 -0700)]
ALSA: hda/realtek: Add quirk for Samsung Galaxy Book Ion

The Galaxy Book Ion uses the same ALC298 codec as other Samsung laptops
which have the no headphone sound bug, like my Samsung Notebook. The
Galaxy Book owner confirmed that this patch fixes the bug.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207423
Signed-off-by: Mike Pozulp <pozulp.kernel@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200818165446.499821-1-pozulp.kernel@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoMerge tag 'asoc-fix-v5.9-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Wed, 19 Aug 2020 06:03:04 +0000 (08:03 +0200)]
Merge tag 'asoc-fix-v5.9-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.9

A bunch of fixes that came in during the merge window, mostly for issues
that were uncovered by the changes to report errors on invalid register
access plus one important fix in that code itself.

3 years agoALSA: usb-audio: ignore broken processing/extension unit
Tom Yan [Mon, 17 Aug 2020 17:20:11 +0000 (01:20 +0800)]
ALSA: usb-audio: ignore broken processing/extension unit

Some devices have broken extension unit where getting current value
doesn't work. Attempt that once when creating mixer control for it. If
it fails, just ignore it, so that it won't cripple the device entirely
(and/or make the error floods).

Signed-off-by: Tom Yan <tom.ty89@gmail.com>
Link: https://lore.kernel.org/r/5f3abc52.1c69fb81.9cf2.fe91@mx.google.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoASoC: intel: Fix memleak in sst_media_open
Dinghao Liu [Thu, 13 Aug 2020 08:41:10 +0000 (16:41 +0800)]
ASoC: intel: Fix memleak in sst_media_open

When power_up_sst() fails, stream needs to be freed
just like when try_module_get() fails. However, current
code is returning directly and ends up leaking memory.

Fixes: 0121327c1a68b ("ASoC: Intel: mfld-pcm: add control for powering up/down dsp")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200813084112.26205-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm8994: Avoid attempts to read unreadable registers
Sylwester Nawrocki [Fri, 31 Jul 2020 17:38:34 +0000 (19:38 +0200)]
ASoC: wm8994: Avoid attempts to read unreadable registers

The driver supports WM1811, WM8994, WM8958 devices but according to
documentation and the regmap definitions the WM8958_DSP2_* registers
are only available on WM8958. In current code these registers are
being accessed as if they were available on all the three chips.

When starting playback on WM1811 CODEC multiple errors like:
"wm8994-codec wm8994-codec: ASoC: error at soc_component_read_no_lock on wm8994-codec: -5"
can be seen, which is caused by attempts to read an unavailable
WM8958_DSP2_PROGRAM register. The issue has been uncovered by recent
commit "e2329ee ASoC: soc-component: add soc_component_err()".

This patch adds a check in wm8958_aif_ev() callback so the DSP2 handling
is only done for WM8958.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200731173834.23832-1-s.nawrocki@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: msm8916-wcd-analog: fix register Interrupt offset
Srinivas Kandagatla [Tue, 11 Aug 2020 10:34:52 +0000 (11:34 +0100)]
ASoC: msm8916-wcd-analog: fix register Interrupt offset

For some reason interrupt set and clear register offsets are
not set correctly.
This patch corrects them!

Fixes: 585e881e5b9e ("ASoC: codecs: Add msm8916-wcd analog codec")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20200811103452.20448-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm8994: Prevent access to invalid VU register bits on WM1811
Sylwester Nawrocki [Tue, 4 Aug 2020 14:10:43 +0000 (16:10 +0200)]
ASoC: wm8994: Prevent access to invalid VU register bits on WM1811

The ADC2 and DAC2 are not available on WM1811 device. This patch moves
the ADC2, DAC2 VU bitfields to a separate array so we can skip accessing
them and avoid unreadable register access on WM1811.

This allows to get rid of warnings during boot like:
wm8994-codec: ASoC: error at soc_component_read_no_lock on wm8994-codec: -5

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20200804141043.11425-1-s.nawrocki@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoALSA: hda/realtek: Add model alc298-samsung-headphone
Mike Pozulp [Mon, 17 Aug 2020 04:32:17 +0000 (21:32 -0700)]
ALSA: hda/realtek: Add model alc298-samsung-headphone

The very quiet and distorted headphone output bug that afflicted my
Samsung Notebook 9 is appearing in many other Samsung laptops. Expose
the quirk which fixed my laptop as a model so other users can try it.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207423
Signed-off-by: Mike Pozulp <pozulp.kernel@gmail.com>
Link: https://lore.kernel.org/r/20200817043219.458889-1-pozulp.kernel@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: Update documentation comment for MS2109 quirk
Hector Martin [Sun, 16 Aug 2020 08:44:31 +0000 (17:44 +0900)]
ALSA: usb-audio: Update documentation comment for MS2109 quirk

As the recent fix addressed the channel swap problem more properly,
update the comment as well.

Fixes: 1b7ecc241a67 ("ALSA: usb-audio: work around streaming quirk for MacroSilicon MS2109")
Signed-off-by: Hector Martin <marcan@marcan.st>
Link: https://lore.kernel.org/r/20200816084431.102151-1-marcan@marcan.st
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: isa: fix spelling mistakes in the comments
Liang Wang [Sun, 16 Aug 2020 07:13:09 +0000 (15:13 +0800)]
ALSA: isa: fix spelling mistakes in the comments

Fix spelling mistakes in the comments:
initailise ==> initialise
tranfer ==> transfer
Initialse ==> Initialise

Signed-off-by: Liang Wang <wangliang101@huawei.com>
Link: https://lore.kernel.org/r/20200816071309.121461-1-wangliang101@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: Add capture support for Saffire 6 (USB 1.1)
Alexander Tsoy [Sat, 15 Aug 2020 00:21:03 +0000 (03:21 +0300)]
ALSA: usb-audio: Add capture support for Saffire 6 (USB 1.1)

Capture and playback endpoints on Saffire 6 (USB 1.1) resides on the same
interface. This was not supported by the composite quirk back in the day
when initial support for this device was added, thus only playback was
enabled until now.

Fixes: 11e424e88bd4 ("ALSA: usb-audio: Add support for Focusrite Saffire 6 USB")
Signed-off-by: Alexander Tsoy <alexander@tsoy.me>
Cc: <stable.vger.kernel.org>
Link: https://lore.kernel.org/r/20200815002103.29247-1-alexander@tsoy.me
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/realtek: Add quirk for Samsung Galaxy Flex Book
Mike Pozulp [Fri, 14 Aug 2020 04:53:44 +0000 (21:53 -0700)]
ALSA: hda/realtek: Add quirk for Samsung Galaxy Flex Book

The Flex Book uses the same ALC298 codec as other Samsung laptops which
have the no headphone sound bug, like my Samsung Notebook. The Flex Book
owner used Early Patching to confirm that this quirk fixes the bug.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207423
Signed-off-by: Mike Pozulp <pozulp.kernel@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200814045346.645367-1-pozulp.kernel@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: echoaudio: Fix potential Oops in snd_echo_resume()
Dinghao Liu [Thu, 13 Aug 2020 07:46:30 +0000 (15:46 +0800)]
ALSA: echoaudio: Fix potential Oops in snd_echo_resume()

Freeing chip on error may lead to an Oops at the next time
the system goes to resume. Fix this by removing all
snd_echo_free() calls on error.

Fixes: 47b5d028fdce8 ("ALSA: Echoaudio - Add suspend support #2")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20200813074632.17022-1-dinghao.liu@zju.edu.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/hdmi: Use force connectivity quirk on another HP desktop
Kai-Heng Feng [Tue, 11 Aug 2020 09:53:34 +0000 (17:53 +0800)]
ALSA: hda/hdmi: Use force connectivity quirk on another HP desktop

There's another HP desktop has buggy BIOS which flags the Port
Connectivity bit as no connection.

Apply force connectivity quirk to enable DP/HDMI audio.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200811095336.32396-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/realtek - Fix unused variable warning
Takashi Iwai [Wed, 12 Aug 2020 07:02:56 +0000 (09:02 +0200)]
ALSA: hda/realtek - Fix unused variable warning

The previous fix forgot to remove the unused variable that triggers a
compile warning now:
  sound/pci/hda/patch_realtek.c: In function 'alc285_fixup_hp_gpio_led':
  sound/pci/hda/patch_realtek.c:4163:19: warning: unused variable 'spec' [-Wunused-variable]

Fix it.

Fixes: 404690649e6a ("ALSA: hda - reverse the setting value in the micmute_led_set")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/r/20200812070256.32145-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoASoC: q6routing: add dummy register read/write function
Srinivas Kandagatla [Tue, 11 Aug 2020 12:02:05 +0000 (13:02 +0100)]
ASoC: q6routing: add dummy register read/write function

Most of the DAPM widgets for DSP ASoC components reuse reg field
of the widgets for its internal calculations, however these are not
real registers. So read/writes to these numbers are not really
valid. However ASoC core will read these registers to get default
state during startup.

With recent changes to ASoC core, every register read/write
failures are reported very verbosely. Prior to this fails to reads
are totally ignored, so we never saw any error messages.

To fix this add dummy read/write function to return default value.

Fixes: e3a33673e845 ("ASoC: qdsp6: q6routing: Add q6routing driver")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200811120205.21805-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: q6afe-dai: mark all widgets registers as SND_SOC_NOPM
Srinivas Kandagatla [Tue, 11 Aug 2020 12:02:04 +0000 (13:02 +0100)]
ASoC: q6afe-dai: mark all widgets registers as SND_SOC_NOPM

Looks like the q6afe-dai dapm widget registers are set as "0",
which is a not correct.

As this registers will be read by ASoC core during startup
which will throw up errors, Fix this by making the registers
as SND_SOC_NOPM as these should be never used.

With recent changes to ASoC core, every register read/write
failures are reported very verbosely. Prior to this fails to reads
are totally ignored, so we never saw any error messages.

Fixes: 24c4cbcfac09 ("ASoC: qdsp6: q6afe: Add q6afe dai driver")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200811120205.21805-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Make soc_component_read() returning an error code again
Takashi Iwai [Mon, 10 Aug 2020 13:46:31 +0000 (15:46 +0200)]
ASoC: Make soc_component_read() returning an error code again

Along with the recent unification of snd_soc_component_read*()
functions, the behavior of snd_soc_component_read() was changed
slightly; namely it returns the register read value directly, and even
if an error happens, it returns zero (but it prints an error
message).  That said, the caller side can't know whether it's an error
or not any longer.

Ideally this shouldn't matter much, but in practice this seems causing
a regression, as John reported.  And, grepping the tree revealed that
there are still plenty of callers that do check the error code, so
we'll need to deal with them in anyway.

As a quick band-aid over the regression, this patch changes the return
value of snd_soc_component_read() again to the negative error code.
It can't work, obviously, for 32bit register values, but it should be
enough for the known regressions, so far.

Fixes: cf6e26c71bfd ("ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32()")
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200810134631.19742-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoALSA: hda - reverse the setting value in the micmute_led_set
Hui Wang [Tue, 11 Aug 2020 12:24:30 +0000 (20:24 +0800)]
ALSA: hda - reverse the setting value in the micmute_led_set

Before the micmute_led_set() is introduced, the function of
alc_gpio_micmute_update() will set the gpio value with the
!micmute_led.led_value, and the machines have the correct micmute led
status. After the micmute_led_set() is introduced, it sets the gpio
value with !!micmute_led.led_value, so the led status is not correct
anymore, we need to set micmute_led_polarity = 1 to workaround it.

Now we fix the micmute_led_set() and remove micmute_led_polarity = 1.

Fixes: 87dc36482cab ("ALSA: hda/realtek - Add LED class support for micmute LED")
Reported-and-suggested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20200811122430.6546-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: echoaduio: Drop superfluous volatile modifier
Takashi Iwai [Mon, 3 Aug 2020 14:39:58 +0000 (16:39 +0200)]
ALSA: echoaduio: Drop superfluous volatile modifier

The dsp_registers field of struct echoaduio has the volatile modifier,
but it's basically superfluous; the field is accessed only for the
base pointer of readl() and writel(), hence marking with __iomem alone
should suffice.  OTOH, having the volatile prefix causes a compile
warning like:
  sound/pci/echoaudio/echoaudio.c:1878:14: warning: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]

So it's better to drop this superfluous modifier.

Link: https://lore.kernel.org/r/20200803143958.24324-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoASoC: amd: Replacing component->name with codec_dai->name.
Ravulapati Vishnu vardhan rao [Fri, 7 Aug 2020 16:10:17 +0000 (21:40 +0530)]
ASoC: amd: Replacing component->name with codec_dai->name.

Replacing string compare with "codec_dai->name" instead of comparing with
"codec_dai->component->name" in hw_params because,
Here the component name for codec RT1015 is "i2c-10EC5682:00"
and will never be "rt1015-aif1" as it is codec-dai->name.
So, strcmp() always compares and fails to set the
sysclk,pll,bratio for expected codec-dai="rt1015-aif1".

Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com>
Link: https://lore.kernel.org/r/20200807161046.17932-1-Vishnuvardhanrao.Ravulapati@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoALSA: usb-audio: Disable Lenovo P620 Rear line-in volume control
Kai-Heng Feng [Mon, 10 Aug 2020 13:31:06 +0000 (21:31 +0800)]
ALSA: usb-audio: Disable Lenovo P620 Rear line-in volume control

The USB device (0x17aa:0x1046) that support Lenovo P620 rear panel
line-in claim to support volume control, but it doens't seem to have an
AMP, so when line-in volume lowers below 80, nothing gets recorded
anymore.

Disable the volume control to workaround the issue.

Fixes: f8c11eb7da4a ("ALSA: usb-audio: Add support for Lenovo ThinkStation P620")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200810133108.31580-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: add quirk for Pioneer DDJ-RB
Hector Martin [Mon, 10 Aug 2020 08:25:02 +0000 (17:25 +0900)]
ALSA: usb-audio: add quirk for Pioneer DDJ-RB

This is just another Pioneer device with fixed endpoints. Input is dummy
but used as feedback (it always returns silence).

Cc: stable@vger.kernel.org
Signed-off-by: Hector Martin <marcan@marcan.st>
Link: https://lore.kernel.org/r/20200810082502.225979-1-marcan@marcan.st
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: work around streaming quirk for MacroSilicon MS2109
Hector Martin [Mon, 10 Aug 2020 08:24:00 +0000 (17:24 +0900)]
ALSA: usb-audio: work around streaming quirk for MacroSilicon MS2109

Further investigation of the L-R swap problem on the MS2109 reveals that
the problem isn't that the channels are swapped, but rather that they
are swapped and also out of phase by one sample. In other words, the
issue is actually that the very first frame that comes from the hardware
is a half-frame containing only the right channel, and after that
everything becomes offset.

So introduce a new quirk field to drop the very first 2 bytes that come
in after the format is configured and a capture stream starts. This puts
the channels in phase and in the correct order.

Cc: stable@vger.kernel.org
Signed-off-by: Hector Martin <marcan@marcan.st>
Link: https://lore.kernel.org/r/20200810082400.225858-1-marcan@marcan.st
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda - fix the micmute led status for Lenovo ThinkCentre AIO
Hui Wang [Mon, 10 Aug 2020 02:16:59 +0000 (10:16 +0800)]
ALSA: hda - fix the micmute led status for Lenovo ThinkCentre AIO

After installing the Ubuntu Linux, the micmute led status is not
correct. Users expect that the led is on if the capture is disabled,
but with the current kernel, the led is off with the capture disabled.

We tried the old linux kernel like linux-4.15, there is no this issue.
It looks like we introduced this issue when switching to the led_cdev.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20200810021659.7429-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: fix overeager device match for MacroSilicon MS2109
Hector Martin [Mon, 10 Aug 2020 04:53:19 +0000 (13:53 +0900)]
ALSA: usb-audio: fix overeager device match for MacroSilicon MS2109

Matching by device matches all interfaces, which breaks the video/HID
portions of the device depending on module load order.

Fixes: e337bf19f6af ("ALSA: usb-audio: add quirk for MacroSilicon MS2109")
Cc: stable@vger.kernel.org
Signed-off-by: Hector Martin <marcan@marcan.st>
Link: https://lore.kernel.org/r/20200810045319.128745-1-marcan@marcan.st
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/realtek: Fix pin default on Intel NUC 8 Rugged
Kai-Heng Feng [Fri, 7 Aug 2020 08:05:12 +0000 (16:05 +0800)]
ALSA: hda/realtek: Fix pin default on Intel NUC 8 Rugged

The jack on Intel NUC 8 Rugged rear panel doesn't work.

The spec [1] states that the jack supports both headphone and
microphone, so override a Pin Complex which has both Amp-In and Amp-Out
to make the jack work.

Node 0x1b fits the requirement, and user confirmed the jack now works
with new pin config.

[1] https://www.intel.com/content/dam/support/us/en/documents/mini-pcs/NUC8CCH_TechProdSpec.pdf
BugLink: https://bugs.launchpad.net/bugs/1875199
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200807080514.15293-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: Creative USB X-Fi Pro SB1095 volume knob support
Mirko Dietrich [Thu, 6 Aug 2020 12:48:50 +0000 (14:48 +0200)]
ALSA: usb-audio: Creative USB X-Fi Pro SB1095 volume knob support

Adds an entry for Creative USB X-Fi to the rc_config array in
mixer_quirks.c to allow use of volume knob on the device.
Adds support for newer X-Fi Pro card, known as "Model No. SB1095"
with USB ID "041e:3263"

Signed-off-by: Mirko Dietrich <buzz@l4m1.de>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200806124850.20334-1-buzz@l4m1.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: fix spelling mistake "buss" -> "bus"
Colin Ian King [Thu, 6 Aug 2020 10:51:34 +0000 (11:51 +0100)]
ALSA: usb-audio: fix spelling mistake "buss" -> "bus"

There is a spelling mistake in a usb_audio_dbg debug message. Also
replace "param" with "parameter".  Fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200806105134.46447-1-colin.king@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: pci: delete repeated words in comments
Randy Dunlap [Thu, 6 Aug 2020 02:19:26 +0000 (19:19 -0700)]
ALSA: pci: delete repeated words in comments

Drop duplicated words in sound/pci/.
{and, the, at}

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20200806021926.32418-1-rdunlap@infradead.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: isa: delete repeated words in comments
Randy Dunlap [Thu, 6 Aug 2020 02:19:16 +0000 (19:19 -0700)]
ALSA: isa: delete repeated words in comments

Drop duplicated words in sound/isa/.
{be, bit}

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20200806021916.32369-1-rdunlap@infradead.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/tegra: Add 100us dma stop delay
Mohan Kumar [Wed, 5 Aug 2020 09:52:21 +0000 (15:22 +0530)]
ALSA: hda/tegra: Add 100us dma stop delay

Tegra HDA has audio data buffer for upto tens of frames, this buffer
can help to avoid underflow. HW will keep issuing new data fetch
request when buffers are not full and current BDL is not done. When SW
disable DMA RUN bit for a stream, HW can't cancel the already issued data
fetch request and hence it can't stop DMA. HW has to wait for all issued
data fetch request get data returned before it stops DMA.

This HW behavior is not in sync with HDA spec which says DMA RUN bit
should be cleared within 1 audio frame. For Tegra, DMA RUN bit was
active for more than one audio frame, due to this the timeout in
snd_hdac_stream_sync function is not helping. When Stream reset set
and clear happens during DMA RUN bit active state it results in Memory
Decode error.

Unfortunately, there is no way to detect when these data accesses have
completed, but testing has shown that a 100us delay between Stream reset
set and clear operation for Tegra avoids the memory decode error.
Therefore, adding a 100us dma stop delay.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Link: https://lore.kernel.org/r/20200805095221.5476-4-mkumard@nvidia.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda: Add dma stop delay variable
Mohan Kumar [Wed, 5 Aug 2020 09:52:20 +0000 (15:22 +0530)]
ALSA: hda: Add dma stop delay variable

A variable dma_stop_delay is added as a new member in hdac_bus
structure to avoid memory decode error incase DMA RUN bit is not
disabled in the given timeout from snd_hdac_stream_sync function and
followed by stream reset which results in memory decode error between
reset set and clear operation.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Link: https://lore.kernel.org/r/20200805095221.5476-3-mkumard@nvidia.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoASoC: hda/tegra: Set buffer alignment to 128 bytes
Mohan Kumar [Wed, 5 Aug 2020 09:52:19 +0000 (15:22 +0530)]
ASoC: hda/tegra: Set buffer alignment to 128 bytes

Set chip->align_buffer_size to 1 for Tegra platforms to make the buffer
alignment to be multiple of 128 bytes. This fix is applied as gstreamer
alsasink gets stuck with the default buffer-time and latency-time
parameters with 4 byte buffer alignment.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
Link: https://lore.kernel.org/r/20200805095221.5476-2-mkumard@nvidia.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: seq: oss: Serialize ioctls
Takashi Iwai [Tue, 4 Aug 2020 18:58:15 +0000 (20:58 +0200)]
ALSA: seq: oss: Serialize ioctls

Some ioctls via OSS sequencer API may race and lead to UAF when the
port create and delete are performed concurrently, as spotted by a
couple of syzkaller cases.  This patch is an attempt to address it by
serializing the ioctls with the existing register_mutex.

Basically OSS sequencer API is an obsoleted interface and was designed
without much consideration of the concurrency.  There are very few
applications with it, and the concurrent performance isn't asked,
hence this "big hammer" approach should be good enough.

Reported-by: syzbot+1a54a94bd32716796edd@syzkaller.appspotmail.com
Reported-by: syzbot+9d2abfef257f3e2d4713@syzkaller.appspotmail.com
Suggested-by: Hillf Danton <hdanton@sina.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200804185815.2453-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/hdmi: Add quirk to force connectivity
Kai-Heng Feng [Tue, 4 Aug 2020 15:58:34 +0000 (23:58 +0800)]
ALSA: hda/hdmi: Add quirk to force connectivity

HDMI on some platforms doesn't enable audio support because its Port
Connectivity [31:30] is set to AC_JACK_PORT_NONE:
Node 0x05 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Pincap 0x0b000094: OUT Detect HBR HDMI DP
  Pin Default 0x58560010: [N/A] Digital Out at Int HDMI
    Conn = Digital, Color = Unknown
    DefAssociation = 0x1, Sequence = 0x0
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=00, enabled=0
  Power states:  D0 D3 EPSS
  Power: setting=D0, actual=D0
  Devices: 0
  Connection: 3
     0x02 0x03* 0x04

For now, use a quirk to force connectivity based on SSID. If there are
more platforms affected by the same issue, we can eye for a more generic
solution.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200804155836.16252-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: add startech usb audio dock name
Curtis Malainey [Tue, 4 Aug 2020 01:06:16 +0000 (18:06 -0700)]
ALSA: usb-audio: add startech usb audio dock name

The dock sold from startech (PID: ICUSBAUDIO7D) has no friendly name
and shows up currently as "USB Sound Device" in ALSA.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Link: https://lore.kernel.org/r/20200804010616.3399256-1-cujomalainey@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoMerge series "ASoC: tegra: Fix compile warning with CONFIG_PM=n" from Takashi Iwai...
Mark Brown [Mon, 3 Aug 2020 15:25:49 +0000 (16:25 +0100)]
Merge series "ASoC: tegra: Fix compile warning with CONFIG_PM=n" from Takashi Iwai <tiwai@suse.de>:

Hi,

this is a trivial patch set to add the missing __maybe_unused for
covering the compile warnings with CONFIG_PM=n.

Takashi

===

Takashi Iwai (5):
  ASoC: tegra: tegra186_dspk: Fix compile warning with CONFIG_PM=n
  ASoC: tegra: tegra210_admaif: Fix compile warning with CONFIG_PM=n
  ASoC: tegra: tegra210_ahub: Fix compile warning with CONFIG_PM=n
  ASoC: tegra: tegra210_dmic: Fix compile warning with CONFIG_PM=n
  ASoC: tegra: tegra210_i2s: Fix compile warning with CONFIG_PM=n

 sound/soc/tegra/tegra186_dspk.c   | 4 ++--
 sound/soc/tegra/tegra210_admaif.c | 4 ++--
 sound/soc/tegra/tegra210_ahub.c   | 4 ++--
 sound/soc/tegra/tegra210_dmic.c   | 4 ++--
 sound/soc/tegra/tegra210_i2s.c    | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

--
2.16.4

3 years agoASoC: fsl: Fix unused variable warning
Takashi Iwai [Mon, 3 Aug 2020 14:46:30 +0000 (16:46 +0200)]
ASoC: fsl: Fix unused variable warning

The variable rtd was left unused in psc_dma_free(), even unnoticed
during conversion to a new style:
  sound/soc/fsl/mpc5200_dma.c:342:30: warning: unused variable 'rtd' [-Wunused-variable]

Drop the superfluous one.

Fixes: 6d1048bc1152 ("ASoC: fsl: mpc5200_dma: remove snd_pcm_ops")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803144630.9615-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra: tegra210_i2s: Fix compile warning with CONFIG_PM=n
Takashi Iwai [Mon, 3 Aug 2020 14:18:50 +0000 (16:18 +0200)]
ASoC: tegra: tegra210_i2s: Fix compile warning with CONFIG_PM=n

Fix trivial compile warnings wrt unused functions by adding
__maybe_unused prefix:
  sound/soc/tegra/tegra210_i2s.c:167:12: warning: 'tegra210_i2s_runtime_suspend' defined but not used [-Wunused-function]
  sound/soc/tegra/tegra210_i2s.c:179:12: warning: 'tegra210_i2s_runtime_resume' defined but not used [-Wunused-function]

Fixes: c0bfa98349d1 ("ASoC: tegra: Add Tegra210 based I2S driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803141850.23713-6-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra: tegra210_dmic: Fix compile warning with CONFIG_PM=n
Takashi Iwai [Mon, 3 Aug 2020 14:18:49 +0000 (16:18 +0200)]
ASoC: tegra: tegra210_dmic: Fix compile warning with CONFIG_PM=n

Fix trivial compile warnings wrt unused functions by adding
__maybe_unused prefix:
  sound/soc/tegra/tegra210_dmic.c:43:12: warning: 'tegra210_dmic_runtime_suspend' defined but not used [-Wunused-function]
  sound/soc/tegra/tegra210_dmic.c:55:12: warning: 'tegra210_dmic_runtime_resume' defined but not used [-Wunused-function]

Fixes: 8c8ff982e9e2 ("ASoC: tegra: Add Tegra210 based DMIC driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803141850.23713-5-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra: tegra210_ahub: Fix compile warning with CONFIG_PM=n
Takashi Iwai [Mon, 3 Aug 2020 14:18:48 +0000 (16:18 +0200)]
ASoC: tegra: tegra210_ahub: Fix compile warning with CONFIG_PM=n

Fix trivial compile warnings wrt unused functions by adding
__maybe_unused prefix:
  sound/soc/tegra/tegra210_ahub.c:567:12: warning: 'tegra_ahub_runtime_suspend' defined but not used [-Wunused-function]
  sound/soc/tegra/tegra210_ahub.c:579:12: warning: 'tegra_ahub_runtime_resume' defined but not used [-Wunused-function]

Fixes: 16e1bcc2caf4 ("ASoC: tegra: Add Tegra210 based AHUB driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803141850.23713-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra: tegra210_admaif: Fix compile warning with CONFIG_PM=n
Takashi Iwai [Mon, 3 Aug 2020 14:18:47 +0000 (16:18 +0200)]
ASoC: tegra: tegra210_admaif: Fix compile warning with CONFIG_PM=n

Fix trivial compile warnings wrt unused functions by adding
__maybe_unused prefix:
  sound/soc/tegra/tegra210_admaif.c:232:12: warning: 'tegra_admaif_runtime_resume' defined but not used [-Wunused-function]
  sound/soc/tegra/tegra210_ahub.c:567:12: warning: 'tegra_ahub_runtime_suspend' defined but not used [-Wunused-function]

Fixes: f74028e159bb ("ASoC: tegra: Add Tegra210 based ADMAIF driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803141850.23713-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra: tegra186_dspk: Fix compile warning with CONFIG_PM=n
Takashi Iwai [Mon, 3 Aug 2020 14:18:46 +0000 (16:18 +0200)]
ASoC: tegra: tegra186_dspk: Fix compile warning with CONFIG_PM=n

Fix trivial compile warnings wrt unused functions by adding
__maybe_unused prefix:
  sound/soc/tegra/tegra186_dspk.c:74:12: warning: 'tegra186_dspk_runtime_suspend' defined but not used [-Wunused-function]
  sound/soc/tegra/tegra186_dspk.c:86:12: warning: 'tegra186_dspk_runtime_resume' defined but not used [-Wunused-function]

Fixes: 327ef6470266 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803141850.23713-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoALSA: usb-audio: Add support for Lenovo ThinkStation P620
Kai-Heng Feng [Mon, 3 Aug 2020 14:26:08 +0000 (22:26 +0800)]
ALSA: usb-audio: Add support for Lenovo ThinkStation P620

Lenovo ThinkStation P620 is like other TRX40 boards, is equipped with
two USB audio cards.

USB device (17aa:104d) provides functionality for Internal Speaker and
Front Headset. It's UAC v2, so it supports insertion control (jack
detection). However, when trying to get the connector status of the
speaker, an error occurs:
[    5.787405] usb 3-1: cannot get connectors status: req = 0x81, wValue = 0x200, wIndex = 0x1000, type = 0

Since the insertion control works perfectly for the headset, the error
for speaker is probably casued by connecting internally. So let's relax
the error for a bit if it's a speaker, and always reports it's connected.

USB device (17aa:1046) is for rear Line-in, Line-out and Microphone.
The insertion control works for all three jacks. However, there's an
Function Unit that doesn't work:
[    5.905415] usb 3-6: cannot get ctl value: req = 0x83, wValue = 0xc00, wIndex = 0x1300, type = 4
[    5.905418] usb 3-6: 19:0: cannot get min/max values for control 12 (id 19)

So turn off the FU to avoid the error.

Also, add specific card name for both devices, so userspace can easily
indentify both cards.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200803142612.17156-1-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoASoC: amd: renoir: restore two more registers during resume
Hui Wang [Thu, 30 Jul 2020 12:31:38 +0000 (20:31 +0800)]
ASoC: amd: renoir: restore two more registers during resume

Recently we found an issue about the suspend and resume. If dmic is
recording the sound, and we run suspend and resume, after the resume,
the dmic can't work well anymore. we need to close the app and reopen
the app, then the dmic could record the sound again.

For example, we run "arecord -D hw:CARD=acp,DEV=0 -f S32_LE -c 2
-r 48000 test.wav", then suspend and resume, after the system resume
back, we speak to the dmic. then stop the arecord, use aplay to play
the test.wav, we could hear the sound recorded after resume is weird,
it is not what we speak to the dmic.

I found two registers are set in the dai_hw_params(), if the two
registers are set during the resume, this issue could be fixed.
Move the code of the dai_hw_params() into the pdm_dai_trigger(), then
these two registers will be set during resume since pdm_dai_trigger()
will be called during resume. And delete the empty function
dai_hw_params().

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200730123138.5659-1-hui.wang@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm8962: Do not remove ADDITIONAL_CONTROL_4 from readable register list
Fabio Estevam [Mon, 3 Aug 2020 11:52:33 +0000 (08:52 -0300)]
ASoC: wm8962: Do not remove ADDITIONAL_CONTROL_4 from readable register list

Removing ADDITIONAL_CONTROL_4 from the list of readable registers cause
audio distortion.

This change was sent as a comment below the --- line when submitting
commit 658bb297e393 ("ASoC: wm8962: Do not access WM8962_GPIO_BASE"), so
it was not supposed to get merged.

Keep WM8962_ADDITIONAL_CONTROL_4 inside wm8962_readable_register() to
fix the regression.

Fixes: 658bb297e393 ("ASoC: wm8962: Do not access WM8962_GPIO_BASE")
Reported-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20200803115233.19034-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl-asoc-card: Remove fsl_asoc_card_set_bias_level function
Shengjiu Wang [Mon, 3 Aug 2020 02:13:31 +0000 (10:13 +0800)]
ASoC: fsl-asoc-card: Remove fsl_asoc_card_set_bias_level function

With this case:
aplay -Dhw:x 16khz.wav 24khz.wav
There is sound distortion for 24khz.wav. The reason is that setting
PLL of WM8962 with set_bias_level function, the bias level is not
changed when 24khz.wav is played, then the PLL won't be reset, the
clock is not correct, so distortion happens.

The resolution of this issue is to remove fsl_asoc_card_set_bias_level.
Move PLL configuration to hw_params and hw_free.

After removing fsl_asoc_card_set_bias_level, also test WM8960 case,
it can work.

Fixes: 708b4351f08c ("ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1596420811-16690-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge tag 'asoc-v5.9' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Mon, 3 Aug 2020 12:41:43 +0000 (14:41 +0200)]
Merge tag 'asoc-v5.9' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v5.9

The biggest changes here one again come from Mormioto-san who has
continued his dilligent work cleaning up long standing issues in the
APIs, it's particularly nice to see the transition from digital_mute()
to mute_stream() finally completed. There's also been a lot of work on
the x86 code again, this time a big focus has been on cleaning up some
issues identified by various static tests, and on the Freescale systems.
Otherwise the biggest thing has been a lot of driver additions:

 - Convert users of digital_mute() to mute_stream().
 - Simplify I/O helper functions.
 - Add a helper for getting the RTD from a substream.
 - Many, many fixes and cleanups to the x86 code.
 - New drivers for Freescale MQS and i.MX6sx, Intel KeemBay I2S, Maxim
   MAX98360A and MAX98373 Soundwire, several Mediatek boards, nVidia
   Tegra 186 and 210, RealTek RL6231, Samsung Midas and Aries boards (some
   of the first phones I worked on!) and TI J721e EVM.

3 years agoRevert "ALSA: hda: call runtime_allow() for all hda controllers"
Hui Wang [Mon, 3 Aug 2020 06:46:38 +0000 (14:46 +0800)]
Revert "ALSA: hda: call runtime_allow() for all hda controllers"

This reverts commit 9a6418487b56 ("ALSA: hda: call runtime_allow()
for all hda controllers").

The reverted patch already introduced some regressions on some
machines:
 - on gemini-lake machines, the error of "azx_get_response timeout"
   happens in the hda driver.
 - on the machines with alc662 codec, the audio jack detection doesn't
   work anymore.

Fixes: 9a6418487b56 ("ALSA: hda: call runtime_allow() for all hda controllers")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208511
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20200803064638.6139-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Fix AE-5 microphone selection commands.
Connor McAdams [Mon, 3 Aug 2020 00:29:27 +0000 (20:29 -0400)]
ALSA: hda/ca0132 - Fix AE-5 microphone selection commands.

The ca0113 command had the wrong group_id, 0x48 when it should've been
0x30. The front microphone selection should now work.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200803002928.8638-3-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Add new quirk ID for Recon3D.
Connor McAdams [Mon, 3 Aug 2020 00:29:26 +0000 (20:29 -0400)]
ALSA: hda/ca0132 - Add new quirk ID for Recon3D.

Add a new quirk ID for the Recon3D, as tested by me.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200803002928.8638-2-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/ca0132 - Fix ZxR Headphone gain control get value.
Connor McAdams [Mon, 3 Aug 2020 00:29:25 +0000 (20:29 -0400)]
ALSA: hda/ca0132 - Fix ZxR Headphone gain control get value.

When the ZxR headphone gain control was added, the ca0132_switch_get
function was not updated, which meant that the changes to the control
state were not saved when entering/exiting alsamixer.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200803002928.8638-1-conmanx360@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoMerge branch 'for-next' into for-linus
Takashi Iwai [Mon, 3 Aug 2020 06:10:08 +0000 (08:10 +0200)]
Merge branch 'for-next' into for-linus

3 years agoALSA: hda/realtek: Add alc269/alc662 pin-tables for Loongson-3 laptops
Huacai Chen [Sun, 2 Aug 2020 09:26:40 +0000 (17:26 +0800)]
ALSA: hda/realtek: Add alc269/alc662 pin-tables for Loongson-3 laptops

There are several Loongson-3 based laptops produced by CZC or Lemote,
they use alc269/alc662 codecs and need specific pin-tables, this patch
add their pin-tables.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1596360400-32425-1-git-send-email-chenhc@lemote.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: docs: fix typo
Julia Lawall [Fri, 31 Jul 2020 19:35:29 +0000 (21:35 +0200)]
ALSA: docs: fix typo

GFP_KRENEL -> GFP_KERNEL

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/1596224129-7699-1-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: doc: use correct config variable name
Julia Lawall [Fri, 31 Jul 2020 19:28:21 +0000 (21:28 +0200)]
ALSA: doc: use correct config variable name

CONFIG_PCM_XRUN_DEBUG should be CONFIG_SND_PCM_XRUN_DEBUG

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/1596223701-7558-1-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoMerge remote-tracking branch 'asoc/for-5.9' into asoc-next
Mark Brown [Fri, 31 Jul 2020 18:54:03 +0000 (19:54 +0100)]
Merge remote-tracking branch 'asoc/for-5.9' into asoc-next

3 years agoMerge remote-tracking branch 'asoc/for-5.8' into asoc-linus
Mark Brown [Fri, 31 Jul 2020 18:54:01 +0000 (19:54 +0100)]
Merge remote-tracking branch 'asoc/for-5.8' into asoc-linus

3 years agoMerge series "ASoC: core: Two step component registration" from Cezary Rojewski ...
Mark Brown [Fri, 31 Jul 2020 18:36:00 +0000 (19:36 +0100)]
Merge series "ASoC: core: Two step component registration" from Cezary Rojewski <cezary.rojewski@intel.com>:

Provide a mechanism for true two-step component registration. This
mimics device registration flow where initialization is the first step
while addition goes as second in line. Drivers may choose to modify
component's fields before registering component to ASoC subsystem via
snd_soc_add_component.

Patchset achieves status quo - behavior of snd_soc_register_component
remains unchanged.

Cezary Rojewski (3):
  ASoC: core: Relocate and expose snd_soc_component_initialize
  ASoC: core: Simplify snd_soc_component_initialize declaration
  ASoC: core: Two step component registration

 include/sound/soc-component.h         |  3 --
 include/sound/soc.h                   | 11 +++---
 sound/soc/soc-component.c             | 16 ---------
 sound/soc/soc-core.c                  | 52 +++++++++++++++++----------
 sound/soc/soc-generic-dmaengine-pcm.c | 14 +++++---
 sound/soc/stm/stm32_adfsdm.c          |  9 +++--
 6 files changed, 55 insertions(+), 50 deletions(-)

--
2.17.1

3 years agoASoC: core: Two step component registration
Cezary Rojewski [Fri, 31 Jul 2020 14:41:46 +0000 (16:41 +0200)]
ASoC: core: Two step component registration

Modify snd_soc_add_component so it calls snd_soc_component_initialize
no longer and thus providing true two-step registration. Drivers may
choose to change component's fields before actually adding it to ASoC
subsystem.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200731144146.6678-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: core: Simplify snd_soc_component_initialize declaration
Cezary Rojewski [Fri, 31 Jul 2020 14:41:45 +0000 (16:41 +0200)]
ASoC: core: Simplify snd_soc_component_initialize declaration

Move 'name' field initialization responsibility back to
snd_soc_component_initialize to prepare snd_soc_add_component function
for being called separatelly as a second registration step.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200731144146.6678-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: core: Relocate and expose snd_soc_component_initialize
Cezary Rojewski [Fri, 31 Jul 2020 14:41:44 +0000 (16:41 +0200)]
ASoC: core: Relocate and expose snd_soc_component_initialize

To allow for two-step component registration, expose
snd_soc_component_initialize function and move it back to soc-core.c.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200731144146.6678-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sh: Replace 'select' DMADEVICES 'with depends on'
Laurent Pinchart [Fri, 31 Jul 2020 15:24:32 +0000 (18:24 +0300)]
ASoC: sh: Replace 'select' DMADEVICES 'with depends on'

Enabling a whole subsystem from a single driver 'select' is frowned
upon and won't be accepted in new drivers, that need to use 'depends on'
instead. Existing selection of DMADEVICES will then cause circular
dependencies. Replace them with a dependency.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20200731152433.1297-3-laurent.pinchart@ideasonboard.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl_sai: Fix value of FSL_SAI_CR1_RFW_MASK
Shengjiu Wang [Fri, 31 Jul 2020 06:28:15 +0000 (14:28 +0800)]
ASoC: fsl_sai: Fix value of FSL_SAI_CR1_RFW_MASK

The fifo_depth is 64 on i.MX8QM/i.MX8QXP, 128 on i.MX8MQ, 16 on
i.MX7ULP.

Original FSL_SAI_CR1_RFW_MASK value 0x1F is not suitable for
these platform, the FIFO watermark mask should be updated
according to the fifo_depth.

Fixes: a860fac42097 ("ASoC: fsl_sai: Add support for imx7ulp/imx8mq")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1596176895-28724-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: meson: cards: deal dpcm flag change
Jerome Brunet [Fri, 31 Jul 2020 12:06:03 +0000 (14:06 +0200)]
ASoC: meson: cards: deal dpcm flag change

Commit b73287f0b074 ("ASoC: soc-pcm: dpcm: fix playback/capture checks")
changed the meaning of dpcm_playback/dpcm_capture and now requires the
CPU DAI BE to aligned with those flags.

This broke all Amlogic cards with uni-directional backends (All gx and
most axg cards).

While I'm still confused as to how this change is an improvement, those
cards can't remain broken forever. Hopefully, next time an API change is
done like that, all the users will be updated as part of the change, and
not left to fend for themselves.

Fixes: b73287f0b074 ("ASoC: soc-pcm: dpcm: fix playback/capture checks")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200731120603.2243261-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>