platform/kernel/linux-starfive.git
3 years agoALSA: core: Move mmap handler into memalloc ops
Takashi Iwai [Wed, 9 Jun 2021 16:25:50 +0000 (18:25 +0200)]
ALSA: core: Move mmap handler into memalloc ops

This patch moves the mmap handling code into the common memalloc
handler.  It allows us to reduce the memory-type specific code in PCM
code gracefully.

Link: https://lore.kernel.org/r/20210609162551.7842-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: core: Abstract memory alloc helpers
Takashi Iwai [Wed, 9 Jun 2021 16:25:49 +0000 (18:25 +0200)]
ALSA: core: Abstract memory alloc helpers

This patch introduces the ops table to each memory allocation type
(SNDRV_DMA_TYPE_XXX) and abstract the handling for the better code
management.  Then we get separate the page allocation, release and
other tasks for each type, especially for the SG buffer.

Each buffer type has now callbacks in the struct snd_malloc_ops, and
the common helper functions call those ops accordingly.  The former
inline code that is specific to SG-buffer is moved into the local
sgbuf.c, and we can simplify the PCM code without details of memory
handling.

Link: https://lore.kernel.org/r/20210609162551.7842-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: core: Drop snd_sgbuf_get_ptr()
Takashi Iwai [Wed, 9 Jun 2021 16:25:48 +0000 (18:25 +0200)]
ALSA: core: Drop snd_sgbuf_get_ptr()

snd_sgbuf_get_ptr() and its sibling snd_pcm_sgbuf_get_ptr() are no
longer used by any drivers.  Let's drop them.

Link: https://lore.kernel.org/r/20210609162551.7842-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: trident: Drop shadow TLB pointer table
Takashi Iwai [Wed, 9 Jun 2021 16:25:47 +0000 (18:25 +0200)]
ALSA: trident: Drop shadow TLB pointer table

The shadow TLB pointer table is allocated and set up, but never really
used any longer by the driver.  Let's drop it.

Since this is the only user of snd_pcm_sgbuf_get_ptr(), we can clean
up the API after this change.

Link: https://lore.kernel.org/r/20210609162551.7842-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: doc: Fix spelling mistakes
huangjianghui [Thu, 10 Jun 2021 06:20:36 +0000 (14:20 +0800)]
ALSA: doc: Fix spelling mistakes

correct Reatek to Realtek

Signed-off-by: huangjianghui <huangjianghui@uniontech.com>
Link: https://lore.kernel.org/r/20210610062036.30300-1-huangjianghui@uniontech.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: arm: Remove unnecessary variables
zuoqilin [Thu, 10 Jun 2021 02:40:53 +0000 (10:40 +0800)]
ALSA: arm: Remove unnecessary variables

There is no need to define the variable "ret" to receive.

Signed-off-by: zuoqilin <zuoqilin@yulong.com>
Link: https://lore.kernel.org/r/20210610024053.1217-1-zuoqilin1@163.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-lib: obsolete workqueue for period update
Takashi Sakamoto [Thu, 10 Jun 2021 03:17:33 +0000 (12:17 +0900)]
ALSA: firewire-lib: obsolete workqueue for period update

The workqueue to notify PCM period elapse is not used anymore.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210610031733.56297-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-lib: operate for period elapse event in process context
Takashi Sakamoto [Thu, 10 Jun 2021 03:17:32 +0000 (12:17 +0900)]
ALSA: firewire-lib: operate for period elapse event in process context

All of drivers in ALSA firewire stack processes two chances to process
isochronous packets in any isochronous context; in software IRQ context
for 1394 OHCI, and in process context of ALSA PCM application.

In the process context, callbacks of .pointer and .ack are utilized. The
callbacks are done by ALSA PCM core under acquiring lock of PCM substream,

In design of ALSA PCM core, call of snd_pcm_period_elapsed() is used for
drivers to awaken user processes from waiting for available frames. The
function voluntarily acquires lock of PCM substream, therefore it is not
called in the process context since it causes dead lock.

As a workaround to avoid the dead lock, all of drivers in ALSA firewire
stack uses workqueue to delegate the call. A variant of
snd_pcm_period_elapsed() without lock acquisition can obsolete the
workqueue.

