summaryrefslogtreecommitdiffstats
path: root/sound/core/sound.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6Linus Torvalds2008-07-141-1/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'bkl-removal' of git://git.lwn.net/linux-2.6: (146 commits) IB/umad: BKL is not needed for ib_umad_open() IB/uverbs: BKL is not needed for ib_uverbs_open() bf561-coreb: BKL unneeded for open() Call fasync() functions without the BKL snd/PCM: fasync BKL pushdown ipmi: fasync BKL pushdown ecryptfs: fasync BKL pushdown Bluetooth VHCI: fasync BKL pushdown tty_io: fasync BKL pushdown tun: fasync BKL pushdown i2o: fasync BKL pushdown mpt: fasync BKL pushdown Remove BKL from remote_llseek v2 Make FAT users happier by not deadlocking x86-mce: BKL pushdown vmwatchdog: BKL pushdown vmcp: BKL pushdown via-pmu: BKL pushdown uml-random: BKL pushdown uml-mmapper: BKL pushdown ...
| * Merge commit 'v2.6.26' into bkl-removalJonathan Corbet2008-07-141-5/+3
| |\
| * | sound: cdev lock_kernel() pushdownJonathan Corbet2008-06-201-1/+14
| | | | | | | | | | | | Signed-off-by: Jonathan Corbet <corbet@lwn.net>
* | | ALSA: remove CONFIG_KMOD from soundJohannes Berg2008-07-101-4/+4
| |/ |/| | | | | | | | | | | | | | | | | A bunch of things in alsa depend on CONFIG_KMOD, use CONFIG_MODULES instead where the dependency is needed at all. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* | SOUND: fix race in device_createGreg Kroah-Hartman2008-05-201-5/+3
|/ | | | | | | | | | | | | | | There is a race from when a device is created with device_create() and then the drvdata is set with a call to dev_set_drvdata() in which a sysfs file could be open, yet the drvdata will be NULL, causing all sorts of bad things to happen. This patch fixes the problem by using the new function, device_create_drvdata(). Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Dont touch fs_struct in driversJan Blunck2008-02-141-4/+0
| | | | | | | | | | | | | | | The sound drivers and the pnpbios core test for current->root != NULL. This test seems to be unnecessary since we always have rootfs mounted before initializing the drivers. Signed-off-by: Jan Blunck <jblunck@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Jaroslav Kysela <perex@suse.cz> Acked-by: Takashi Iwai <tiwai@suse.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [ALSA] Remove sound/driver.hTakashi Iwai2008-01-311-1/+0
| | | | | | | | | | | | 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>
* [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.czJaroslav Kysela2007-10-161-2/+2
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* [ALSA] sound: snd_register_device_for_dev fixMariusz Kozlowski2007-10-161-0/+8
| | | | | | | | | | | | | | | | | | | | | snd_register_device_for_dev() can oops when device_create() returns ERR_PTR(err). Scenario: preg->dev = device_create(...); /* fails */ if (preg->dev) /* contains ERR_PTR(err) */ dev_set_drvdata(preg->dev, private_data); and dev_set_drvdata() looks like this: static inline void dev_set_drvdata (struct device *dev, void *data) { dev->driver_data = data; <--- boom } This patch should prevent that. Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* unregister_chrdev(): ignore the return valueAkinobu Mita2007-07-191-2/+1
| | | | | | | | | | | unregister_chrdev() always returns 0. There is no need to check the return value. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [PATCH] mark struct file_operations const 9Arjan van de Ven2007-02-121-1/+1
| | | | | | | | | | | Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [ALSA] allow registering an alsa device with struct device pointerJohannes Berg2007-02-091-7/+8
| | | | | | | | | | This patch adds snd_register_device_for_dev taking a struct device pointer to link the new device to and makes snd_register_device a simple static inline wrapper around it. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [PATCH] ALSA: Fix sysfs breakageTakashi Iwai2007-01-291-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recent change for a new sysfs tree with card* object breaks the /sys/class/sound tree if CONFIG_SYSFS_DEPRECATED is enabled. The device in each entry doesn't point the correct device object: /sys/class/sound ... |-- pcmC0D0c | |-- dev | |-- device -> ../../../class/sound/card0 | |-- pcm_class | |-- power | | `-- wakeup | |-- subsystem -> ../../../class/sound | `-- uevent Also, this change breaks some drivers (like sound/arm/*) referring card->dev directly to obtain the device object for memory handling. This patch reverts the semantics of card->dev to the former version, which points to a real device object. The card* object is stored in a new card->card_dev field, instead. The device parent is chosen either card->dev or card->card_dev according to CONFIG_SYSFS_DEPRECATED to keep the tree compatibility. Also, card* isn't created if CONFIG_SYSFS_DEPRECATED is enabled. The reason of card* object is a root of all beloing devices, and it makes little sense if each sound device points to the real device object directly. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Monty Montgomery <xiphmont@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: convert sound core to use struct deviceGreg Kroah-Hartman2006-12-011-13/+9
| | | | | | | | | | | | | | | | | | | | Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. It also makes the struct sound_card to show up as a "real" device where all the different sound class devices are placed as childs and different card attribute files can hang off of. /sys/class/sound is still a flat directory, but the symlink targets of all devices belonging to the same card, point the the /sys/devices tree below the new card device object. Thanks to Kay for the updates to this patch. Signed-off-by: Kay Sievers <kay.sievers@novell.com> Acked-by: Jaroslav Kysela <perex@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [ALSA] Add pcm_class attribute to PCM sysfs entryTakashi Iwai2006-09-231-12/+44
| | | | | | | | | This patch adds a new attribute, pcm_class, to each PCM sysfs entry. It's useful to detect what kind of PCM stream is, for example, HAL can check whether it's a modem or not. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] Fix disconnection of proc interfaceTakashi Iwai2006-09-231-2/+1
| | | | | | | | | | - Add the linked list to each proc entry to enable a single-shot disconnection (unregister) - Deprecate snd_info_unregister(), use snd_info_free_entry() - Removed NULL checks of snd_info_free_entry() Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] remove unused snd_minor.name fieldClemens Ladisch2006-07-121-2/+1
| | | | | | | | Drop the snd_minor structure's name field that was just a helper for devfs device deregistration. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [PATCH] devfs: Remove devfs support from the sound subsystemGreg Kroah-Hartman2006-06-261-24/+0
| | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [ALSA] Remove zero-initialization of static variablesTakashi Iwai2006-06-221-1/+1
| | | | | | | Removed zero-initializations of static variables. A tiny optimization. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Fix rwlock around snd_iprintf() in sound coreTakashi Iwai2006-06-221-6/+1
| | | | | | | | | Fixed rwlock around snd_iprintf() in sound core part. Replaced with mutex. Also, make mutex and flags static variables with addition of snd_card_locked() function (just for sound.c). Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Remove unneeded read/write_size fields in proc text opsTakashi Iwai2006-06-221-1/+0
| | | | | | | Remove unneeded read/write_size fields in proc text ops. snd_info_set_text_ops() is fixed, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Clean up EXPORT_SYMBOL()s in snd moduleTakashi Iwai2006-06-221-88/+11
| | | | | | Move EXPORT_SYMBOL()s to places adjacent to functions/variables. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [PATCH] mark f_ops const in the inodeArjan van de Ven2006-03-281-2/+2
| | | | | | | | | | | Mark the f_ops members of inodes as const, as well as fix the ripple-through this causes by places that copy this f_ops and then "do stuff" with it. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [ALSA] sound/core/: fix 3 off-by-one errorsAdrian Bunk2006-03-221-2/+2
| | | | | | | | | Modules: ALSA Core This patch fixes three off-by-one errors found by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] semaphore -> mutex (core part)Ingo Molnar2006-03-221-11/+12
| | | | | | | | | | | Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Revert the nested-device patchTakashi Iwai2006-01-041-9/+2
| | | | | | | | | Modules: ALSA Core Revert the nested-device patch to keep the compatibility with the current HAL configuration. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Nest sound devicesClemens Ladisch2006-01-031-2/+9
| | | | | | | | Modules: ALSA Core Make the control device parent of all other ALSA devices of a card. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* [ALSA] Optimize for config without PROC_FSTakashi Iwai2006-01-031-0/+2
| | | | | | | | Modules: HWDEP Midlevel,ALSA Core,PCM Midlevel,Timer Midlevel Optimize the code when compiled without CONFIG_PROC_FS. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Fix a missing includeTakashi Iwai2006-01-031-0/+1
| | | | | | | | Modules: ALSA Core Fix missing include <linux/device.h> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] dynamic minors (6/6): increase maximum number of sound cardsClemens Ladisch2006-01-031-3/+3
| | | | | | | | | | | Modules: ALSA Core,Memalloc module,ALSA sequencer With dynamic minor numbers, we can increase the number of sound cards. This requires that the sequencer client numbers of some kernel drivers are allocated dynamically, too. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* [ALSA] dynamic minors (4/6): dynamic minor number allocationClemens Ladisch2006-01-031-19/+46
| | | | | | | | Modules: ALSA Core,ALSA Minor Numbers Add an option to allocate device file minor numbers dynamically. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* [ALSA] dynamic minors (3/6): store device-specific object pointers dynamicallyClemens Ladisch2006-01-031-6/+40
| | | | | | | | | | Instead of storing the pointers to the device-specific structures in an array, put them into the struct snd_minor, and look them up dynamically. This makes the device type modules independent of the minor number encoding. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* [ALSA] dynamic minors (2/6): simplify storage of snd_minor structuresClemens Ladisch2006-01-031-44/+28
| | | | | | | | | | | Modules: ALSA Core Store the snd_minor structure pointers in one array instead of using a separate list for each card. This simplifies the mapping from device files to minor struct by removing the need to know about the encoding of the card number in the minor number. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* [ALSA] dynamic minors (1/6): store device type in struct snd_minorClemens Ladisch2006-01-031-7/+31
| | | | | | | | | | Instead of a comment string, store the device type in the snd_minor structure. This makes snd_minor more flexible, and has the nice side effect that we don't need anymore to create a separate snd_minor template for registering a device but can pass the file_operations directly to snd_register_device(). Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* [ALSA] Decentralize PM controlTakashi Iwai2006-01-031-22/+0
| | | | | | | | | | | Modules: ALSA Core,Control Midlevel,/oss/Makefile Remove the centralized PM control in the sound core. Each driver is responsible to get callbacks from bus/driver now. SND_GENERIC_DRIVER is removed together with this action. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Remove xxx_t typedefs: Core componentTakashi Iwai2006-01-031-16/+16
| | | | | | | | Modules: ALSA Core Remove xxx_t typedefs from the core component. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [DRIVER MODEL] Convert platform drivers to use struct platform_driverRussell King2005-11-091-4/+4
| | | | | | | | | This allows us to eliminate the casts in the drivers, and eventually remove the use of the device_driver function pointer methods for platform device drivers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
* [ALSA] clean up device types symbolsClemens Ladisch2005-11-041-2/+2
| | | | | | | | | | Modules: ALSA Core,ALSA Minor Numbers Remove the unused and undefined symbols SNDRV_DEVICE_TYPE_{MIXER, PCM_PLOOP,PCM_CLOOP}, and introduce a new symbol SNDRV_MINOR_GLOBAL for non-card-specific devices like the sequencer or the timer. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
* [ALSA] Remove kmalloc wrappersTakashi Iwai2005-11-041-14/+0
| | | | | | | | Modules: ALSA Core Remove kmalloc wrappers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Remove vmalloc wrapper, kfree_nocheck()Takashi Iwai2005-11-041-4/+1
| | | | | | | | - 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>
* [ALSA] Make snd_task_name() module localTakashi Iwai2005-11-041-1/+0
| | | | | | | | | Modules: ALSA Core,ALSA<-OSS emulation Remove a global function snd_task_name(), and move it local to snd-pcm-oss module. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [PATCH] Driver Core: fix up all callers of class_device_create()Greg Kroah-Hartman2005-10-281-1/+1
| | | | | | | | The previous patch adding the ability to nest struct class_device changed the paramaters to the call class_device_create(). This patch fixes up all in-kernel users of the function. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [ALSA] Introduce snd_card_set_generic_dev()Takashi Iwai2005-09-121-1/+14
| | | | | | | | | | ALSA Core A new function snd_card_set_generic_dev() is introduced to add the 'generic device' support for devices without proper bus on sysfs. It's a last resort, and should be removed in future when they have a proper bus, instead. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [PATCH] Kconfig fix (ISA_DMA_API and sound/*)Al Viro2005-08-231-1/+1
| | | | | | | | fixed kconfig dependencies on ISA_DMA_API for parts of sound/* that rely on it. Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] create a kstrdup library functionPaulo Marques2005-06-231-1/+1
| | | | | | | | | | | | | | | | This patch creates a new kstrdup library function and changes the "local" implementations in several places to use this function. Most of the changes come from the sound and net subsystems. The sound part had already been acknowledged by Takashi Iwai and the net part by David S. Miller. I left UML alone for now because I would need more time to read the code carefully before making changes there. Signed-off-by: Paulo Marques <pmarques@grupopie.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.gitJaroslav Kysela2005-06-211-3/+3
|\
| * [PATCH] class: convert sound/* to use the new class api instead of class_simplegregkh@suse.de2005-06-201-3/+3
| | | | | | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | [ALSA] sound/core/: possible cleanupsAdrian Bunk2005-05-291-1/+0
|/ | | | | | | | | | | PCM Midlevel,ALSA Core,Timer Midlevel,ALSA sequencer,Virtual Midi This patch contains the following possible cleanups: - make needlessly global code static - #if 0 the following unused global functions - remove the following unneeded EXPORT_SYMBOL's Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Linux-2.6.12-rc2Linus Torvalds2005-04-161-0/+491
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!