projects/linux·commit 444bd6fc

Merge HEAD from master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa

444bd6fc · Linus Torvalds <[email protected]> · 2005-08-30 07:47:01 -07:00

Commit
444bd6fc18e4788f701a119cdfefe4f02444d9cb
Parents
3cb904ca · c8846970

Merge commit. Changes below are compared with the first parent: 3cb904ca.

Changes

84 files changed · +2033 −700

FileStatusAddDelContent
Documentation/sound/alsa/ALSA-Configuration.txtmodified+1−0View file
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmplmodified+11−4View file
include/linux/sound.hmodified+2−0View file
include/sound/ac97_codec.hmodified+9−0View file
include/sound/ad1816a.hmodified+1−0View file
include/sound/asound.hmodified+5−1View file
include/sound/cs46xx.hmodified+1−1View file
include/sound/emu10k1.hmodified+1−1View file
include/sound/gus.hmodified+4−4View file
include/sound/pcm.hmodified+0−1View file
include/sound/version.hmodified+2−2View file
include/sound/ymfpci.hmodified+6−0View file
sound/arm/pxa2xx-ac97.cmodified+6−6View file
sound/core/memalloc.cmodified+2−3View file
sound/core/memory.cmodified+1−1View file
sound/core/oss/pcm_oss.cmodified+4−7View file
sound/core/pcm_compat.cmodified+34−15View file
sound/core/pcm_lib.cmodified+16−4View file
sound/core/pcm_native.cmodified+5−9View file
sound/core/sound_oss.cmodified+5−2View file
sound/core/timer.cmodified+11−5View file
sound/drivers/vx/vx_mixer.cmodified+2−2View file
sound/drivers/vx/vx_pcm.cmodified+4−4View file
sound/isa/ad1816a/ad1816a.cmodified+5−0View file
sound/isa/ad1816a/ad1816a_lib.cmodified+10−4View file
sound/isa/ad1848/ad1848_lib.cmodified+1−0View file
sound/isa/cmi8330.cmodified+2−2View file
sound/isa/cs423x/cs4231_lib.cmodified+2−0View file
sound/isa/gus/gus_io.cmodified+4−2View file
sound/isa/opl3sa2.cmodified+90−24View file
sound/isa/sb/sb16_main.cmodified+1−1View file
sound/pci/Kconfigmodified+7−3View file
sound/pci/ac97/Makefilemodified+2−0View file
sound/pci/ac97/ac97_bus.cadded+79−0View file
sound/pci/ac97/ac97_codec.cmodified+64−21View file
sound/pci/ac97/ac97_patch.cmodified+355−94View file
sound/pci/ac97/ac97_patch.hmodified+1−0View file
sound/pci/ali5451/ali5451.cmodified+3−3View file
sound/pci/atiixp.cmodified+9−1View file
sound/pci/au88x0/au88x0_pcm.cmodified+6−4View file
sound/pci/ca0106/ca0106_main.cmodified+8−0View file
sound/pci/ca0106/ca0106_mixer.cmodified+2−2View file
sound/pci/cmipci.cmodified+1−1View file
sound/pci/cs46xx/cs46xx.cmodified+1−1View file
sound/pci/cs46xx/cs46xx_lib.cmodified+10−8View file
sound/pci/emu10k1/emu10k1.cmodified+1−1View file
sound/pci/emu10k1/emu10k1_main.cmodified+8−0View file
sound/pci/emu10k1/emu10k1x.cmodified+2−2View file
sound/pci/emu10k1/emufx.cmodified+13−13View file
sound/pci/emu10k1/emumixer.cmodified+17−6View file
sound/pci/emu10k1/emupcm.cmodified+6−1View file
sound/pci/ens1370.cmodified+1−1View file
sound/pci/fm801.cmodified+4−4View file
sound/pci/hda/Makefilemodified+1−1View file
sound/pci/hda/hda_codec.cmodified+67−30View file
sound/pci/hda/hda_codec.hmodified+1−0View file
sound/pci/hda/hda_generic.cmodified+5−0View file
sound/pci/hda/hda_intel.cmodified+123−34View file
sound/pci/hda/hda_patch.hmodified+3−0View file
sound/pci/hda/patch_analog.cmodified+2−2View file
sound/pci/hda/patch_cmedia.cmodified+1−0View file
sound/pci/hda/patch_realtek.cmodified+8−1View file
sound/pci/hda/patch_si3054.cadded+300−0View file
sound/pci/ice1712/delta.cmodified+5−5View file
sound/pci/ice1712/ice1712.cmodified+5−5View file
sound/pci/ice1712/ice1724.cmodified+3−3View file
sound/pci/intel8x0.cmodified+49−8View file
sound/pci/korg1212/korg1212.cmodified+2−2View file
sound/pci/nm256/nm256.cmodified+70−23View file
sound/pci/rme32.cmodified+2−2View file
sound/pci/rme96.cmodified+2−2View file
sound/pci/rme9652/hdsp.cmodified+27−28View file
sound/pci/rme9652/hdspm.cmodified+17−16View file
sound/pci/rme9652/rme9652.cmodified+12−12View file
sound/pci/trident/trident_main.cmodified+5−5View file
sound/pci/via82xx.cmodified+11−6View file
sound/pci/via82xx_modem.cmodified+2−1View file
sound/pci/ymfpci/ymfpci_main.cmodified+160−72View file
sound/pcmcia/vx/vxpocket.cmodified+7−5View file
sound/sound_core.cmodified+18−9View file
sound/synth/emux/emux_synth.cmodified+0−1View file
sound/usb/usbaudio.cmodified+187−133View file
sound/usb/usbmidi.cmodified+89−22View file
sound/usb/usx2y/usx2yhwdeppcm.cmodified+1−1View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/sound/alsa/ALSA-Configuration.txt

View file
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index a18ecb9..5c49ba0 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -132,6 +132,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
mpu_irq - IRQ # for MPU-401 UART (PnP setup)
dma1 - first DMA # for AD1816A chip (PnP setup)
dma2 - second DMA # for AD1816A chip (PnP setup)
+ clockfreq - Clock frequency for AD1816A chip (default = 0, 33000Hz)
Module supports up to 8 cards, autoprobe and PnP.

Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl

View file
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index db0b7d2..0475478 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -3422,10 +3422,17 @@ struct _snd_pcm_runtime {
<para>
The <structfield>iface</structfield> field specifies the type of
- the control,
- <constant>SNDRV_CTL_ELEM_IFACE_XXX</constant>. There are
- <constant>MIXER</constant>, <constant>PCM</constant>,
- <constant>CARD</constant>, etc.
+ the control, <constant>SNDRV_CTL_ELEM_IFACE_XXX</constant>, which
+ is usually <constant>MIXER</constant>.
+ Use <constant>CARD</constant> for global controls that are not
+ logically part of the mixer.
+ If the control is closely associated with some specific device on
+ the sound card, use <constant>HWDEP</constant>,
+ <constant>PCM</constant>, <constant>RAWMIDI</constant>,
+ <constant>TIMER</constant>, or <constant>SEQUENCER</constant>, and
+ specify the device number with the
+ <structfield>device</structfield> and
+ <structfield>subdevice</structfield> fields.
</para>
<para>

include/linux/sound.h

View file
diff --git a/include/linux/sound.h b/include/linux/sound.h
index 428f597..72b9af4 100644
--- a/include/linux/sound.h
+++ b/include/linux/sound.h
@@ -29,7 +29,9 @@
* Sound core interface functions
*/
+struct device;
extern int register_sound_special(struct file_operations *fops, int unit);
+extern int register_sound_special_device(struct file_operations *fops, int unit, struct device *dev);
extern int register_sound_mixer(struct file_operations *fops, int dev);
extern int register_sound_midi(struct file_operations *fops, int dev);
extern int register_sound_dsp(struct file_operations *fops, int dev);

include/sound/ac97_codec.h

View file
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 1309c12..2857cf0 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -26,6 +26,7 @@
*/
#include <linux/bitops.h>
+#include <linux/device.h>
#include "pcm.h"
#include "control.h"
#include "info.h"
@@ -374,6 +375,9 @@
#define AC97_HAS_NO_PC_BEEP (1<<12) /* no PC Beep volume */
#define AC97_HAS_NO_VIDEO (1<<13) /* no Video volume */
#define AC97_HAS_NO_CD (1<<14) /* no CD volume */
+#define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */
+#define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */
+#define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */
/* rates indexes */
#define AC97_RATES_FRONT_DAC 0
@@ -520,6 +524,7 @@ struct _snd_ac97 {
/* jack-sharing info */
unsigned char indep_surround;
unsigned char channel_mode;
+ struct device dev;
};
/* conditions */
@@ -599,4 +604,8 @@ struct ac97_enum {
unsigned short mask;
const char **texts;
};
+
+/* ad hoc AC97 device driver access */
+extern struct bus_type ac97_bus_type;
+
#endif /* __SOUND_AC97_CODEC_H */

include/sound/ad1816a.h

View file
diff --git a/include/sound/ad1816a.h b/include/sound/ad1816a.h
index 395978e..ca2e0e4 100644
--- a/include/sound/ad1816a.h
+++ b/include/sound/ad1816a.h
@@ -138,6 +138,7 @@ struct _snd_ad1816a {
spinlock_t lock;
unsigned short mode;
+ unsigned int clock_freq;
snd_card_t *card;
snd_pcm_t *pcm;

include/sound/asound.h

View file
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 9974f83..8e552d6 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -560,7 +560,7 @@ enum {
* Timer section - /dev/snd/timer
*/
-#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4)
+#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
enum sndrv_timer_class {
SNDRV_TIMER_CLASS_NONE = -1,
@@ -693,11 +693,15 @@ enum sndrv_timer_event {
SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */
SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */
SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */
+ SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */
+ SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */
/* master timer events for slave timer instances */
SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
+ SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
+ SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
};
struct sndrv_timer_tread {

include/sound/cs46xx.h

View file
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index 182dd27..9b94510 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1748,7 +1748,7 @@ int snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
-int snd_cs46xx_mixer(cs46xx_t *chip);
+int snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device);
int snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rmidi);
int snd_cs46xx_start_dsp(cs46xx_t *chip);
int snd_cs46xx_gameport(cs46xx_t *chip);

include/sound/emu10k1.h

View file
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index c2ef3f0..4e3993d 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -1178,7 +1178,7 @@ int snd_p16v_free(emu10k1_t * emu);
int snd_p16v_mixer(emu10k1_t * emu);
int snd_emu10k1_pcm_multi(emu10k1_t * emu, int device, snd_pcm_t ** rpcm);
int snd_emu10k1_fx8010_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm);
-int snd_emu10k1_mixer(emu10k1_t * emu);
+int snd_emu10k1_mixer(emu10k1_t * emu, int pcm_device, int multi_device);
int snd_emu10k1_timer(emu10k1_t * emu, int device);
int snd_emu10k1_fx8010_new(emu10k1_t *emu, int device, snd_hwdep_t ** rhwdep);

include/sound/gus.h

View file
diff --git a/include/sound/gus.h b/include/sound/gus.h
index b4b461c..7000d9d 100644
--- a/include/sound/gus.h
+++ b/include/sound/gus.h
@@ -512,13 +512,13 @@ extern void snd_gf1_ctrl_stop(snd_gus_card_t * gus, unsigned char reg);
extern void snd_gf1_write8(snd_gus_card_t * gus, unsigned char reg, unsigned char data);
extern unsigned char snd_gf1_look8(snd_gus_card_t * gus, unsigned char reg);
-extern inline unsigned char snd_gf1_read8(snd_gus_card_t * gus, unsigned char reg)
+static inline unsigned char snd_gf1_read8(snd_gus_card_t * gus, unsigned char reg)
{
return snd_gf1_look8(gus, reg | 0x80);
}
extern void snd_gf1_write16(snd_gus_card_t * gus, unsigned char reg, unsigned int data);
extern unsigned short snd_gf1_look16(snd_gus_card_t * gus, unsigned char reg);
-extern inline unsigned short snd_gf1_read16(snd_gus_card_t * gus, unsigned char reg)
+static inline unsigned short snd_gf1_read16(snd_gus_card_t * gus, unsigned char reg)
{
return snd_gf1_look16(gus, reg | 0x80);
}
@@ -532,12 +532,12 @@ extern void snd_gf1_i_ctrl_stop(snd_gus_card_t * gus, unsigned char reg);
extern void snd_gf1_i_write8(snd_gus_card_t * gus, unsigned char reg, unsigned char data);
extern unsigned char snd_gf1_i_look8(snd_gus_card_t * gus, unsigned char reg);
extern void snd_gf1_i_write16(snd_gus_card_t * gus, unsigned char reg, unsigned int data);
-extern inline unsigned char snd_gf1_i_read8(snd_gus_card_t * gus, unsigned char reg)
+static inline unsigned char snd_gf1_i_read8(snd_gus_card_t * gus, unsigned char reg)
{
return snd_gf1_i_look8(gus, reg | 0x80);
}
extern unsigned short snd_gf1_i_look16(snd_gus_card_t * gus, unsigned char reg);
-extern inline unsigned short snd_gf1_i_read16(snd_gus_card_t * gus, unsigned char reg)
+static inline unsigned short snd_gf1_i_read16(snd_gus_card_t * gus, unsigned char reg)
{
return snd_gf1_i_look16(gus, reg | 0x80);
}

include/sound/pcm.h

View file
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index d935417..fa23ebf 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -379,7 +379,6 @@ struct _snd_pcm_substream {
unsigned int dma_buf_id;
size_t dma_max;
/* -- hardware operations -- */
- unsigned int open_flag: 1; /* lowlevel device has been opened */
snd_pcm_ops_t *ops;
/* -- runtime information -- */
snd_pcm_runtime_t *runtime;

include/sound/version.h

View file
diff --git a/include/sound/version.h b/include/sound/version.h
index c085136..8d19bfa 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
/* include/version.h. Generated by configure. */
-#define CONFIG_SND_VERSION "1.0.9b"
-#define CONFIG_SND_DATE " (Thu Jul 28 12:20:13 2005 UTC)"
+#define CONFIG_SND_VERSION "1.0.10rc1"
+#define CONFIG_SND_DATE " (Tue Aug 30 05:31:08 2005 UTC)"

include/sound/ymfpci.h

View file
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
index 4b57068..9a3c1e6 100644
--- a/include/sound/ymfpci.h
+++ b/include/sound/ymfpci.h
@@ -295,6 +295,7 @@ struct _snd_ymfpci_pcm {
unsigned int running: 1;
unsigned int output_front: 1;
unsigned int output_rear: 1;
+ unsigned int update_pcm_vol;
u32 period_size; /* cached from runtime->period_size */
u32 buffer_size; /* cached from runtime->buffer_size */
u32 period_pos;
@@ -367,6 +368,11 @@ struct _snd_ymfpci {
int mode_dup4ch;
int rear_opened;
int spdif_opened;
+ struct {
+ u16 left;
+ u16 right;
+ snd_kcontrol_t *ctl;
+ } pcm_mixer[32];
spinlock_t reg_lock;
spinlock_t voice_lock;

sound/arm/pxa2xx-ac97.c

View file
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 4605230..29450be 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -132,9 +132,9 @@ static void pxa2xx_ac97_reset(ac97_t *ac97)
udelay(10);
GCR |= GCR_WARM_RST;
pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
- udelay(50);
+ udelay(500);
#else
- GCR |= GCR_WARM_RST|GCR_PRIRDY_IEN|GCR_SECRDY_IEN;;
+ GCR |= GCR_WARM_RST|GCR_PRIRDY_IEN|GCR_SECRDY_IEN;
wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);
#endif
@@ -261,7 +261,7 @@ static int pxa2xx_ac97_do_suspend(snd_card_t *card, unsigned int state)
return 0;
}
-static int pxa2xx_ac97_do_resume(snd_card_t *card, unsigned int state)
+static int pxa2xx_ac97_do_resume(snd_card_t *card)
{
if (card->power_state != SNDRV_CTL_POWER_D0) {
pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data;
@@ -275,13 +275,13 @@ static int pxa2xx_ac97_do_resume(snd_card_t *card, unsigned int state)
return 0;
}
-static int pxa2xx_ac97_suspend(struct device *_dev, u32 state, u32 level)
+static int pxa2xx_ac97_suspend(struct device *_dev, pm_message_t state, u32 level)
{
snd_card_t *card = dev_get_drvdata(_dev);
int ret = 0;
if (card && level == SUSPEND_DISABLE)
- ret = pxa2xx_ac97_do_suspend(card, SNDRV_CTL_POWER_D3cold);
+ ret = pxa2xx_ac97_do_suspend(card, PMSG_SUSPEND);
return ret;
}
@@ -292,7 +292,7 @@ static int pxa2xx_ac97_resume(struct device *_dev, u32 level)
int ret = 0;
if (card && level == RESUME_ENABLE)
- ret = pxa2xx_ac97_do_resume(card, SNDRV_CTL_POWER_D0);
+ ret = pxa2xx_ac97_do_resume(card);
return ret;
}

sound/core/memalloc.c

View file
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 0213256..39a54a4 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -512,7 +512,7 @@ static void free_all_reserved_pages(void)
* proc file interface
*/
#define SND_MEM_PROC_FILE "driver/snd-page-alloc"
-struct proc_dir_entry *snd_mem_proc;
+static struct proc_dir_entry *snd_mem_proc;
static int snd_mem_proc_read(char *page, char **start, off_t off,
int count, int *eof, void *data)
@@ -655,8 +655,7 @@ static int __init snd_mem_init(void)
static void __exit snd_mem_exit(void)
{
- if (snd_mem_proc)
- remove_proc_entry(SND_MEM_PROC_FILE, NULL);
+ remove_proc_entry(SND_MEM_PROC_FILE, NULL);
free_all_reserved_pages();
if (snd_allocated_pages > 0)
printk(KERN_ERR "snd-malloc: Memory leak? pages not freed = %li\n", snd_allocated_pages);

sound/core/memory.c

View file
diff --git a/sound/core/memory.c b/sound/core/memory.c
index f689557..1622893 100644
--- a/sound/core/memory.c
+++ b/sound/core/memory.c
@@ -56,7 +56,7 @@ static DEFINE_SPINLOCK(snd_alloc_vmalloc_lock);
#define VMALLOC_MAGIC 0x87654320
static snd_info_entry_t *snd_memory_info_entry;
-void snd_memory_init(void)
+void __init snd_memory_init(void)
{
snd_alloc_kmalloc = 0;
snd_alloc_vmalloc = 0;

sound/core/oss/pcm_oss.c

View file
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index de7444c..a13bd7b 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -1705,13 +1705,12 @@ static int snd_pcm_oss_release_file(snd_pcm_oss_file_t *pcm_oss_file)
if (snd_pcm_running(substream))
snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
snd_pcm_stream_unlock_irq(substream);
- if (substream->open_flag) {
+ if (substream->ffile != NULL) {
if (substream->ops->hw_free != NULL)
substream->ops->hw_free(substream);
substream->ops->close(substream);
- substream->open_flag = 0;
+ substream->ffile = NULL;
}
- substream->ffile = NULL;
snd_pcm_oss_release_substream(substream);
snd_pcm_release_substream(substream);
}
@@ -1778,14 +1777,13 @@ static int snd_pcm_oss_open_file(struct file *file,
snd_pcm_oss_release_file(pcm_oss_file);
return err;
}
- psubstream->open_flag = 1;
+ psubstream->ffile = file;
err = snd_pcm_hw_constraints_complete(psubstream);
if (err < 0) {
snd_printd("snd_pcm_hw_constraint_complete failed\n");
snd_pcm_oss_release_file(pcm_oss_file);
return err;
}
- psubstream->ffile = file;
snd_pcm_oss_init_substream(psubstream, psetup, minor);
}
if (csubstream != NULL) {
@@ -1800,14 +1798,13 @@ static int snd_pcm_oss_open_file(struct file *file,
snd_pcm_oss_release_file(pcm_oss_file);
return err;
}
- csubstream->open_flag = 1;
+ csubstream->ffile = file;
err = snd_pcm_hw_constraints_complete(csubstream);
if (err < 0) {
snd_printd("snd_pcm_hw_constraint_complete failed\n");
snd_pcm_oss_release_file(pcm_oss_file);
return err;
}
- csubstream->ffile = file;
snd_pcm_oss_init_substream(csubstream, csetup, minor);
}

sound/core/pcm_compat.c

View file
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index 3920bf0..4b6307d 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -103,10 +103,24 @@ struct sndrv_pcm_sw_params32 {
unsigned char reserved[64];
};
+/* recalcuate the boundary within 32bit */
+static snd_pcm_uframes_t recalculate_boundary(snd_pcm_runtime_t *runtime)
+{
+ snd_pcm_uframes_t boundary;
+
+ if (! runtime->buffer_size)
+ return 0;
+ boundary = runtime->buffer_size;
+ while (boundary * 2 <= 0x7fffffffUL - runtime->buffer_size)
+ boundary *= 2;
+ return boundary;
+}
+
static int snd_pcm_ioctl_sw_params_compat(snd_pcm_substream_t *substream,
struct sndrv_pcm_sw_params32 __user *src)
{
snd_pcm_sw_params_t params;
+ snd_pcm_uframes_t boundary;
int err;
memset(&params, 0, sizeof(params));
@@ -120,10 +134,17 @@ static int snd_pcm_ioctl_sw_params_compat(snd_pcm_substream_t *substream,
get_user(params.silence_threshold, &src->silence_threshold) ||
get_user(params.silence_size, &src->silence_size))
return -EFAULT;
+ /*
+ * Check silent_size parameter. Since we have 64bit boundary,
+ * silence_size must be compared with the 32bit boundary.
+ */
+ boundary = recalculate_boundary(substream->runtime);
+ if (boundary && params.silence_size >= boundary)
+ params.silence_size = substream->runtime->boundary;
err = snd_pcm_sw_params(substream, &params);
if (err < 0)
return err;
- if (put_user(params.boundary, &src->boundary))
+ if (boundary && put_user(boundary, &src->boundary))
return -EFAULT;
return err;
}
@@ -199,16 +220,6 @@ static int snd_pcm_status_user_compat(snd_pcm_substream_t *substream,
return err;
}
-/* recalcuate the boundary within 32bit */
-static void recalculate_boundary(snd_pcm_runtime_t *runtime)
-{
- if (! runtime->buffer_size)
- return;
- runtime->boundary = runtime->buffer_size;
- while (runtime->boundary * 2 <= 0x7fffffffUL - runtime->buffer_size)
- runtime->boundary *= 2;
-}
-
/* both for HW_PARAMS and HW_REFINE */
static int snd_pcm_ioctl_hw_params_compat(snd_pcm_substream_t *substream,
int refine,
@@ -241,8 +252,11 @@ static int snd_pcm_ioctl_hw_params_compat(snd_pcm_substream_t *substream,
goto error;
}
- if (! refine)
- recalculate_boundary(runtime);
+ if (! refine) {
+ unsigned int new_boundary = recalculate_boundary(runtime);
+ if (new_boundary)
+ runtime->boundary = new_boundary;
+ }
error:
kfree(data);
return err;
@@ -380,6 +394,7 @@ static int snd_pcm_ioctl_sync_ptr_compat(snd_pcm_substream_t *substream,
u32 sflags;
struct sndrv_pcm_mmap_control scontrol;
struct sndrv_pcm_mmap_status sstatus;
+ snd_pcm_uframes_t boundary;
int err;
snd_assert(runtime, return -EINVAL);
@@ -395,17 +410,21 @@ static int snd_pcm_ioctl_sync_ptr_compat(snd_pcm_substream_t *substream,
}
status = runtime->status;
control = runtime->control;
+ boundary = recalculate_boundary(runtime);
+ if (! boundary)
+ boundary = 0x7fffffff;
snd_pcm_stream_lock_irq(substream);
+ /* FIXME: we should consider the boundary for the sync from app */
if (!(sflags & SNDRV_PCM_SYNC_PTR_APPL))
control->appl_ptr = scontrol.appl_ptr;
else
- scontrol.appl_ptr = control->appl_ptr;
+ scontrol.appl_ptr = control->appl_ptr % boundary;
if (!(sflags & SNDRV_PCM_SYNC_PTR_AVAIL_MIN))
control->avail_min = scontrol.avail_min;
else
scontrol.avail_min = control->avail_min;
sstatus.state = status->state;
- sstatus.hw_ptr = status->hw_ptr;
+ sstatus.hw_ptr = status->hw_ptr % boundary;
sstatus.tstamp = status->tstamp;
sstatus.suspended_state = status->suspended_state;
snd_pcm_stream_unlock_irq(substream);

sound/core/pcm_lib.c

View file
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index c5bfd09..0082914 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1584,8 +1584,8 @@ int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
return snd_pcm_hw_param_value(params, var, NULL);
}
-int _snd_pcm_hw_param_mask(snd_pcm_hw_params_t *params,
- snd_pcm_hw_param_t var, const snd_mask_t *val)
+static int _snd_pcm_hw_param_mask(snd_pcm_hw_params_t *params,
+ snd_pcm_hw_param_t var, const snd_mask_t *val)
{
int changed;
assert(hw_is_mask(var));
@@ -2063,7 +2063,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream,
if (((avail < runtime->control->avail_min && size > avail) ||
(size >= runtime->xfer_align && avail < runtime->xfer_align))) {
wait_queue_t wait;
- enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED } state;
+ enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED, DROPPED } state;
long tout;
if (nonblock) {
@@ -2097,6 +2097,9 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream,
case SNDRV_PCM_STATE_SUSPENDED:
state = SUSPENDED;
goto _end_loop;
+ case SNDRV_PCM_STATE_SETUP:
+ state = DROPPED;
+ goto _end_loop;
default:
break;
}
@@ -2123,6 +2126,9 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream,
snd_printd("playback write error (DMA or IRQ trouble?)\n");
err = -EIO;
goto _end_unlock;
+ case DROPPED:
+ err = -EBADFD;
+ goto _end_unlock;
default:
break;
}
@@ -2359,7 +2365,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream,
} else if ((avail < runtime->control->avail_min && size > avail) ||
(size >= runtime->xfer_align && avail < runtime->xfer_align)) {
wait_queue_t wait;
- enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED } state;
+ enum { READY, SIGNALED, ERROR, SUSPENDED, EXPIRED, DROPPED } state;
long tout;
if (nonblock) {
@@ -2394,6 +2400,9 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream,
goto _end_loop;
case SNDRV_PCM_STATE_DRAINING:
goto __draining;
+ case SNDRV_PCM_STATE_SETUP:
+ state = DROPPED;
+ goto _end_loop;
default:
break;
}
@@ -2420,6 +2429,9 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream,
snd_printd("capture read error (DMA or IRQ trouble?)\n");
err = -EIO;
goto _end_unlock;
+ case DROPPED:
+ err = -EBADFD;
+ goto _end_unlock;
default:
break;
}

sound/core/pcm_native.c

View file
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 10c2c98..03c1715 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1025,7 +1025,7 @@ static void snd_pcm_post_suspend(snd_pcm_substream_t *substream, int state)
snd_pcm_runtime_t *runtime = substream->runtime;
snd_pcm_trigger_tstamp(substream);
if (substream->timer)
- snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MPAUSE, &runtime->trigger_tstamp);
+ snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSUSPEND, &runtime->trigger_tstamp);
runtime->status->suspended_state = runtime->status->state;
runtime->status->state = SNDRV_PCM_STATE_SUSPENDED;
snd_pcm_tick_set(substream, 0);
@@ -1115,7 +1115,7 @@ static void snd_pcm_post_resume(snd_pcm_substream_t *substream, int state)
snd_pcm_runtime_t *runtime = substream->runtime;
snd_pcm_trigger_tstamp(substream);
if (substream->timer)
- snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MCONTINUE, &runtime->trigger_tstamp);
+ snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MRESUME, &runtime->trigger_tstamp);
runtime->status->state = runtime->status->suspended_state;
if (runtime->sleep_min)
snd_pcm_tick_prepare(substream);
@@ -1967,13 +1967,12 @@ static int snd_pcm_release_file(snd_pcm_file_t * pcm_file)
runtime = substream->runtime;
str = substream->pstr;
snd_pcm_unlink(substream);
- if (substream->open_flag) {
+ if (substream->ffile != NULL) {
if (substream->ops->hw_free != NULL)
substream->ops->hw_free(substream);
substream->ops->close(substream);
- substream->open_flag = 0;
+ substream->ffile = NULL;
}
- substream->ffile = NULL;
snd_pcm_remove_file(str, pcm_file);
snd_pcm_release_substream(substream);
kfree(pcm_file);
@@ -2022,18 +2021,15 @@ static int snd_pcm_open_file(struct file *file,

This diff is incomplete. Download the complete patch.

sound/core/sound_oss.c

View file

This diff is incomplete. Download the complete patch.

sound/core/timer.c

View file

This diff is incomplete. Download the complete patch.

sound/drivers/vx/vx_mixer.c

View file

This diff is incomplete. Download the complete patch.

sound/drivers/vx/vx_pcm.c

View file

This diff is incomplete. Download the complete patch.

sound/isa/ad1816a/ad1816a.c

View file

This diff is incomplete. Download the complete patch.

sound/isa/ad1816a/ad1816a_lib.c

View file

This diff is incomplete. Download the complete patch.

sound/isa/ad1848/ad1848_lib.c

View file

This diff is incomplete. Download the complete patch.

sound/isa/cmi8330.c

View file

This diff is incomplete. Download the complete patch.

sound/isa/cs423x/cs4231_lib.c

View file

This diff is incomplete. Download the complete patch.

sound/isa/gus/gus_io.c

View file

This diff is incomplete. Download the complete patch.

sound/isa/opl3sa2.c

View file

This diff is incomplete. Download the complete patch.

sound/isa/sb/sb16_main.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/Kconfig

View file

This diff is incomplete. Download the complete patch.

sound/pci/ac97/Makefile

View file

This diff is incomplete. Download the complete patch.

sound/pci/ac97/ac97_bus.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/ac97/ac97_codec.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/ac97/ac97_patch.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/ac97/ac97_patch.h

View file

This diff is incomplete. Download the complete patch.

sound/pci/ali5451/ali5451.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/atiixp.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/au88x0/au88x0_pcm.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/ca0106/ca0106_main.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/ca0106/ca0106_mixer.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/cmipci.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/cs46xx/cs46xx.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/cs46xx/cs46xx_lib.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/emu10k1/emu10k1.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/emu10k1/emu10k1_main.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/emu10k1/emu10k1x.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/emu10k1/emufx.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/emu10k1/emumixer.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/emu10k1/emupcm.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/ens1370.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/fm801.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/hda/Makefile

View file

This diff is incomplete. Download the complete patch.

sound/pci/hda/hda_codec.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/hda/hda_codec.h

View file

This diff is incomplete. Download the complete patch.

sound/pci/hda/hda_generic.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/hda/hda_intel.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/hda/hda_patch.h

View file

This diff is incomplete. Download the complete patch.

sound/pci/hda/patch_analog.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/hda/patch_cmedia.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/hda/patch_realtek.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/hda/patch_si3054.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/ice1712/delta.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/ice1712/ice1712.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/ice1712/ice1724.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/intel8x0.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/korg1212/korg1212.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/nm256/nm256.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/rme32.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/rme96.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/rme9652/hdsp.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/rme9652/hdspm.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/rme9652/rme9652.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/trident/trident_main.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/via82xx.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/via82xx_modem.c

View file

This diff is incomplete. Download the complete patch.

sound/pci/ymfpci/ymfpci_main.c

View file

This diff is incomplete. Download the complete patch.

sound/pcmcia/vx/vxpocket.c

View file

This diff is incomplete. Download the complete patch.

sound/sound_core.c

View file

This diff is incomplete. Download the complete patch.

sound/synth/emux/emux_synth.c

View file

This diff is incomplete. Download the complete patch.

sound/usb/usbaudio.c

View file

This diff is incomplete. Download the complete patch.

sound/usb/usbmidi.c

View file

This diff is incomplete. Download the complete patch.

sound/usb/usx2y/usx2yhwdeppcm.c

View file

This diff is incomplete. Download the complete patch.