1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2553d6d5fSMaxime Bizon #ifndef BCM63XX_PCMCIA_H_ 3553d6d5fSMaxime Bizon #define BCM63XX_PCMCIA_H_ 4553d6d5fSMaxime Bizon 5553d6d5fSMaxime Bizon #include <linux/types.h> 6553d6d5fSMaxime Bizon #include <linux/timer.h> 7553d6d5fSMaxime Bizon #include <pcmcia/ss.h> 8553d6d5fSMaxime Bizon #include <bcm63xx_dev_pcmcia.h> 9553d6d5fSMaxime Bizon 10553d6d5fSMaxime Bizon /* socket polling rate in ms */ 11553d6d5fSMaxime Bizon #define BCM63XX_PCMCIA_POLL_RATE 500 12553d6d5fSMaxime Bizon 13553d6d5fSMaxime Bizon enum { 14553d6d5fSMaxime Bizon CARD_CARDBUS = (1 << 0), 15553d6d5fSMaxime Bizon CARD_PCCARD = (1 << 1), 16553d6d5fSMaxime Bizon CARD_5V = (1 << 2), 17553d6d5fSMaxime Bizon CARD_3V = (1 << 3), 18553d6d5fSMaxime Bizon CARD_XV = (1 << 4), 19553d6d5fSMaxime Bizon CARD_YV = (1 << 5), 20553d6d5fSMaxime Bizon }; 21553d6d5fSMaxime Bizon 22553d6d5fSMaxime Bizon struct bcm63xx_pcmcia_socket { 23553d6d5fSMaxime Bizon struct pcmcia_socket socket; 24553d6d5fSMaxime Bizon 25553d6d5fSMaxime Bizon /* platform specific data */ 26553d6d5fSMaxime Bizon struct bcm63xx_pcmcia_platform_data *pd; 27553d6d5fSMaxime Bizon 28553d6d5fSMaxime Bizon /* all regs access are protected by this spinlock */ 29553d6d5fSMaxime Bizon spinlock_t lock; 30553d6d5fSMaxime Bizon 31553d6d5fSMaxime Bizon /* pcmcia registers resource */ 32553d6d5fSMaxime Bizon struct resource *reg_res; 33553d6d5fSMaxime Bizon 34553d6d5fSMaxime Bizon /* base remapped address of registers */ 35553d6d5fSMaxime Bizon void __iomem *base; 36553d6d5fSMaxime Bizon 37553d6d5fSMaxime Bizon /* whether a card is detected at the moment */ 38553d6d5fSMaxime Bizon int card_detected; 39553d6d5fSMaxime Bizon 40553d6d5fSMaxime Bizon /* type of detected card (mask of above enum) */ 41553d6d5fSMaxime Bizon u8 card_type; 42553d6d5fSMaxime Bizon 43553d6d5fSMaxime Bizon /* keep last socket status to implement event reporting */ 44553d6d5fSMaxime Bizon unsigned int old_status; 45553d6d5fSMaxime Bizon 46553d6d5fSMaxime Bizon /* backup of requested socket state */ 47553d6d5fSMaxime Bizon socket_state_t requested_state; 48553d6d5fSMaxime Bizon 49553d6d5fSMaxime Bizon /* timer used for socket status polling */ 50553d6d5fSMaxime Bizon struct timer_list timer; 51553d6d5fSMaxime Bizon 52553d6d5fSMaxime Bizon /* attribute/common memory resources */ 53553d6d5fSMaxime Bizon struct resource *attr_res; 54553d6d5fSMaxime Bizon struct resource *common_res; 55553d6d5fSMaxime Bizon struct resource *io_res; 56553d6d5fSMaxime Bizon 57553d6d5fSMaxime Bizon /* base address of io memory */ 58553d6d5fSMaxime Bizon void __iomem *io_base; 59553d6d5fSMaxime Bizon }; 60553d6d5fSMaxime Bizon 61553d6d5fSMaxime Bizon #endif /* BCM63XX_PCMCIA_H_ */ 62