Commit 5d999784 authored by Paul Mackerras's avatar Paul Mackerras

Merge samba.org:/stuff/paulus/kernel/linux-2.5

into samba.org:/stuff/paulus/kernel/for-linus-ppc
parents cf0841ac 8a82602e
...@@ -53,14 +53,9 @@ Module parameters ...@@ -53,14 +53,9 @@ Module parameters
for soundcards which are not installed in your system for soundcards which are not installed in your system
device_mode device_mode
- specifies permission mask for dynamic sound device filesystem - specifies permission mask for dynamic sound device filesystem
(available only when DEVFS is enabled)
- default value = 0666 - default value = 0666
- for example 'device_mode=0660' - for example 'device_mode=0660'
device_gid
- specifies GID number for dynamic sound device filesystem
- default value = 0 (root)
device_uid
- specifies UID number for dynamic sound device filesystem
- default value = 0 (root)
Module snd-pcm-oss Module snd-pcm-oss
...@@ -144,6 +139,7 @@ Module parameters ...@@ -144,6 +139,7 @@ Module parameters
Module for ALi M5451 PCI chip. Module for ALi M5451 PCI chip.
pcm_channels - Number of hardware channels assigned for PCM pcm_channels - Number of hardware channels assigned for PCM
spdif - Support SPDIF I/O (disabled by default)
Module supports autoprobe and multiple chips (max 8). Module supports autoprobe and multiple chips (max 8).
...@@ -846,6 +842,20 @@ Module parameters ...@@ -846,6 +842,20 @@ Module parameters
Module supports up to 8 cards. Module supports up to 8 cards.
Module snd-sscape
-----------------
Module for ENSONIQ SoundScape PnP cards.
port - Port # (PnP setup)
irq - IRQ # (PnP setup)
mpu_irq - MPU-401 IRQ # (PnP setup)
dma - DMA # (PnP setup)
Module supports up to 8 cards. ISA PnP must be enabled.
You need sscape_ctl tool in alsa-tools package for loading
the microcode.
Module snd-sun-amd7930 (on sparc only) Module snd-sun-amd7930 (on sparc only)
-------------------------------------- --------------------------------------
...@@ -945,19 +955,34 @@ Module parameters ...@@ -945,19 +955,34 @@ Module parameters
Module snd-via82xx Module snd-via82xx
------------------ ------------------
Module for AC'97 motherboards based on VIA 82C686A/686B, 8233 Module for AC'97 motherboards based on VIA 82C686A/686B, 8233,
(south) bridge. 8233A, 8233C, 8235 (south) bridge.
mpu_port - 0x300,0x310,0x320,0x330, otherwise obtain BIOS setup mpu_port - 0x300,0x310,0x320,0x330, otherwise obtain BIOS setup
[VIA686A/686B only]
ac97_clock - AC'97 codec clock base (default 48000Hz) ac97_clock - AC'97 codec clock base (default 48000Hz)
dxs_support - support DXS channels,
0 = auto (default), 1 = enable, 2 = disable,
3 = 48k only
[VIA8233/C,8235 only]
Module supports autoprobe and multiple bus-master chips (max 8). Module supports autoprobe and multiple bus-master chips (max 8).
Note: on some SMP motherboards like MSI 694D the interrupts might Note: on some SMP motherboards like MSI 694D the interrupts might
not be generated properly. In such a case, please try to not be generated properly. In such a case, please try to
set the SMP (or MPS) version on BIOS to 1.1 instead of set the SMP (or MPS) version on BIOS to 1.1 instead of
default value 1.4. Then the interrupt number will be default value 1.4. Then the interrupt number will be
assigned under 15. You might also upgrade your BIOS. assigned under 15. You might also upgrade your BIOS.
Note: VIA8233/5 (not VIA8233A) can support DXS (direct sound)
channels as the first PCM. With this device, up to 4
streams can be played at the same time. If the playback on
this PCM is noisy, try to specify dxs_channels option to 2
or 3.
Note: for the MPU401 on VIA823x, use snd-mpu401 driver
additonally.
Module snd-virmidi Module snd-virmidi
------------------ ------------------
...@@ -969,6 +994,53 @@ Module parameters ...@@ -969,6 +994,53 @@ Module parameters
Module supports up to 8 cards. Module supports up to 8 cards.
Module snd-vx222
----------------
Module for Digigram VX-Pocket VX222, V222 v2 and Mic cards.
mic - Enable Microphone on V222 Mic (NYI)
Module supports up to 8 cards.
For loading the firmware, use vxloader utility in alsa-tools
package. You can load the firmware automatically by adding
the following to /etc/modules.conf
post-install snd-vx222 "/usr/bin/vxload"
Module snd-vxpocket
-------------------
Module for Digigram VX-Pocket VX2 PCMCIA card.
irq_mask - IRQ bitmask, specifies the available IRQs as bits
Module supports up to 8 cards. The module is compiled only when
PCMCIA is supported on kernel.
To activate the driver via the card manager, you'll need to set
up /etc/pcmcia/vxpocket.conf. See the sound/pcmcia/vx/vxpocket.c.
For loading the firmware, use vxloader utility in alsa-tools
package.
Module snd-vxp440
-----------------
Module for Digigram VX-Pocket 440 PCMCIA card.
irq_mask - IRQ bitmask, specifies the available IRQs as bits
Module supports up to 8 cards. The module is compiled only when
PCMCIA is supported on kernel.
To activate the driver via the card manager, you'll need to set
up /etc/pcmcia/vxp440.conf. See the sound/pcmcia/vx/vxp440.c.
For loading the firmware, use vxloader utility in alsa-tools
package.
Module snd-ymfpci Module snd-ymfpci
----------------- -----------------
......
...@@ -115,8 +115,7 @@ or ...@@ -115,8 +115,7 @@ or
% aplay -Dspdif foo.wav % aplay -Dspdif foo.wav
So far, only S16LE format is supported. Still no 24bit. Sorry, not 24bit format is also supported experimentally.
enough info for this.
The playback and capture over SPDIF use normal DAC and ADC, The playback and capture over SPDIF use normal DAC and ADC,
respectively, so you cannot playback both analog and digital streams respectively, so you cannot playback both analog and digital streams
......
...@@ -1538,11 +1538,12 @@ ...@@ -1538,11 +1538,12 @@
<informalexample> <informalexample>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
static void snd_mychip_interrupt(int irq, void *dev_id, static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id,
struct pt_regs *regs) struct pt_regs *regs)
{ {
mychip_t *chip = snd_magic_cast(mychip_t, dev_id, return); mychip_t *chip = snd_magic_cast(mychip_t, dev_id, return);
.... ....
return IRQ_HANDLED;
} }
]]> ]]>
</programlisting> </programlisting>
...@@ -3149,8 +3150,8 @@ struct _snd_pcm_runtime { ...@@ -3149,8 +3150,8 @@ struct _snd_pcm_runtime {
<title>Interrupt Handler Case #1</title> <title>Interrupt Handler Case #1</title>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
static void snd_mychip_interrupt(int irq, void *dev_id, static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id,
struct pt_regs *regs) struct pt_regs *regs)
{ {
mychip_t *chip = snd_magic_cast(mychip_t, dev_id, return); mychip_t *chip = snd_magic_cast(mychip_t, dev_id, return);
spin_lock(&chip->lock); spin_lock(&chip->lock);
...@@ -3160,9 +3161,11 @@ struct _snd_pcm_runtime { ...@@ -3160,9 +3161,11 @@ struct _snd_pcm_runtime {
spin_unlock(&chip->lock); spin_unlock(&chip->lock);
snd_pcm_period_elapsed(chip->substream); snd_pcm_period_elapsed(chip->substream);
spin_lock(&chip->lock); spin_lock(&chip->lock);
// acknowledge the interrupt if necessary
} }
.... ....
spin_unlock(&chip->lock); spin_unlock(&chip->lock);
return IRQ_HANDLED;
} }
]]> ]]>
</programlisting> </programlisting>
...@@ -3191,8 +3194,8 @@ struct _snd_pcm_runtime { ...@@ -3191,8 +3194,8 @@ struct _snd_pcm_runtime {
<title>Interrupt Handler Case #2</title> <title>Interrupt Handler Case #2</title>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
static void snd_mychip_interrupt(int irq, void *dev_id, static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id,
struct pt_regs *regs) struct pt_regs *regs)
{ {
mychip_t *chip = snd_magic_cast(mychip_t, dev_id, return); mychip_t *chip = snd_magic_cast(mychip_t, dev_id, return);
spin_lock(&chip->lock); spin_lock(&chip->lock);
...@@ -3221,9 +3224,11 @@ struct _snd_pcm_runtime { ...@@ -3221,9 +3224,11 @@ struct _snd_pcm_runtime {
snd_pcm_period_elapsed(substream); snd_pcm_period_elapsed(substream);
spin_lock(&chip->lock); spin_lock(&chip->lock);
} }
// acknowledge the interrupt if necessary
} }
.... ....
spin_unlock(&chip->lock); spin_unlock(&chip->lock);
return IRQ_HANDLED;
} }
]]> ]]>
</programlisting> </programlisting>
......
...@@ -249,7 +249,7 @@ control. In fact, the controls with "XXX [Playback|Capture] ...@@ -249,7 +249,7 @@ control. In fact, the controls with "XXX [Playback|Capture]
[Volume|Switch]" will be checked in addition. [Volume|Switch]" will be checked in addition.
The current assignment of these mixer elements is listed in the proc The current assignment of these mixer elements is listed in the proc
file, /proc/asound/cardX/mixer_oss, which will be like the following file, /proc/asound/cardX/oss_mixer, which will be like the following
VOLUME "Master" 0 VOLUME "Master" 0
BASS "" 0 BASS "" 0
...@@ -267,7 +267,7 @@ For changing the assignment, you can write the configuration to this ...@@ -267,7 +267,7 @@ For changing the assignment, you can write the configuration to this
proc file. For example, to map "Wave Playback" to the PCM volume, proc file. For example, to map "Wave Playback" to the PCM volume,
send the command like the following: send the command like the following:
% echo 'VOLUME "Wave Playback" 0' > /proc/asound/card0/mixer_oss % echo 'VOLUME "Wave Playback" 0' > /proc/asound/card0/oss_mixer
The command is exactly as same as listed in the proc file. You can The command is exactly as same as listed in the proc file. You can
change one or more elements, one volume per line. In the last change one or more elements, one volume per line. In the last
......
...@@ -2335,7 +2335,7 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio ...@@ -2335,7 +2335,7 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio
setup_driver_defaults(drive); setup_driver_defaults(drive);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
spin_lock(&drives_lock); spin_lock(&drives_lock);
list_add(&drive->list, &driver->drives); list_add_tail(&drive->list, &driver->drives);
spin_unlock(&drives_lock); spin_unlock(&drives_lock);
// printk(KERN_INFO "%s: attached %s driver.\n", drive->name, driver->name); // printk(KERN_INFO "%s: attached %s driver.\n", drive->name, driver->name);
if ((drive->autotune == IDE_TUNE_DEFAULT) || if ((drive->autotune == IDE_TUNE_DEFAULT) ||
......
...@@ -682,8 +682,10 @@ static int ppp_ioctl(struct inode *inode, struct file *file, ...@@ -682,8 +682,10 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
if (code == 0) if (code == 0)
break; break;
err = -EFAULT; err = -EFAULT;
if (copy_from_user(code, uprog.filter, len)) if (copy_from_user(code, uprog.filter, len)) {
kfree(code);
break; break;
}
err = sk_chk_filter(code, uprog.len); err = sk_chk_filter(code, uprog.len);
if (err) { if (err) {
kfree(code); kfree(code);
......
...@@ -44,7 +44,7 @@ struct xfrm_selector ...@@ -44,7 +44,7 @@ struct xfrm_selector
uid_t user; uid_t user;
}; };
#define XFRM_INF (~(u64)0) #define XFRM_INF (~(__u64)0)
struct xfrm_lifetime_cfg struct xfrm_lifetime_cfg
{ {
...@@ -164,7 +164,7 @@ struct xfrm_usersa_info { ...@@ -164,7 +164,7 @@ struct xfrm_usersa_info {
}; };
struct xfrm_usersa_id { struct xfrm_usersa_id {
xfrm_address_t saddr; xfrm_address_t daddr;
__u32 spi; __u32 spi;
__u16 family; __u16 family;
__u8 proto; __u8 proto;
......
...@@ -157,18 +157,18 @@ do { spin_lock_init(&((__sk)->lock.slock)); \ ...@@ -157,18 +157,18 @@ do { spin_lock_init(&((__sk)->lock.slock)); \
*/ */
struct sock { struct sock {
/* Begin of struct sock/struct tcp_tw_bucket shared layout */ /* Begin of struct sock/struct tcp_tw_bucket shared layout */
volatile unsigned char state, unsigned short family;
zapped; volatile unsigned char state;
unsigned char reuse; unsigned char reuse;
unsigned char shutdown;
int bound_dev_if; int bound_dev_if;
struct sock *next; struct sock *next;
struct sock **pprev; struct sock **pprev;
struct sock *bind_next; struct sock *bind_next;
struct sock **bind_pprev; struct sock **bind_pprev;
atomic_t refcnt; atomic_t refcnt;
unsigned short family;
/* End of struct sock/struct tcp_tw_bucket shared layout */ /* End of struct sock/struct tcp_tw_bucket shared layout */
volatile unsigned char zapped;
unsigned char shutdown;
unsigned char use_write_queue; unsigned char use_write_queue;
unsigned char userlocks; unsigned char userlocks;
socket_lock_t lock; socket_lock_t lock;
......
...@@ -169,10 +169,9 @@ struct tcp_tw_bucket { ...@@ -169,10 +169,9 @@ struct tcp_tw_bucket {
* XXX Yes I know this is gross, but I'd have to edit every single * XXX Yes I know this is gross, but I'd have to edit every single
* XXX networking file if I created a "struct sock_header". -DaveM * XXX networking file if I created a "struct sock_header". -DaveM
*/ */
volatile unsigned char state, /* Connection state */ unsigned short family;
substate; /* "zapped" -> "substate" */ volatile unsigned char state; /* Connection state */
unsigned char reuse; /* SO_REUSEADDR setting */ unsigned char reuse; /* SO_REUSEADDR setting */
unsigned char rcv_wscale; /* also TW bucket specific */
int bound_dev_if; int bound_dev_if;
/* Main hash linkage for various protocol lookup tables. */ /* Main hash linkage for various protocol lookup tables. */
struct sock *next; struct sock *next;
...@@ -180,8 +179,9 @@ struct tcp_tw_bucket { ...@@ -180,8 +179,9 @@ struct tcp_tw_bucket {
struct sock *bind_next; struct sock *bind_next;
struct sock **bind_pprev; struct sock **bind_pprev;
atomic_t refcnt; atomic_t refcnt;
unsigned short family;
/* End of struct sock/struct tcp_tw_bucket shared layout */ /* End of struct sock/struct tcp_tw_bucket shared layout */
volatile unsigned char substate;
unsigned char rcv_wscale;
__u16 sport; __u16 sport;
/* Socket demultiplex comparisons on incoming packets. */ /* Socket demultiplex comparisons on incoming packets. */
/* these five are in inet_opt */ /* these five are in inet_opt */
......
...@@ -293,6 +293,7 @@ struct _snd_ac97 { ...@@ -293,6 +293,7 @@ struct _snd_ac97 {
unsigned short codec_cfg[3]; // CODEC_CFG bits unsigned short codec_cfg[3]; // CODEC_CFG bits
struct semaphore mutex; struct semaphore mutex;
} ad18xx; } ad18xx;
unsigned int dev_flags; /* device specific */
} spec; } spec;
}; };
...@@ -329,7 +330,7 @@ void snd_ac97_suspend(ac97_t *ac97); ...@@ -329,7 +330,7 @@ void snd_ac97_suspend(ac97_t *ac97);
void snd_ac97_resume(ac97_t *ac97); void snd_ac97_resume(ac97_t *ac97);
#endif #endif
enum { AC97_TUNE_HP_ONLY, AC97_TUNE_SWAP_HP }; enum { AC97_TUNE_HP_ONLY, AC97_TUNE_SWAP_HP, AC97_TUNE_SWAP_SURROUND };
struct ac97_quirk { struct ac97_quirk {
unsigned short vendor; unsigned short vendor;
......
#ifndef __SOUND_AK4XXX_ADDA_H
#define __SOUND_AK4XXX_ADDA_H
/*
* ALSA driver for AK4524 / AK4528 / AK4529 / AK4355 / AK4381
* AD and DA converters
*
* Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz>
*
* 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
*
*/
#ifndef AK4XXX_MAX_CHIPS
#define AK4XXX_MAX_CHIPS 4
#endif
typedef struct snd_akm4xxx akm4xxx_t;
struct snd_ak4xxx_ops {
void (*lock)(akm4xxx_t *ak, int chip);
void (*unlock)(akm4xxx_t *ak, int chip);
void (*write)(akm4xxx_t *ak, int chip, unsigned char reg, unsigned char val);
// unsigned char (*read)(akm4xxx_t *ak, int chip, unsigned char reg);
void (*set_rate_val)(akm4xxx_t *ak, unsigned int rate);
};
struct snd_akm4xxx {
snd_card_t *card;
unsigned int num_adcs; /* AK4524 or AK4528 ADCs */
unsigned int num_dacs; /* AK4524 or AK4528 DACs */
unsigned char images[AK4XXX_MAX_CHIPS][16]; /* saved register image */
unsigned char ipga_gain[AK4XXX_MAX_CHIPS][2]; /* saved register image for IPGA (AK4528) */
unsigned long private_value[AK4XXX_MAX_CHIPS]; /* helper for driver */
void *private_data[AK4XXX_MAX_CHIPS]; /* helper for driver */
/* template should fill the following fields */
unsigned int idx_offset; /* control index offset */
enum {
SND_AK4524, SND_AK4528, SND_AK4529, SND_AK4355, SND_AK4381
} type;
struct snd_ak4xxx_ops ops;
};
void snd_akm4xxx_write(akm4xxx_t *ak, int chip, unsigned char reg, unsigned char val);
void snd_akm4xxx_reset(akm4xxx_t *ak, int state);
void snd_akm4xxx_init(akm4xxx_t *ak);
int snd_akm4xxx_build_controls(akm4xxx_t *ak);
#endif /* __SOUND_AK4XXX_ADDA_H */
...@@ -596,7 +596,7 @@ struct sndrv_seq_remove_events { ...@@ -596,7 +596,7 @@ struct sndrv_seq_remove_events {
#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */ #define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
/* other standards...*/ /* other standards...*/
#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device */ #define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */ #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */ #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
/*...*/ /*...*/
......
...@@ -184,7 +184,7 @@ static inline void snd_power_unlock(snd_card_t *card) ...@@ -184,7 +184,7 @@ static inline void snd_power_unlock(snd_card_t *card)
up(&card->power_lock); up(&card->power_lock);
} }
void snd_power_wait(snd_card_t *card); int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file);
static inline unsigned int snd_power_get_state(snd_card_t *card) static inline unsigned int snd_power_get_state(snd_card_t *card)
{ {
...@@ -199,7 +199,7 @@ static inline void snd_power_change_state(snd_card_t *card, unsigned int state) ...@@ -199,7 +199,7 @@ static inline void snd_power_change_state(snd_card_t *card, unsigned int state)
#else #else
#define snd_power_lock(card) do { (void)(card); } while (0) #define snd_power_lock(card) do { (void)(card); } while (0)
#define snd_power_unlock(card) do { (void)(card); } while (0) #define snd_power_unlock(card) do { (void)(card); } while (0)
#define snd_power_wait(card) do { (void)(card); } while (0) static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct file *file) { return 0; }
#define snd_power_get_state(card) SNDRV_CTL_POWER_D0 #define snd_power_get_state(card) SNDRV_CTL_POWER_D0
#define snd_power_change_state(card, state) do { (void)(card); } while (0) #define snd_power_change_state(card, state) do { (void)(card); } while (0)
#endif #endif
...@@ -211,8 +211,8 @@ struct _snd_minor { ...@@ -211,8 +211,8 @@ struct _snd_minor {
int number; /* minor number */ int number; /* minor number */
int device; /* device number */ int device; /* device number */
const char *comment; /* for /proc/asound/devices */ const char *comment; /* for /proc/asound/devices */
snd_info_entry_t *dev; /* for /proc/asound/dev */
struct file_operations *f_ops; /* file operations */ struct file_operations *f_ops; /* file operations */
char name[0]; /* device name (keep at the end of structure) */
}; };
typedef struct _snd_minor snd_minor_t; typedef struct _snd_minor snd_minor_t;
...@@ -240,12 +240,13 @@ int snd_minor_info_done(void); ...@@ -240,12 +240,13 @@ int snd_minor_info_done(void);
/* sound_oss.c */ /* sound_oss.c */
#ifdef CONFIG_SND_OSSEMUL #ifdef CONFIG_SND_OSSEMUL
int snd_minor_info_oss_init(void); int snd_minor_info_oss_init(void);
int snd_minor_info_oss_done(void); int snd_minor_info_oss_done(void);
int snd_oss_init_module(void); int snd_oss_init_module(void);
#else
#define snd_minor_info_oss_init() /*NOP*/
#define snd_minor_info_oss_done() /*NOP*/
#define snd_oss_init_module() /*NOP*/
#endif #endif
/* memory.c */ /* memory.c */
...@@ -268,6 +269,10 @@ void snd_hidden_vfree(void *obj); ...@@ -268,6 +269,10 @@ void snd_hidden_vfree(void *obj);
#define kfree_nocheck(obj) snd_wrapper_kfree(obj) #define kfree_nocheck(obj) snd_wrapper_kfree(obj)
#define vfree_nocheck(obj) snd_wrapper_vfree(obj) #define vfree_nocheck(obj) snd_wrapper_vfree(obj)
#else #else
#define snd_memory_init() /*NOP*/
#define snd_memory_done() /*NOP*/
#define snd_memory_info_init() /*NOP*/
#define snd_memory_info_done() /*NOP*/
#define kmalloc_nocheck(size, flags) kmalloc(size, flags) #define kmalloc_nocheck(size, flags) kmalloc(size, flags)
#define vmalloc_nocheck(size) vmalloc(size) #define vmalloc_nocheck(size) vmalloc(size)
#define kfree_nocheck(obj) kfree(obj) #define kfree_nocheck(obj) kfree(obj)
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#define CS8427_REG_UDATABUF 0x13 #define CS8427_REG_UDATABUF 0x13
#define CS8427_REG_QSUBCODE 0x14 /* 0x14-0x1d (10 bytes) */ #define CS8427_REG_QSUBCODE 0x14 /* 0x14-0x1d (10 bytes) */
#define CS8427_REG_OMCKRMCKRATIO 0x1e #define CS8427_REG_OMCKRMCKRATIO 0x1e
#define CS8427_REG_CORU_DATABUF 0x20 #define CS8427_REG_CORU_DATABUF 0x20 /* 24 byte buffer area */
#define CS8427_REG_ID_AND_VER 0x7f #define CS8427_REG_ID_AND_VER 0x7f
/* CS8427_REG_CONTROL1 bits */ /* CS8427_REG_CONTROL1 bits */
...@@ -188,6 +188,7 @@ ...@@ -188,6 +188,7 @@
int snd_cs8427_detect(snd_i2c_bus_t *bus, unsigned char addr); int snd_cs8427_detect(snd_i2c_bus_t *bus, unsigned char addr);
int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr, snd_i2c_device_t **r_cs8427); int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr, snd_i2c_device_t **r_cs8427);
void snd_cs8427_reset(snd_i2c_device_t *cs8427);
int snd_cs8427_iec958_build(snd_i2c_device_t *cs8427, snd_pcm_substream_t *playback_substream, snd_pcm_substream_t *capture_substream); int snd_cs8427_iec958_build(snd_i2c_device_t *cs8427, snd_pcm_substream_t *playback_substream, snd_pcm_substream_t *capture_substream);
int snd_cs8427_iec958_active(snd_i2c_device_t *cs8427, int active); int snd_cs8427_iec958_active(snd_i2c_device_t *cs8427, int active);
int snd_cs8427_iec958_pcm(snd_i2c_device_t *cs8427, unsigned int rate); int snd_cs8427_iec958_pcm(snd_i2c_device_t *cs8427, unsigned int rate);
......
...@@ -69,20 +69,15 @@ struct snd_info_entry_ops { ...@@ -69,20 +69,15 @@ struct snd_info_entry_ops {
struct vm_area_struct * vma); struct vm_area_struct * vma);
}; };
struct snd_info_entry_device {
unsigned short major;
unsigned short minor;
};
struct snd_info_entry { struct snd_info_entry {
const char *name; const char *name;
mode_t mode; mode_t mode;
long size; long size;
unsigned short content; unsigned short content;
unsigned short disconnected: 1;
union { union {
struct snd_info_entry_text text; struct snd_info_entry_text text;
struct snd_info_entry_ops *ops; struct snd_info_entry_ops *ops;
struct snd_info_entry_device device;
} c; } c;
snd_info_entry_t *parent; snd_info_entry_t *parent;
snd_card_t *card; snd_card_t *card;
......
...@@ -53,7 +53,7 @@ static const char __module_generic_string_##name [] \ ...@@ -53,7 +53,7 @@ static const char __module_generic_string_##name [] \
#define SNDRV_DEFAULT_STR { [0 ... (SNDRV_CARDS-1)] = NULL } #define SNDRV_DEFAULT_STR { [0 ... (SNDRV_CARDS-1)] = NULL }
#define SNDRV_DEFAULT_ENABLE { 1, [1 ... (SNDRV_CARDS-1)] = 0 } #define SNDRV_DEFAULT_ENABLE { 1, [1 ... (SNDRV_CARDS-1)] = 0 }
#define SNDRV_DEFAULT_ENABLE_PNP { [0 ... (SNDRV_CARDS-1)] = 1 } #define SNDRV_DEFAULT_ENABLE_PNP { [0 ... (SNDRV_CARDS-1)] = 1 }
#ifdef __ISAPNP__ #ifdef CONFIG_PNP
#define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE_PNP #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE_PNP
#else #else
#define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* *
*/ */
#include <linux/interrupt.h>
#include "rawmidi.h" #include "rawmidi.h"
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -50,8 +49,6 @@ ...@@ -50,8 +49,6 @@
#define MPU401_MODE_BIT_OUTPUT 1 #define MPU401_MODE_BIT_OUTPUT 1
#define MPU401_MODE_BIT_INPUT_TRIGGER 2 #define MPU401_MODE_BIT_INPUT_TRIGGER 2
#define MPU401_MODE_BIT_OUTPUT_TRIGGER 3 #define MPU401_MODE_BIT_OUTPUT_TRIGGER 3
#define MPU401_MODE_BIT_RX_LOOP 4
#define MPU401_MODE_BIT_TX_LOOP 5
#define MPU401_MODE_INPUT (1<<MPU401_MODE_BIT_INPUT) #define MPU401_MODE_INPUT (1<<MPU401_MODE_BIT_INPUT)
#define MPU401_MODE_OUTPUT (1<<MPU401_MODE_BIT_OUTPUT) #define MPU401_MODE_OUTPUT (1<<MPU401_MODE_BIT_OUTPUT)
...@@ -88,6 +85,9 @@ struct _snd_mpu401 { ...@@ -88,6 +85,9 @@ struct _snd_mpu401 {
spinlock_t input_lock; spinlock_t input_lock;
spinlock_t output_lock; spinlock_t output_lock;
spinlock_t timer_lock; spinlock_t timer_lock;
atomic_t rx_loop;
atomic_t tx_loop;
struct timer_list timer; struct timer_list timer;
......
#ifndef __SOUND_OPL4_H
#define __SOUND_OPL4_H
/*
* Global definitions for the OPL4 driver
* Copyright (c) 2003 by Clemens Ladisch <clemens@ladisch.de>
*
* 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
*/
#include <sound/opl3.h>
typedef struct opl4 opl4_t;
extern int snd_opl4_create(snd_card_t *card,
unsigned long fm_port, unsigned long pcm_port,
int seq_device,
opl3_t **opl3, opl4_t **opl4);
#endif /* __SOUND_OPL4_H */
...@@ -317,8 +317,8 @@ struct _snd_pcm_runtime { ...@@ -317,8 +317,8 @@ struct _snd_pcm_runtime {
snd_pcm_uframes_t silence_size; /* Silence filling size */ snd_pcm_uframes_t silence_size; /* Silence filling size */
snd_pcm_uframes_t boundary; /* pointers wrap point */ snd_pcm_uframes_t boundary; /* pointers wrap point */
snd_pcm_uframes_t silenced_start; snd_pcm_uframes_t silence_start; /* starting pointer to silence area */
snd_pcm_uframes_t silenced_size; snd_pcm_uframes_t silence_filled; /* size filled with silence */
snd_pcm_sync_id_t sync; /* hardware synchronization ID */ snd_pcm_sync_id_t sync; /* hardware synchronization ID */
...@@ -328,7 +328,6 @@ struct _snd_pcm_runtime { ...@@ -328,7 +328,6 @@ struct _snd_pcm_runtime {
atomic_t mmap_count; atomic_t mmap_count;
/* -- locking / scheduling -- */ /* -- locking / scheduling -- */
spinlock_t lock;
wait_queue_head_t sleep; wait_queue_head_t sleep;
struct timer_list tick_timer; struct timer_list tick_timer;
struct fasync_struct *fasync; struct fasync_struct *fasync;
...@@ -360,6 +359,11 @@ struct _snd_pcm_runtime { ...@@ -360,6 +359,11 @@ struct _snd_pcm_runtime {
#endif #endif
}; };
typedef struct _snd_pcm_group { /* keep linked substreams */
spinlock_t lock;
struct list_head substreams;
} snd_pcm_group_t;
struct _snd_pcm_substream { struct _snd_pcm_substream {
snd_pcm_t *pcm; snd_pcm_t *pcm;
snd_pcm_str_t *pstr; snd_pcm_str_t *pstr;
...@@ -383,8 +387,10 @@ struct _snd_pcm_substream { ...@@ -383,8 +387,10 @@ struct _snd_pcm_substream {
/* -- next substream -- */ /* -- next substream -- */
snd_pcm_substream_t *next; snd_pcm_substream_t *next;
/* -- linked substreams -- */ /* -- linked substreams -- */
snd_pcm_substream_t *link_next; struct list_head link_list; /* linked list member */
snd_pcm_substream_t *link_prev; snd_pcm_group_t self_group; /* fake group for non linked substream (with substream lock inside) */
snd_pcm_group_t *group; /* pointer to current group */
/* -- assigned files -- */
snd_pcm_file_t *file; snd_pcm_file_t *file;
struct file *ffile; struct file *ffile;
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
...@@ -468,6 +474,8 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree); ...@@ -468,6 +474,8 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree);
* Native I/O * Native I/O
*/ */
extern rwlock_t snd_pcm_link_rwlock;
int snd_pcm_info(snd_pcm_substream_t * substream, snd_pcm_info_t *info); int snd_pcm_info(snd_pcm_substream_t * substream, snd_pcm_info_t *info);
int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t *info); int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t *info);
int snd_pcm_status(snd_pcm_substream_t * substream, snd_pcm_status_t *status); int snd_pcm_status(snd_pcm_substream_t * substream, snd_pcm_status_t *status);
...@@ -568,6 +576,53 @@ static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem) ...@@ -568,6 +576,53 @@ static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)
* PCM library * PCM library
*/ */
static inline int snd_pcm_stream_linked(snd_pcm_substream_t *substream)
{
return substream->group != &substream->self_group;
}
static inline void snd_pcm_stream_lock(snd_pcm_substream_t *substream)
{
read_lock(&snd_pcm_link_rwlock);
spin_lock(&substream->self_group.lock);
}
static inline void snd_pcm_stream_unlock(snd_pcm_substream_t *substream)
{
spin_unlock(&substream->self_group.lock);
read_unlock(&snd_pcm_link_rwlock);
}
static inline void snd_pcm_stream_lock_irq(snd_pcm_substream_t *substream)
{
read_lock_irq(&snd_pcm_link_rwlock);
spin_lock(&substream->self_group.lock);
}
static inline void snd_pcm_stream_unlock_irq(snd_pcm_substream_t *substream)
{
spin_unlock(&substream->self_group.lock);
read_unlock_irq(&snd_pcm_link_rwlock);
}
#define snd_pcm_stream_lock_irqsave(substream, flags) \
do { \
read_lock_irqsave(&snd_pcm_link_rwlock, (flags)); \
spin_lock(&substream->self_group.lock); \
} while (0)
#define snd_pcm_stream_unlock_irqrestore(substream, flags) \
do { \
spin_unlock(&substream->self_group.lock); \
read_unlock_irqrestore(&snd_pcm_link_rwlock, (flags)); \
} while (0)
#define snd_pcm_group_for_each(pos, substream) \
list_for_each(pos, &substream->group->substreams)
#define snd_pcm_group_substream_entry(pos) \
list_entry(pos, snd_pcm_substream_t, link_list)
static inline int snd_pcm_running(snd_pcm_substream_t *substream) static inline int snd_pcm_running(snd_pcm_substream_t *substream)
{ {
return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING || return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING ||
......
...@@ -40,10 +40,11 @@ enum sb_hw_type { ...@@ -40,10 +40,11 @@ enum sb_hw_type {
SB_HW_DT019X, /* Diamond Tech. DT-019X / Avance Logic ALS-007 */ SB_HW_DT019X, /* Diamond Tech. DT-019X / Avance Logic ALS-007 */
}; };
#define SB_OPEN_PCM 0x01 #define SB_OPEN_PCM 0x01
#define SB_OPEN_MIDI_INPUT 0x02 #define SB_OPEN_MIDI_INPUT 0x02
#define SB_OPEN_MIDI_OUTPUT 0x04 #define SB_OPEN_MIDI_OUTPUT 0x04
#define SB_OPEN_MIDI_TRIGGER 0x08 #define SB_OPEN_MIDI_INPUT_TRIGGER 0x08
#define SB_OPEN_MIDI_OUTPUT_TRIGGER 0x10
#define SB_MODE_HALT 0x00 #define SB_MODE_HALT 0x00
#define SB_MODE_PLAYBACK_8 0x01 #define SB_MODE_PLAYBACK_8 0x01
...@@ -157,6 +158,7 @@ typedef struct _snd_sb sb_t; ...@@ -157,6 +158,7 @@ typedef struct _snd_sb sb_t;
#define SB_DSP_STEREO_16BIT 0xac #define SB_DSP_STEREO_16BIT 0xac
#define SB_DSP_MIDI_INPUT_IRQ 0x31 #define SB_DSP_MIDI_INPUT_IRQ 0x31
#define SB_DSP_MIDI_UART_IRQ 0x35
#define SB_DSP_MIDI_OUTPUT 0x38 #define SB_DSP_MIDI_OUTPUT 0x38
#define SB_DSP4_OUT8_AI 0xc6 #define SB_DSP4_OUT8_AI 0xc6
...@@ -295,13 +297,13 @@ int snd_sbmixer_new(sb_t *chip); ...@@ -295,13 +297,13 @@ int snd_sbmixer_new(sb_t *chip);
/* sb8_init.c */ /* sb8_init.c */
int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm); int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm);
/* sb8.c */ /* sb8.c */
void snd_sb8dsp_interrupt(sb_t *chip); irqreturn_t snd_sb8dsp_interrupt(sb_t *chip);
int snd_sb8_playback_open(snd_pcm_substream_t *substream); int snd_sb8_playback_open(snd_pcm_substream_t *substream);
int snd_sb8_capture_open(snd_pcm_substream_t *substream); int snd_sb8_capture_open(snd_pcm_substream_t *substream);
int snd_sb8_playback_close(snd_pcm_substream_t *substream); int snd_sb8_playback_close(snd_pcm_substream_t *substream);
int snd_sb8_capture_close(snd_pcm_substream_t *substream); int snd_sb8_capture_close(snd_pcm_substream_t *substream);
/* midi8.c */ /* midi8.c */
void snd_sb8dsp_midi_interrupt(sb_t *chip); irqreturn_t snd_sb8dsp_midi_interrupt(sb_t *chip);
int snd_sb8dsp_midi(sb_t *chip, int device, snd_rawmidi_t ** rrawmidi); int snd_sb8dsp_midi(sb_t *chip, int device, snd_rawmidi_t ** rrawmidi);
/* sb16_init.c */ /* sb16_init.c */
......
...@@ -193,6 +193,9 @@ static inline int _snd_magic_bad(void *obj, unsigned long magic) ...@@ -193,6 +193,9 @@ static inline int _snd_magic_bad(void *obj, unsigned long magic)
#define snd_usb_midi_in_endpoint_t_magic 0xa15a3f03 #define snd_usb_midi_in_endpoint_t_magic 0xa15a3f03
#define ak4117_t_magic 0xa15a4000 #define ak4117_t_magic 0xa15a4000
#define psic_t_magic 0xa15a4100 #define psic_t_magic 0xa15a4100
#define opl4_t_magic 0xa15a2602
#define vx_core_t_magic 0xa15a4110
#define vx_pipe_t_magic 0xa15a4112
#else #else
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* features support * features support
*/ */
/* $Id: uda1341.h,v 1.4 2003/02/25 12:48:16 perex Exp $ */ /* $Id: uda1341.h,v 1.5 2003/04/19 13:34:32 perex Exp $ */
#define UDA1341_ALSA_NAME "snd-uda1341" #define UDA1341_ALSA_NAME "snd-uda1341"
...@@ -210,6 +210,10 @@ enum uda1341_config { ...@@ -210,6 +210,10 @@ enum uda1341_config {
CMD_IG, CMD_IG,
CMD_AGC_TIME, CMD_AGC_TIME,
CMD_AGC_LEVEL, CMD_AGC_LEVEL,
#ifdef CONFIG_PM
CMD_SUSPEND,
CMD_RESUME,
#endif
CMD_LAST, CMD_LAST,
}; };
...@@ -221,19 +225,6 @@ enum write_through { ...@@ -221,19 +225,6 @@ enum write_through {
}; };
int __init snd_chip_uda1341_mixer_new(snd_card_t *card, struct l3_client **clnt); int __init snd_chip_uda1341_mixer_new(snd_card_t *card, struct l3_client **clnt);
void __init snd_chip_uda1341_mixer_del(snd_card_t *card);
#ifdef DEBUG_MODE
#define DEBUG(format, args...) do{printk(format, ##args);}while(0)
#else
#define DEBUG(format, args...) /* nothing */
#endif
#ifdef DEBUG_FUNCTION_NAMES
#define DEBUG_NAME(format, args...) do{printk(format, ##args);}while(0)
#else
#define DEBUG_NAME(format, args...) /* nothing */
#endif
/* /*
* Local variables: * Local variables:
......
/* include/version.h. Generated by configure. */ /* include/version.h. Generated by configure. */
#define CONFIG_SND_VERSION "0.9.2" #define CONFIG_SND_VERSION "0.9.4"
#define CONFIG_SND_DATE " (Thu Mar 20 13:31:57 2003 UTC)" #define CONFIG_SND_DATE " (Sat May 31 13:37:06 2003 UTC)"
This diff is collapsed.
...@@ -280,7 +280,6 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) ...@@ -280,7 +280,6 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
write_unlock_bh(&xfrm_policy_lock); write_unlock_bh(&xfrm_policy_lock);
if (delpol) { if (delpol) {
atomic_dec(&delpol->refcnt);
xfrm_policy_kill(delpol); xfrm_policy_kill(delpol);
xfrm_pol_put(delpol); xfrm_pol_put(delpol);
} }
......
...@@ -112,9 +112,9 @@ static void xfrm_timer_handler(unsigned long data) ...@@ -112,9 +112,9 @@ static void xfrm_timer_handler(unsigned long data)
if (tmo < next) if (tmo < next)
next = tmo; next = tmo;
} }
if (x->lft.hard_use_expires_seconds && x->curlft.use_time) { if (x->lft.hard_use_expires_seconds) {
long tmo = x->lft.hard_use_expires_seconds + long tmo = x->lft.hard_use_expires_seconds +
x->curlft.use_time - now; (x->curlft.use_time ? : now) - now;
if (tmo <= 0) if (tmo <= 0)
goto expired; goto expired;
if (tmo < next) if (tmo < next)
...@@ -130,9 +130,9 @@ static void xfrm_timer_handler(unsigned long data) ...@@ -130,9 +130,9 @@ static void xfrm_timer_handler(unsigned long data)
else if (tmo < next) else if (tmo < next)
next = tmo; next = tmo;
} }
if (x->lft.soft_use_expires_seconds && x->curlft.use_time) { if (x->lft.soft_use_expires_seconds) {
long tmo = x->lft.soft_use_expires_seconds + long tmo = x->lft.soft_use_expires_seconds +
x->curlft.use_time - now; (x->curlft.use_time ? : now) - now;
if (tmo <= 0) if (tmo <= 0)
warn = 1; warn = 1;
else if (tmo < next) else if (tmo < next)
......
...@@ -260,7 +260,7 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) ...@@ -260,7 +260,7 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma)
if (!x) if (!x)
return err; return err;
x1 = xfrm_state_lookup(&x->props.saddr, x->id.spi, x->id.proto, x->props.family); x1 = xfrm_state_lookup(&x->id.daddr, x->id.spi, x->id.proto, x->props.family);
if (x1) { if (x1) {
xfrm_state_put(x); xfrm_state_put(x);
xfrm_state_put(x1); xfrm_state_put(x1);
...@@ -277,7 +277,7 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) ...@@ -277,7 +277,7 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma)
struct xfrm_state *x; struct xfrm_state *x;
struct xfrm_usersa_id *p = NLMSG_DATA(nlh); struct xfrm_usersa_id *p = NLMSG_DATA(nlh);
x = xfrm_state_lookup(&p->saddr, p->spi, p->proto, p->family); x = xfrm_state_lookup(&p->daddr, p->spi, p->proto, p->family);
if (x == NULL) if (x == NULL)
return -ESRCH; return -ESRCH;
...@@ -403,7 +403,7 @@ static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) ...@@ -403,7 +403,7 @@ static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma)
struct sk_buff *resp_skb; struct sk_buff *resp_skb;
int err; int err;
x = xfrm_state_lookup(&p->saddr, p->spi, p->proto, p->family); x = xfrm_state_lookup(&p->daddr, p->spi, p->proto, p->family);
err = -ESRCH; err = -ESRCH;
if (x == NULL) if (x == NULL)
goto out_noput; goto out_noput;
......
...@@ -24,8 +24,14 @@ source "sound/arm/Kconfig" ...@@ -24,8 +24,14 @@ source "sound/arm/Kconfig"
# here assuming USB is defined before ALSA # here assuming USB is defined before ALSA
source "sound/usb/Kconfig" source "sound/usb/Kconfig"
# the following will depenend on the order of config.
# here assuming PCMCIA is defined before ALSA
source "sound/pcmcia/Kconfig"
source "sound/sparc/Kconfig" source "sound/sparc/Kconfig"
source "sound/parisc/Kconfig"
endmenu endmenu
menu "Open Sound System" menu "Open Sound System"
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
obj-$(CONFIG_SOUND) += soundcore.o obj-$(CONFIG_SOUND) += soundcore.o
obj-$(CONFIG_SOUND_PRIME) += oss/ obj-$(CONFIG_SOUND_PRIME) += oss/
obj-$(CONFIG_DMASOUND) += oss/ obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ synth/ usb/ sparc/ parisc/ pcmcia/
obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ synth/ usb/ sparc/
ifeq ($(CONFIG_SND),y) ifeq ($(CONFIG_SND),y)
obj-y += last.o obj-y += last.o
......
This diff is collapsed.
...@@ -69,6 +69,7 @@ obj-$(CONFIG_SND_SB16) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmi ...@@ -69,6 +69,7 @@ obj-$(CONFIG_SND_SB16) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmi
obj-$(CONFIG_SND_SBAWE) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_SBAWE) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_ES968) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o obj-$(CONFIG_SND_ES968) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o
obj-$(CONFIG_SND_WAVEFRONT) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_WAVEFRONT) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_SSCAPE) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_ALS4000) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_ALS4000) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_CMIPCI) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_CMIPCI) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_CS4281) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_CS4281) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o
...@@ -78,6 +79,7 @@ obj-$(CONFIG_SND_ES1938) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-hwd ...@@ -78,6 +79,7 @@ obj-$(CONFIG_SND_ES1938) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-hwd
obj-$(CONFIG_SND_ES1968) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o obj-$(CONFIG_SND_ES1968) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o
obj-$(CONFIG_SND_FM801) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_FM801) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_ICE1712) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o obj-$(CONFIG_SND_ICE1712) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o
obj-$(CONFIG_SND_ICE1724) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o
obj-$(CONFIG_SND_INTEL8X0) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o obj-$(CONFIG_SND_INTEL8X0) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o
obj-$(CONFIG_SND_MAESTRO3) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o obj-$(CONFIG_SND_MAESTRO3) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
obj-$(CONFIG_SND_RME32) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o obj-$(CONFIG_SND_RME32) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
...@@ -90,7 +92,7 @@ obj-$(CONFIG_SND_EMU10K1) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-ra ...@@ -90,7 +92,7 @@ obj-$(CONFIG_SND_EMU10K1) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-ra
obj-$(CONFIG_SND_KORG1212) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o obj-$(CONFIG_SND_KORG1212) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
obj-$(CONFIG_SND_NM256) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o obj-$(CONFIG_SND_NM256) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
obj-$(CONFIG_SND_RME9652) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o obj-$(CONFIG_SND_RME9652) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
obj-$(CONFIG_SND_HDSP) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o obj-$(CONFIG_SND_HDSP) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_TRIDENT) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o obj-$(CONFIG_SND_TRIDENT) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o
obj-$(CONFIG_SND_YMFPCI) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_YMFPCI) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_POWERMAC) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o obj-$(CONFIG_SND_POWERMAC) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
...@@ -101,5 +103,11 @@ ifeq ($(CONFIG_SND_SB16_CSP),y) ...@@ -101,5 +103,11 @@ ifeq ($(CONFIG_SND_SB16_CSP),y)
obj-$(CONFIG_SND_SBAWE) += snd-hwdep.o obj-$(CONFIG_SND_SBAWE) += snd-hwdep.o
endif endif
obj-$(CONFIG_SND_USB_AUDIO) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o obj-$(CONFIG_SND_USB_AUDIO) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-rawmidi.o
obj-$(CONFIG_SND_SUN_AMD7930) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
obj-$(CONFIG_SND_SUN_CS4231) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
obj-$(CONFIG_SND_HARMONY) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o
obj-$(CONFIG_SND_VXPOCKET) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-hwdep.o
obj-$(CONFIG_SND_VXP440) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-hwdep.o
obj-$(CONFIG_SND_VX222) += snd-pcm.o snd-timer.o snd-page-alloc.o snd.o snd-hwdep.o
obj-m := $(sort $(obj-m)) obj-m := $(sort $(obj-m))
...@@ -396,10 +396,6 @@ static snd_kcontrol_t *_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id) ...@@ -396,10 +396,6 @@ static snd_kcontrol_t *_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id)
continue; continue;
if (kctl->id.index + kctl->count <= id->index) if (kctl->id.index + kctl->count <= id->index)
continue; continue;
if (kctl->id.index != id->index) {
printk("BOOOR: %i, %i, %i\n", kctl->id.index, kctl->count, id->index);
continue;
}
return kctl; return kctl;
} }
return NULL; return NULL;
...@@ -772,9 +768,9 @@ static int snd_ctl_ioctl(struct inode *inode, struct file *file, ...@@ -772,9 +768,9 @@ static int snd_ctl_ioctl(struct inode *inode, struct file *file,
return -EPERM; return -EPERM;
#ifdef CONFIG_PM #ifdef CONFIG_PM
if (card->set_power_state) { if (card->set_power_state) {
snd_power_lock(card); snd_power_lock(card);
err = card->set_power_state(card, err); err = card->set_power_state(card, err);
snd_power_unlock(card); snd_power_unlock(card);
} else } else
#endif #endif
err = -ENOPROTOOPT; err = -ENOPROTOOPT;
...@@ -931,9 +927,7 @@ static int snd_ctl_fasync(int fd, struct file * file, int on) ...@@ -931,9 +927,7 @@ static int snd_ctl_fasync(int fd, struct file * file, int on)
static struct file_operations snd_ctl_f_ops = static struct file_operations snd_ctl_f_ops =
{ {
#ifndef LINUX_2_2
.owner = THIS_MODULE, .owner = THIS_MODULE,
#endif
.read = snd_ctl_read, .read = snd_ctl_read,
.open = snd_ctl_open, .open = snd_ctl_open,
.release = snd_ctl_release, .release = snd_ctl_release,
......
...@@ -292,9 +292,7 @@ static int snd_hwdep_control_ioctl(snd_card_t * card, snd_ctl_file_t * control, ...@@ -292,9 +292,7 @@ static int snd_hwdep_control_ioctl(snd_card_t * card, snd_ctl_file_t * control,
static struct file_operations snd_hwdep_f_ops = static struct file_operations snd_hwdep_f_ops =
{ {
#ifndef LINUX_2_2
.owner = THIS_MODULE, .owner = THIS_MODULE,
#endif
.llseek = snd_hwdep_llseek, .llseek = snd_hwdep_llseek,
.read = snd_hwdep_read, .read = snd_hwdep_read,
.write = snd_hwdep_write, .write = snd_hwdep_write,
......
This diff is collapsed.
...@@ -193,9 +193,7 @@ int snd_card_disconnect(snd_card_t * card) ...@@ -193,9 +193,7 @@ int snd_card_disconnect(snd_card_t * card)
f_ops = &s_f_ops->f_ops; f_ops = &s_f_ops->f_ops;
memset(f_ops, 0, sizeof(*f_ops)); memset(f_ops, 0, sizeof(*f_ops));
#ifndef LINUX_2_2
f_ops->owner = file->f_op->owner; f_ops->owner = file->f_op->owner;
#endif
f_ops->release = file->f_op->release; f_ops->release = file->f_op->release;
f_ops->poll = snd_disconnect_poll; f_ops->poll = snd_disconnect_poll;
...@@ -252,6 +250,10 @@ int snd_card_free(snd_card_t * card) ...@@ -252,6 +250,10 @@ int snd_card_free(snd_card_t * card)
snd_cards_count--; snd_cards_count--;
write_unlock(&snd_card_rwlock); write_unlock(&snd_card_rwlock);
#ifdef CONFIG_PM
wake_up(&card->power_sleep);
#endif
/* wait, until all devices are ready for the free operation */ /* wait, until all devices are ready for the free operation */
wait_event(card->shutdown_sleep, card->files == NULL); wait_event(card->shutdown_sleep, card->files == NULL);
...@@ -662,21 +664,35 @@ int snd_card_file_remove(snd_card_t *card, struct file *file) ...@@ -662,21 +664,35 @@ int snd_card_file_remove(snd_card_t *card, struct file *file)
/** /**
* snd_power_wait - wait until the power-state is changed. * snd_power_wait - wait until the power-state is changed.
* @card: soundcard structure * @card: soundcard structure
* @power_state: expected power state
* @file: file structure for the O_NONBLOCK check (optional)
* *
* Waits until the power-state is changed. * Waits until the power-state is changed.
* *
* Note: the power lock must be active before call. * Note: the power lock must be active before call.
*/ */
void snd_power_wait(snd_card_t *card) int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file)
{ {
wait_queue_t wait; wait_queue_t wait;
/* fastpath */
if (snd_power_get_state(card) == power_state)
return 0;
init_waitqueue_entry(&wait, current); init_waitqueue_entry(&wait, current);
add_wait_queue(&card->power_sleep, &wait); add_wait_queue(&card->power_sleep, &wait);
snd_power_unlock(card); while (1) {
set_current_state(TASK_UNINTERRUPTIBLE); if (card->shutdown)
schedule_timeout(30 * HZ); return -ENODEV;
remove_wait_queue(&card->power_sleep, &wait); if (snd_power_get_state(card) == power_state) {
snd_power_lock(card); remove_wait_queue(&card->power_sleep, &wait);
return 0;
}
if (file && (file->f_flags & O_NONBLOCK))
return -EAGAIN;
snd_power_unlock(card);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(30 * HZ);
snd_power_lock(card);
}
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/compat.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include "ioctl32.h" #include "ioctl32.h"
...@@ -137,10 +136,15 @@ struct sndrv_pcm_channel_info32 { ...@@ -137,10 +136,15 @@ struct sndrv_pcm_channel_info32 {
COPY(step);\ COPY(step);\
} }
struct timeval32 {
s32 tv_sec;
s32 tv_usec;
} __attribute__((packed));
struct sndrv_pcm_status32 { struct sndrv_pcm_status32 {
s32 state; s32 state;
struct compat_timespec trigger_tstamp; struct timeval32 trigger_tstamp;
struct compat_timespec tstamp; struct timeval32 tstamp;
u32 appl_ptr; u32 appl_ptr;
u32 hw_ptr; u32 hw_ptr;
s32 delay; s32 delay;
...@@ -155,9 +159,9 @@ struct sndrv_pcm_status32 { ...@@ -155,9 +159,9 @@ struct sndrv_pcm_status32 {
{\ {\
COPY(state);\ COPY(state);\
COPY(trigger_tstamp.tv_sec);\ COPY(trigger_tstamp.tv_sec);\
COPY(trigger_tstamp.tv_nsec);\ COPY(trigger_tstamp.tv_usec);\
COPY(tstamp.tv_sec);\ COPY(tstamp.tv_sec);\
COPY(tstamp.tv_nsec);\ COPY(tstamp.tv_usec);\
COPY(appl_ptr);\ COPY(appl_ptr);\
COPY(hw_ptr);\ COPY(hw_ptr);\
COPY(delay);\ COPY(delay);\
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/compat.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/rawmidi.h> #include <sound/rawmidi.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -43,9 +42,14 @@ struct sndrv_rawmidi_params32 { ...@@ -43,9 +42,14 @@ struct sndrv_rawmidi_params32 {
COPY(no_active_sensing);\ COPY(no_active_sensing);\
} }
struct timeval32 {
s32 tv_sec;
s32 tv_usec;
} __attribute__((packed));
struct sndrv_rawmidi_status32 { struct sndrv_rawmidi_status32 {
s32 stream; s32 stream;
struct compat_timespec tstamp; struct timeval32 tstamp;
u32 avail; u32 avail;
u32 xruns; u32 xruns;
unsigned char reserved[16]; unsigned char reserved[16];
...@@ -55,7 +59,7 @@ struct sndrv_rawmidi_status32 { ...@@ -55,7 +59,7 @@ struct sndrv_rawmidi_status32 {
{\ {\
COPY(stream);\ COPY(stream);\
COPY(tstamp.tv_sec);\ COPY(tstamp.tv_sec);\
COPY(tstamp.tv_nsec);\ COPY(tstamp.tv_usec);\
COPY(avail);\ COPY(avail);\
COPY(xruns);\ COPY(xruns);\
} }
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/compat.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/timer.h> #include <sound/timer.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -32,7 +31,7 @@ struct sndrv_timer_info32 { ...@@ -32,7 +31,7 @@ struct sndrv_timer_info32 {
s32 card; s32 card;
unsigned char id[64]; unsigned char id[64];
unsigned char name[80]; unsigned char name[80];
u32 reserved0; u32 ticks;
u32 resolution; u32 resolution;
unsigned char reserved[64]; unsigned char reserved[64];
}; };
...@@ -43,11 +42,17 @@ struct sndrv_timer_info32 { ...@@ -43,11 +42,17 @@ struct sndrv_timer_info32 {
COPY(card);\ COPY(card);\
memcpy(dst->id, src->id, sizeof(src->id));\ memcpy(dst->id, src->id, sizeof(src->id));\
memcpy(dst->name, src->name, sizeof(src->name));\ memcpy(dst->name, src->name, sizeof(src->name));\
COPY(ticks);\
COPY(resolution);\ COPY(resolution);\
} }
struct timeval32 {
s32 tv_sec;
s32 tv_usec;
};
struct sndrv_timer_status32 { struct sndrv_timer_status32 {
struct compat_timespec tstamp; struct timeval32 tstamp;
u32 resolution; u32 resolution;
u32 lost; u32 lost;
u32 overrun; u32 overrun;
...@@ -58,7 +63,7 @@ struct sndrv_timer_status32 { ...@@ -58,7 +63,7 @@ struct sndrv_timer_status32 {
#define CVT_sndrv_timer_status()\ #define CVT_sndrv_timer_status()\
{\ {\
COPY(tstamp.tv_sec);\ COPY(tstamp.tv_sec);\
COPY(tstamp.tv_nsec);\ COPY(tstamp.tv_usec);\
COPY(resolution);\ COPY(resolution);\
COPY(lost);\ COPY(lost);\
COPY(overrun);\ COPY(overrun);\
......
...@@ -80,7 +80,6 @@ struct snd_mem_list { ...@@ -80,7 +80,6 @@ struct snd_mem_list {
#define snd_assert(expr, args...) /**/ #define snd_assert(expr, args...) /**/
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
#if defined(__i386__) || defined(__ppc__) || defined(__x86_64__) #if defined(__i386__) || defined(__ppc__) || defined(__x86_64__)
#define HACK_PCI_ALLOC_CONSISTENT #define HACK_PCI_ALLOC_CONSISTENT
...@@ -98,7 +97,7 @@ struct snd_mem_list { ...@@ -98,7 +97,7 @@ struct snd_mem_list {
* again. * again.
*/ */
void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size, static void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size,
dma_addr_t *dma_handle) dma_addr_t *dma_handle)
{ {
void *ret; void *ret;
...@@ -133,7 +132,6 @@ void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size, ...@@ -133,7 +132,6 @@ void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size,
#endif /* arch */ #endif /* arch */
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
#endif /* LINUX >= 2.4.0 */
/* /*
...@@ -261,14 +259,16 @@ void snd_dma_free_pages(const struct snd_dma_device *dev, struct snd_dma_buffer ...@@ -261,14 +259,16 @@ void snd_dma_free_pages(const struct snd_dma_device *dev, struct snd_dma_buffer
/* /*
* search for the device * search for the device
*/ */
static struct snd_mem_list *mem_list_find(const struct snd_dma_device *dev, int allow_unused) static struct snd_mem_list *mem_list_find(const struct snd_dma_device *dev, int search_empty)
{ {
struct list_head *p; struct list_head *p;
struct snd_mem_list *mem; struct snd_mem_list *mem;
list_for_each(p, &mem_list_head) { list_for_each(p, &mem_list_head) {
mem = list_entry(p, struct snd_mem_list, list); mem = list_entry(p, struct snd_mem_list, list);
if (compare_device(&mem->dev, dev, allow_unused)) if (mem->used && search_empty)
continue;
if (compare_device(&mem->dev, dev, search_empty))
return mem; return mem;
} }
return NULL; return NULL;
...@@ -623,7 +623,7 @@ void snd_free_pci_pages(struct pci_dev *pci, ...@@ -623,7 +623,7 @@ void snd_free_pci_pages(struct pci_dev *pci,
} }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) && defined(__i386__) #if defined(__i386__)
/* /*
* on ix86, we allocate a page with GFP_KERNEL to assure the * on ix86, we allocate a page with GFP_KERNEL to assure the
* allocation. the code is almost same with kernel/i386/pci-dma.c but * allocation. the code is almost same with kernel/i386/pci-dma.c but
......
...@@ -376,9 +376,7 @@ int snd_mixer_oss_ioctl_card(snd_card_t *card, unsigned int cmd, unsigned long a ...@@ -376,9 +376,7 @@ int snd_mixer_oss_ioctl_card(snd_card_t *card, unsigned int cmd, unsigned long a
static struct file_operations snd_mixer_oss_f_ops = static struct file_operations snd_mixer_oss_f_ops =
{ {
#ifndef LINUX_2_2
.owner = THIS_MODULE, .owner = THIS_MODULE,
#endif
.open = snd_mixer_oss_open, .open = snd_mixer_oss_open,
.release = snd_mixer_oss_release, .release = snd_mixer_oss_release,
.ioctl = snd_mixer_oss_ioctl, .ioctl = snd_mixer_oss_ioctl,
......
...@@ -1477,10 +1477,10 @@ static int snd_pcm_oss_release_file(snd_pcm_oss_file_t *pcm_oss_file) ...@@ -1477,10 +1477,10 @@ static int snd_pcm_oss_release_file(snd_pcm_oss_file_t *pcm_oss_file)
continue; continue;
runtime = substream->runtime; runtime = substream->runtime;
spin_lock_irq(&runtime->lock); snd_pcm_stream_lock_irq(substream);
if (snd_pcm_running(substream)) if (snd_pcm_running(substream))
snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP); snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
spin_unlock_irq(&runtime->lock); snd_pcm_stream_unlock_irq(substream);
if (substream->open_flag) { if (substream->open_flag) {
if (substream->ops->hw_free != NULL) if (substream->ops->hw_free != NULL)
substream->ops->hw_free(substream); substream->ops->hw_free(substream);
...@@ -1918,21 +1918,21 @@ static unsigned int snd_pcm_oss_poll(struct file *file, poll_table * wait) ...@@ -1918,21 +1918,21 @@ static unsigned int snd_pcm_oss_poll(struct file *file, poll_table * wait)
if (psubstream != NULL) { if (psubstream != NULL) {
snd_pcm_runtime_t *runtime = psubstream->runtime; snd_pcm_runtime_t *runtime = psubstream->runtime;
poll_wait(file, &runtime->sleep, wait); poll_wait(file, &runtime->sleep, wait);
spin_lock_irq(&runtime->lock); snd_pcm_stream_lock_irq(psubstream);
if (runtime->status->state != SNDRV_PCM_STATE_DRAINING && if (runtime->status->state != SNDRV_PCM_STATE_DRAINING &&
(runtime->status->state != SNDRV_PCM_STATE_RUNNING || (runtime->status->state != SNDRV_PCM_STATE_RUNNING ||
snd_pcm_oss_playback_ready(psubstream))) snd_pcm_oss_playback_ready(psubstream)))
mask |= POLLOUT | POLLWRNORM; mask |= POLLOUT | POLLWRNORM;
spin_unlock_irq(&runtime->lock); snd_pcm_stream_unlock_irq(psubstream);
} }
if (csubstream != NULL) { if (csubstream != NULL) {
snd_pcm_runtime_t *runtime = csubstream->runtime; snd_pcm_runtime_t *runtime = csubstream->runtime;
poll_wait(file, &runtime->sleep, wait); poll_wait(file, &runtime->sleep, wait);
spin_lock_irq(&runtime->lock); snd_pcm_stream_lock_irq(csubstream);
if (runtime->status->state != SNDRV_PCM_STATE_RUNNING || if (runtime->status->state != SNDRV_PCM_STATE_RUNNING ||
snd_pcm_oss_capture_ready(csubstream)) snd_pcm_oss_capture_ready(csubstream))
mask |= POLLIN | POLLRDNORM; mask |= POLLIN | POLLRDNORM;
spin_unlock_irq(&runtime->lock); snd_pcm_stream_unlock_irq(csubstream);
} }
return mask; return mask;
...@@ -1981,11 +1981,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area) ...@@ -1981,11 +1981,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)
if (runtime->oss.plugin_first != NULL) if (runtime->oss.plugin_first != NULL)
return -EIO; return -EIO;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 25)
if (area->vm_pgoff != 0) if (area->vm_pgoff != 0)
#else
if (area->vm_offset != 0)
#endif
return -EINVAL; return -EINVAL;
err = snd_pcm_mmap_data(substream, file, area); err = snd_pcm_mmap_data(substream, file, area);
...@@ -2148,9 +2144,7 @@ static void snd_pcm_oss_proc_done(snd_pcm_t *pcm) ...@@ -2148,9 +2144,7 @@ static void snd_pcm_oss_proc_done(snd_pcm_t *pcm)
static struct file_operations snd_pcm_oss_f_reg = static struct file_operations snd_pcm_oss_f_reg =
{ {
#ifndef LINUX_2_2
.owner = THIS_MODULE, .owner = THIS_MODULE,
#endif
.read = snd_pcm_oss_read, .read = snd_pcm_oss_read,
.write = snd_pcm_oss_write, .write = snd_pcm_oss_write,
.open = snd_pcm_oss_open, .open = snd_pcm_oss_open,
......
...@@ -317,10 +317,10 @@ static void snd_pcm_substream_proc_hw_params_read(snd_info_entry_t *entry, snd_i ...@@ -317,10 +317,10 @@ static void snd_pcm_substream_proc_hw_params_read(snd_info_entry_t *entry, snd_i
snd_iprintf(buffer, "closed\n"); snd_iprintf(buffer, "closed\n");
return; return;
} }
spin_lock_irq(&runtime->lock); snd_pcm_stream_lock_irq(substream);
if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { if (runtime->status->state == SNDRV_PCM_STATE_OPEN) {
snd_iprintf(buffer, "no setup\n"); snd_iprintf(buffer, "no setup\n");
spin_unlock_irq(&runtime->lock); snd_pcm_stream_unlock_irq(substream);
return; return;
} }
snd_iprintf(buffer, "access: %s\n", snd_pcm_access_name(runtime->access)); snd_iprintf(buffer, "access: %s\n", snd_pcm_access_name(runtime->access));
...@@ -340,7 +340,7 @@ static void snd_pcm_substream_proc_hw_params_read(snd_info_entry_t *entry, snd_i ...@@ -340,7 +340,7 @@ static void snd_pcm_substream_proc_hw_params_read(snd_info_entry_t *entry, snd_i
snd_iprintf(buffer, "OSS periods: %u\n", runtime->oss.periods); snd_iprintf(buffer, "OSS periods: %u\n", runtime->oss.periods);
} }
#endif #endif
spin_unlock_irq(&runtime->lock); snd_pcm_stream_unlock_irq(substream);
} }
static void snd_pcm_substream_proc_sw_params_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) static void snd_pcm_substream_proc_sw_params_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
...@@ -351,10 +351,10 @@ static void snd_pcm_substream_proc_sw_params_read(snd_info_entry_t *entry, snd_i ...@@ -351,10 +351,10 @@ static void snd_pcm_substream_proc_sw_params_read(snd_info_entry_t *entry, snd_i
snd_iprintf(buffer, "closed\n"); snd_iprintf(buffer, "closed\n");
return; return;
} }
spin_lock_irq(&runtime->lock); snd_pcm_stream_lock_irq(substream);
if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { if (runtime->status->state == SNDRV_PCM_STATE_OPEN) {
snd_iprintf(buffer, "no setup\n"); snd_iprintf(buffer, "no setup\n");
spin_unlock_irq(&runtime->lock); snd_pcm_stream_unlock_irq(substream);
return; return;
} }
snd_iprintf(buffer, "tstamp_mode: %s\n", snd_pcm_tstamp_mode_name(runtime->tstamp_mode)); snd_iprintf(buffer, "tstamp_mode: %s\n", snd_pcm_tstamp_mode_name(runtime->tstamp_mode));
...@@ -367,7 +367,7 @@ static void snd_pcm_substream_proc_sw_params_read(snd_info_entry_t *entry, snd_i ...@@ -367,7 +367,7 @@ static void snd_pcm_substream_proc_sw_params_read(snd_info_entry_t *entry, snd_i
snd_iprintf(buffer, "silence_threshold: %lu\n", runtime->silence_threshold); snd_iprintf(buffer, "silence_threshold: %lu\n", runtime->silence_threshold);
snd_iprintf(buffer, "silence_size: %lu\n", runtime->silence_size); snd_iprintf(buffer, "silence_size: %lu\n", runtime->silence_size);
snd_iprintf(buffer, "boundary: %lu\n", runtime->boundary); snd_iprintf(buffer, "boundary: %lu\n", runtime->boundary);
spin_unlock_irq(&runtime->lock); snd_pcm_stream_unlock_irq(substream);
} }
static void snd_pcm_substream_proc_status_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) static void snd_pcm_substream_proc_status_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
...@@ -588,13 +588,15 @@ int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count) ...@@ -588,13 +588,15 @@ int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count)
pstr->substream = substream; pstr->substream = substream;
else else
prev->next = substream; prev->next = substream;
substream->link_next = substream;
substream->link_prev = substream;
err = snd_pcm_substream_proc_init(substream); err = snd_pcm_substream_proc_init(substream);
if (err < 0) { if (err < 0) {
snd_magic_kfree(substream); snd_magic_kfree(substream);
return err; return err;
} }
substream->group = &substream->self_group;
spin_lock_init(&substream->self_group.lock);
INIT_LIST_HEAD(&substream->self_group.substreams);
list_add_tail(&substream->link_list, &substream->self_group.substreams);
spin_lock_init(&substream->timer_lock); spin_lock_init(&substream->timer_lock);
prev = substream; prev = substream;
} }
...@@ -793,7 +795,6 @@ int snd_pcm_open_substream(snd_pcm_t *pcm, int stream, ...@@ -793,7 +795,6 @@ int snd_pcm_open_substream(snd_pcm_t *pcm, int stream,
memset((void*)runtime->control, 0, size); memset((void*)runtime->control, 0, size);
init_waitqueue_head(&runtime->sleep); init_waitqueue_head(&runtime->sleep);
spin_lock_init(&runtime->lock);
atomic_set(&runtime->mmap_count, 0); atomic_set(&runtime->mmap_count, 0);
init_timer(&runtime->tick_timer); init_timer(&runtime->tick_timer);
runtime->tick_timer.function = snd_pcm_tick_timer_func; runtime->tick_timer.function = snd_pcm_tick_timer_func;
...@@ -1022,6 +1023,7 @@ EXPORT_SYMBOL(snd_pcm_release_substream); ...@@ -1022,6 +1023,7 @@ EXPORT_SYMBOL(snd_pcm_release_substream);
EXPORT_SYMBOL(snd_pcm_format_name); EXPORT_SYMBOL(snd_pcm_format_name);
EXPORT_SYMBOL(snd_pcm_subformat_name); EXPORT_SYMBOL(snd_pcm_subformat_name);
/* pcm_native.c */ /* pcm_native.c */
EXPORT_SYMBOL(snd_pcm_link_rwlock);
EXPORT_SYMBOL(snd_pcm_start); EXPORT_SYMBOL(snd_pcm_start);
#ifdef CONFIG_PM #ifdef CONFIG_PM
EXPORT_SYMBOL(snd_pcm_suspend); EXPORT_SYMBOL(snd_pcm_suspend);
......
This diff is collapsed.
This diff is collapsed.
...@@ -1316,9 +1316,7 @@ static void snd_rawmidi_proc_info_read(snd_info_entry_t *entry, ...@@ -1316,9 +1316,7 @@ static void snd_rawmidi_proc_info_read(snd_info_entry_t *entry,
static struct file_operations snd_rawmidi_f_ops = static struct file_operations snd_rawmidi_f_ops =
{ {
#ifndef LINUX_2_2
.owner = THIS_MODULE, .owner = THIS_MODULE,
#endif
.read = snd_rawmidi_read, .read = snd_rawmidi_read,
.write = snd_rawmidi_write, .write = snd_rawmidi_write,
.open = snd_rawmidi_open, .open = snd_rawmidi_open,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment