Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * ss.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * The initial developer of the original code is David A. Hinds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * (C) 1999             David A. Hinds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #ifndef _LINUX_SS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #define _LINUX_SS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/sched.h>	/* task_struct, completion */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/mutex.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #ifdef CONFIG_CARDBUS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/pci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) /* Definitions for card status flags for GetStatus */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #define SS_WRPROT	0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #define SS_CARDLOCK	0x0002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #define SS_EJECTION	0x0004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #define SS_INSERTION	0x0008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #define SS_BATDEAD	0x0010
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #define SS_BATWARN	0x0020
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #define SS_READY	0x0040
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #define SS_DETECT	0x0080
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #define SS_POWERON	0x0100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #define SS_GPI		0x0200
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #define SS_STSCHG	0x0400
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #define SS_CARDBUS	0x0800
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #define SS_3VCARD	0x1000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #define SS_XVCARD	0x2000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #define SS_PENDING	0x4000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #define SS_ZVCARD	0x8000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) /* InquireSocket capabilities */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #define SS_CAP_PAGE_REGS	0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) #define SS_CAP_VIRTUAL_BUS	0x0002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #define SS_CAP_MEM_ALIGN	0x0004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) #define SS_CAP_STATIC_MAP	0x0008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #define SS_CAP_PCCARD		0x4000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #define SS_CAP_CARDBUS		0x8000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) /* for GetSocket, SetSocket */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) typedef struct socket_state_t {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	u_int	flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	u_int	csc_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	u_char	Vcc, Vpp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	u_char	io_irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) } socket_state_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) extern socket_state_t dead_socket;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) /* Socket configuration flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) #define SS_PWR_AUTO	0x0010
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) #define SS_IOCARD	0x0020
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) #define SS_RESET	0x0040
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) #define SS_DMA_MODE	0x0080
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) #define SS_SPKR_ENA	0x0100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) #define SS_OUTPUT_ENA	0x0200
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) /* Flags for I/O port and memory windows */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #define MAP_ACTIVE	0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) #define MAP_16BIT	0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) #define MAP_AUTOSZ	0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #define MAP_0WS		0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) #define MAP_WRPROT	0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) #define MAP_ATTRIB	0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) #define MAP_USE_WAIT	0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) #define MAP_PREFETCH	0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) /* Use this just for bridge windows */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) #define MAP_IOSPACE	0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) /* power hook operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) #define HOOK_POWER_PRE	0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) #define HOOK_POWER_POST	0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) typedef struct pccard_io_map {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	u_char	map;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	u_char	flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	u_short	speed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	phys_addr_t start, stop;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) } pccard_io_map;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) typedef struct pccard_mem_map {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	u_char		map;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	u_char		flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	u_short		speed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	phys_addr_t	static_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	u_int		card_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	struct resource	*res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) } pccard_mem_map;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) typedef struct io_window_t {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	u_int			InUse, Config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	struct resource		*res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) } io_window_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) /* Maximum number of IO windows per socket */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #define MAX_IO_WIN 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) /* Maximum number of memory windows per socket */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define MAX_WIN 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)  * Socket operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) struct pcmcia_socket;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) struct pccard_resource_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) struct config_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) struct pcmcia_callback;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) struct user_info_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) struct pccard_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	int (*init)(struct pcmcia_socket *s);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	int (*suspend)(struct pcmcia_socket *s);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	int (*get_status)(struct pcmcia_socket *s, u_int *value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	int (*set_socket)(struct pcmcia_socket *s, socket_state_t *state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	int (*set_io_map)(struct pcmcia_socket *s, struct pccard_io_map *io);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	int (*set_mem_map)(struct pcmcia_socket *s, struct pccard_mem_map *mem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) struct pcmcia_socket {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	struct module			*owner;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	socket_state_t			socket;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	u_int				state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	u_int				suspended_state;	/* state before suspend */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	u_short				functions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	u_short				lock_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	pccard_mem_map			cis_mem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	void __iomem 			*cis_virt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	io_window_t			io[MAX_IO_WIN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	pccard_mem_map			win[MAX_WIN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	struct list_head		cis_cache;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	size_t				fake_cis_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	u8				*fake_cis;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	struct list_head		socket_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	struct completion		socket_released;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	/* deprecated */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	unsigned int			sock;		/* socket number */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	/* socket capabilities */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	u_int				features;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	u_int				irq_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	u_int				map_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	u_int				io_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	u_int				pci_irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	struct pci_dev			*cb_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	/* socket setup is done so resources should be able to be allocated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	 * Only if set to 1, calls to find_{io,mem}_region are handled, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	 * insertio events are actually managed by the PCMCIA layer.*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	u8				resource_setup_done;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	/* socket operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	struct pccard_operations	*ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	struct pccard_resource_ops	*resource_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	void				*resource_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	/* Zoom video behaviour is so chip specific its not worth adding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	   this to _ops */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	void 				(*zoom_video)(struct pcmcia_socket *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 						      int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	/* so is power hook */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	int (*power_hook)(struct pcmcia_socket *sock, int operation);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	/* allows tuning the CB bridge before loading driver for the CB card */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) #ifdef CONFIG_CARDBUS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	void (*tune_bridge)(struct pcmcia_socket *sock, struct pci_bus *bus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	/* state thread */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	struct task_struct		*thread;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	struct completion		thread_done;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	unsigned int			thread_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	unsigned int			sysfs_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	/* For the non-trivial interaction between these locks,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	 * see Documentation/pcmcia/locking.rst */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	struct mutex			skt_mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	struct mutex			ops_mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	/* protects thread_events and sysfs_events */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	spinlock_t			thread_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	/* pcmcia (16-bit) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	struct pcmcia_callback		*callback;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) #if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	/* The following elements refer to 16-bit PCMCIA devices inserted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	 * into the socket */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	struct list_head		devices_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	/* the number of devices, used only internally and subject to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	 * incorrectness and change */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	u8				device_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	/* does the PCMCIA card consist of two pseudo devices? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	u8				pcmcia_pfc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	/* non-zero if PCMCIA card is present */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	atomic_t			present;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	/* IRQ to be used by PCMCIA devices. May not be IRQ 0. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	unsigned int			pcmcia_irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #endif /* CONFIG_PCMCIA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	/* socket device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	struct device			dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	/* data internal to the socket driver */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	void				*driver_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	/* status of the card during resume from a system sleep state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	int				resume_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) /* socket drivers must define the resource operations type they use. There
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)  * are three options:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)  * - pccard_static_ops		iomem and ioport areas are assigned statically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)  * - pccard_iodyn_ops		iomem areas is assigned statically, ioport
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)  *				areas dynamically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)  *				If this option is selected, use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)  *				"select PCCARD_IODYN" in Kconfig.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)  * - pccard_nonstatic_ops	iomem and ioport areas are assigned dynamically.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)  *				If this option is selected, use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)  *				"select PCCARD_NONSTATIC" in Kconfig.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) extern struct pccard_resource_ops pccard_static_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) #if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) extern struct pccard_resource_ops pccard_iodyn_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) extern struct pccard_resource_ops pccard_nonstatic_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) /* If PCMCIA is not used, but only CARDBUS, these functions are not used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)  * at all. Therefore, do not use the large (240K!) rsrc_nonstatic module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) #define pccard_iodyn_ops pccard_static_ops
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) #define pccard_nonstatic_ops pccard_static_ops
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) /* socket drivers use this callback in their IRQ handler */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) extern void pcmcia_parse_events(struct pcmcia_socket *socket,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 				unsigned int events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) /* to register and unregister a socket */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) extern int pcmcia_register_socket(struct pcmcia_socket *socket);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) extern void pcmcia_unregister_socket(struct pcmcia_socket *socket);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) #endif /* _LINUX_SS_H */