diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2006-09-17 18:17:19 +0200 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2006-09-17 18:19:31 +0200 |
commit | 9b4f2e9576658c4e52d95dc8d309f51b2e2db096 (patch) | |
tree | 7b1902b0f931783fccc6fee45c6f9c16b4fde5ce /sound/pci/emu10k1 | |
parent | 3c6c65f5ed5a6d307bd607aecd06d658c0934d88 (diff) | |
parent | 803db244b9f71102e366fd689000c1417b9a7508 (diff) | |
download | talos-op-linux-9b4f2e9576658c4e52d95dc8d309f51b2e2db096.tar.gz talos-op-linux-9b4f2e9576658c4e52d95dc8d309f51b2e2db096.zip |
ieee1394: merge from Linus
Conflicts: drivers/ieee1394/hosts.c
Patch "lockdep: annotate ieee1394 skb-queue-head locking" was meddling
with patch "ieee1394: fix kerneldoc of hpsb_alloc_host".
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'sound/pci/emu10k1')
-rw-r--r-- | sound/pci/emu10k1/emu10k1.c | 2 | ||||
-rw-r--r-- | sound/pci/emu10k1/emu10k1_main.c | 21 | ||||
-rw-r--r-- | sound/pci/emu10k1/emu10k1x.c | 37 | ||||
-rw-r--r-- | sound/pci/emu10k1/emumpu401.c | 35 | ||||
-rw-r--r-- | sound/pci/emu10k1/irq.c | 6 |
5 files changed, 75 insertions, 26 deletions
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c index 549673ea14a9..289bcd99c19c 100644 --- a/sound/pci/emu10k1/emu10k1.c +++ b/sound/pci/emu10k1/emu10k1.c @@ -77,7 +77,7 @@ MODULE_PARM_DESC(subsystem, "Force card subsystem model."); /* * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 */ -static struct pci_device_id snd_emu10k1_ids[] __devinitdata = { +static struct pci_device_id snd_emu10k1_ids[] = { { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* EMU10K1 */ { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy */ { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy 2 Value SB0400 */ diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index d6f135fe2958..79f24cdf5fbf 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -531,7 +531,7 @@ static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu, snd_emu10k1_ecard_write(emu, emu->ecard_ctrl); } -static int __devinit snd_emu10k1_ecard_init(struct snd_emu10k1 * emu) +static int snd_emu10k1_ecard_init(struct snd_emu10k1 * emu) { unsigned int hc_value; @@ -571,7 +571,7 @@ static int __devinit snd_emu10k1_ecard_init(struct snd_emu10k1 * emu) return 0; } -static int __devinit snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu) +static int snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu) { unsigned long special_port; unsigned int value; @@ -633,7 +633,7 @@ static int snd_emu1212m_fpga_netlist_write(struct snd_emu10k1 * emu, int reg, in return 0; } -static int __devinit snd_emu10k1_emu1212m_init(struct snd_emu10k1 * emu) +static int snd_emu10k1_emu1212m_init(struct snd_emu10k1 * emu) { unsigned int i; int tmp; @@ -936,6 +936,17 @@ static struct snd_emu_chip_details emu_chip_details[] = { .ca0151_chip = 1, .spk71 = 1, .spdif_bug = 1} , + /* Dell OEM/Creative Labs Audigy 2 ZS */ + /* See ALSA bug#1365 */ + {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10031102, + .driver = "Audigy2", .name = "Audigy 2 ZS [SB0353]", + .id = "Audigy2", + .emu10k2_chip = 1, + .ca0102_chip = 1, + .ca0151_chip = 1, + .spk71 = 1, + .spdif_bug = 1, + .ac97_chip = 1} , {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102, .driver = "Audigy2", .name = "Audigy 2 Platinum [SB0240P]", .id = "Audigy2", @@ -1430,6 +1441,10 @@ void snd_emu10k1_resume_init(struct snd_emu10k1 *emu) { if (emu->card_capabilities->ecard) snd_emu10k1_ecard_init(emu); + else if (emu->card_capabilities->ca_cardbus_chip) + snd_emu10k1_cardbus_init(emu); + else if (emu->card_capabilities->emu1212m) + snd_emu10k1_emu1212m_init(emu); else snd_emu10k1_ptr_write(emu, AC97SLOT, 0, AC97SLOT_CNTR|AC97SLOT_LFE); snd_emu10k1_init(emu, emu->enable_ir, 1); diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 2167279429b8..bda8bdf59935 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c @@ -1286,7 +1286,7 @@ static void snd_emu10k1x_midi_interrupt(struct emu10k1x *emu, unsigned int statu do_emu10k1x_midi_interrupt(emu, &emu->midi, status); } -static void snd_emu10k1x_midi_cmd(struct emu10k1x * emu, +static int snd_emu10k1x_midi_cmd(struct emu10k1x * emu, struct emu10k1x_midi *midi, unsigned char cmd, int ack) { unsigned long flags; @@ -1312,11 +1312,14 @@ static void snd_emu10k1x_midi_cmd(struct emu10k1x * emu, ok = 1; } spin_unlock_irqrestore(&midi->input_lock, flags); - if (!ok) + if (!ok) { snd_printk(KERN_ERR "midi_cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)!!!\n", cmd, emu->port, mpu401_read_stat(emu, midi), mpu401_read_data(emu, midi)); + return 1; + } + return 0; } static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream) @@ -1332,12 +1335,17 @@ static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream) midi->substream_input = substream; if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT)) { spin_unlock_irqrestore(&midi->open_lock, flags); - snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1); - snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1); + if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1)) + goto error_out; + if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1)) + goto error_out; } else { spin_unlock_irqrestore(&midi->open_lock, flags); } return 0; + +error_out: + return -EIO; } static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream) @@ -1353,12 +1361,17 @@ static int snd_emu10k1x_midi_output_open(struct snd_rawmidi_substream *substream midi->substream_output = substream; if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) { spin_unlock_irqrestore(&midi->open_lock, flags); - snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1); - snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1); + if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 1)) + goto error_out; + if (snd_emu10k1x_midi_cmd(emu, midi, MPU401_ENTER_UART, 1)) + goto error_out; } else { spin_unlock_irqrestore(&midi->open_lock, flags); } return 0; + +error_out: + return -EIO; } static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream) @@ -1366,6 +1379,7 @@ static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream struct emu10k1x *emu; struct emu10k1x_midi *midi = substream->rmidi->private_data; unsigned long flags; + int err = 0; emu = midi->emu; snd_assert(emu, return -ENXIO); @@ -1375,11 +1389,11 @@ static int snd_emu10k1x_midi_input_close(struct snd_rawmidi_substream *substream midi->substream_input = NULL; if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_OUTPUT)) { spin_unlock_irqrestore(&midi->open_lock, flags); - snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0); + err = snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0); } else { spin_unlock_irqrestore(&midi->open_lock, flags); } - return 0; + return err; } static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substream) @@ -1387,6 +1401,7 @@ static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substrea struct emu10k1x *emu; struct emu10k1x_midi *midi = substream->rmidi->private_data; unsigned long flags; + int err = 0; emu = midi->emu; snd_assert(emu, return -ENXIO); @@ -1396,11 +1411,11 @@ static int snd_emu10k1x_midi_output_close(struct snd_rawmidi_substream *substrea midi->substream_output = NULL; if (!(midi->midi_mode & EMU10K1X_MIDI_MODE_INPUT)) { spin_unlock_irqrestore(&midi->open_lock, flags); - snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0); + err = snd_emu10k1x_midi_cmd(emu, midi, MPU401_RESET, 0); } else { spin_unlock_irqrestore(&midi->open_lock, flags); } - return 0; + return err; } static void snd_emu10k1x_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) @@ -1594,7 +1609,7 @@ static void __devexit snd_emu10k1x_remove(struct pci_dev *pci) } // PCI IDs -static struct pci_device_id snd_emu10k1x_ids[] __devinitdata = { +static struct pci_device_id snd_emu10k1x_ids[] = { { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dell OEM version (EMU10K1) */ { 0, } }; diff --git a/sound/pci/emu10k1/emumpu401.c b/sound/pci/emu10k1/emumpu401.c index d96eb455103f..950c6bcd6b7d 100644 --- a/sound/pci/emu10k1/emumpu401.c +++ b/sound/pci/emu10k1/emumpu401.c @@ -116,7 +116,7 @@ static void snd_emu10k1_midi_interrupt2(struct snd_emu10k1 *emu, unsigned int st do_emu10k1_midi_interrupt(emu, &emu->midi2, status); } -static void snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_midi *midi, unsigned char cmd, int ack) +static int snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_midi *midi, unsigned char cmd, int ack) { unsigned long flags; int timeout, ok; @@ -141,11 +141,14 @@ static void snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_mi ok = 1; } spin_unlock_irqrestore(&midi->input_lock, flags); - if (!ok) + if (!ok) { snd_printk(KERN_ERR "midi_cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)!!!\n", cmd, emu->port, mpu401_read_stat(emu, midi), mpu401_read_data(emu, midi)); + return 1; + } + return 0; } static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream) @@ -161,12 +164,17 @@ static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream) midi->substream_input = substream; if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) { spin_unlock_irqrestore(&midi->open_lock, flags); - snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1); - snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1); + if (snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1)) + goto error_out; + if (snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1)) + goto error_out; } else { spin_unlock_irqrestore(&midi->open_lock, flags); } return 0; + +error_out: + return -EIO; } static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream) @@ -182,12 +190,17 @@ static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream) midi->substream_output = substream; if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) { spin_unlock_irqrestore(&midi->open_lock, flags); - snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1); - snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1); + if (snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 1)) + goto error_out; + if (snd_emu10k1_midi_cmd(emu, midi, MPU401_ENTER_UART, 1)) + goto error_out; } else { spin_unlock_irqrestore(&midi->open_lock, flags); } return 0; + +error_out: + return -EIO; } static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream) @@ -195,6 +208,7 @@ static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream) struct snd_emu10k1 *emu; struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; unsigned long flags; + int err = 0; emu = midi->emu; snd_assert(emu, return -ENXIO); @@ -204,11 +218,11 @@ static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream) midi->substream_input = NULL; if (!(midi->midi_mode & EMU10K1_MIDI_MODE_OUTPUT)) { spin_unlock_irqrestore(&midi->open_lock, flags); - snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0); + err = snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0); } else { spin_unlock_irqrestore(&midi->open_lock, flags); } - return 0; + return err; } static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream) @@ -216,6 +230,7 @@ static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream struct snd_emu10k1 *emu; struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data; unsigned long flags; + int err = 0; emu = midi->emu; snd_assert(emu, return -ENXIO); @@ -225,11 +240,11 @@ static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream midi->substream_output = NULL; if (!(midi->midi_mode & EMU10K1_MIDI_MODE_INPUT)) { spin_unlock_irqrestore(&midi->open_lock, flags); - snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0); + err = snd_emu10k1_midi_cmd(emu, midi, MPU401_RESET, 0); } else { spin_unlock_irqrestore(&midi->open_lock, flags); } - return 0; + return err; } static void snd_emu10k1_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) diff --git a/sound/pci/emu10k1/irq.c b/sound/pci/emu10k1/irq.c index a8b31286b6db..1076af4c3669 100644 --- a/sound/pci/emu10k1/irq.c +++ b/sound/pci/emu10k1/irq.c @@ -37,9 +37,13 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs) int handled = 0; while ((status = inl(emu->port + IPR)) != 0) { - //printk("emu10k1 irq - status = 0x%x\n", status); + //snd_printk(KERN_INFO "emu10k1 irq - status = 0x%x\n", status); orig_status = status; handled = 1; + if ((status & 0xffffffff) == 0xffffffff) { + snd_printk(KERN_INFO "snd-emu10k1: Suspected sound card removal\n"); + break; + } if (status & IPR_PCIERROR) { snd_printk(KERN_ERR "interrupt: PCI error\n"); snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE); |