History log of /linux-master/sound/pci/oxygen/oxygen_mixer.c
Revision Date Author Comments
# a03cfad5 11-Jan-2024 Takashi Iwai <tiwai@suse.de>

ALSA: oxygen: Fix right channel of capture volume mixer

There was a typo in oxygen mixer code that didn't update the right
channel value properly for the capture volume. Let's fix it.

This trivial fix was originally reported on Bugzilla.

Fixes: a3601560496d ("[ALSA] oxygen: add front panel controls")
Cc: <stable@vger.kernel.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=156561
Link: https://lore.kernel.org/r/20240112111023.6208-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9c9cf6be 01-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 404

Based on 1 normalized pattern(s):

this driver is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 this
driver 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 driver 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-only

has been chosen to replace the boilerplate/reference in 6 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Armijn Hemel <armijn@tjaldur.nl>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190531190112.130218438@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9ee92f53 31-May-2018 Yisheng Xie <xieyisheng1@huawei.com>

ALSA: oxygen: use match_string() helper

match_string() returns the index of an array for a matching string,
which can be used instead of open coded variant.

Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 8ec7cfce 02-Aug-2015 Tomer Barletz <barletz@gmail.com>

ALSA: oxygen: Fix logical-not-parentheses warning

This fixes the following warning, that is seen with gcc 5.1:
warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses].

Signed-off-by: Tomer Barletz <barletz@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 0902fbb9 16-Jan-2015 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: add support for third analog input

Make it possible for cards to have three stereo analog input pairs.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 20eb26a2 16-Jan-2015 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: do not create useless S/PDIF controls

Cards without S/PDIF output do not need those controls.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# e9c2f10b 24-Jan-2014 Roman Volkov <v1ron@mail.ru>

ALSA: oxygen: export oxygen_update_dac_routing symbol

When the user switches the output from stereo to multichannel
or vice versa, the driver needs to update the channel routing.
Instead of creating additional subroutines, I better export existing
oxygen_update_dac_routing symbol from the oxygen mixer
and call this function. It calls model.adjust_dac_routing()
and my function does the work.

Signed-off-by: Roman Volkov <v1ron@mail.ru>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>


# 2492250e 04-Feb-2012 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen, virtuoso: fix exchanged L/R volumes of aux and CD inputs

The driver accidentally exchanged the left/right fields for stereo AC'97
mixer registers. This affected only the aux and CD inputs because the
line input bypasses the AC'97 codec and the mic input is mono; cards
without AC'97 (Xonar DS/DG/HDAV Slim, HG2PCI, HiFier) were not affected.

Reported-and-tested-by: Abby Cedar <abbycedar@yahoo.com.au>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: 2.6.31+ <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# efbeb071 31-Jan-2011 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: fix output routing on Xonar DG

This card uses separate I2S outputs for the front speakers and
headphones, and reverses the order of the three speaker outputs.
To work around this, add a model-specific callback to adjust the
controller's playback routing.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 860cffd5 10-Jan-2011 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: add digital input validity check switch

Add a mixer control to prevent capturing S/PDIF samples that are not
marked as valid (non-audio or corrupted samples).

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9600732b 10-Jan-2011 Clemens Ladisch <clemens@ladisch.de>

ALSA: core, oxygen, virtuoso: add an enum control info helper

Introduce the helper function snd_ctl_enum_info() to fill out the
elem_info fields for an enumerated control.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 66410bfd 10-Jan-2011 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: add Xonar DG support

Add experimental support for the Asus Xonar DG sound card.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1f4d7be7 10-Jan-2011 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: allow different number of PCM and mixer channels

For cards like the Xonar HDAV1.3, differentiate between the number of
PCM channels that can be played and the number of channels whose volume
can be adjusted.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# e96f38f7 02-Dec-2010 Clemens Ladisch <clemens@ladisch.de>

ALSA: virtuoso: fix front panel routing for D1/DX/ST(X)

The "Front Panel" switch on the Xonar D1/DX actually switches only the
output direction, so mark it appropriately.

The front panel microphone is controlled by the FMIC2MIC bit of the
CM9780. It was unconditionally enabled on the D1/DX and never set on
the ST(X); add a control for it. Selecting the front panel microphone
as source does not actually disable the microphone jack, but this is
bug-compatible with the Windows driver, and users rely on it.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9a0b3792 04-Oct-2010 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: fix input monitor dB scale

The input monitor half volume bit results in a factor of 0.5, so the
minimum scale value should be -6 dB.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b6ca8ab3 04-Oct-2010 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: handle CD input configuration with a flag

There are more models without a CD input than with one, so handle this
explicitly with a device_config flag to avoid having to define a control
filter callback to filter it out.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 62428f7b 28-Sep-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: fix input monitor control names

Insert "Playback" into the input monitor control names to prevent
alsa-lib from treating these controls as global controls.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 3d8bb454 28-Sep-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: add stereo upmixing to center/LFE channels

Add the possibility to route a mix of the two channels of stereo data to
the center and LFE outputs. This is implemented only for models where
the DACs support this, i.e., for the Xonar D1 and DX.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 75919d7c 28-Sep-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: better defaults for upmixing control

On card models with two-channel outputs, the base driver can
automatically disable the upmixing control so that the model
drivers do not need to do this.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 14744d7d 25-Jun-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: make mic volume control mono

The microphone input and its volume register have only one channel, so
we have to make the corresponding mixer control a mono control.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# d76596b1 22-Sep-2008 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: rename pcm_dev_cfg

Rename the pcm_dev_cfg field to device_config because there will be
additional flags that do not describe PCM devices.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>


# 9bd6a73a 22-Sep-2008 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: use a copy of the model struct

Put a copy of the model structure into the chip structure so that model-
specific drivers can modify it depending on a particular device
instance.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>


# 6627bea1 22-Sep-2008 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: use SPDIF channel status symbols

When setting the SPDIF channel status sample rate field, use the
recently defined symbols instead of magic numbers.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>


# 3d839e5b 26-Aug-2008 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: prevent muting of nonexistent AC97 controls

The Xonar DX does not have CD Capture controls, so we have to check that
a control actually exists before muting it.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9f9115d8 16-Jun-2008 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: fix NULL pointer dereference when loading snd-oxygen

Check that model->control_filter is set before trying to call it.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 4972a177 16-Apr-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: generalize DAC volume TLV handling

Add a pointer for DAC volume TLV data to the model structure so that the
model driver do not need to manually assign it in their control filter.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 193e8138 16-Apr-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: generalize handling of DAC volume limits

Add fields for the DAC volume limits to the module structure so that
model drivers do not need to install their own control info handlers.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1d98c7d4 09-Apr-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: use SPDIF input only if present

If the card model does not have a digital input or an AC97 codec,
disable the respective interrupt and mixer controls.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 11864b4b 09-Apr-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] virtuoso: correctly switch input jack on Xonar DX

When selecting the capture source on the Xonar DX, the input jack must
be routed to either the line input or the microphone input by setting a
GPIO pin. This requires an additional callback so that the model driver
can hook into the toggling of AC97 switches.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# e97f7999 01-Apr-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: fix line-in recording selection (now for real)

On C-Media cards, the GPIO pin 0 of the CM9780 must be handled exactly
like on Xonar cards, so move the Xonar code to the common mixer code.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# f009ad9b 19-Mar-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: change model-specific PCM device configuration

When specifying which PCM devices to use, model drivers now use flags
that also specify the routing between PCM devices and DMA channels
instead of just DMA channel bits. This simplifies some code that checks
for these flags.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# fa5d8106 19-Mar-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: add monitor controls

Add controls to enable monitoring of the analog and digital inputs.

To allow monitoring after loading the driver when nothing has been
played back or recorded yet, the I2S input and outputs are initialized
to a valid configuration.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# a3601560 28-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: add front panel controls

Add mixer controls for the front panel AC97 codec.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 911b499a 28-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: make line-in exclusive only on Xonar

Move the line input switching code to the Virtuoso driver because only
the Xonar cards bypass the analog mixer for line input.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# c626026d 25-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] add TempoTec HiFier driver

Add a driver for the MediaTek/TempoTec HiFier Fantasia sound card.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 976cd627 25-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: make the number of analog output configurable

Add a field to struct oxygen_model to allow model drivers for cards with
less than eight output channels.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 02f21c9d 22-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: add SPDIF loopback control

Add a mixer control for the SPDIF loopback function.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# e9d88a8b 21-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: fix control filter

Actually use the template that was maybe changed by the control filter
instead of the original one.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 878ac3ee 21-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: add more symbols

Add symbol definitions for the various codecs and GPIO pins.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# c9946b2c 21-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: remove magic numbers

Replace some magic numbers with register symbols.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# e0059549 18-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: fix playback routing

The default playback routing must be 0xe4, not 0xe1; the front and
surround DACs were exchanged.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# ccc80fb4 16-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: add control filter to model struct

Allow the models to modify mixer controls before they are added to the
card.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 31c77643 16-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: make AC97 codec optional

Only initialize and create mixer controls for the first AC97 codec when
one has actually been detected.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# fb920b7d 15-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: rename PCM to Master

Rename the 'PCM Playback Volume'/'Switch' mixer controls to 'Master'.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 893e44ba 14-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: make line-in switch exclusive

The line input cannot be mixed with the other inputs, so we have to mute
the other input switches when it is selected.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 01a3affb 14-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: use an array of snd_kcontrol pointers

Use an array for the pointers to known controls so that it is easier to
add more.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 7113e958 14-Jan-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: fix channel routing

Do not exchange the surround and back jacks except when in 7.1 mode
where the surround jack is not rear but side.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 9004acc7 08-Jan-2008 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove sound/driver.h

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>


# d0ce9946 23-Dec-2007 Clemens Ladisch <clemens@ladisch.de>

[ALSA] add CMI8788 driver

Add the snd-oxygen driver for the C-Media CMI8788 (Oxygen) chip, used on
the Asound A-8788, AuzenTech X-Meridian, Bgears b-Enspirer,
Club3D Theatron DTS, HT-Omega Claro, Razer Barracuda AC-1,
Sondigo Inferno, and TempoTec HIFIER sound cards.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>