patch-2.3.99-pre3 linux/drivers/pcmcia/ti113x.h

Next file: linux/drivers/pcmcia/yenta.c
Previous file: linux/drivers/pci/pci.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre2/linux/drivers/pcmcia/ti113x.h linux/drivers/pcmcia/ti113x.h
@@ -137,16 +137,32 @@
 #ifdef CONFIG_CARDBUS
 
 /*
- * Generic TI open - TI has an extension for the
+ * Generic TI init - TI has an extension for the
  * INTCTL register that sets the PCI CSC interrupt.
  * Make sure we set it correctly at open and init
- * time.
+ * time
+ * - open: disable the PCI CSC interrupt. This makes
+ *   it possible to use the CSC interrupt to probe the
+ *   ISA interrupts.
+ * - init: set the interrupt to match our PCI state.
+ *   This makes us correctly get PCI CSC interrupt
+ *   events.
  */
 static int ti_open(pci_socket_t *socket)
 {
 	u8 new, reg = exca_readb(socket, I365_INTCTL);
 
 	new = reg & ~I365_INTR_ENA;
+	if (new != reg)
+		exca_writeb(socket, I365_INTCTL, new);
+	return 0;
+}
+
+static int ti_intctl(pci_socket_t *socket)
+{
+	u8 new, reg = exca_readb(socket, I365_INTCTL);
+
+	new = reg & ~I365_INTR_ENA;
 	if (socket->cb_irq)
 		new |= I365_INTR_ENA;
 	if (new != reg)
@@ -157,7 +173,7 @@
 static int ti_init(pci_socket_t *socket)
 {
 	yenta_init(socket);
-	ti_open(socket);
+	ti_intctl(socket);
 	return 0;
 }
 
@@ -200,7 +216,7 @@
 	config_writel(socket, TI113X_SYSTEM_CONTROL, ti_sysctl(socket));
 	config_writeb(socket, TI113X_CARD_CONTROL, ti_cardctl(socket));
 	config_writeb(socket, TI113X_DEVICE_CONTROL, ti_devctl(socket));
-	ti_open(socket);
+	ti_intctl(socket);
 	return 0;
 }
 
@@ -237,7 +253,7 @@
 	yenta_init(socket);
 
 	config_writeb(socket, TI1250_DIAGNOSTIC, ti_diag(socket));
-	ti_open(socket);
+	ti_intctl(socket);
 	return 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)