History log of /linux-master/sound/pci/oxygen/oxygen_lib.c
Revision Date Author Comments
# 6ebc16e2 11-Apr-2022 Takashi Iwai <tiwai@suse.de>

ALSA: oxygen: Fix the missing snd_card_free() call at probe error

The previous cleanup with devres may lead to the incorrect release
orders at the probe error handling due to the devres's nature. Until
we register the card, snd_card_free() has to be called at first for
releasing the stuff properly when the driver tries to manage and
release the stuff via card->private_free().

This patch fixes it by calling snd_card_free() on the error from the
probe callback using a new helper function.

Fixes: 596ae97ab0ce ("ALSA: oxygen: Allocate resources with device-managed APIs")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220412102636.16000-35-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 596ae97a 15-Jul-2021 Takashi Iwai <tiwai@suse.de>

ALSA: oxygen: Allocate resources with device-managed APIs

This patch converts the resource management in PCI oxygen drivers with
devres as a clean up. Each manual resource management is converted
with the corresponding devres helper, and the page allocations are
done with the devres helper.

This should give no user-visible functional changes.

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


# bf17d20a 09-Dec-2019 Takashi Iwai <tiwai@suse.de>

ALSA: oxygen: Support PCM sync_stop

The driver invokes snd_pcm_period_elapsed() simply from the interrupt
handler. Set card->sync_irq for enabling the missing sync_stop PCM
operation, as well as removing the superfluous synchronize_irq()
call.

Link: https://lore.kernel.org/r/20191210063454.31603-30-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>


# 47f2769b 04-Feb-2019 Takashi Iwai <tiwai@suse.de>

ALSA: pci: Clean up with new procfs helpers

Simplify the proc fs creation code with new helper functions,
snd_card_ro_proc_new() and snd_card_rw_proc_new().
Just a code refactoring and no functional changes.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 17bc4815 11-Jan-2019 Takashi Iwai <tiwai@suse.de>

ALSA: pci: Remove superfluous snd_pcm_suspend*() calls

The call of snd_pcm_suspend_all() & co became superfluous since we
call it in the PCM PM ops. Let's remove them.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 4bccb403 21-Dec-2018 Tom Yan <tom.ty89@gmail.com>

ALSA: oxygen: initialize spdif_playback_enable to 0

There's no reason for us to do that while we initialize dac_mute to
1. Also oxygen_init() has been clearing the OXYGEN_SPDIF_OUT_ENABLE
bit anyway.

Signed-off-by: Tom Yan <tom.ty89@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 3270f0dd 29-May-2015 Takashi Iwai <tiwai@suse.de>

ALSA: pci: Drop superfluous ifdef CONFIG_PROC_FS

The compiler can optimize the unused code away, so we can drop
ifdefs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

ALSA: oxygen: add XIO2001 initialization

Configure the XIO2001 bridge on PCI Express cards so that it does less
needless prefetching.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
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>


# 2d6b2e59 07-Jan-2015 Takashi Iwai <tiwai@suse.de>

ALSA: oxygen: Simplify PM callbacks

This is a similar cleanup like the commit [3db084fd0af5: ALSA: fm801:
PCI core handles power state for us].

Since pci_set_power_state(), pci_save_state() and pci_restore_state()
are already done in the PCI core side, so we don't need to it doubly.

Also, pci_enable_device(), pci_disable_device() and pci_set_master()
calls in PM callbacks are superfluous nowadays, too, so get rid of
them as well.

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


# 1fac1686 03-Jan-2015 Markus Elfring <elfring@users.sourceforge.net>

ALSA: oxygen: Delete an unnecessary check before the function call "snd_pcm_suspend"

The snd_pcm_suspend() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 03d3ac21 25-Feb-2014 Takashi Iwai <tiwai@suse.de>

ALSA: oxygen: Use standard printk helpers

Convert with dev_err() and co from snd_printk(), etc.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 60c5772b 29-Jan-2014 Takashi Iwai <tiwai@suse.de>

ALSA: pci: Convert to snd_card_new() with a device pointer

Also remove superfluous snd_card_set_dev() calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 20a24225 28-May-2013 Takashi Iwai <tiwai@suse.de>

ALSA: PCI: Remove superfluous pci_set_drvdata(pci, NULL) at remove

As drvdata is cleared to NULL at probe failure or at removal by the
driver core, we don't have to call pci_set_drvdata(pci, NULL) any
longer in each driver.

The only remaining pci_set_drvdata(NULL) is in azx_firmware_cb() in
hda_intel.c. Since this function itself releases the card instance,
we need to clear drvdata here as well, so that it won't be released
doubly in the remove callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 43829731 20-Aug-2012 Tejun Heo <tj@kernel.org>

workqueue: deprecate flush[_delayed]_work_sync()

flush[_delayed]_work_sync() are now spurious. Mark them deprecated
and convert all users to flush[_delayed]_work().

If you're cc'd and wondering what's going on: Now all workqueues are
non-reentrant and the regular flushes guarantee that the work item is
not pending or running on any CPU on return, so there's no reason to
use the sync flushes at all and they're going away.

This patch doesn't make any functional difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Mattia Dongili <malattia@linux.it>
Cc: Kent Yoder <key@linux.vnet.ibm.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Bryan Wu <bryan.wu@canonical.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-wireless@vger.kernel.org
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: Sangbeom Kim <sbkim73@samsung.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Petr Vandrovec <petr@vandrovec.name>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Avi Kivity <avi@redhat.com>


# c7561cd8 14-Aug-2012 Takashi Iwai <tiwai@suse.de>

ALSA: PCI: Replace CONFIG_PM with CONFIG_PM_SLEEP

Otherwise we may get compile warnings due to unused functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 68cb2b55 02-Jul-2012 Takashi Iwai <tiwai@suse.de>

ALSA: Convert to new pm_ops for PCI drivers

Straightforward conversion to the new pm_ops from the legacy
suspend/resume ops.

Since we change vx222, vx_core and vxpocket have to be converted,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# da155d5b 14-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

sound: Add module.h to the previously silent sound users

Lots of sound drivers were getting module.h via the implicit presence
of it in <linux/device.h> but we are going to clean that up. So
fix up those users now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# dba8b469 13-Sep-2011 Clemens Ladisch <clemens@ladisch.de>

ALSA: mpu401: clean up interrupt specification

The semantics of snd_mpu401_uart_new()'s interrupt parameters are
somewhat counterintuitive: To prevent the function from allocating its
own interrupt, either the irq number must be invalid, or the irq_flags
parameter must be zero. At the same time, the irq parameter being
invalid specifies that the mpu401 code has to work without an interrupt
allocated by the caller. This implies that, if there is an interrupt
and it is allocated by the caller, the irq parameter must be set to
a valid-looking number which then isn't actually used.

With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value,
which forces us to handle the parameters differently.

This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the
device interrupt is handled by the caller, and makes the allocation of
the interrupt to depend only on the irq parameter. As suggested by
Takashi, the irq_flags parameter was dropped because, when used, it had
the constant value IRQF_DISABLED.

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


# 934c2b6d 10-Jun-2011 Takashi Iwai <tiwai@suse.de>