An extra care is needed for the callback of .pointer since it's called
from snd_pcm_period_elapsed(). The isochronous context in Linux FireWire
subsystem is safe mostly for nested call except in software IRQ context.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210610031733.56297-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: pcm: add snd_pcm_period_elapsed() variant without acquiring lock of PCM substream
Takashi Sakamoto [Thu, 10 Jun 2021 03:17:31 +0000 (12:17 +0900)]
ALSA: pcm: add snd_pcm_period_elapsed() variant without acquiring lock of PCM substream

Current implementation of ALSA PCM core has a kernel API,
snd_pcm_period_elapsed(), for drivers to queue event to awaken processes
from waiting for available frames. The function voluntarily acquires lock
of PCM substream, therefore it is not called in process context for any
PCM operation since the lock is already acquired.

It is convenient for packet-oriented driver, at least for drivers to audio
and music unit in IEEE 1394 bus. The drivers are allowed by Linux
FireWire subsystem to process isochronous packets queued till recent
isochronous cycle in process context in any time.

This commit adds snd_pcm_period_elapsed() variant,
snd_pcm_period_elapsed_without_lock(), for drivers to queue the event in
the process context.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210610031733.56297-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: parisc: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:40 +0000 (16:05 +0200)]
ALSA: parisc: Fix assignment in if condition

PARISC harmony driver code contains an assignment in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-67-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: i2c: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:39 +0000 (16:05 +0200)]
ALSA: i2c: Fix assignment in if condition

ALSA I2C helper drivers contain a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-66-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: poewrmac: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:38 +0000 (16:05 +0200)]
ALSA: poewrmac: Fix assignment in if condition

PPC powermac driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-65-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: synth: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:37 +0000 (16:05 +0200)]
ALSA: synth: Fix assignment in if condition

EMUx synth driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-64-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: serial: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:36 +0000 (16:05 +0200)]
ALSA: serial: Fix assignment in if condition

A few ALSA serial drivers contain assignments in if condition, which
is a bad coding style that may confuse readers and occasionally lead
to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-63-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: opl3: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:35 +0000 (16:05 +0200)]
ALSA: opl3: Fix assignment in if condition

OPL3 helper code contains a few assignments in if condition, which is
a bad coding style that may confuse readers and occasionally lead to
bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-62-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: vx: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:34 +0000 (16:05 +0200)]
ALSA: vx: Fix assignment in if condition

VX driver helper code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-61-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: mpu401: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:33 +0000 (16:05 +0200)]
ALSA: mpu401: Fix assignment in if condition

MPU401 driver code contains a few assignments in if condition, which
is a bad coding style that may confuse readers and occasionally lead
to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-60-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: sparc: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:32 +0000 (16:05 +0200)]
ALSA: sparc: Fix assignment in if condition

SPARC drivers contain a few assignments in if condition, which is a
bad coding style that may confuse readers and occasionally lead to
bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-59-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: pcmcia: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:31 +0000 (16:05 +0200)]
ALSA: pcmcia: Fix assignment in if condition

PCMCIA VX222 and PDAudioCF drivers contain a few assignments in if
condition, which is a bad coding style that may confuse readers and
occasionally lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-58-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: seq: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:30 +0000 (16:05 +0200)]
ALSA: seq: Fix assignment in if condition

There are lots of places doing assignments in if condition in ALSA
sequencer core, which is a bad coding style that may confuse readers
and occasionally lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-57-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: oss: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:29 +0000 (16:05 +0200)]
ALSA: oss: Fix assignment in if condition

There are a few places doing assignments in if condition in ALSA PCM
and OSS emulation layers, which is a bad coding style that may confuse
readers and occasionally lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-56-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: pcm: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:28 +0000 (16:05 +0200)]
ALSA: pcm: Fix assignment in if condition

There are a few places doing assignments in if condition in ALSA PCM
core code, which is a bad coding style that may confuse readers and
occasionally lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-55-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: core: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:27 +0000 (16:05 +0200)]
ALSA: core: Fix assignment in if condition

