ramips: fix HiWiFi HC5761A switch settings
[oweals/openwrt.git] / target / linux / brcm47xx / patches-4.14 / 940-bcm47xx-yenta.patch
1 --- a/drivers/pcmcia/yenta_socket.c
2 +++ b/drivers/pcmcia/yenta_socket.c
3 @@ -920,6 +920,8 @@ static unsigned int yenta_probe_irq(stru
4          * Probe for usable interrupts using the force
5          * register to generate bogus card status events.
6          */
7 +#ifndef CONFIG_BCM47XX
8 +       /* WRT54G3G does not like this */
9         cb_writel(socket, CB_SOCKET_EVENT, -1);
10         cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
11         reg = exca_readb(socket, I365_CSCINT);
12 @@ -935,6 +937,7 @@ static unsigned int yenta_probe_irq(stru
13         }
14         cb_writel(socket, CB_SOCKET_MASK, 0);
15         exca_writeb(socket, I365_CSCINT, reg);
16 +#endif
17  
18         mask = probe_irq_mask(val) & 0xffff;
19  
20 @@ -1019,6 +1022,10 @@ static void yenta_get_socket_capabilitie
21         else
22                 socket->socket.irq_mask = 0;
23  
24 +       /* irq mask probing is broken for the WRT54G3G */
25 +       if (socket->socket.irq_mask == 0)
26 +               socket->socket.irq_mask = 0x6f8;
27 +
28         dev_info(&socket->dev->dev, "ISA IRQ mask 0x%04x, PCI irq %d\n",
29                  socket->socket.irq_mask, socket->cb_irq);
30  }
31 @@ -1251,6 +1258,15 @@ static int yenta_probe(struct pci_dev *d
32         dev_info(&dev->dev, "Socket status: %08x\n",
33                  cb_readl(socket, CB_SOCKET_STATE));
34  
35 +       /* Generate an interrupt on card insert/remove */
36 +       config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
37 +
38 +       /* Set up Multifunction Routing Status Register */
39 +       config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
40 +
41 +       /* Switch interrupts to parallelized */
42 +       config_writeb(socket, 0x92, 0x64);
43 +
44         yenta_fixup_parent_bridge(dev->subordinate);
45  
46         /* Register it with the pcmcia layer.. */