ALSA: use KBUILD_MODNAME for request_irq argument in sound/pci/*

The name argument of request_irq() appears in /proc/interrupts, and
it's quite ugly when the name entry contains a space or special letters.
In general, it's simpler and more readable when the module name appears
there, so let's replace all entries with KBUILD_MODNAME.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

ALSA: oxygen: do not show chip revision in card longname

Apparently, the revision is 2 on all sold sound cards, so this
information is not actually useful.

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


# 5b8bf2a5 10-Jan-2011 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: simplify model-specific MCLK handling

Replace the get_i2s_mclk callback with tables of MCLK values. This
simplifies the MCLK-handling code in both the framework and the model-
specific drivers.

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


# 5b84ba26 11-Dec-2010 Tejun Heo <tj@kernel.org>

sound: don't use flush_scheduled_work()

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>


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

ALSA: oxygen: show correct package ID

Instead of the hardcoded "CMI8788", show the actual chip name.

Note: This is neither what the chip is (it's always the same),
nor what the chip is actually called.

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


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

ALSA: oxygen: allow to dump codec registers

To help with debugging, add the registers of the model-specific
codecs to the controller and AC97 register dump in the proc file.

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


# 31f86bac 02-Nov-2010 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: add Kuroutoshikou CMI8787-HG2PCI support

Add support for the Kuroutoshikou CMI8787-HG2PCI sound card.

[replaced non-latin letters in the patch by tiwai]

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


# ebebeece 06-Oct-2010 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: add PEX8111 initialization

Configure the PEX8111 bridge on the PCI Express cards so that the audio
DMA controller can do proper burst reads and is less likely to lose
data. This is usually done automatically, but is required on older
cards where the user has not applied the PLX firmware update.

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


# 7cb4ced5 06-Oct-2010 Clemens Ladisch <clemens@ladisch.de>

ALSA: oxygen: rewrite PCIe bridge initialization

Change the PCIe/PCI bridge initialization code to configure only the
bridge that is actually connected to the sound chip, instead of any
bridge found in the system. The new code also makes it easier to add
other bridges.

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


# 4c25b932 07-Sep-2010 Clemens Ladisch <clemens@ladisch.de>

ALSA: virtuoso: work around missing reset in the Xonar DS Windows driver

For the WM8776 chip, this driver uses a different sample format and
more features than the Windows driver. When rebooting from Linux into
Windows, the latter driver does not reset the chip but assumes all its
registers have their default settings, so we get garbled sound or, if
the output happened to be muted before rebooting, no sound.

To make that driver happy, hook our driver's cleanup function into the
shutdown notifier and ensure that the chip gets reset.

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


# 5a0e3ad6 24-Mar-2010 Tejun Heo <tj@kernel.org>

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>


# 362bc24d 28-Sep-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: fix for PI7C9X110 compatibility

If the card is used with a Pericom PI7C9X110 PCI-E/PCI bridge,
reconfigure the latter's PCI buffering to fix an unknown problem.

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


# 87b61902 28-Sep-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: do not try to restore nonexistent EEPROM

On cards where the EEPROM was deliberately omitted, we do not need to
try to restore the EEPROM's contents.

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


# 92653453 02-Sep-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: handle cards with missing EEPROM

The card model detection code introduced in 2.6.30 that tries to work
around partially broken EEPROM contents by reading the EEPROM directly
does not handle cards where the EEPROM has been omitted. In this case,
we have to use the default ID to allow the driver to load.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Reported-and-tested-by: Ozan Çağlayan <ozan@pardus.org.tr>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 82af308f 27-Feb-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: zero-initialize model data

Model drivers assume that model_data is zeroed, so we better use
kzalloc() (like we did before when it was allocated together with the
card structure).

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


# 1275d6f6 19-Feb-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: automatically restore overwritten EEPROM

If the EEPROM was partially overwritten (which seems to happen before the OS is
booted), restore its entire contents by deducing it from the remaining
information.

This does not have any effect on the Linux driver, which works even with
incomplete information in the EEPROM, but it makes other drivers work again.

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


# 30459d7b 19-Feb-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: handle cards with broken EEPROM

Under as yet unknown circumstances, the first word of the sound card's
EEPROM gets overwritten. When this has happened, we cannot rely on the
subsystem IDs that the kernel reads from the PCI configuration
registers. Instead, we read the IDs directly from the EEPROM and do the
ID matching manually.

Because the model-specific driver cannot determine the model before
calling oxygen_pci_probe(), that function now gets a get_model()
callback as parameter. The customizing of the model structure, which
was formerly done by the probe() callback, also has moved into
get_model().

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


# a69bb3c3 19-Feb-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: use static driver name

When allocating resources, use a fixed name instead of reading it from
the model structure. This allows us to allocate the resources before
the actual model is known.

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


# 6ed91157 19-Feb-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: allocate model_data dynamically

Allocate the model-specific data dynamically instead of including it in
the memory block of the card structure. This will allow us to determine
the actual model after the card creation.

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


# bb718588 19-Feb-2009 Clemens Ladisch <clemens@ladisch.de>

sound: oxygen: make the owner module a parameter of the probe function

Move the owner field out of the oxygen_model structure and make it
a parameter of oxygen_pci_probe(), because the actual owner module does
not depend on the card model. Furthermore, moving it out of the model
structure allows us to create the card structure before the actual model
is known.

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


# e58de7ba 28-Dec-2008 Takashi Iwai <tiwai@alsa3.local>

ALSA: Convert to snd_card_create() in sound/pci/*

Convert from snd_card_new() to the new snd_card_create() function
in sound/pci/*.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

ALSA: oxygen: add UART I/O functions

Add functions to allow model drivers to communicate with external chips
by doing I/O with the not-used-for-MIDI UART.

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


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

ALSA: oxygen: configure MIDI via device_config

To enable the MIDI port, model drivers must now set flags in
device_config, not only in misc_flags. This allows model drivers to
enable the UART without creating an ALSA MIDI device.

Signed-off-by: Clemens Ladisch <clemens@ladisch.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>


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

ALSA: oxygen: add probe callback

Add a probe callback to the model structure so that model-specific
drivers can refine their model detection before the card is initialized.

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>


# 4a4bc53b 13-May-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: add PM support

Add suspend/resume support.

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


# c1365007 13-May-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: add symbol for I/O space size

Remove another magic number - add a symbol for the size of the PCI I/O
range.

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


# d023dc0a 13-May-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] oxygen: fix version in MODULE_LICENSE

Adjust the MODULE_LICENSE strings to properly reflect the actual license.

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


# f000fd80 22-Apr-2008 Jeff Garzik <jgarzik@redhat.com>

[ALSA] Fix synchronize_irq() bugs, redundancies

free_irq() calls synchronize_irq() for you, so there is no need for
drivers to manually do the same thing (again). Thus, calls where
sync-irq immediately precedes free-irq can be simplified.

However, during this audit several bugs were noticed, where free-irq is
preceded by a "irq >= 0" check... but the sync-irq call is not covered
by the same check.

So, where sync-irq could not be eliminated completely, the missing check
was added.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

[ALSA] oxygen: mute by default

Initialize the playback volume controls as being muted and having
minimal volume.

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>


# 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>


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

[ALSA] oxygen: disable clock of unused I2S inputs

Disable the master clock outputs of any unused I2S inputs.

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


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

[ALSA] oxygen: move MIDI flag to model struct

Put the flag that enables the MIDI port into the model structure instead
of passing it as a separate parameter to oxygen_pci_probe().

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


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

[ALSA] oxygen: make SPI/2-wire configuration model-specific

Allow the model drivers to specify if the codec communication goes over
SPI or a 2-wire bus.

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>


# f007dc04 22-Feb-2008 Takashi Iwai <tiwai@suse.de>

[ALSA] oxygen - Fix section mismatch

Removed invalid __devinit and __devexit that are remaining after
split to a helper module.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


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

[ALSA] virtuoso: monitor external power on D2X

On the Xonar D2X, monitor the GPIO pin that indicates whether external
power is present.

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


# 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>


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

[ALSA] oxygen: use AC97 interrupt

After an AC97 register read or write, use the AC97 interrupt instead of
polling to wait for the access to be completed.

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>


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

[ALSA] oxygen: more initialization

Initialize more registers of the controller and the second AC97 codec.

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


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

[ALSA] oxygen: add 192 kHz SPDIF input support

Change the oxygen_spdif_input_bits_changed() function so that clock
changes on the SPDIF input are correctly detected. This means that
sample rates greater than 96 kHz are now supported.

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


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

[ALSA] oxygen: move model-specific data out of common header

Instead of having model-specific fields in the common struct oxygen, put
them into a private structure that is allocated together with the card
structure.

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>


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

[ALSA] oxygen: remove MIDI autodetection

The MIDI bit in the MISC register is set by default and cannot be used
to detect the presence of a MIDI port. Instead, add a parameter to the
oxygen_pci_probe() function so that model drivers can specify this.

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>


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

[ALSA] oxygen: add register definitions

Add more symbols for registers and register fields.

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


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

[ALSA] oxygen: make SPI configuration configurable

Add a field to the model structure so that it is possible to have a card
where the SPI outputs 4 and 5 are used for an EEPROM.

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>


# 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>