History log of /linux-master/sound/pci/aw2/aw2-alsa.c
Revision Date Author Comments
# bf4067e8 11-Apr-2022 Takashi Iwai <tiwai@suse.de>

ALSA: aw2: 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() manually on the error
from the probe callback.

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


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

ALSA: aw2: Allocate resources with device-managed APIs

This patch converts the resource management in PCI aw2 driver with
devres as a clean up. Each manual resource management is converted
with the corresponding devres helper, and the card object release is
managed now via card->private_free instead of a lowlevel snd_device.

This should give no user-visible functional changes.

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


# 669f65ea 14-Jan-2021 Takashi Iwai <tiwai@suse.de>

ALSA: pci: Simplify with dma_set_mask_and_coherent()

Many PCI drivers still have two explicit calls of dma_set_mask() and
dma_set_coherent_mask().

Let's simplify with dma_set_mask_and_coherent().

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


# 4bdc0d67 06-Jan-2020 Christoph Hellwig <hch@lst.de>

remove ioremap_nocache and devm_ioremap_nocache

ioremap has provided non-cached semantics by default since the Linux 2.6
days, so remove the additional ioremap_nocache interface.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>


# efb0ad25 03-Jan-2020 Takashi Iwai <tiwai@suse.de>

ALSA: pci: Constify snd_device_ops definitions

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>


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

ALSA: aw2: 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.

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


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

ALSA: pci: Drop superfluous ioctl PCM ops

PCM core deals the empty ioctl field now as default(*).
Let's kill the redundant lines.

(*) commit fc033cbf6fb7 ("ALSA: pcm: Allow NULL ioctl ops")

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


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

ALSA: aw2: Use managed buffer allocation

Clean up the driver with the new managed buffer allocation API.
The hw_params and hw_free callbacks became superfluous and got
dropped.

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


# 6974f8ad 05-Nov-2019 Takashi Iwai <tiwai@suse.de>

ALSA: pci: Avoid non-standard macro usage

Pass the device pointer from the PCI pointer directly, instead of a
non-standard macro. The macro didn't give any better readability.

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


# 023b915e 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

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

Based on 1 normalized pattern(s):

driver 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 version 2 the [audiowerk2] [alsa]
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 the [audiowerk2] [alsa] driver if not
write to the free software foundation inc 51 franklin street fifth
floor boston ma 02110 1301 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

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

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081201.505559553@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5116b94a 04-Feb-2019 Takashi Iwai <tiwai@suse.de>

ALSA: pci: Drop superfluous PCM preallocation error checks

snd_pcm_lib_preallocate_pages() and co always succeed, so the error
check is simply redundant. Drop it.

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


# 343fd5056 12-Aug-2017 Bhumika Goyal <bhumirks@gmail.com>

ALSA: aw2: make snd_pcm_hardware const

Make these const as they are only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# f3b827e0 19-Feb-2017 Bhumika Goyal <bhumirks@gmail.com>

ALSA: pci: constify snd_kcontrol_new structures

Declare snd_kcontrol_new structures as const as they are only passed as
an argument to the function snd_ctl_new1. This argument is of type
const, so snd_kcontrol_new structures having the same property can be
made const too.
Done using Coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct snd_kcontrol_new i@p = {...};

@ok1@
identifier r1.i;
position p;
expression e1;
@@
snd_ctl_new1(&i@p,e1)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct snd_kcontrol_new i;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 6769e988 01-Sep-2016 Julia Lawall <Julia.Lawall@lip6.fr>

ALSA: constify snd_pcm_ops structures

Check for snd_pcm_ops structures that are only stored in the ops field of a
snd_soc_platform_driver structure or passed as the third argument to
snd_pcm_set_ops. The corresponding field or parameter is declared const,
so snd_pcm_ops structures that have this property can be declared as const
also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct snd_pcm_ops i@p = { ... };

@ok1@
identifier r.i;
struct snd_soc_platform_driver e;
position p;
@@
e.ops = &i@p;

@ok2@
identifier r.i;
expression e1, e2;
position p;
@@
snd_pcm_set_ops(e1, e2, &i@p)

@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
struct snd_pcm_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct snd_pcm_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 412b979c 15-Apr-2015 Quentin Lambert <lambert.quentin@gmail.com>

ALSA: remove deprecated use of pci api

Replace occurences of the pci api by appropriate call to the dma api.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr)

@deprecated@
idexpression id;
position p;
@@

(
pci_dma_supported@p ( id, ...)
|
pci_alloc_consistent@p ( id, ...)
)

@bad1@
idexpression id;
position deprecated.p;
@@
...when != &id->dev
when != pci_get_drvdata ( id )
when != pci_enable_device ( id )
(
pci_dma_supported@p ( id, ...)
|
pci_alloc_consistent@p ( id, ...)
)

@depends on !bad1@
idexpression id;
expression direction;
position deprecated.p;
@@

(
- pci_dma_supported@p ( id,
+ dma_supported ( &id->dev,
...
+ , GFP_ATOMIC
)
|
- pci_alloc_consistent@p ( id,
+ dma_alloc_coherent ( &id->dev,
...
+ , GFP_ATOMIC
)
)

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

ALSA: Deletion of checks before the function call "iounmap"

The iounmap() function performs also input parameter validation.
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>


# 4d765e48 20-Oct-2014 Takashi Iwai <tiwai@suse.de>

ALSA: aw2: Use snd_ctl_enum_info()

... and reduce the open codes. Also add missing const to the text array.

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


# 9baa3c34 08-Aug-2014 Benoit Taine <benoit.taine@lip6.fr>

PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use

We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
meet kernel coding style guidelines. This issue was reported by checkpatch.

A simplified version of the semantic patch that makes this change is as
follows (http://coccinelle.lip6.fr/):

// <smpl>

@@
identifier i;
declarer name DEFINE_PCI_DEVICE_TABLE;
initializer z;
@@

- DEFINE_PCI_DEVICE_TABLE(i)
+ const struct pci_device_id i[]
= z;

// </smpl>

[bhelgaas: add semantic patch]
Signed-off-by: Benoit Taine <benoit.taine@lip6.fr>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>


# 179bb7f1 25-Feb-2014 Takashi Iwai <tiwai@suse.de>

ALSA: aw2: Use standard printk helpers

Convert with dev_err() and co from snd_printk(), etc.
A couple of prints are difficult to convert with dev_err() so they are
converted to pr_err() at least.

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>


# e23e7a14 05-Dec-2012 Bill Pemberton <wfp5p@virginia.edu>

ALSA: pci: remove __dev* attributes

CONFIG_HOTPLUG is going away as an option. As result the __dev*
markings will be going away.

Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
and __devexit.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# e9f66d9b 23-Apr-2012 Takashi Iwai <tiwai@suse.de>

ALSA: pci: clean up using module_pci_driver()

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


# a67ff6a5 14-Dec-2011 Rusty Russell <rusty@rustcorp.com.au>

ALSA: module_param: make bool parameters really bool

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>


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


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


# 3733e424 10-Jun-2011 Takashi Iwai <tiwai@suse.de>

ALSA: Use KBUILD_MODNAME for pci_driver.name entries

The convention for pci_driver.name entry in kernel drivers seem to be
the module name or equivalent ones. But, so far, almost all PCI sound
drivers use more verbose name like "ABC Xyz (12)", and these are fairly
confusing when appearing as a file name.

This patch converts the all pci_driver.name entries in sound/pci/* to
use KBUILD_MODNAME for more unified appearance.

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


# 34329fae 21-May-2010 H Hartley Sweeten <hartleys@visionengravers.com>

ALSA: aw2-alsa.c: use pci_ids.h defines and fix checkpatch.pl noise

Use the VENDOR/DEVICE ids provided in pci_ids.h instead of creating
local ids of the same values.

Also, fix the following checkpatch.pl warnings:

WARNING: Use #include <linux/io.h> instead of <asm/io.h>
WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# cebe41d4 05-Feb-2010 Alexey Dobriyan <adobriyan@gmail.com>

sound: use DEFINE_PCI_DEVICE_TABLE

Use DEFINE_PCI_DEVICE_TABLE() to make PCI device ids go to
.devinit.rodata section, so they can be discarded in some cases,
and make them const.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 284901a9 06-Apr-2009 Yang Hongyang <yanghy@cn.fujitsu.com>

dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)

Replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)

Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# e8bf069c 22-Feb-2009 Anssi Hannula <anssi.hannula@gmail.com>

ALSA: aw2: do not grab every saa7146 based device

Audiowerk2 driver snd-aw2 is bound to any saa7146 device as it does not
check subsystem ids. Many DVB devices are saa7146 based, so aw2 driver
grabs them as well.

According to http://lkml.org/lkml/2008/10/15/311 aw2 devices have the
subsystem ids set to 0, the saa7146 default.

Fix conflicts with DVB devices by checking for subsystem ids = 0
specifically.

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
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>


# 44e05177 23-Jun-2008 Takashi Iwai <tiwai@suse.de>

ALSA: aw2 - Fix Oops at initialization

The irq handler may be called before the proper initialization of hardware.
Call snd_aw2_saa7146_setup() before the irq handler registration.

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


# 7a435674 02-Apr-2008 Clemens Ladisch <clemens@ladisch.de>

[ALSA] aw2: remove duplicate MODULE_LICENSE

"GPL 2" does not mean that there have to be two MODULE_LICENSE("GPL")
entries. ;-)

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


# 91e24faa 19-Mar-2008 Andrew Morton <akpm@linux-foundation.org>

[ALSA] sound/pci/aw2/aw2-alsa.c needs dma-mapping.h

sparc32:

sound/pci/aw2/aw2-alsa.c: In function 'snd_aw2_create':
sound/pci/aw2/aw2-alsa.c:282: error: 'DMA_32BIT_MASK' undeclared (first use in this function)
sound/pci/aw2/aw2-alsa.c:282: error: (Each undeclared identifier is reported only once
sound/pci/aw2/aw2-alsa.c:282: error: for each function it appears in.)

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 34b6757d 19-Feb-2008 Takashi Iwai <tiwai@suse.de>

[ALSA] aw2 - Add missing module parameters

Added the missing declarations for module parameters.

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


# 98f2a97f 19-Feb-2008 Cedric Bregardis <cedric.bregardis@free.fr>

[ALSA] Emagic Audiowerk 2 ALSA driver.

Signed-off-by: Cedric Bregardis <cedric.bregardis@free.fr>
Signed-off-by: Jean-Christian Hassler <jhassler@free.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>