mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Merge HEAD from master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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(¶ms, 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, ¶ms);
|
||||
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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
snd_pcm_release_file(pcm_file);
|
||||
return err;
|
||||
}
|
||||
substream->open_flag = 1;
|
||||
substream->ffile = file;
|
||||
|
||||
err = snd_pcm_hw_constraints_complete(substream);
|
||||
if (err < 0) {
|
||||
snd_printd("snd_pcm_hw_constraints_complete failed\n");
|
||||
substream->ops->close(substream);
|
||||
snd_pcm_release_file(pcm_file);
|
||||
return err;
|
||||
}
|
||||
|
||||
substream->ffile = file;
|
||||
|
||||
file->private_data = pcm_file;
|
||||
*rpcm_file = pcm_file;
|
||||
return 0;
|
||||
|
||||
@@ -98,6 +98,7 @@ int snd_register_oss_device(int type, snd_card_t * card, int dev, snd_minor_t *
|
||||
int cidx = SNDRV_MINOR_OSS_CARD(minor);
|
||||
int track2 = -1;
|
||||
int register1 = -1, register2 = -1;
|
||||
struct device *carddev = NULL;
|
||||
|
||||
if (minor < 0)
|
||||
return minor;
|
||||
@@ -121,11 +122,13 @@ int snd_register_oss_device(int type, snd_card_t * card, int dev, snd_minor_t *
|
||||
track2 = SNDRV_MINOR_OSS(cidx, SNDRV_MINOR_OSS_DMMIDI1);
|
||||
break;
|
||||
}
|
||||
register1 = register_sound_special(reg->f_ops, minor);
|
||||
if (card)
|
||||
carddev = card->dev;
|
||||
register1 = register_sound_special_device(reg->f_ops, minor, carddev);
|
||||
if (register1 != minor)
|
||||
goto __end;
|
||||
if (track2 >= 0) {
|
||||
register2 = register_sound_special(reg->f_ops, track2);
|
||||
register2 = register_sound_special_device(reg->f_ops, track2, carddev);
|
||||
if (register2 != track2)
|
||||
goto __end;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user