]> git.neil.brown.name Git - history.git/commitdiff
[PCMCIA] add EnE specific initialization to fix HDSP
authorDaniel Ritz <daniel.ritz@ch.rmk.(none)>
Tue, 4 May 2004 22:31:38 +0000 (23:31 +0100)
committerRussell King <rmk@flint.arm.linux.org.uk>
Tue, 4 May 2004 22:31:38 +0000 (23:31 +0100)
Patch from Daniel Ritz.

This patch clears an almost undocumented EnE specific test register
that makes sound on RME Hammerfall DSP Carbus work...should even work
after suspend.

drivers/pcmcia/ti113x.h

index 496a51923285997287e114b3235f9a4d04fb61a6..315f634fd7f10377a995a4283c486193015e3e6a 100644 (file)
 /* ExCA IO offset registers */
 #define TI113X_IO_OFFSET(map)          (0x36+((map)<<1))
 
+/* EnE test register */
+#define ENE_TEST_C9                    0xc9    /* 8bit */
+#define ENE_TEST_C9_TLTENABLE          0x02
+
 #ifdef CONFIG_CARDBUS
 
 /*
 #define ti_devctl(socket)      ((socket)->private[2])
 #define ti_diag(socket)                ((socket)->private[3])
 #define ti_mfunc(socket)       ((socket)->private[4])
+#define ene_test_c9(socket)    ((socket)->private[5])
 
 /*
  * These are the TI specific power management handlers.
@@ -171,6 +176,9 @@ static void ti_save_state(struct yenta_socket *socket)
        ti_cardctl(socket) = config_readb(socket, TI113X_CARD_CONTROL);
        ti_devctl(socket) = config_readb(socket, TI113X_DEVICE_CONTROL);
        ti_diag(socket) = config_readb(socket, TI1250_DIAGNOSTIC);
+
+       if (socket->dev->vendor == PCI_VENDOR_ID_ENE)
+               ene_test_c9(socket) = config_readb(socket, ENE_TEST_C9);
 }
 
 static void ti_restore_state(struct yenta_socket *socket)
@@ -180,6 +188,9 @@ static void ti_restore_state(struct yenta_socket *socket)
        config_writeb(socket, TI113X_CARD_CONTROL, ti_cardctl(socket));
        config_writeb(socket, TI113X_DEVICE_CONTROL, ti_devctl(socket));
        config_writeb(socket, TI1250_DIAGNOSTIC, ti_diag(socket));
+
+       if (socket->dev->vendor == PCI_VENDOR_ID_ENE)
+               config_writeb(socket, ENE_TEST_C9, ene_test_c9(socket));
 }
 
 /*
@@ -591,6 +602,16 @@ static int ti12xx_override(struct yenta_socket *socket)
                config_writel(socket, TI113X_SYSTEM_CONTROL, val);
        }
 
+       /*
+        * for EnE bridges only: clear testbit TLTEnable. this makes the
+        * RME Hammerfall DSP sound card working.
+        */
+       if (socket->dev->vendor == PCI_VENDOR_ID_ENE) {
+               u8 test_c9 = config_readb(socket, ENE_TEST_C9);
+               test_c9 &= ~ENE_TEST_C9_TLTENABLE;
+               config_writeb(socket, ENE_TEST_C9, test_c9);
+       }
+
        /*
         * Yenta expects controllers to use CSCINT to route
         * CSC interrupts to PCI rather than INTVAL.