Commit 4280f798 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] Fix interrupt generation on MIDI input for es1938 sound cards

ES1938 driver
The patch ensures that a es1938 based sound card generates interrupts on
incoming MIDI events. I tested the patch successfully on an ess Solo-1 in
a AlphaPC UX/164.
Signed-off-by: default avatarAndreas Feldner <pelzi@flying-snail.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e3f76858
......@@ -1422,8 +1422,9 @@ static int snd_es1938_free(es1938_t *chip)
{
/* disable irqs */
outb(0x00, SLIO_REG(chip, IRQCONTROL));
/*if (chip->rmidi)
snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0);*/
if (chip->rmidi)
snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0);
#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
if (chip->gameport.io)
gameport_unregister_port(&chip->gameport);
......@@ -1574,6 +1575,9 @@ static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *r
/* MPU401 */
if (status & 0x80) {
// the following line is evil! It switches off MIDI interrupt handling after the first interrupt received.
// replacing the last 0 by 0x40 works for ESS-Solo1, but just doing nothing works as well!
// andreas@flying-snail.de
// snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0); /* ack? */
if (chip->rmidi) {
handled = 1;
......@@ -1688,8 +1692,11 @@ static int __devinit snd_es1938_probe(struct pci_dev *pci,
if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
chip->mpu_port, 1, chip->irq, 0, &chip->rmidi) < 0) {
printk(KERN_ERR "es1938: unable to initialize MPU-401\n");
} /*else
snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0x40);*/
} else {
// this line is vital for MIDI interrupt handling on ess-solo1
// andreas@flying-snail.de
snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0x40);
}
#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
chip->gameport.io = chip->game_port;
......
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