Apply const prefix to each possible place: the static tables for
registers and bits, the quirk tables, etc.
Just for minor optimization and no functional changes.
Link: https://lore.kernel.org/r/20200105144823.29547-11-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This is a preliminary patch to allow const for snd_ac97_bus_ops
definitions in each driver's code. The ops reference is read-only,
hence it can be declared as const for further optimization.
There should be no functional changes by this patch.
Link: https://lore.kernel.org/r/20200103081714.9560-23-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Now we may declare const for snd_device_ops definitions, so let's do
it for optimization.
There should be no functional changes by this patch.
Link: https://lore.kernel.org/r/20200103081714.9560-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ac97/ac97_codec.c:599:38: warning:
snd_ac97_controls_master_mono defined but not used [-Wunused-const-variable=]
It is never used, so can be removed.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
59 temple place suite 330 boston ma 02111 1307 usa
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-or-later
has been chosen to replace the boilerplate/reference in 1334 file(s).
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function snd_ac97_put_spsa() gets the bit shift value from the
associated private_value, but it extracts too much; the current code
extracts 8 bit values in bits 8-15, but this is a combination of two
nibbles (bits 8-11 and bits 12-15) for left and right shifts.
Due to the incorrect bits extraction, the actual shift may go beyond
the 32bit value, as spotted recently by UBSAN check:
UBSAN: Undefined behaviour in sound/pci/ac97/ac97_codec.c:836:7
shift exponent 68 is too large for 32-bit type 'int'
This patch fixes the shift value extraction by masking the properly
with 0x0f instead of 0xff.
Reported-and-tested-by: Meelis Roos <mroos@linux.ee>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
For a sake of code simplification, remove the init and the exit
entries that do nothing.
Notes for readers: actually it's OK to remove *both* init and exit,
but not OK to remove the exit entry. By removing only the exit while
keeping init, the module becomes permanently loaded; i.e. you cannot
unload it any longer!
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Sphinx takes a word like (*foo)->bar in the kernel-doc comments as a
part of the emphasized marker, and complains like
./sound/pci/ac97/ac97_codec.c:1908: WARNING: Inline emphasis start-string without end-string.
For avoiding this, wrap it with the quotes (``) in the comment.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Patch to add an VT1613 AC97 codec support.
This codec has additional DC offset removal control,
headphone output and no video input.
Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add 0x54584e03 ID for TI TLV320AIC27 AC'97 codec according to datasheet:
http://www.ti.com/lit/ds/slas253a/slas253a.pdf
The weird thing is that the chip is physically marked 320AD91.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The char arrays with size 44 are for the name string of
snd_ctl_elem_id. Define the constant and replace the raw numbers with
it for clarifying better.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
script/kernel-doc reports the following type of warnings (when run in verbose
mode):
Warning(sound/core/init.c:152): No description found for return value of
'snd_card_create'
To fix that:
- add missing descriptions of function return values
- use "Return:" sections to describe those return values
Along the way:
- complete some descriptions
- fix some typos
Signed-off-by: Yacine Belkadi <yacine.belkadi.1@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
module_param(bool) used to counter-intuitively take an int. In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.
It's time to remove the int/unsigned int option. For this version
it'll simply give a warning, but it'll break next kernel version.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The implicit presence of module.h lured several users into
incorrectly thinking that they only needed/used modparam.h
but once we clean up the module.h presence, these will show
up as build failures, so fix 'em now.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Make newly created AC97 emulation of azt3328 known to the AC97 layer
side.
- relocate common functions to the top (due to definition after use)
- rename control names
- adjust 3D settings to the card's custom layout of this register
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use AC97 macros (sometimes already existing, or newly added)
instead of error-prone repetition of open-coded values.
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
flush_scheduled_work() is deprecated and scheduled to be removed.
* cancel[_delayed]_work() + flush_scheduled_work() ->
cancel[_delayed]_work_sync().
* wm8350, wm8753 and soc-core use custom code to cancel a delayed
work, execute it immediately if it was pending and wait for its
completion. This is equivalent to flush_delayed_work_sync(). Use
it instead.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add the STMicroelectronics ST7597 codec and an unknown codec
from the same manufacturer found on the Creative SB 128 card (CT4810).
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
I have a Soundblaster 16PCI. For many years, alsa has had a bug where
not all of the card's controls are detected (many alsa versions,
many kernel versions). In particular, Master Playback Volume is
usually not detected, and so I get no sound or extremely faint sound.
The problem has always been inconsistent: sometimes all of the controls
are detected correctly, and sometimes a partial set is detected. It works
correctly about 10% of the time.
Finally, I got around to tracking down the problem. When the driver
fails, it prints the kernel message "AC'97 0 analog subsections not
ready". This message is generated from the function snd_ac97_mixer()
in ac97_codec.c. The message indicates that the card failed to come
back after reset within the time limit. The time limit is
120 milliseconds.
I tried increasing the time limit to 1 second, and found that this
made the driver work about 70% of the time. I tried increasing it
to 5 seconds, and it now seems to work 100% of the time.
I expect that this change would be completely harmless for
existing cards that work, and would only introduce additional
delay for cards that do not work.
ALSA bug#4032.
Signed-off-by: Steve Soule <sts11dbxr@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
To avoid confusion in control names for the standard analog PC Beep generator
using a small Internal PC Speaker, rename all related "PC Speaker" and "PC
Beep" controls to "Beep" only. This name is more universal and can be also
used on more platforms without confusion.
Introduce also "Internal Speaker" in ControlNames.txt for systems with
full-featured build-in internal speaker.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The WM9715 is software compatible with the WM9711 and WM9712.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
1. Implement 7.1 Output for vt1618 codec.
2. Fix typos in comments from my previous 1617a patch.
Signed-off-by: John L. Utz III <john.utz@dmx.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Kill snd_assert() in sound/pci/*, either removed or replaced with
if () with snd_BUG_ON().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Use pin 37 for mono-out as default on ALC203.
Reported-by: george pee <georgepee@gmail.com>
Tested-by: george pee <georgepee@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Some laptops don't like PR3 powerdown. Do PR3 powerdown only
for the real power-saving.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The power_save option was set as boot although it was meant to be a
timeout value like the same option of snd-hda-intel originally.
Now fixed to the same style.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This header file exists only for some hacks to adapt alsa-driver
tree. It's useless for building in the kernel. Let's move a few
lines in it to sound/core.h and remove it.
With this patch, sound/driver.h isn't removed but has just a single
compile warning to include it. This should be really killed in
future.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
These patches enable a few YMF743 controls (Tone/3D/IEC958) that won't
be detected with the current version of ALSA.
The second one contains following changes:
- A chip-specific SPDIF support for YMF743 (It doesn't have AC97
standard SPDIF registers seen on YMF753).
- The implementation for 'IEC958 Playback Source' and 'IEC958 Mute'
are identical to the ones for YMF753. But there is no 'IEC958 Output
Pin' for YMF743.
Signed-off-by: Keita Maehara <maehara@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Added CONFIG_SND_AC97_POWER_SAVE_DEFAULT and CONFIG_SND_HDA_POWER_SAVE_DEFAULT
Kconfig options as the default values for power-saving mode of AC97 and
HD-audio drivers, respectively.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
On codec chips with both audio and modem functions (e.g. Conexant one),
performing AC97_RESET resets the whole registers. When both audio and
modem drivers are resumed at the same time, the modem one often is
resumed after the audio, and it results in the reset of audio registers
(ALSA bug#3333).
This patch fixes such a problem. Since the modem codec basically
doesn't need AC97_RESET, skip this initialization unless specified
as audio.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Replace the direct calculation of jiffies with msecs_to_jiffies().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Include ac97_patch.c from the main ac97_codec.c in order to make
bunch of patch_*() functions static. This helps optimization.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Fixed the silent output problem on laptops with Conexant Cx20551 codec
chip, such as Packard-bell EasyNote A* series.
The information was taken from ALSA bug#1134.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>