fix yenta_socket driver
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-2.6.32 / 940-bcm47xx-yenta.patch
1 Index: linux-2.6.32.9/drivers/pcmcia/yenta_socket.c
2 ===================================================================
3 --- linux-2.6.32.9.orig/drivers/pcmcia/yenta_socket.c 2010-03-12 09:43:45.000000000 +0100
4 +++ linux-2.6.32.9/drivers/pcmcia/yenta_socket.c 2010-03-12 10:05:33.000000000 +0100
5 @@ -866,6 +866,8 @@
6 * Probe for usable interrupts using the force
7 * register to generate bogus card status events.
8 */
9 +#ifndef CONFIG_BCM47XX
10 + /* WRT54G3G does not like this */
11 cb_writel(socket, CB_SOCKET_EVENT, -1);
12 cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
13 exca_writeb(socket, I365_CSCINT, 0);
14 @@ -880,6 +882,7 @@
15 }
16 cb_writel(socket, CB_SOCKET_MASK, 0);
17 exca_writeb(socket, I365_CSCINT, 0);
18 +#endif
19
20 mask = probe_irq_mask(val) & 0xffff;
21
22 @@ -960,6 +963,10 @@
23 else
24 socket->socket.irq_mask = 0;
25
26 + /* irq mask probing is broken for the WRT54G3G */
27 + if (socket->socket.irq_mask == 0)
28 + socket->socket.irq_mask = 0x6f8;
29 +
30 dev_printk(KERN_INFO, &socket->dev->dev,
31 "ISA IRQ mask 0x%04x, PCI irq %d\n",
32 socket->socket.irq_mask, socket->cb_irq);
33 @@ -1198,6 +1205,15 @@
34 dev_printk(KERN_INFO, &dev->dev,
35 "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
36
37 + /* Generate an interrupt on card insert/remove */
38 + config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
39 +
40 + /* Set up Multifunction Routing Status Register */
41 + config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
42 +
43 + /* Switch interrupts to parallelized */
44 + config_writeb(socket, 0x92, 0x64);
45 +
46 yenta_fixup_parent_bridge(dev->subordinate);
47
48 /* Register it with the pcmcia layer.. */