*** sb16_midi.c.orig Wed Jan 8 03:01:02 1997 --- sb16_midi.c Wed Jan 8 03:06:00 1997 *************** *** 278,289 **** --- 278,317 ---- return ok; } + /* + NOTICE: this function is imported OSS/Free 3.8 for Linux + this function initializes MIDI port for Vibra chip + */ + static void + sb16_set_mpu_port (struct address_info *hw_config) + { + /* + * This routine initializes new MIDI port setup register of SB Vibra (CT2502). + */ + unsigned char bits = sb_getmixer (0x84) & ~0x06; + + switch (hw_config->io_base) + { + case 0x300: + sb_setmixer (0x84, bits | 0x04); + break; + + case 0x330: + sb_setmixer (0x84, bits | 0x00); + break; + + default: + sb_setmixer (0x84, bits | 0x02); /* Disable MPU */ + printk ("SB16: Invalid MIDI I/O port %x\n", hw_config->io_base); + } + } int probe_sb16midi (struct address_info *hw_config) { int ok = 0; extern int sbc_major; + extern int sbc_minor; if (sbc_major < 4) return 0; /* Not a SB16 */ *************** *** 292,297 **** --- 320,328 ---- if (sb_get_irq () < 0) return 0; + + if (sbc_minor > 12) /* initialize MIDI port for Vibra chip */ + sb16_set_mpu_port(hw_config); ok = reset_sb16midi ();