There are a few places doing assignments in if condition in ALSA core
code, which is a bad coding style that may confuse readers and
occasionally lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-54-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: ymfpci: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:26 +0000 (16:05 +0200)]
ALSA: ymfpci: Fix assignment in if condition

PCI YMFPCI driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-53-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: vx222: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:25 +0000 (16:05 +0200)]
ALSA: vx222: Fix assignment in if condition

PCI VX222 driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-52-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: trident: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:24 +0000 (16:05 +0200)]
ALSA: trident: Fix assignment in if condition

PCI Trident driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-51-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: rme9652: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:23 +0000 (16:05 +0200)]
ALSA: rme9652: Fix assignment in if condition

PCI RME9652 driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-50-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hdsp: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:22 +0000 (16:05 +0200)]
ALSA: hdsp: Fix assignment in if condition

PCI HDSP driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-49-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: riptide: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:21 +0000 (16:05 +0200)]
ALSA: riptide: Fix assignment in if condition

PCI riptide driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-48-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: pcxhr: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:20 +0000 (16:05 +0200)]
ALSA: pcxhr: Fix assignment in if condition

PCI PCXHR driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-47-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: nm256: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:19 +0000 (16:05 +0200)]
ALSA: nm256: Fix assignment in if condition

PCI NM256 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-46-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: mixart: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:18 +0000 (16:05 +0200)]
ALSA: mixart: Fix assignment in if condition

PCI miXart driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-45-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: korg1212: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:17 +0000 (16:05 +0200)]
ALSA: korg1212: Fix assignment in if condition

PCI Korg1212 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-44-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: ice1712: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:16 +0000 (16:05 +0200)]
ALSA: ice1712: Fix assignment in if condition

PCI ICE1712 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-43-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: emu10k1x: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:15 +0000 (16:05 +0200)]
ALSA: emu10k1x: Fix assignment in if condition

PCI EMU10k1X driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-42-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: emu10k1: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:14 +0000 (16:05 +0200)]
ALSA: emu10k1: Fix assignment in if condition

PCI EMU10k1 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-41-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: echoaudio: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:13 +0000 (16:05 +0200)]
ALSA: echoaudio: Fix assignment in if condition

PCI echoaudio drivers contain a few assignments in if condition, which
is a bad coding style that may confuse readers and occasionally lead
to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-40-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: cs5535audio: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:12 +0000 (16:05 +0200)]
ALSA: cs5535audio: Fix assignment in if condition

PCI CS5535 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-39-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: cs46xx: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:11 +0000 (16:05 +0200)]
ALSA: cs46xx: Fix assignment in if condition

PCI CS46xx driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-38-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: ca0106: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:10 +0000 (16:05 +0200)]
ALSA: ca0106: Fix assignment in if condition

PCI CA0106 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-37-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: au88x0: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:09 +0000 (16:05 +0200)]
ALSA: au88x0: Fix assignment in if condition

PCI AU88x0 driver code contains a lot of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes.  A potential real fix is
about the PCI AGP bridge management refcount in addition while spotted
out during conversions.

Link: https://lore.kernel.org/r/20210608140540.17885-36-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: ac97: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:08 +0000 (16:05 +0200)]
ALSA: ac97: Fix assignment in if condition

AC97 codec driver code contains a lot of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-35-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: via82xx: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:07 +0000 (16:05 +0200)]
ALSA: via82xx: Fix assignment in if condition

PCI VIA82xx driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-34-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: sonicvibes: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:06 +0000 (16:05 +0200)]
ALSA: sonicvibes: Fix assignment in if condition

PCI sonicvibes driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-33-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: rme96: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:05 +0000 (16:05 +0200)]
ALSA: rme96: Fix assignment in if condition

PCI RME96 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes (only systematic
conversions except for a few rate handling codes), no functional
changes.

Link: https://lore.kernel.org/r/20210608140540.17885-32-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: rme32: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:04 +0000 (16:05 +0200)]
ALSA: rme32: Fix assignment in if condition

PCI RME32 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes (except for a slight
refactoring about AutoSync rate check, only systematic conversions),
no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-31-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: maestro3: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:03 +0000 (16:05 +0200)]
ALSA: maestro3: Fix assignment in if condition

PCI maestro3 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-30-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: intel8x0: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:02 +0000 (16:05 +0200)]
ALSA: intel8x0: Fix assignment in if condition

PCI intel8x0 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-29-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: fm801: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:01 +0000 (16:05 +0200)]
ALSA: fm801: Fix assignment in if condition

PCI FM801 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-28-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: es1968: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:05:00 +0000 (16:05 +0200)]
ALSA: es1968: Fix assignment in if condition

PCI ES1968 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-27-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: es1938: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:59 +0000 (16:04 +0200)]
ALSA: es1938: Fix assignment in if condition

PCI ES1938 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-26-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: ens137x: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:58 +0000 (16:04 +0200)]
ALSA: ens137x: Fix assignment in if condition

PCI ENS137x driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-25-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: cs4281: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:57 +0000 (16:04 +0200)]
ALSA: cs4281: Fix assignment in if condition

PCI CS4281 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-24-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: cmipci: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:56 +0000 (16:04 +0200)]
ALSA: cmipci: Fix assignment in if condition

PCI CMIPCI driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-23-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: bt87x: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:55 +0000 (16:04 +0200)]
ALSA: bt87x: Fix assignment in if condition

PCI BT87x driver code contains an assignments in if condition, which
is a bad coding style that may confuse readers and occasionally lead
to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-22-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: azt3328: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:54 +0000 (16:04 +0200)]
ALSA: azt3328: Fix assignment in if condition

PCI AZT3328 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-21-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: atiixp: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:53 +0000 (16:04 +0200)]
ALSA: atiixp: Fix assignment in if condition

PCI ATIIXP driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-20-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: als4000: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:52 +0000 (16:04 +0200)]
ALSA: als4000: Fix assignment in if condition

PCI ALS4000 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-19-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: als300: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:51 +0000 (16:04 +0200)]
ALSA: als300: Fix assignment in if condition

PCI ALS300 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-18-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: ak4531: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:50 +0000 (16:04 +0200)]
ALSA: ak4531: Fix assignment in if condition

AK4531 codec driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-17-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: ad1889: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:49 +0000 (16:04 +0200)]
ALSA: ad1889: Fix assignment in if condition

PCI AD1889 driver code contains a few assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-16-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: isa: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:48 +0000 (16:04 +0200)]
ALSA: isa: Fix assignment in if condition

ISA ES1688 and WSS  driver code contains a few assignments in if
condition, which is a bad coding style that may confuse readers and
occasionally lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-15-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: azt2320: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:47 +0000 (16:04 +0200)]
ALSA: azt2320: Fix assignment in if condition

ISA AZT2320 driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-14-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: als100: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:46 +0000 (16:04 +0200)]
ALSA: als100: Fix assignment in if condition

ISA ALS100 driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-13-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: cmi8330: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:45 +0000 (16:04 +0200)]
ALSA: cmi8330: Fix assignment in if condition

ISA CMI8330 driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-12-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: es18xx: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:44 +0000 (16:04 +0200)]
ALSA: es18xx: Fix assignment in if condition

ISA ES18xx driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-11-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: opl3sa2: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:43 +0000 (16:04 +0200)]
ALSA: opl3sa2: Fix assignment in if condition

ISA OPL3SA2 driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: opti9xx: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:42 +0000 (16:04 +0200)]
ALSA: opti9xx: Fix assignment in if condition

ISA Opti9xx driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: cs423x: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:41 +0000 (16:04 +0200)]
ALSA: cs423x: Fix assignment in if condition

ISA CS423x driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: wavefront: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:40 +0000 (16:04 +0200)]
ALSA: wavefront: Fix assignment in if condition

ISA WaveFront driver code contains lots of assignments in if
condition, which is a bad coding style that may confuse readers and
occasionally lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: ad1816a: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:39 +0000 (16:04 +0200)]
ALSA: ad1816a: Fix assignment in if condition

