bcm47xx: add testing support for kernel 6.1
[openwrt/staging/nbd.git] / target / linux / bcm47xx / patches-6.1 / 940-bcm47xx-yenta.patch
1 --- a/drivers/pcmcia/yenta_socket.c
2 +++ b/drivers/pcmcia/yenta_socket.c
3 @@ -925,6 +925,8 @@ static struct cardbus_type cardbus_type[
4
5 static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask)
6 {
7 +/* WRT54G3G does not like this */
8 +#ifndef CONFIG_BCM47XX
9 int i;
10 unsigned long val;
11 u32 mask;
12 @@ -953,6 +955,9 @@ static unsigned int yenta_probe_irq(stru
13 mask = probe_irq_mask(val) & 0xffff;
14
15 return mask;
16 +#else
17 + return 0;
18 +#endif
19 }
20
21
22 @@ -1033,6 +1038,10 @@ static void yenta_get_socket_capabilitie
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_info(&socket->dev->dev, "ISA IRQ mask 0x%04x, PCI irq %d\n",
31 socket->socket.irq_mask, socket->cb_irq);
32 }
33 @@ -1264,6 +1273,15 @@ static int yenta_probe(struct pci_dev *d
34 dev_info(&dev->dev, "Socket status: %08x\n",
35 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.. */