git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
sound
/
isa
/
sb
/
sb_common.c
diff --git
a/sound/isa/sb/sb_common.c
b/sound/isa/sb/sb_common.c
index
f36383a
..
3094f38
100644
(file)
--- a/
sound/isa/sb/sb_common.c
+++ b/
sound/isa/sb/sb_common.c
@@
-33,22
+33,19
@@
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/io.h>
#include <asm/dma.h>
-#define chip_t sb_t
-
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("ALSA lowlevel driver for Sound Blaster cards");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
MODULE_DESCRIPTION("ALSA lowlevel driver for Sound Blaster cards");
MODULE_LICENSE("GPL");
-MODULE_CLASSES("{sound}");
#define BUSY_LOOPS 100000
#undef IO_DEBUG
#define BUSY_LOOPS 100000
#undef IO_DEBUG
-int snd_sbdsp_command(s
b_t
*chip, unsigned char val)
+int snd_sbdsp_command(s
truct snd_sb
*chip, unsigned char val)
{
int i;
#ifdef IO_DEBUG
{
int i;
#ifdef IO_DEBUG
- snd_printk("command 0x%x\n", val);
+ snd_printk(
KERN_DEBUG
"command 0x%x\n", val);
#endif
for (i = BUSY_LOOPS; i; i--)
if ((inb(SBP(chip, STATUS)) & 0x80) == 0) {
#endif
for (i = BUSY_LOOPS; i; i--)
if ((inb(SBP(chip, STATUS)) & 0x80) == 0) {
@@
-59,7
+56,7
@@
int snd_sbdsp_command(sb_t *chip, unsigned char val)
return 0;
}
return 0;
}
-int snd_sbdsp_get_byte(s
b_t
*chip)
+int snd_sbdsp_get_byte(s
truct snd_sb
*chip)
{
int val;
int i;
{
int val;
int i;
@@
-67,7
+64,7
@@
int snd_sbdsp_get_byte(sb_t *chip)
if (inb(SBP(chip, DATA_AVAIL)) & 0x80) {
val = inb(SBP(chip, READ));
#ifdef IO_DEBUG
if (inb(SBP(chip, DATA_AVAIL)) & 0x80) {
val = inb(SBP(chip, READ));
#ifdef IO_DEBUG
- snd_printk("get_byte 0x%x\n", val);
+ snd_printk(
KERN_DEBUG
"get_byte 0x%x\n", val);
#endif
return val;
}
#endif
return val;
}
@@
-76,7
+73,7
@@
int snd_sbdsp_get_byte(sb_t *chip)
return -ENODEV;
}
return -ENODEV;
}
-int snd_sbdsp_reset(s
b_t
*chip)
+int snd_sbdsp_reset(s
truct snd_sb
*chip)
{
int i;
{
int i;
@@
-95,7
+92,7
@@
int snd_sbdsp_reset(sb_t *chip)
return -ENODEV;
}
return -ENODEV;
}
-
int snd_sbdsp_version(sb_t
* chip)
+
static int snd_sbdsp_version(struct snd_sb
* chip)
{
unsigned int result = -ENODEV;
{
unsigned int result = -ENODEV;
@@
-105,7
+102,7
@@
int snd_sbdsp_version(sb_t * chip)
return result;
}
return result;
}
-static int snd_sbdsp_probe(s
b_t
* chip)
+static int snd_sbdsp_probe(s
truct snd_sb
* chip)
{
int version;
int major, minor;
{
int version;
int major, minor;
@@
-157,7
+154,7
@@
static int snd_sbdsp_probe(sb_t * chip)
str = "16";
break;
default:
str = "16";
break;
default:
- snd_printk("SB [0x%lx]: unknown DSP chip version %i.%i\n",
+ snd_printk(
KERN_INFO
"SB [0x%lx]: unknown DSP chip version %i.%i\n",
chip->port, major, minor);
return -ENODEV;
}
chip->port, major, minor);
return -ENODEV;
}
@@
-179,12
+176,10
@@
static int snd_sbdsp_probe(sb_t * chip)
return 0;
}
return 0;
}
-static int snd_sbdsp_free(s
b_t
*chip)
+static int snd_sbdsp_free(s
truct snd_sb
*chip)
{
{
- if (chip->res_port) {
- release_resource(chip->res_port);
- kfree_nocheck(chip->res_port);
- }
+ if (chip->res_port)
+ release_and_free_resource(chip->res_port);
if (chip->irq >= 0)
free_irq(chip->irq, (void *) chip);
#ifdef CONFIG_ISA
if (chip->irq >= 0)
free_irq(chip->irq, (void *) chip);
#ifdef CONFIG_ISA
@@
-197,34
+192,34
@@
static int snd_sbdsp_free(sb_t *chip)
free_dma(chip->dma16);
}
#endif
free_dma(chip->dma16);
}
#endif
-
snd_magic_
kfree(chip);
+ kfree(chip);
return 0;
}
return 0;
}
-static int snd_sbdsp_dev_free(s
nd_device_t
*device)
+static int snd_sbdsp_dev_free(s
truct snd_device
*device)
{
{
- s
b_t *chip = snd_magic_cast(sb_t, device->device_data, return -ENXIO)
;
+ s
truct snd_sb *chip = device->device_data
;
return snd_sbdsp_free(chip);
}
return snd_sbdsp_free(chip);
}
-int snd_sbdsp_create(s
nd_card_t
*card,
+int snd_sbdsp_create(s
truct snd_card
*card,
unsigned long port,
int irq,
unsigned long port,
int irq,
- irq
return_t (*irq_handler)(int, void *, struct pt_regs *)
,
+ irq
_handler_t irq_handler
,
int dma8,
int dma16,
unsigned short hardware,
int dma8,
int dma16,
unsigned short hardware,
- s
b_t
**r_chip)
+ s
truct snd_sb
**r_chip)
{
{
- s
b_t
*chip;
+ s
truct snd_sb
*chip;
int err;
int err;
- static s
nd_device_ops_t
ops = {
+ static s
truct snd_device_ops
ops = {
.dev_free = snd_sbdsp_dev_free,
};
snd_assert(r_chip != NULL, return -EINVAL);
*r_chip = NULL;
.dev_free = snd_sbdsp_dev_free,
};
snd_assert(r_chip != NULL, return -EINVAL);
*r_chip = NULL;
- chip =
snd_magic_kcalloc(sb_t, 0
, GFP_KERNEL);
+ chip =
kzalloc(sizeof(*chip)
, GFP_KERNEL);
if (chip == NULL)
return -ENOMEM;
spin_lock_init(&chip->reg_lock);
if (chip == NULL)
return -ENOMEM;
spin_lock_init(&chip->reg_lock);
@@
-237,7
+232,7
@@
int snd_sbdsp_create(snd_card_t *card,
chip->port = port;
if (request_irq(irq, irq_handler, hardware == SB_HW_ALS4000 ?
chip->port = port;
if (request_irq(irq, irq_handler, hardware == SB_HW_ALS4000 ?
-
SA_INTERRUPT | SA_SHIRQ : SA_INTERRUPT
,
+
IRQF_SHARED : IRQF_DISABLED
,
"SoundBlaster", (void *) chip)) {
snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq);
snd_sbdsp_free(chip);
"SoundBlaster", (void *) chip)) {
snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq);
snd_sbdsp_free(chip);
@@
-298,6
+293,10
@@
EXPORT_SYMBOL(snd_sbmixer_write);
EXPORT_SYMBOL(snd_sbmixer_read);
EXPORT_SYMBOL(snd_sbmixer_new);
EXPORT_SYMBOL(snd_sbmixer_add_ctl);
EXPORT_SYMBOL(snd_sbmixer_read);
EXPORT_SYMBOL(snd_sbmixer_new);
EXPORT_SYMBOL(snd_sbmixer_add_ctl);
+#ifdef CONFIG_PM
+EXPORT_SYMBOL(snd_sbmixer_suspend);
+EXPORT_SYMBOL(snd_sbmixer_resume);
+#endif
/*
* INIT part
/*
* INIT part