ISA AD1816A driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: gus: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:38 +0000 (16:04 +0200)]
ALSA: gus: Fix assignment in if condition

ISA GUS driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: sb: Fix potential double-free of CSP mixer elements
Takashi Iwai [Tue, 8 Jun 2021 14:04:37 +0000 (16:04 +0200)]
ALSA: sb: Fix potential double-free of CSP mixer elements

snd_sb_qsound_destroy() contains the calls of removing the previously
created mixer controls, but it doesn't clear the pointers.  As
snd_sb_qsound_destroy() itself may be repeatedly called via ioctl,
this could lead to double-free potentially.

Fix it by clearing the struct fields properly afterwards.

Link: https://lore.kernel.org/r/20210608140540.17885-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: sb: Minor coding style fixes
Takashi Iwai [Tue, 8 Jun 2021 14:04:36 +0000 (16:04 +0200)]
ALSA: sb: Minor coding style fixes

The handling of snd_ctl_new1() and snd_ctl_add() can be sometimes
tricky, as snd_ctl_add() automatically removes the passed object at
its error path.  The recent fix addressed an overlooked issue that is
relevant with that in SB driver code, and it can be a bit more
simplified by assigning to a temporary variable, i.e. storing to the
struct field only after the creation succeeds.

Link: https://lore.kernel.org/r/20210608140540.17885-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: sb: Fix assignment in if condition
Takashi Iwai [Tue, 8 Jun 2021 14:04:35 +0000 (16:04 +0200)]
ALSA: sb: Fix assignment in if condition

