Skip to content

Commit

Permalink
Merge HEAD from master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Aug 30, 2005
2 parents 3cb904c + c884697 commit 444bd6f
Show file tree
Hide file tree
Showing 84 changed files with 2,033 additions and 700 deletions.
1 change: 1 addition & 0 deletions Documentation/sound/alsa/ALSA-Configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
15 changes: 11 additions & 4 deletions Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions include/linux/sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions include/sound/ac97_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/

#include <linux/bitops.h>
#include <linux/device.h>
#include "pcm.h"
#include "control.h"
#include "info.h"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -520,6 +524,7 @@ struct _snd_ac97 {
/* jack-sharing info */
unsigned char indep_surround;
unsigned char channel_mode;
struct device dev;
};

/* conditions */
Expand Down Expand Up @@ -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 */
1 change: 1 addition & 0 deletions include/sound/ad1816a.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion include/sound/asound.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion include/sound/cs46xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion include/sound/emu10k1.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions include/sound/gus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
1 change: 0 additions & 1 deletion include/sound/pcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions include/sound/version.h
Original file line number Diff line number Diff line change
@@ -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)"
6 changes: 6 additions & 0 deletions include/sound/ymfpci.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions sound/arm/pxa2xx-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down
5 changes: 2 additions & 3 deletions sound/core/memalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion sound/core/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 4 additions & 7 deletions sound/core/oss/pcm_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
}

Expand Down
Loading

0 comments on commit 444bd6f

Please sign in to comment.