940-bcm47xx-yenta.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask)
  5. {
  6. +/* WRT54G3G does not like this */
  7. +#ifndef CONFIG_BCM47XX
  8. int i;
  9. unsigned long val;
  10. u32 mask;
  11. @@ -953,6 +955,9 @@ static unsigned int yenta_probe_irq(stru
  12. mask = probe_irq_mask(val) & 0xffff;
  13. return mask;
  14. +#else
  15. + return 0;
  16. +#endif
  17. }
  18. @@ -1033,6 +1038,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_info(&socket->dev->dev, "ISA IRQ mask 0x%04x, PCI irq %d\n",
  26. socket->socket.irq_mask, socket->cb_irq);
  27. }
  28. @@ -1264,6 +1273,15 @@ static int yenta_probe(struct pci_dev *d
  29. dev_info(&dev->dev, "Socket status: %08x\n",
  30. 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.. */