Subject: other pcmcia patches
From: Russell King <[email-masked]>
To: Andrew Morton <[email-masked]>
Date: Tue, 24 Jun 2003 00:00:32 +0100

Andrew,

If you're putting those 6 patches in, this should go before those 6
patches.  Linus should be pulling this tonight.

I think you may already have some of this though.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1372  -> 1.1374 
#	drivers/pcmcia/ti113x.h	1.6     -> 1.8    
#	include/linux/pci_ids.h	1.105   -> 1.106  
#	drivers/pcmcia/yenta_socket.c	1.28    -> 1.29   
#	drivers/ide/legacy/ide-cs.c	1.10    -> 1.11   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/06/22	[email-masked]	1.1373
# Merge flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5
# into flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5-pcmcia
# --------------------------------------------
# 03/06/23	[email-masked]	1.1374
# [PCMCIA] Fix ide-cs driver name (for PCMCIA binding)
# 
# Problem noticed by Eivind Tagseth.
# 
# We seem to have resurected the "ide_cs" driver name for the ide-cs module.
# Restore the driver name to "ide-cs".
# --------------------------------------------
#
diff -Nru a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
--- a/drivers/ide/legacy/ide-cs.c	Mon Jun 23 23:58:26 2003
+++ b/drivers/ide/legacy/ide-cs.c	Mon Jun 23 23:58:26 2003
@@ -473,7 +473,7 @@
 static struct pcmcia_driver ide_cs_driver = {
 	.owner		= THIS_MODULE,
 	.drv		= {
-		.name	= "ide_cs",
+		.name	= "ide-cs",
 	},
 	.attach		= ide_attach,
 	.detach		= ide_detach,
diff -Nru a/drivers/pcmcia/ti113x.h b/drivers/pcmcia/ti113x.h
--- a/drivers/pcmcia/ti113x.h	Mon Jun 23 23:58:26 2003
+++ b/drivers/pcmcia/ti113x.h	Mon Jun 23 23:58:26 2003
@@ -175,6 +175,27 @@
 	new = reg & ~I365_INTR_ENA;
 	if (new != reg)
 		exca_writeb(socket, I365_INTCTL, new);
+
+	/*
+	 * If ISA interrupts don't work, then fall back to routing card
+	 * interrupts to the PCI interrupt of the socket.
+	 */
+	if (!socket->socket.irq_mask) {
+		int irqmux, devctl;
+
+		printk (KERN_INFO "ti113x: Routing card interrupts to PCI\n");
+
+		devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
+		devctl &= ~TI113X_DCR_IMODE_MASK;
+
+		irqmux = config_readl(socket, TI122X_IRQMUX);
+		irqmux = (irqmux & ~0x0f) | 0x02; /* route INTA */
+		irqmux = (irqmux & ~0xf0) | 0x20; /* route INTB */
+
+		config_writel(socket, TI122X_IRQMUX, irqmux);
+		config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
+	}
+
 	socket->socket.ss_entry->init = ti_init;
 	return 0;
 }
@@ -239,6 +260,17 @@
 	ti113x_override(socket);
 	socket->socket.ss_entry->init = ti1250_init;
 	return 0;
+}
+
+
+static int ti12xx_override(struct yenta_socket *socket)
+{
+	/* make sure that memory burst is active */
+	ti_sysctl(socket) = config_readl(socket, TI113X_SYSTEM_CONTROL);
+	ti_sysctl(socket) |= TI122X_SCR_MRBURSTUP;
+	config_writel(socket, TI113X_SYSTEM_CONTROL, ti_sysctl(socket));
+
+	return ti113x_override(socket);
 }
 
 #endif /* CONFIG_CARDBUS */
diff -Nru a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
--- a/drivers/pcmcia/yenta_socket.c	Mon Jun 23 23:58:26 2003
+++ b/drivers/pcmcia/yenta_socket.c	Mon Jun 23 23:58:26 2003
@@ -807,22 +807,29 @@
 	unsigned short device;
 	int (*override) (struct yenta_socket *socket);
 } cardbus_override[] = {
-	{ PD(TI,1130),	&ti113x_override },
 	{ PD(TI,1031),	&ti_override },
-	{ PD(TI,1131),	&ti113x_override },
-	{ PD(TI,1250),	&ti1250_override },
-	{ PD(TI,1220),	&ti_override },
-	{ PD(TI,1221),	&ti_override },
+
+	/* TBD: Check if these TI variants can use more
+	 * advanced overrides instead */
 	{ PD(TI,1210),	&ti_override },
-	{ PD(TI,1450),	&ti_override },
-	{ PD(TI,1225),	&ti_override },
-	{ PD(TI,1251A),	&ti_override },
 	{ PD(TI,1211),	&ti_override },
+	{ PD(TI,1251A),	&ti_override },
 	{ PD(TI,1251B),	&ti_override },
-	{ PD(TI,1410),	ti1250_override },
 	{ PD(TI,1420),	&ti_override },
+	{ PD(TI,1450),	&ti_override },
 	{ PD(TI,4410),	&ti_override },
 	{ PD(TI,4451),	&ti_override },
+
+	{ PD(TI,1130),	&ti113x_override },
+	{ PD(TI,1131),	&ti113x_override },
+
+	{ PD(TI,1220),	&ti12xx_override },
+	{ PD(TI,1221),	&ti12xx_override },
+	{ PD(TI,1225),	&ti12xx_override },
+	{ PD(TI,1520),  &ti12xx_override },
+
+	{ PD(TI,1250),	&ti1250_override },
+	{ PD(TI,1410),	&ti1250_override },
 
 	{ PD(RICOH,RL5C465), &ricoh_override },
 	{ PD(RICOH,RL5C466), &ricoh_override },
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h	Mon Jun 23 23:58:26 2003
+++ b/include/linux/pci_ids.h	Mon Jun 23 23:58:26 2003
@@ -668,7 +668,6 @@
 #define PCI_DEVICE_ID_TI_1220		0xac17
 #define PCI_DEVICE_ID_TI_1221		0xac19
 #define PCI_DEVICE_ID_TI_1210		0xac1a
-#define PCI_DEVICE_ID_TI_1410		0xac50
 #define PCI_DEVICE_ID_TI_1450		0xac1b
 #define PCI_DEVICE_ID_TI_1225		0xac1c
 #define PCI_DEVICE_ID_TI_1251A		0xac1d
@@ -676,7 +675,9 @@
 #define PCI_DEVICE_ID_TI_1251B		0xac1f
 #define PCI_DEVICE_ID_TI_4410		0xac41
 #define PCI_DEVICE_ID_TI_4451		0xac42
+#define PCI_DEVICE_ID_TI_1410		0xac50
 #define PCI_DEVICE_ID_TI_1420		0xac51
+#define PCI_DEVICE_ID_TI_1520		0xac55
 
 #define PCI_VENDOR_ID_SONY		0x104d
 #define PCI_DEVICE_ID_SONY_CXD3222	0x8039

-- 
Russell King ([email-masked])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html