A lot of code for SB drivers is in a legacy style with assignment in
if condition.  This also made harder to catch some bugs (e.g. the
commit 1c98f574403d "ALSA: emu8000: Fix a use after free in
snd_emu8000_create_mixer").

This patch fixes the coding style.  All are rather simple conversions
and there should be no functional changes.
(The changes in snd_emu8000_new() for hw->res_port1, 2 and 3 are
 slightly different from the older ones, but this shouldn't matter
 much in practice.)

Link: https://lore.kernel.org/r/20210608140540.17885-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: scarlett2: Read mux at init time
Geoffrey D. Bennett [Mon, 7 Jun 2021 19:13:51 +0000 (04:43 +0930)]
ALSA: usb-audio: scarlett2: Read mux at init time

Add support for retrieving the mux configuration from the hardware
when the driver is initialising. Previously the ALSA controls were
initialised to a default hard-coded state instead of being initialised
to match the hardware state.

Fixes: 9e4d5c1be21f ("ALSA: usb-audio: Scarlett Gen 2 mixer interface")
Suggested-by: Vladimir Sadovnikov <sadko4u@gmail.com>
Tested-by: Markus Schroetter <project.m.schroetter@gmail.com>
Tested-by: Alex Fellows <alex.fellows@gmail.com>
Tested-by: Daniel Sales <daniel.sales.z@gmail.com>
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://lore.kernel.org/r/15b17c60a2bca174bcddcec41c9419b746f21c1d.1623091570.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: usb-audio: scarlett2: Read mixer volumes at init time
Geoffrey D. Bennett [Mon, 7 Jun 2021 19:13:25 +0000 (04:43 +0930)]
ALSA: usb-audio: scarlett2: Read mixer volumes at init time

Add support for reading the mixer volumes from the hardware when the
driver is initialising. Previously these ALSA volume controls were
initialised to zero instead of being initialised to match the hardware
state.

Fixes: 9e4d5c1be21f ("ALSA: usb-audio: Scarlett Gen 2 mixer interface")
Suggested-by: Vladimir Sadovnikov <sadko4u@gmail.com>
Tested-by: Markus Schroetter <project.m.schroetter@gmail.com>
Tested-by: Alex Fellows <alex.fellows@gmail.com>
Tested-by: Daniel Sales <daniel.sales.z@gmail.com>
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://lore.kernel.org/r/bb33fa9b79efc6f7a0f0e6fb7018cc8d4d59b3ba.1623091570.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoMerge branch 'for-linus' into for-next
Takashi Iwai [Tue, 8 Jun 2021 12:02:06 +0000 (14:02 +0200)]
Merge branch 'for-linus' into for-next

3 years agoALSA: hda/realtek: fix mute/micmute LEDs for HP ZBook Power G8
Jeremy Szu [Tue, 8 Jun 2021 11:47:48 +0000 (19:47 +0800)]
ALSA: hda/realtek: fix mute/micmute LEDs for HP ZBook Power G8

The HP ZBook Power G8 using ALC236 codec which using 0x02 to
control mute LED and 0x01 to control micmute LED.
Therefore, add a quirk to make it works.

Signed-off-by: Jeremy Szu <jeremy.szu@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210608114750.32009-1-jeremy.szu@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/realtek: headphone and mic don't work on an Acer laptop
Hui Wang [Tue, 8 Jun 2021 02:46:00 +0000 (10:46 +0800)]
ALSA: hda/realtek: headphone and mic don't work on an Acer laptop

There are 2 issues on this machine, the 1st one is mic's plug/unplug
can't be detected, that is because the mic is set to manual detecting
mode, need to apply ALC255_FIXUP_XIAOMI_HEADSET_MIC to set it to auto
detecting mode. The other one is headphone's plug/unplug can't be
detected by pulseaudio, that is because the pulseaudio will use
ucm2/sof-hda-dsp on this machine, and the ucm2 only handle
'Headphone Jack', but on this machine the headphone's pincfg sets the
location to Front, then the alsa mixer name is "Front Headphone Jack"
instead of "Headphone Jack", so override the pincfg to change location
to Left.

BugLink: http://bugs.launchpad.net/bugs/1930188
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20210608024600.6198-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-lib: delete unused kernel API
Takashi Sakamoto [Mon, 7 Jun 2021 08:12:50 +0000 (17:12 +0900)]
ALSA: firewire-lib: delete unused kernel API

No driver use snd_fw_schedule_registration(). Let's delete it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210607081250.13397-10-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: fireface: cease from delayed card registration
Takashi Sakamoto [Mon, 7 Jun 2021 08:12:49 +0000 (17:12 +0900)]
ALSA: fireface: cease from delayed card registration

The delayed registration of sound card instance brings less benefit than
complication of kobject management. This commit ceases from it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210607081250.13397-9-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-motu: cease from delayed card registration
Takashi Sakamoto [Mon, 7 Jun 2021 08:12:48 +0000 (17:12 +0900)]
ALSA: firewire-motu: cease from delayed card registration

The delayed registration of sound card instance brings less benefit than
complication of kobject management. This commit ceases from it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210607081250.13397-8-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-tascam: cease from delayed card registration
Takashi Sakamoto [Mon, 7 Jun 2021 08:12:47 +0000 (17:12 +0900)]
ALSA: firewire-tascam: cease from delayed card registration

The delayed registration of sound card instance brings less benefit than
complication of kobject management. This commit ceases from it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210607081250.13397-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-digi00x: cease from delayed card registration
Takashi Sakamoto [Mon, 7 Jun 2021 08:12:46 +0000 (17:12 +0900)]
ALSA: firewire-digi00x: cease from delayed card registration

The delayed registration of sound card instance brings less benefit than
complication of kobject management. This commit ceases from it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210607081250.13397-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: dice: cease from delayed card registration
Takashi Sakamoto [Mon, 7 Jun 2021 08:12:45 +0000 (17:12 +0900)]
ALSA: dice: cease from delayed card registration

The delayed registration of sound card instance brings less benefit than
complication of kobject management. This commit ceases from it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210607081250.13397-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: oxfw: cease from delayed card registration
Takashi Sakamoto [Mon, 7 Jun 2021 08:12:44 +0000 (17:12 +0900)]
ALSA: oxfw: cease from delayed card registration

The delayed registration of sound card instance brings less benefit than
complication of kobject management. This commit ceases from it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210607081250.13397-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: fireworks: cease from delayed card registration
Takashi Sakamoto [Mon, 7 Jun 2021 08:12:43 +0000 (17:12 +0900)]
ALSA: fireworks: cease from delayed card registration

The delayed registration of sound card instance brings less benefit than
complication of kobject management. This commit ceases from it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210607081250.13397-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: bebob: cease from delayed card registration
Takashi Sakamoto [Mon, 7 Jun 2021 08:12:42 +0000 (17:12 +0900)]
ALSA: bebob: cease from delayed card registration

The delayed registration of sound card instance brings less benefit than
complication of kobject management. This commit ceases from it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210607081250.13397-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-motu: add support for hybrid model of MOTU Ultralite mk3
Takashi Sakamoto [Sun, 6 Jun 2021 04:34:09 +0000 (13:34 +0900)]
ALSA: firewire-motu: add support for hybrid model of MOTU Ultralite mk3

This commit adds support for the hybrid model of MOTU Ultralite mk3 with
alpha connector, which is already discontinued. The hardware specification
of the model is the same as the one of FireWire-only model.

$ cd linux-firewire-utils
$ python3 src/crpp < /sys/bus/firewire/devices/fw1/config_rom
               ROM header and bus information block
               -----------------------------------------------------------------
400  04101573  bus_info_length 4, crc_length 16, crc 5491
404  31333934  bus_name "1394"
408  20ff7000  irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 255, max_rec 7 (256)
40c  0001f200  company_id 0001f2     |
410  000a059c  device_id 00000a059c  | EUI-64 0001f200000a059c

               root directory
               -----------------------------------------------------------------
414  0004ef04  directory_length 4, crc 61188
418  030001f2  vendor
41c  0c0083c0  node capabilities per IEEE 1394
420  d1000002  --> unit directory at 428
424  8d000005  --> eui-64 leaf at 438

               unit directory at 428
               -----------------------------------------------------------------
428  0003f00b  directory_length 3, crc 61451
42c  120001f2  specifier id
430  13000030  version
434  17103800  model

               eui-64 leaf at 438
               -----------------------------------------------------------------
438  0002d89c  leaf_length 2, crc 55452
43c  0001f200  company_id 0001f2     |
440  000a059c  device_id 00000a059c  | EUI-64 0001f200000a059c

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210606043409.40019-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-lib: remove useless operations for kernel preemption
Takashi Sakamoto [Sun, 6 Jun 2021 02:56:51 +0000 (11:56 +0900)]
ALSA: firewire-lib: remove useless operations for kernel preemption

In all of drivers of ALSA firewire stack, the callback of .pointer and
.ack in snd_pcm_ops structure is done in acquired spin_lock of PCM
substream, therefore already under disabled kernel preemption.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210606025651.29970-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-lib: fix error codes for allocation failure
Dan Carpenter [Sat, 5 Jun 2021 12:46:39 +0000 (15:46 +0300)]
ALSA: firewire-lib: fix error codes for allocation failure

Return -ENOMEM if kcalloc() fails.  Currently the code returns success.

Fixes: f9e5ecdfc2c2 ("ALSA: firewire-lib: add replay target to cache sequence of packet")
Fixes: 6f24bb8a157c ("ALSA: firewire-lib: pool sequence of packet in IT context independently")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/YLtyL4VoArwVLor1@mwanda
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-lib: fix the context to call snd_pcm_stop_xrun()
Takashi Sakamoto [Sat, 5 Jun 2021 09:10:54 +0000 (18:10 +0900)]
ALSA: firewire-lib: fix the context to call snd_pcm_stop_xrun()

In the workqueue to queue wake-up event, isochronous context is not
processed, thus it's useless to check context for the workqueue to switch
status of runtime for PCM substream to XRUN. On the other hand, in
software IRQ context of 1394 OHCI, it's needed.

This commit fixes the bug introduced when tasklet was replaced with
workqueue.

Cc: <stable@vger.kernel.org>
Fixes: 2b3d2987d800 ("ALSA: firewire: Replace tasklet with work")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210605091054.68866-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook 840 Aero G8
Jeremy Szu [Sat, 5 Jun 2021 08:25:38 +0000 (16:25 +0800)]
ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook 840 Aero G8

The HP EliteBook 840 Aero G8 using ALC285 codec which using 0x04 to
control mute LED and 0x01 to control micmute LED.
In the other hand, there is no output from right channel of speaker.
Therefore, add a quirk to make it works.

Signed-off-by: Jeremy Szu <jeremy.szu@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210605082539.41797-3-jeremy.szu@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/realtek: fix mute/micmute LEDs and speaker for HP EliteBook x360 1040 G8
Jeremy Szu [Sat, 5 Jun 2021 08:25:37 +0000 (16:25 +0800)]
ALSA: hda/realtek: fix mute/micmute LEDs and speaker for HP EliteBook x360 1040 G8

The HP EliteBook x360 1040 G8 using ALC285 codec which using 0x04 to control
mute LED and 0x01 to control micmute LED.
In the other hand, there is no output from right channel of speaker.
Therefore, add a quirk to make it works.

Signed-off-by: Jeremy Szu <jeremy.szu@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210605082539.41797-2-jeremy.szu@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/realtek: fix mute/micmute LEDs and speaker for HP Elite Dragonfly G2
Jeremy Szu [Sat, 5 Jun 2021 08:25:36 +0000 (16:25 +0800)]
ALSA: hda/realtek: fix mute/micmute LEDs and speaker for HP Elite Dragonfly G2

The HP Elite Dragonfly G2 using ALC285 codec which using 0x04 to control
mute LED and 0x01 to control micmute LED.
In the other hand, there is no output from right channel of speaker.
Therefore, add a quirk to make it works.

Signed-off-by: Jeremy Szu <jeremy.szu@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210605082539.41797-1-jeremy.szu@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda/realtek: Change device names for quirks to barebone names
Werner Sembach [Fri, 4 Jun 2021 14:02:07 +0000 (16:02 +0200)]
ALSA: hda/realtek: Change device names for quirks to barebone names

Change the name string of several devices needing quirks to the Clevo-barebone
ones. Also make the names follow the same pattern for multiple Clevo names
referring to the same mainboard.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Link: https://lore.kernel.org/r/20210604140207.8023-1-wse@tuxedocomputers.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: firewire-motu: fix error return code in snd_motu_stream_reserve_duplex()
Yang Yingliang [Thu, 3 Jun 2021 14:32:03 +0000 (22:32 +0800)]
ALSA: firewire-motu: fix error return code in snd_motu_stream_reserve_duplex()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: e50dfac81f73 ("ALSA: firewire-motu: cache event ticks in source packet header per data block")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210603143203.582017-1-yangyingliang@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: hda: update the power_state during the direct-complete
Hui Wang [Wed, 2 Jun 2021 14:54:24 +0000 (22:54 +0800)]
ALSA: hda: update the power_state during the direct-complete

The patch_realtek.c needs to check if the power_state.event equals
PM_EVENT_SUSPEND, after using the direct-complete, the suspend() and
resume() will be skipped if the codec is already rt_suspended, in this
case, the patch_realtek.c will always get PM_EVENT_ON even the system
is really resumed from S3.

We could set power_state to PMSG_SUSPEND in the prepare(), if other
PM functions are called before complete(), those functions will
override power_state; if no other PM functions are called before
complete(), we could know the suspend() and resume() are skipped since
only S3 pm functions could be skipped by direct-complete, in this case
set power_state to PMSG_RESUME in the complete(). This could guarantee
the first time of calling hda_codec_runtime_resume() after complete()
has the correct power_state.

Fixes: 215a22ed31a1 ("ALSA: hda: Refactor codec PM to use direct-complete optimization")
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20210602145424.3132-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: timer: Fix master timer notification
Takashi Iwai [Wed, 2 Jun 2021 11:38:23 +0000 (13:38 +0200)]
ALSA: timer: Fix master timer notification

snd_timer_notify1() calls the notification to each slave for a master
event, but it passes a wrong event number.  It should be +10 offset,
corresponding to SNDRV_TIMER_EVENT_MXXX, but it's incorrectly with
+100 offset.  Casually this was spotted by UBSAN check via syzkaller.

Reported-by: syzbot+d102fa5b35335a7e544e@syzkaller.appspotmail.com
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/000000000000e5560e05c3bd1d63@google.com
Link: https://lore.kernel.org/r/20210602113823.23777-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>