History log of /linux-master/sound/isa/ad1816a/ad1816a_lib.c
Revision Date Author Comments
# d6fb54e8 15-Jul-2021 Takashi Iwai <tiwai@suse.de>

ALSA: ad1816a: Allocate resources with device-managed APIs

This patch converts the resource management in ISA ad1816a 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-53-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 5ab6d660 08-Jun-2021 Takashi Iwai <tiwai@suse.de>

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>


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

ALSA: isa: Constify snd_kcontrol_new items

Most of snd_kcontrol_new definitions are read-only and passed as-is.
Let's declare them as const for further optimization.

There should be no functional changes by this patch.

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


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

ALSA: isa: 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-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# cb5b8358 01-Jan-2020 Julia Lawall <Julia.Lawall@inria.fr>

ALSA: ad1816a: constify copied structure

The snd_ad1816a_timer_table structure is only copied into
another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/1577864614-5543-2-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

ALSA: ad1816a: 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-40-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

ALSA: isa: 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-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

ALSA: ad1816a: 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-11-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1a59d1b8 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

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

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>


# 0b6a2c9c 31-Jan-2019 Takashi Iwai <tiwai@suse.de>

ALSA: isa: Avoid passing NULL to memory allocators

We used to pass NULL to memory allocators for ISA devices due to
historical reasons. But we prefer rather a proper device object to be
assigned, so let's fix it by replacing snd_dma_isa_data() call with
card->dev reference, and kill snd_dma_isa_data() definition.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 28394f0e 11-Jan-2019 Takashi Iwai <tiwai@suse.de>

ALSA: isa: 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>


# d63f33d3 25-Jul-2018 Takashi Iwai <tiwai@suse.de>

ALSA: ad1816a: Fix sparse warning wrt PCM format type

The PCM format type is with __bitwise, and it can't be converted from
integer implicitly. Instead of an ugly cast, declare the function
argument of snd_ad1816a_get_format() with the proper snd_pcm_format_t
type.

This fixes the sparse warning like:
sound/isa/ad1816a/ad1816a_lib.c:93:14: warning: restricted snd_pcm_format_t degrades to integer

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


# aec54654 17-Aug-2017 Bhumika Goyal <bhumirks@gmail.com>

ALSA: isa: make snd_pcm_hardware const

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

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


# 58a24fc1 11-Aug-2017 Arvind Yadav <arvind.yadav.cs@gmail.com>

ALSA: ad1816a: constify snd_pcm_ops structures

snd_pcm_ops are not supposed to change at runtime. All functions
working with snd_pcm_ops provided by <sound/pcm.h> work with
const snd_pcm_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 6cbbfe1c 28-Jan-2015 Takashi Iwai <tiwai@suse.de>

ALSA: Include linux/io.h instead of asm/io.h

Nowadays it's recommended. Replace all in a shot.

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


# 7f605418 01-Jan-2015 Lars-Peter Clausen <lars@metafoo.de>

ALSA: ad1816a: Remove always NULL parameters

snd_ad1816a_pcm() and snd_ad1816a_timer() take a pointer to a pointer of a
PCM/timer where if this parameter is provided the newly allocated object is
stored. All callers pass NULL though, so remove the parameter. This makes
the code a bit cleaner and shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1da0c477 20-Oct-2014 Takashi Iwai <tiwai@suse.de>

ALSA: ad1816a: 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>


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

ALSA: isa: 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>


# 6f0fa660 19-Aug-2012 Ondrej Zary <linux@rainbow-software.org>

ALSA: snd-ad1816a: Implement suspend/resume

Implement suspend/resume support for AD1816 chips.
Tested with Terratec SoundSystem Base-1.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# c86b6b45 19-Aug-2012 Ondrej Zary <linux@rainbow-software.org>

ALSA: snd-ad1816a: remove useless struct snd_card_ad1816a

struct snd_card_ad1816a is only set but the values are never used then.
Removing it allows struct snd_card's private_data to be used for
struct snd_ad1816a, simplifying the code.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 88e24c3a 22-Sep-2011 Yong Zhang <yong.zhang0@gmail.com>

sound: irq: Remove IRQF_DISABLED

Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
We run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).

So now this flag is a NOOP and can be removed.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 4c9f1d3e 05-Feb-2009 Takashi Iwai <tiwai@suse.de>

ALSA: isa/*: Add missing KERN_* prefix to printk

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


# a17ac45a 21-Jan-2009 Krzysztof Helt <krzysztof.h1@wp.pl>

ALSA: ad1816a: enable hardware timer

Enable hardware timer with 10 usec resolution.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 622207dc 08-Aug-2008 Takashi Iwai <tiwai@suse.de>

ALSA: Kill snd_assert() in sound/isa/*

Kill snd_assert() in sound/isa/*, 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>


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


# b83f346b 13-Aug-2007 Clemens Ladisch <clemens@ladisch.de>

[ALSA] remove incorrect usage of SNDRV_PCM_INFO_SYNC_START and snd_pcm_set_sync()

Set the SNDRV_PCM_INFO_SYNC_START flag and the substream's sync ID
(only) if the substream actually can be linked to another one.

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


# 0cb29ea0 29-Jan-2007 Takashi Iwai <tiwai@suse.de>

[ALSA] Add even more 'const' to everything related to TLV

Mark TLV data as 'const'
Signed-of-by: Philipp Matthias Hahn <pmhahn@pmhahn.de>

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


# 7d12e780 05-Oct-2006 David Howells <dhowells@redhat.com>

IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)


# 0e7febf1 22-Aug-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] Add dB scale information to ad1816a driver

Added the dB scale information to ad1816a driver.

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


# 65ca68b3 01-Jul-2006 Thomas Gleixner <tglx@linutronix.de>

[PATCH] irq-flags: sound: Use the new IRQF_ constants

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# d08a23e2 09-Feb-2006 Ken Arromdee <arromdee@rahul.net>

[ALSA] ad1816a - Fix PCM trigger direction

Modules: AD1816A driver

Fixed the bug of capture with Shark Predator ISA resulting in:
arecord: pcm_read:1196: read error: Input/output error

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


# 00a4e3d9 17-Nov-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Merge ad1816a-lib module to ad1816a

Modules: AD1816A driver

Merge ad1816a-lib module to ad1816.
There is no more reason to split.

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


# cbdd0dd1 17-Nov-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove xxx_t typedefs: ISA AD1816A

Modules: AD1816A driver

Remove xxx_t typedefs from the ISA AD1816A driver.

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


# c3e6f7d8 16-Nov-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove superfluous pcm_free callbacks

Remove superflous pcm_free callbacks.

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


# b1d5776d 10-Oct-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove vmalloc wrapper, kfree_nocheck()

- Remove vmalloc wrapper
- Add release_and_free_resource() to remove kfree_nocheck() from each driver
and simplify the code

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


# 9e76a76e 09-Sep-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Replace with kzalloc() - isa stuff

ES18xx driver,OPL3SA2 driver,AD1816A driver,AD1848 driver,CS4231 driver
ES1688 driver,GUS Library,Opti9xx drivers,EMU8000 driver
SB16/AWE driver,SB drivers
Replace kcalloc(1,..) with kzalloc().

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


# 5b8f7f73 03-Aug-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] ad1816a - Add clockfreq module option

Documentation,AD1816A driver
Added clockfreq module option for the card with a different clock frequency
than 33kHz.

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


# 1da177e4 16-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org>

Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!