History log of /linux-master/sound/drivers/dummy.c
Revision Date Author Comments
# d728eed4 07-Feb-2024 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: Replace with DEFINE_SIPMLE_DEV_PM_OPS()

Use the new DEFINE_SIMPLE_DEV_PM_OPS() instead of SIMPLE_DEV_PM_OPS()
for code-simplification. We need no longer CONFIG_PM_SLEEP ifdefs.
Just a cleanup, no functional changes.

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


# 526a19b3 15-Aug-2023 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: Convert to generic PCM copy ops

This patch converts the dummy driver code to use the new unified PCM
copy callback. As dummy driver doesn't do anything in the callback,
it's just a simple replacement.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230815190136.8987-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 446bc11f 12-Sep-2022 YJ Lee <yunjunlee@chromium.org>

ALSA: dummy: Add customizable volume min/max.

Add module parameters to support customized min/max volume leveling,
which will be useful to test devices with different volume granularity.

Signed-off-by: YJ Lee <yunjunlee@chromium.org>
Link: https://lore.kernel.org/r/20220912072945.760949-1-yunjunlee@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 7ae22bdf 12-Sep-2022 YJ Lee <yunjunlee@chromium.org>

ALSA: dummy: Fix trailing whitespaces.

Fix checkpatch.pl ERROR: trailing whitespaces.

Signed-off-by: YJ Lee <yunjunlee@chromium.org>
Link: https://lore.kernel.org/r/20220912072854.760824-1-yunjunlee@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

ALSA: dummy: Allocate resources with device-managed APIs

Use the new snd_devm_card_new() for the card object allocation, and
clean up the superfluous remove callback.

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


# 6417f031 16-Mar-2021 Leon Romanovsky <leon@kernel.org>

module: remove never implemented MODULE_SUPPORTED_DEVICE

MODULE_SUPPORTED_DEVICE was added in pre-git era and never was
implemented. We can safely remove it, because the kernel has grown
to have many more reliable mechanisms to determine if device is
supported or not.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 7095be6d 23-Dec-2020 Lars-Peter Clausen <lars@metafoo.de>

ALSA: dummy: Use DIV_ROUND_UP() instead of open-coding it

Use DIV_ROUND_UP() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-(((x) + (y) - 1) / (y))
+DIV_ROUND_UP(x, y)
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-7-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# c5f72ef1 06-Feb-2020 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: Use standard macros for fixing PCM format cast

Simplify the code with the new macros for PCM format type iterations.
This fixes the sparse warnings nicely:
sound/drivers/dummy.c:906:25: warning: restricted snd_pcm_format_t degrades to integer
sound/drivers/dummy.c:908:25: warning: incorrect type in argument 1 (different base types)
sound/drivers/dummy.c:908:25: expected restricted snd_pcm_format_t [usertype] format
sound/drivers/dummy.c:908:25: got int [assigned] i

No functional changes, just sparse warning fixes.

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


# 2acf25f1 01-Feb-2020 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: Fix PCM format loop in proc output

The loop termination for iterating over all formats should contain
SNDRV_PCM_FORMAT_LAST, not less than it.

Fixes: 9b151fec139d ("ALSA: dummy - Add debug proc file")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200201080530.22390-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# d64e7f7c 05-Jan-2020 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: More constifications

Apply const prefix to every possible place: mostly for declaring the
dummy hardware models.

Just for minor optimization and no functional changes.

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


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

ALSA: dummy: Constify snd_pcm_ops definitions

The snd_pcm_ops items defined in snd-dummy driver can be gracefully
declared as const. Let's mark them for further optimization.

There should be no functional changes by this patch.

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


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

ALSA: drivers: 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.
Constify snd_kcontrol_new items

There should be no functional changes by this patch.

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


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

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


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

ALSA: dummy: Use managed buffer allocation

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

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


# 8fd9da75 05-Nov-2019 Takashi Iwai <tiwai@suse.de>

ALSA: drivers: Remove superfluous snd_dma_continuous_data()

