Commit f7e40ac9 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] cmpci cleanup

cmpci probing partially cleaned up in preparation to mpu401 fixes
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 549b4360
...@@ -3000,6 +3000,7 @@ static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id ...@@ -3000,6 +3000,7 @@ static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id
mm_segment_t fs; mm_segment_t fs;
int i, val, ret; int i, val, ret;
unsigned char reg_mask; unsigned char reg_mask;
int timeout;
struct { struct {
unsigned short deviceid; unsigned short deviceid;
char *devicename; char *devicename;
...@@ -3184,15 +3185,6 @@ static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id ...@@ -3184,15 +3185,6 @@ static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id
} }
#endif #endif
#ifdef CONFIG_SOUND_CMPCI_MIDI #ifdef CONFIG_SOUND_CMPCI_MIDI
/* disable MPU-401 */
maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0x04, 0);
s->mpu_data.name = "cmpci mpu";
s->mpu_data.io_base = s->iomidi;
s->mpu_data.irq = -s->irq; // tell mpu401 to share irq
if (probe_mpu401(&s->mpu_data))
s->iomidi = 0;
if (s->iomidi) {
/* set IO based at 0x330 */
switch (s->iomidi) { switch (s->iomidi) {
case 0x330: case 0x330:
reg_mask = 0; reg_mask = 0;
...@@ -3208,13 +3200,19 @@ static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id ...@@ -3208,13 +3200,19 @@ static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id
break; break;
default: default:
s->iomidi = 0; s->iomidi = 0;
break; goto skip_mpu;
}
/* disable MPU-401 */
maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0x04, 0);
s->mpu_data.name = "cmpci mpu";
s->mpu_data.io_base = s->iomidi;
s->mpu_data.irq = -s->irq; // tell mpu401 to share irq
if (probe_mpu401(&s->mpu_data)) {
s->iomidi = 0;
goto skip_mpu;
} }
maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 3, ~0x60, reg_mask); maskb(s->iobase + CODEC_CMI_LEGACY_CTRL + 3, ~0x60, reg_mask);
/* enable MPU-401 */ /* enable MPU-401 */
if (s->iomidi) {
int timeout;
maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0, 0x04); maskb(s->iobase + CODEC_CMI_FUNCTRL1, ~0, 0x04);
/* clear all previously received interrupt */ /* clear all previously received interrupt */
for (timeout = 900000; timeout > 0; timeout--) { for (timeout = 900000; timeout > 0; timeout--) {
...@@ -3230,8 +3228,7 @@ static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id ...@@ -3230,8 +3228,7 @@ static int __devinit cm_probe(struct pci_dev *pcidev, const struct pci_device_id
attach_mpu401(&s->mpu_data, THIS_MODULE); attach_mpu401(&s->mpu_data, THIS_MODULE);
s->midi_devc = s->mpu_data.slots[1]; s->midi_devc = s->mpu_data.slots[1];
} }
} skip_mpu:
}
#endif #endif
#ifdef CONFIG_SOUND_CMPCI_JOYSTICK #ifdef CONFIG_SOUND_CMPCI_JOYSTICK
/* enable joystick */ /* enable joystick */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment