aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-09-14 08:57:30 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-09-14 08:57:30 -0400
commitdbaa9a9d2b37d838125fb7f2b9fdc5dc5fa4eaa9 (patch)
tree8641efeba632bddfa0e486b41a5f19578b1a1a31 /sound
parent142e27fc8a3619471669d6241784eec9167c47d1 (diff)
parent2f4ba45a75d6383b4a1201169a808ffea416ffa0 (diff)
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'sound')
-rw-r--r--sound/isa/sb/sb16_csp.c44
-rw-r--r--sound/oss/midibuf.c2
-rw-r--r--sound/oss/skeleton.c219
-rw-r--r--sound/oss/soundcard.c3
-rw-r--r--sound/oss/sys_timer.c3
-rw-r--r--sound/oss/uart6850.c3
-rw-r--r--sound/usb/usbaudio.c10
7 files changed, 29 insertions, 255 deletions
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index b62920eead3..d64790bcd83 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -42,8 +42,6 @@ MODULE_LICENSE("GPL");
#else
#define CSP_HDR_VALUE(a,b,c,d) ((d) | ((c)<<8) | ((b)<<16) | ((a)<<24))
#endif
-#define LE_SHORT(v) le16_to_cpu(v)
-#define LE_INT(v) le32_to_cpu(v)
#define RIFF_HEADER CSP_HDR_VALUE('R', 'I', 'F', 'F')
#define CSP__HEADER CSP_HDR_VALUE('C', 'S', 'P', ' ')
@@ -56,20 +54,20 @@ MODULE_LICENSE("GPL");
/*
* RIFF data format
*/
-typedef struct riff_header {
+struct riff_header {
__u32 name;
__u32 len;
-} riff_header_t;
+};
-typedef struct desc_header {
- riff_header_t info;
+struct desc_header {
+ struct riff_header info;
__u16 func_nr;
__u16 VOC_type;
__u16 flags_play_rec;
__u16 flags_16bit_8bit;
__u16 flags_stereo_mono;
__u16 flags_rates;
-} desc_header_t;
+};
/*
* prototypes
@@ -302,9 +300,9 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user
unsigned char __user *data_end;
unsigned short func_nr = 0;
- riff_header_t file_h, item_h, code_h;
+ struct riff_header file_h, item_h, code_h;
__u32 item_type;
- desc_header_t funcdesc_h;
+ struct desc_header funcdesc_h;
unsigned long flags;
int err;
@@ -316,12 +314,12 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user
if (copy_from_user(&file_h, data_ptr, sizeof(file_h)))
return -EFAULT;
if ((file_h.name != RIFF_HEADER) ||
- (LE_INT(file_h.len) >= SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE - sizeof(file_h))) {
+ (le32_to_cpu(file_h.len) >= SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE - sizeof(file_h))) {
snd_printd("%s: Invalid RIFF header\n", __FUNCTION__);
return -EINVAL;
}
data_ptr += sizeof(file_h);
- data_end = data_ptr + LE_INT(file_h.len);
+ data_end = data_ptr + le32_to_cpu(file_h.len);
if (copy_from_user(&item_type, data_ptr, sizeof(item_type)))
return -EFAULT;
@@ -331,7 +329,7 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user
}
data_ptr += sizeof (item_type);
- for (; data_ptr < data_end; data_ptr += LE_INT(item_h.len)) {
+ for (; data_ptr < data_end; data_ptr += le32_to_cpu(item_h.len)) {
if (copy_from_user(&item_h, data_ptr, sizeof(item_h)))
return -EFAULT;
data_ptr += sizeof(item_h);
@@ -344,7 +342,7 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user
case FUNC_HEADER:
if (copy_from_user(&funcdesc_h, data_ptr + sizeof(item_type), sizeof(funcdesc_h)))
return -EFAULT;
- func_nr = LE_SHORT(funcdesc_h.func_nr);
+ func_nr = le16_to_cpu(funcdesc_h.func_nr);
break;
case CODE_HEADER:
if (func_nr != info.func_req)
@@ -370,11 +368,11 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user
if (code_h.name != INIT_HEADER)
break;
data_ptr += sizeof(code_h);
- err = snd_sb_csp_load_user(p, data_ptr, LE_INT(code_h.len),
+ err = snd_sb_csp_load_user(p, data_ptr, le32_to_cpu(code_h.len),
SNDRV_SB_CSP_LOAD_INITBLOCK);
if (err)
return err;
- data_ptr += LE_INT(code_h.len);
+ data_ptr += le32_to_cpu(code_h.len);
}
/* main microcode block */
if (copy_from_user(&code_h, data_ptr, sizeof(code_h)))
@@ -386,17 +384,17 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user
}
data_ptr += sizeof(code_h);
err = snd_sb_csp_load_user(p, data_ptr,
- LE_INT(code_h.len), 0);
+ le32_to_cpu(code_h.len), 0);
if (err)
return err;
/* fill in codec header */
strlcpy(p->codec_name, info.codec_name, sizeof(p->codec_name));
p->func_nr = func_nr;
- p->mode = LE_SHORT(funcdesc_h.flags_play_rec);
- switch (LE_SHORT(funcdesc_h.VOC_type)) {
+ p->mode = le16_to_cpu(funcdesc_h.flags_play_rec);
+ switch (le16_to_cpu(funcdesc_h.VOC_type)) {
case 0x0001: /* QSound decoder */
- if (LE_SHORT(funcdesc_h.flags_play_rec) == SNDRV_SB_CSP_MODE_DSP_WRITE) {
+ if (le16_to_cpu(funcdesc_h.flags_play_rec) == SNDRV_SB_CSP_MODE_DSP_WRITE) {
if (snd_sb_qsound_build(p) == 0)
/* set QSound flag and clear all other mode flags */
p->mode = SNDRV_SB_CSP_MODE_QSOUND;
@@ -426,12 +424,12 @@ static int snd_sb_csp_riff_load(snd_sb_csp_t * p, snd_sb_csp_microcode_t __user
p->mode = 0;
snd_printd("%s: Unsupported CSP codec type: 0x%04x\n",
__FUNCTION__,
- LE_SHORT(funcdesc_h.VOC_type));
+ le16_to_cpu(funcdesc_h.VOC_type));
return -EINVAL;
}
- p->acc_channels = LE_SHORT(funcdesc_h.flags_stereo_mono);
- p->acc_width = LE_SHORT(funcdesc_h.flags_16bit_8bit);
- p->acc_rates = LE_SHORT(funcdesc_h.flags_rates);
+ p->acc_channels = le16_to_cpu(funcdesc_h.flags_stereo_mono);
+ p->acc_width = le16_to_cpu(funcdesc_h.flags_16bit_8bit);
+ p->acc_rates = le16_to_cpu(funcdesc_h.flags_rates);
/* Decouple CSP from IRQ and DMAREQ lines */
spin_lock_irqsave(&p->chip->reg_lock, flags);
diff --git a/sound/oss/midibuf.c b/sound/oss/midibuf.c
index b2676fa3463..6982556ded5 100644
--- a/sound/oss/midibuf.c
+++ b/sound/oss/midibuf.c
@@ -50,7 +50,7 @@ static struct midi_parms parms[MAX_MIDI_DEV];
static void midi_poll(unsigned long dummy);
-static struct timer_list poll_timer = TIMER_INITIALIZER(midi_poll, 0, 0);
+static DEFINE_TIMER(poll_timer, midi_poll, 0, 0);
static volatile int open_devs;
static DEFINE_SPINLOCK(lock);
diff --git a/sound/oss/skeleton.c b/sound/oss/skeleton.c
deleted file mode 100644
index 8fea783dd0c..00000000000
--- a/sound/oss/skeleton.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * PCI sound skeleton example
- *
- * (c) 1998 Red Hat Software
- *
- * This software may be used and distributed according to the
- * terms of the GNU General Public License, incorporated herein by
- * reference.
- *
- * This example is designed to be built in the linux/drivers/sound
- * directory as part of a kernel build. The example is modular only
- * drop me a note once you have a working modular driver and want
- * to integrate it with the main code.
- * -- Alan <alan@redhat.com>
- *
- * This is a first draft. Please report any errors, corrections or
- * improvements to me.
- */
-
-#include <linux/module.h>
-#include <linux/delay.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/kernel.h>
-#include <linux/pci.h>
-
-#include <asm/io.h>
-
-#include "sound_config.h"
-
-/*
- * Define our PCI vendor ID here
- */
-
-#ifndef PCI_VENDOR_MYIDENT
-#define PCI_VENDOR_MYIDENT 0x125D
-
-/*
- * PCI identity for the card.
- */
-
-#define PCI_DEVICE_ID_MYIDENT_MYCARD1 0x1969
-#endif
-
-#define CARD_NAME "ExampleWave 3D Pro Ultra ThingyWotsit"
-
-#define MAX_CARDS 8
-
-/*
- * Each address_info object holds the information about one of
- * our card resources. In this case the MSS emulation of our
- * ficticious card. Its used to manage and attach things.
- */
-
-static struct address_info mss_data[MAX_CARDS];
-static int cards;
-
-/*
- * Install the actual card. This is an example
- */
-
-static int mycard_install(struct pci_dev *pcidev)
-{
- int iobase;
- int mssbase;
- int mpubase;
- u8 x;
- u16 w;
- u32 v;
- int i;
- int dma;
-
- /*
- * Our imaginary code has its I/O on PCI address 0, a
- * MSS on PCI address 1 and an MPU on address 2
- *
- * For the example we will only initialise the MSS
- */
-
- iobase = pci_resource_start(pcidev, 0);
- mssbase = pci_resource_start(pcidev, 1);
- mpubase = pci_resource_start(pcidev, 2);
-
- /*
- * Reset the board
- */
-
- /*
- * Wait for completion. udelay() waits in microseconds
- */
-
- udelay(100);
-
- /*
- * Ok card ready. Begin setup proper. You might for example
- * load the firmware here
- */
-
- dma = card_specific_magic(ioaddr);
-
- /*
- * Turn on legacy mode (example), There are also byte and
- * dword (32bit) PCI configuration function calls
- */
-
- pci_read_config_word(pcidev, 0x40, &w);
- w&=~(1<<15); /* legacy decode on */
- w|=(1<<14); /* Reserved write as 1 in this case */
- w|=(1<<3)|(1<<1)|(1<<0); /* SB on , FM on, MPU on */
- pci_write_config_word(pcidev, 0x40, w);
-
- /*
- * Let the user know we found his toy.
- */
-
- printk(KERN_INFO "Programmed "CARD_NAME" at 0x%X to legacy mode.\n",
- iobase);
-
- /*
- * Now set it up the description of the card
- */
-
- mss_data[cards].io_base = mssbase;
- mss_data[cards].irq = pcidev->irq;
- mss_data[cards].dma = dma;
-
- /*
- * Check there is an MSS present
- */
-
- if(ad1848_detect(mssbase, NULL, mss_data[cards].osp)==0)
- return 0;
-
- /*
- * Initialize it
- */
-
- mss_data[cards].slots[3] = ad1848_init("MyCard MSS 16bit",
- mssbase,
- mss_data[cards].irq,
- mss_data[cards].dma,
- mss_data[cards].dma,
- 0,
- 0,
- THIS_MODULE);
-
- cards++;
- return 1;
-}
-
-
-/*
- * This loop walks the PCI configuration database and finds where
- * the sound cards are.
- */
-
-int init_mycard(void)
-{
- struct pci_dev *pcidev=NULL;
- int count=0;
-
- while((pcidev = pci_find_device(PCI_VENDOR_MYIDENT, PCI_DEVICE_ID_MYIDENT_MYCARD1, pcidev))!=NULL)
- {
- if (pci_enable_device(pcidev))
- continue;
- count+=mycard_install(pcidev);
- if(count)
- return 0;
- if(count==MAX_CARDS)
- break;
- }
-
- if(count==0)
- return -ENODEV;
- return 0;
-}
-
-/*
- * This function is called when the user or kernel loads the
- * module into memory.
- */
-
-
-int init_module(void)
-{
- if(init_mycard()<0)
- {
- printk(KERN_ERR "No "CARD_NAME" cards found.\n");
- return -ENODEV;
- }
-
- return 0;
-}
-
-/*
- * This is called when it is removed. It will only be removed
- * when its use count is 0.
- */
-
-void cleanup_module(void)
-{
- for(i=0;i< cards; i++)
- {
- /*
- * Free attached resources
- */
-
- ad1848_unload(mss_data[i].io_base,
- mss_data[i].irq,
- mss_data[i].dma,
- mss_data[i].dma,
- 0);
- /*
- * And disconnect the device from the kernel
- */
- sound_unload_audiodevice(mss_data[i].slots[3]);
- }
-}
-
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index a686be936af..95fa81e26de 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -681,8 +681,7 @@ static void do_sequencer_timer(unsigned long dummy)
}
-static struct timer_list seq_timer =
- TIMER_INITIALIZER(do_sequencer_timer, 0, 0);
+static DEFINE_TIMER(seq_timer, do_sequencer_timer, 0, 0);
void request_sound_timer(int count)
{
diff --git a/sound/oss/sys_timer.c b/sound/oss/sys_timer.c
index 6afe29b763b..c9d04518b17 100644
--- a/sound/oss/sys_timer.c
+++ b/sound/oss/sys_timer.c
@@ -28,8 +28,7 @@ static unsigned long prev_event_time;
static void poll_def_tmr(unsigned long dummy);
static DEFINE_SPINLOCK(lock);
-
-static struct timer_list def_tmr = TIMER_INITIALIZER(poll_def_tmr, 0, 0);
+static DEFINE_TIMER(def_tmr, poll_def_tmr, 0, 0);
static unsigned long
tmr2ticks(int tmr_value)
diff --git a/sound/oss/uart6850.c b/sound/oss/uart6850.c
index be00cf12865..74ae75f9e2d 100644
--- a/sound/oss/uart6850.c
+++ b/sound/oss/uart6850.c
@@ -78,8 +78,7 @@ static void (*midi_input_intr) (int dev, unsigned char data);
static void poll_uart6850(unsigned long dummy);
-static struct timer_list uart6850_timer =
- TIMER_INITIALIZER(poll_uart6850, 0, 0);
+static DEFINE_TIMER(uart6850_timer, poll_uart6850, 0, 0);
static void uart6850_input_loop(void)
{
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 5aa5fe651a8..bfbec587665 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -735,10 +735,9 @@ static int deactivate_urbs(snd_usb_substream_t *subs, int force, int can_sleep)
if (test_bit(i, &subs->active_mask)) {
if (! test_and_set_bit(i, &subs->unlink_mask)) {
struct urb *u = subs->dataurb[i].urb;
- if (async) {
- u->transfer_flags |= URB_ASYNC_UNLINK;
+ if (async)
usb_unlink_urb(u);
- } else
+ else
usb_kill_urb(u);
}
}
@@ -748,10 +747,9 @@ static int deactivate_urbs(snd_usb_substream_t *subs, int force, int can_sleep)
if (test_bit(i+16, &subs->active_mask)) {
if (! test_and_set_bit(i+16, &subs->unlink_mask)) {
struct urb *u = subs->syncurb[i].urb;
- if (async) {
- u->transfer_flags |= URB_ASYNC_UNLINK;
+ if (async)
usb_unlink_urb(u);
- } else
+ else
usb_kill_urb(u);
}
}