bcm63xx_pcmcia.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef BCM63XX_PCMCIA_H_
  3. #define BCM63XX_PCMCIA_H_
  4. #include <linux/types.h>
  5. #include <linux/timer.h>
  6. #include <pcmcia/ss.h>
  7. #include <bcm63xx_dev_pcmcia.h>
  8. /* socket polling rate in ms */
  9. #define BCM63XX_PCMCIA_POLL_RATE 500
  10. enum {
  11. CARD_CARDBUS = (1 << 0),
  12. CARD_PCCARD = (1 << 1),
  13. CARD_5V = (1 << 2),
  14. CARD_3V = (1 << 3),
  15. CARD_XV = (1 << 4),
  16. CARD_YV = (1 << 5),
  17. };
  18. struct bcm63xx_pcmcia_socket {
  19. struct pcmcia_socket socket;
  20. /* platform specific data */
  21. struct bcm63xx_pcmcia_platform_data *pd;
  22. /* all regs access are protected by this spinlock */
  23. spinlock_t lock;
  24. /* pcmcia registers resource */
  25. struct resource *reg_res;
  26. /* base remapped address of registers */
  27. void __iomem *base;
  28. /* whether a card is detected at the moment */
  29. int card_detected;
  30. /* type of detected card (mask of above enum) */
  31. u8 card_type;
  32. /* keep last socket status to implement event reporting */
  33. unsigned int old_status;
  34. /* backup of requested socket state */
  35. socket_state_t requested_state;
  36. /* timer used for socket status polling */
  37. struct timer_list timer;
  38. /* attribute/common memory resources */
  39. struct resource *attr_res;
  40. struct resource *common_res;
  41. struct resource *io_res;
  42. /* base address of io memory */
  43. void __iomem *io_base;
  44. };
  45. #endif /* BCM63XX_PCMCIA_H_ */