940-bcm47xx-yenta.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. mask = probe_irq_mask(val) & 0xffff;
  18. @@ -1019,6 +1022,10 @@ static void yenta_get_socket_capabilitie
  19. else
  20. socket->socket.irq_mask = 0;
  21. + /* irq mask probing is broken for the WRT54G3G */
  22. + if (socket->socket.irq_mask == 0)
  23. + socket->socket.irq_mask = 0x6f8;
  24. +
  25. dev_printk(KERN_INFO, &socket->dev->dev,
  26. "ISA IRQ mask 0x%04x, PCI irq %d\n",
  27. socket->socket.irq_mask, socket->cb_irq);
  28. @@ -1257,6 +1264,15 @@ static int yenta_probe(struct pci_dev *d
  29. dev_printk(KERN_INFO, &dev->dev,
  30. "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
  31. + /* Generate an interrupt on card insert/remove */
  32. + config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
  33. +
  34. + /* Set up Multifunction Routing Status Register */
  35. + config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
  36. +
  37. + /* Switch interrupts to parallelized */
  38. + config_writeb(socket, 0x92, 0x64);
  39. +
  40. yenta_fixup_parent_bridge(dev->subordinate);
  41. /* Register it with the pcmcia layer.. */