aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2005-10-31 05:27:41 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-31 19:09:39 -0500
commitd83c671fb7023f69a9582e622d01525054f23b66 (patch)
treec9b72300f45441bbe8571a7fbaaf2aa5e6b3d28c /sound
parent659603ef692d3f6c7c216e80310990253864bf2e (diff)
[PATCH] Creative Audigy 2 cardbus: Add IO window wakeup magic
This adds the magic IO wakeup code for the CardBus version of the Creative Labs Audigy 2 to the snd-emu10k1 driver. Without the magic IO enable sequence, reading from the IO region of the card will fail spectacularly, and the machine will hang. My next task will be getting the driver to actually play sound without distortion. Signed-off-by: James Courtier-Dutton <James@superbug.co.uk> [ This is a work-in-progress, but since it avoids a total lockup if the emu10k module is loaded on a machine with the cardbus card inserted, we're better off with it than without it, even if sound quality is bad right now ] Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index e9cd8e054f25..53aeff0b783a 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -579,6 +579,30 @@ static int __devinit snd_emu10k1_ecard_init(emu10k1_t * emu)
579 return 0; 579 return 0;
580} 580}
581 581
582static int __devinit snd_emu10k1_cardbus_init(emu10k1_t * emu)
583{
584 unsigned long special_port;
585 unsigned int value;
586
587 /* Special initialisation routine
588 * before the rest of the IO-Ports become active.
589 */
590 special_port = emu->port + 0x38;
591 value = inl(special_port);
592 outl(0x00d00000, special_port);
593 value = inl(special_port);
594 outl(0x00d00001, special_port);
595 value = inl(special_port);
596 outl(0x00d0005f, special_port);
597 value = inl(special_port);
598 outl(0x00d0007f, special_port);
599 value = inl(special_port);
600 outl(0x0090007f, special_port);
601 value = inl(special_port);
602
603 return 0;
604}
605
582/* 606/*
583 * Create the EMU10K1 instance 607 * Create the EMU10K1 instance
584 */ 608 */
@@ -624,6 +648,16 @@ static emu_chip_details_t emu_chip_details[] = {
624 .ca0108_chip = 1, 648 .ca0108_chip = 1,
625 .spk71 = 1, 649 .spk71 = 1,
626 .ac97_chip = 1} , 650 .ac97_chip = 1} ,
651 /* Audigy 2 ZS Notebook Cardbus card.*/
652 /* Tested by James@superbug.co.uk 30th October 2005 */
653 /* Not working yet, but progressing. */
654 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x20011102,
655 .driver = "Audigy2", .name = "Audigy 2 ZS Notebook [SB0530]",
656 .id = "Audigy2",
657 .emu10k2_chip = 1,
658 .ca0108_chip = 1,
659 .ca_cardbus_chip = 1,
660 .spk71 = 1} ,
627 {.vendor = 0x1102, .device = 0x0008, 661 {.vendor = 0x1102, .device = 0x0008,
628 .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]", 662 .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]",
629 .id = "Audigy2", 663 .id = "Audigy2",
@@ -1011,6 +1045,11 @@ int __devinit snd_emu10k1_create(snd_card_t * card,
1011 snd_emu10k1_free(emu); 1045 snd_emu10k1_free(emu);
1012 return err; 1046 return err;
1013 } 1047 }
1048 } else if (emu->card_capabilities->ca_cardbus_chip) {
1049 if ((err = snd_emu10k1_cardbus_init(emu)) < 0) {
1050 snd_emu10k1_free(emu);
1051 return err;
1052 }
1014 } else { 1053 } else {
1015 /* 5.1: Enable the additional AC97 Slots. If the emu10k1 version 1054 /* 5.1: Enable the additional AC97 Slots. If the emu10k1 version
1016 does not support this, it shouldn't do any harm */ 1055 does not support this, it shouldn't do any harm */