The recent change (commit 08422d2c559d: "ALSA: memalloc: Allow NULL
device for SNDRV_DMA_TYPE_CONTINUOUS type") made the PCM preallocation
helper accepting NULL as the device pointer for the default usage.
Drop the snd_dma_continuous_data() usage that became superfluous from
the callers.

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


# 815d808c 04-Feb-2019 Takashi Iwai <tiwai@suse.de>

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


# 3c40dfeb 11-Jan-2019 Takashi Iwai <tiwai@suse.de>

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


# 6a73cf46 23-May-2018 Joe Perches <joe@perches.com>

sound: Use octal not symbolic permissions

Convert the S_<FOO> symbolic permissions to their octal equivalents as
using octal and not symbolic permissions is preferred by many as more
readable.

see: https://lkml.org/lkml/2016/8/2/1945

Done with automated conversion via:
$ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace <files...>

Miscellanea:

o Wrapped one multi-line call to a single line

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b03bbbe0 21-Dec-2017 Thomas Gleixner <tglx@linutronix.de>

ALSA/dummy: Replace tasklet with softirq hrtimer

The tasklet is used to defer the execution of snd_pcm_period_elapsed() to
the softirq context. Using the HRTIMER_MODE_SOFT mode invokes the timer
callback in softirq context as well which renders the tasklet useless.

[o-takashi: avoid stall due to a call of hrtimer_cancel() on a callback of hrtimer]

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: alsa-devel@alsa-project.org
Cc: keescook@chromium.org
Link: http://lkml.kernel.org/r/20171221104205.7269-35-anna-maria@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>


# a4a1b737 26-Nov-2017 Colin Ian King <colin.king@canonical.com>

ALSA: drivers: make array 'names' const, reduces object code size

Don't populate array 'names' on the stack but instead make them static.
Makes the object code smaller by 50 bytes:

Before:
text data bss dec hex filename
21237 9192 1120 31549 7b3d linux/sound/drivers/dummy.o

After:
text data bss dec hex filename
21095 9280 1120 31495 7b07 linux/sound/drivers/dummy.o

(gcc version 7.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# bc47ba90 24-Oct-2017 Kees Cook <keescook@chromium.org>

ALSA: drivers: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

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


# d53611d2 10-May-2017 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: Convert to new PCM copy ops

It's a dummy ops, so just replacing it.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# d5dbbe65 24-Jun-2016 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: Fix a use-after-free at closing

syzkaller fuzzer spotted a potential use-after-free case in snd-dummy
driver when hrtimer is used as backend:
> ==================================================================
> BUG: KASAN: use-after-free in rb_erase+0x1b17/0x2010 at addr ffff88005e5b6f68
> Read of size 8 by task syz-executor/8984
> =============================================================================
> BUG kmalloc-192 (Not tainted): kasan: bad access detected
> -----------------------------------------------------------------------------
>
> Disabling lock debugging due to kernel taint
> INFO: Allocated in 0xbbbbbbbbbbbbbbbb age=18446705582212484632
> ....
> [< none >] dummy_hrtimer_create+0x49/0x1a0 sound/drivers/dummy.c:464
> ....
> INFO: Freed in 0xfffd8e09 age=18446705496313138713 cpu=2164287125 pid=-1
> [< none >] dummy_hrtimer_free+0x68/0x80 sound/drivers/dummy.c:481
> ....
> Call Trace:
> [<ffffffff8179e59e>] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:333
> [< inline >] rb_set_parent include/linux/rbtree_augmented.h:111
> [< inline >] __rb_erase_augmented include/linux/rbtree_augmented.h:218
> [<ffffffff82ca5787>] rb_erase+0x1b17/0x2010 lib/rbtree.c:427
> [<ffffffff82cb02e8>] timerqueue_del+0x78/0x170 lib/timerqueue.c:86
> [<ffffffff814d0c80>] __remove_hrtimer+0x90/0x220 kernel/time/hrtimer.c:903
> [< inline >] remove_hrtimer kernel/time/hrtimer.c:945
> [<ffffffff814d23da>] hrtimer_try_to_cancel+0x22a/0x570 kernel/time/hrtimer.c:1046
> [<ffffffff814d2742>] hrtimer_cancel+0x22/0x40 kernel/time/hrtimer.c:1066
> [<ffffffff85420531>] dummy_hrtimer_stop+0x91/0xb0 sound/drivers/dummy.c:417
> [<ffffffff854228bf>] dummy_pcm_trigger+0x17f/0x1e0 sound/drivers/dummy.c:507
> [<ffffffff85392170>] snd_pcm_do_stop+0x160/0x1b0 sound/core/pcm_native.c:1106
> [<ffffffff85391b26>] snd_pcm_action_single+0x76/0x120 sound/core/pcm_native.c:956
> [<ffffffff85391e01>] snd_pcm_action+0x231/0x290 sound/core/pcm_native.c:974
> [< inline >] snd_pcm_stop sound/core/pcm_native.c:1139
> [<ffffffff8539754d>] snd_pcm_drop+0x12d/0x1d0 sound/core/pcm_native.c:1784
> [<ffffffff8539d3be>] snd_pcm_common_ioctl1+0xfae/0x2150 sound/core/pcm_native.c:2805
> [<ffffffff8539ee91>] snd_pcm_capture_ioctl1+0x2a1/0x5e0 sound/core/pcm_native.c:2976
> [<ffffffff8539f2ec>] snd_pcm_kernel_ioctl+0x11c/0x160 sound/core/pcm_native.c:3020
> [<ffffffff853d9a44>] snd_pcm_oss_sync+0x3a4/0xa30 sound/core/oss/pcm_oss.c:1693
> [<ffffffff853da27d>] snd_pcm_oss_release+0x1ad/0x280 sound/core/oss/pcm_oss.c:2483
> .....

A workaround is to call hrtimer_cancel() in dummy_hrtimer_sync() which
is called certainly before other blocking ops.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# ddce57a6 02-Feb-2016 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: Implement timer backend switching more safely

Currently the selected timer backend is referred at any moment from
the running PCM callbacks. When the backend is switched, it's
possible to lead to inconsistency from the running backend. This was
pointed by syzkaller fuzzer, and the commit [7ee96216c31a: ALSA:
dummy: Disable switching timer backend via sysfs] disabled the dynamic
switching for avoiding the crash.

This patch improves the handling of timer backend switching. It keeps
the reference to the selected backend during the whole operation of an
opened stream so that it won't be changed by other streams.

Together with this change, the hrtimer parameter is reenabled as
writable now.

NOTE: this patch also turned out to fix the still remaining race.
Namely, ops was still replaced dynamically at dummy_pcm_open:

static int dummy_pcm_open(struct snd_pcm_substream *substream)
{
....
dummy->timer_ops = &dummy_systimer_ops;
if (hrtimer)
dummy->timer_ops = &dummy_hrtimer_ops;

Since dummy->timer_ops is common among all streams, and when the
replacement happens during accesses of other streams, it may lead to a
crash. This was actually triggered by syzkaller fuzzer and KASAN.

This patch rewrites the code not to use the ops shared by all streams
any longer, too.

BugLink: http://lkml.kernel.org/r/CACT4Y+aZ+xisrpuM6cOXbL21DuM0yVxPYXf4cD4Md9uw0C3dBQ@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 7ee96216 27-Jan-2016 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: Disable switching timer backend via sysfs

ALSA dummy driver can switch the timer backend between system timer
and hrtimer via its hrtimer module option. This can be also switched
dynamically via sysfs, but it may lead to a memory corruption when
switching is done while a PCM stream is running; the stream instance
for the newly switched timer method tries to access the memory that
was allocated by another timer method although the sizes differ.

As the simplest fix, this patch just disables the switch via sysfs by
dropping the writable bit.

BugLink: http://lkml.kernel.org/r/CACT4Y+ZGEeEBntHW5WHn2GoeE0G_kRrCmUh6=dWyy-wfzvuJLg@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# d8c5ed75 29-Dec-2015 Julia Lawall <Julia.Lawall@lip6.fr>

ALSA: dummy: constify dummy_timer_ops structures

The dummy_timer_ops structures are never modified, so declare them as
const.

Done with the help of Coccinelle.

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


# 129a4c9f 28-May-2015 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: Replace CONFIG_PROC_FS with CONFIG_SND_PROC_FS

Although there shouldn't be a problem in practice (the compiler should
handle well), it's better to follow to the new Kconfig.

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


# e4c28688 25-May-2015 Takashi Iwai <tiwai@suse.de>

ALSA: dummy: make local data static

Add missing prefix to make some local data static.

Spotted by sparse:
sound/drivers/dummy.c:159:20: warning: symbol 'model_emu10k1' was not declared. Should it be static?
sound/drivers/dummy.c:165:20: warning: symbol 'model_rme9652' was not declared. Should it be static?
....

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


# 2a52b6ee 19-Jan-2015 Roman Kollar <rkollar@mail.muni.cz>

ALSA: dummy: use setup_timer and mod_timer

Use setup_timer and mod_timer instead of structure assignments as it
is the preferred way to setup and set the timer.

Signed-off-by: Roman Kollar <rkollar@mail.muni.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 5d5638af 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

ALSA: drivers: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# 5872f3f6 28-Jan-2014 Takashi Iwai <tiwai@suse.de>

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


# b785a492 19-Jul-2013 Jingoo Han <jg1.han@samsung.com>

ALSA: replace strict_strto*() with kstrto*()

The usage of strict_strto*() is not preferred, because
strict_strto*() is obsolete. Thus, kstrto*() should be
used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


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

ALSA: Remove the rest of *_set_drvdata(NULL) calls

A few calls are still left in parport drivers after this commit, which
I'm not quite sure yet.

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


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

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


# 16e43467 19-Oct-2012 Clemens Ladisch <clemens@ladisch.de>

ALSA: dummy: allow disabling mixer controls

To make the testing of deactivated mixer controls easier (and for people
with common hardware, possible), add a control that deactivates some
other controls.

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


# d34e4e00 09-Aug-2012 Takashi Iwai <tiwai@suse.de>

ALSA: platform: Check CONFIG_PM_SLEEP instead of CONFIG_PM

When CONFIG_PM is set but CONFIG_PM_SLEEP is unset,
SIMPLE_DEV_PM_OPS() ignores the given functions, and this leads to
compile warnings.

For avoiding this, simply check CONFIG_PM_SLEEP instead of CONFIG_PM.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 284e7ca7 02-Jul-2012 Takashi Iwai <tiwai@suse.de>

ALSA: convert PM ops of platform_driver to new pm ops

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


# 8bf01d8a 02-Jul-2012 Takashi Iwai <tiwai@suse.de>

ALSA: Add missing .owner=THIS_MODULE to platform_driver definitions

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>


# 65a77217 15-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

sound: fix drivers needing module.h not moduleparam.h

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>


# d5e1ca05 02-Feb-2010 Jaroslav Kysela <perex@perex.cz>

ALSA: dummy driver - add model parameter

This is a cleanup for the dummy driver. The model kernel module parameter
is introduced to select the soundcard emulation.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 23aebca4 02-Nov-2009 Takashi Iwai <tiwai@suse.de>

ALSA: dummy - Fix descriptions of pcm_substreams parameter

Now up to 128 substreams are supported.

Reported-by: Adrian Bridgett <adrian@smop.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 4b3be6af 17-Oct-2009 Julia Lawall <julia@diku.dk>

ALSA: sound: Move dereference after NULL test and drop unnecessary NULL tests

In pcm.c, if the NULL test on pcm is needed, then the dereference should be
after the NULL test.

In dummy.c and ali5451.c, the context of the calls to
snd_card_dummy_new_mixer and snd_ali_free_voice show that dummy and pvoice,
respectively cannot be NULL.

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

// <smpl>
@match exists@
expression x, E;
identifier fld;
@@

* x->fld
... when != \(x = E\|&x\)
* x == NULL
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# b888d1ce 08-Sep-2009 Takashi Iwai <tiwai@suse.de>

ALSA: dummy - Increase MAX_PCM_SUBSTREAMS to 128

Increase the limit of PCM substreams to 128. The default value is
unchanged; only the max accept value is increased.

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


# 9b151fec 08-Sep-2009 Takashi Iwai <tiwai@suse.de>

ALSA: dummy - Add debug proc file

Added the debug proc file to see or change the snd_pcm_hardware fields
to emulate. The parameters can be changed by writing to a proc file like:

# echo periods_min 4 > /proc/asound/card1/dummy_pcm

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


# a68c4d11 03-Sep-2009 Takashi Iwai <tiwai@suse.de>

ALSA: dummy - Fake buffer allocations

Instead of allocating the real buffers, use a fake buffer and ignore
read/write in the dummy driver so that we can save the resources.
For mmap, a single page (unique to the direction, though) is reused
to all buffers.

When the app requires to read/write the real buffers, pass fake_buffer=0
module option at loading time. This will get back to the old behavior.

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


# b5d10781 04-Sep-2009 Takashi Iwai <tiwai@suse.de>

ALSA: dummy - Fix the timer calculation in systimer mode

Fix the expire-time calculation in the systimer mode when the buffer
size isn't aligned to the period size.

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


# b142037b 03-Sep-2009 Takashi Iwai <tiwai@suse.de>

ALSA: dummy - Better jiffies handling

In the system-timer mode, snd-dummy driver issues each tick to update
the position. This is highly inefficient and even inaccurate if the
timer can't be triggered at each tick.

Now rewritten to wake up only at the period boundary. The position
is calculated from the current jiffies.

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


# c631d03c 03-Sep-2009 Takashi Iwai <tiwai@suse.de>

ALSA: dummy - Support high-res timer mode

Allow snd-dummy driver to use high-res timer as its timing source
instead of the system timer. The new module option "hrtimer" is added
to turn on/off the high-res timer support. It can be switched even
dynamically via sysfs.

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


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

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

Convert from snd_card_new() to the new snd_card_create() function
in other sound subdirectories.

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


# e78521f3 19-Oct-2008 Mariusz Kozlowski <m.kozlowski@tuxland.pl>

ALSA: misc typo fixes

Fixed typos in disabled codes via #if 0.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1a11cb64 14-Aug-2008 Jaroslav Kysela <perex@perex.cz>

ALSA: dummy driver - do not use assignment in if condition

checkpatch.pl does not like assignment in if condition

Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 54e8e21e 15-Aug-2008 Daniel THOMPSON <daniel.thompson@st.com>

sound: Fix esoteric double free in the dummy sound driver.

The dummy driver uses runtime->private_free but still frees
its pcm structures on error paths.

This is esoteric because the error paths in question are
unreachable. Thus the bug is only a problem when someone
copies this code into other drivers.

Signed-off-by: Daniel R Thompson <daniel.thompson@st.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 5e246b85 08-Aug-2008 Takashi Iwai <tiwai@suse.de>

ALSA: Kill snd_assert() in other places

Kill snd_assert() in other places, 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>


# 369b240d 16-Apr-2008 Roel Kluin <12o3l@tiscali.nl>

[ALSA] sound/drivers/dummy.c: fix negative snd_pcm_format_width() check

bps is unsigned, a negative snd_pcm_format_width() return value is not noticed

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 470f23b8 27-Feb-2008 Ahmet İnan <ainan at>

[ALSA] snd-dummy - better realtime app support

when the time interval for a period is smaller than kernel HZ, then
snd-aloop and snd-dummy cannot call snd_pcm_period_elapsed as fast enough
annymore. this happens for example with games. but the app still needs to
see, that the buffer actually did go further, which is provided by these
patches.

Signed-off-by: Ahmet İnan <ainan <at> mathematik.uni-freiburg.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 53463a83 20-Feb-2008 Ahmet İnan <ainan at>

[ALSA] snd-dummy - improved timing, silence on prepare

Signed-off-by: Ahmet İnan <ainan <at> mathematik.uni-freiburg.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


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


# c1017a4c 15-Oct-2007 Jaroslav Kysela <perex@perex.cz>

[ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz


Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# a5ce8890 23-Jul-2007 Takashi Iwai <tiwai@suse.de>

[ALSA] Clean up with common snd_ctl_boolean_*_info callbacks

Clean up codes using the new common snd_ctl_boolean_*_info() callbacks.

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


# c12aad6e 24-Jun-2007 Randy Dunlap <randy.dunlap@oracle.com>

[ALSA] more section mismatches

Something about __init_or_module isn't working as expected (?).
CONFIG_HOTPLUG=y
CONFIG_MODULES=n
Fix shared init/exit code helper:
WARNING: sound/built-in.o(.exit.text+0x243): Section mismatch: reference to .init.text: (between 'alsa_card_mpu401_exit' and 'ac97_bus_exit')
WARNING: sound/built-in.o(.exit.text+0x21b): Section mismatch: reference to .init.text: (between 'alsa_card_dummy_exit' and 'alsa_card_serial_exit')

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# 788c6043 13-Feb-2007 Prarit Bhargava <prarit@redhat.com>

[ALSA] Fix __devinit and __devexit issues with sound drivers

Fix __devinit and __devexit issues with sound drivers.
Resolves MODPOST warnings similar to:
WARNING: sound/drivers/snd-dummy.o - Section mismatch: reference to .init.text:snd_dummy_probe from .data.rel.local between 'snd_dummy_driver' (at offset 0x0) and 'snd_dummy_controls'
WARNING: sound/drivers/snd-mtpav.o - Section mismatch: reference to .init.text:snd_mtpav_probe from .data.rel.local between 'snd_mtpav_driver' (at offset 0x0) and 'snd_mtpav_input'
WARNING: sound/drivers/snd-virmidi.o - Section mismatch: reference to .init.text:snd_virmidi_probe from .data.rel.local after 'snd_virmidi_driver' (at offset 0x0)

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.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>


# fb567a8e 23-Aug-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] Add dB scale information to dummy driver

Added the dB scale information to dummy driver.

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


# e05d6964 17-Aug-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] Fix some typos in snd-dummy driver

Fixed some typos in snd-dummy driver.

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


# 7152447d 12-Apr-2006 Rene Herman <rene.herman@keyaccess.nl>

[ALSA] unregister platform device again if probe was unsuccessful

This second one unregisters the platform device again when the probe is
unsuccesful for sound/drivers, sound/arm/sa11xx-uda1341.c and
sound/ppc/powermac.c. This gets them all.

Signed-off-by: Rene Herman <rene.herman@keyaccess.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# a182ee98 12-Apr-2006 Rene Herman <rene.herman@keyaccess.nl>

[ALSA] continue on IS_ERR from platform device registration

I previously only concerned myself with sound/isa. When I now checked
for more platform_device_register_simple() usages in ALSA I found a
couple more drivers that needed the same patches as already submitted
for all the ISA drivers.
This first one is the continue-on-iserr patch for sound/drivers. This
gets them all.

Signed-off-by: Rene Herman <rene.herman@keyaccess.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 8278ca8f 20-Feb-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] Fix check of enable module option

Fix the check of enable module option in probe of platform_device drivers.
It shouldn't break the loop but just ignore if enable[i] is false.

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


# 2ad5dd8d 03-Jan-2006 Jaroslav Kysela <perex@suse.cz>

[ALSA] dummy driver - added CA0106 emulation defines

Modules: Generic drivers

Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# f7a9275d 07-Dec-2005 Clemens Ladisch <clemens@ladisch.de>

[ALSA] unregister platform devices

Call platform_device_unregister() for all platform devices that we've
registered.

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


# b32425ac 18-Nov-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Fix possible races in timer callbacks

Fix possible races in timer callbacks.

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


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

[ALSA] dummy - Use platform_device

Modules: Generic drivers

Rewrite the probe/remove code using platform_device.
Added the suspend/resume support, too.

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


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

[ALSA] Remove xxx_t typedefs: Generic drivers

Modules: Generic drivers

Remove xxx_t typedefs from the generic drivers
(dummy, mtpav, serial-u16550 and virmidi).

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


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

[ALSA] snd-dummy - Code clean-up

Modules: Generic drivers

Clean up snd-dummy driver code.
- Make common PCM callbacks
- Simplify open callback
- Remove unnecessary irqsave in control callbacks

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


# 561b220a 09-Sep-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Replace with kzalloc() - others

Documentation,SA11xx UDA1341 driver,Generic drivers,MPU401 UART,OPL3
OPL4,Digigram VX core,I2C cs8427,I2C lib core,I2C tea6330t,L3 drivers
AK4114 receiver,AK4117 receiver,PDAudioCF driver,PPC PMAC driver
SPARC AMD7930 driver,SPARC cs4231 driver,Synth,Common EMU synth
USB generic driver,USB USX2Y
Replace kcalloc(1,..) with kzalloc().

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


# 16dab54b 05-Sep-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Add snd_card_set_generic_dev() call

ARM,SA11xx UDA1341 driver,Generic drivers,MPU401 UART,MIPS
MIPS AU1x00 driver,PPC,PPC PowerMac driver,SPARC,SPARC AMD7930 driver
SPARC cs4231 driver,SPARC DBRI driver
- Added snd_card_set_generic_dev() call.
- Added SND_GENERIC_DRIVER to Kconfig.
- Clean up the error path in probe if necessary.

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!