Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef BCM63XX_PCMCIA_H_
0003 #define BCM63XX_PCMCIA_H_
0004 
0005 #include <linux/types.h>
0006 #include <linux/timer.h>
0007 #include <pcmcia/ss.h>
0008 #include <bcm63xx_dev_pcmcia.h>
0009 
0010 /* socket polling rate in ms */
0011 #define BCM63XX_PCMCIA_POLL_RATE    500
0012 
0013 enum {
0014     CARD_CARDBUS = (1 << 0),
0015     CARD_PCCARD = (1 << 1),
0016     CARD_5V = (1 << 2),
0017     CARD_3V = (1 << 3),
0018     CARD_XV = (1 << 4),
0019     CARD_YV = (1 << 5),
0020 };
0021 
0022 struct bcm63xx_pcmcia_socket {
0023     struct pcmcia_socket socket;
0024 
0025     /* platform specific data */
0026     struct bcm63xx_pcmcia_platform_data *pd;
0027 
0028     /* all regs access are protected by this spinlock */
0029     spinlock_t lock;
0030 
0031     /* pcmcia registers resource */
0032     struct resource *reg_res;
0033 
0034     /* base remapped address of registers */
0035     void __iomem *base;
0036 
0037     /* whether a card is detected at the moment */
0038     int card_detected;
0039 
0040     /* type of detected card (mask of above enum) */
0041     u8 card_type;
0042 
0043     /* keep last socket status to implement event reporting */
0044     unsigned int old_status;
0045 
0046     /* backup of requested socket state */
0047     socket_state_t requested_state;
0048 
0049     /* timer used for socket status polling */
0050     struct timer_list timer;
0051 
0052     /* attribute/common memory resources */
0053     struct resource *attr_res;
0054     struct resource *common_res;
0055     struct resource *io_res;
0056 
0057     /* base address of io memory */
0058     void __iomem *io_base;
0059 };
0060 
0061 #endif /* BCM63XX_PCMCIA_H_ */