diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 17:25:16 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 17:25:16 -0400 |
| commit | b65378898c2eefb20f419632c1199bc0592e2f79 (patch) | |
| tree | 052bb72d329c44790f91fc8097b8500d4774d02c /include | |
| parent | 157b6ceb13e4b4148ee03dd517dbe88748943125 (diff) | |
| parent | 5b917a1420d3d1a9c8da49fb0090692dc9aaee86 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (22 commits)
pcmcia: synclink_cs: fix information leak to userland
pcmcia: don't call flush_scheduled_work() spuriously
serial_cs: drop spurious flush_scheduled_work() call
pcmcia/yenta: guide users in case of problems with O2-bridges
pcmcia: fix unused function compile warning
pcmcia: vrc4173_cardu: Fix error path for pci_release_regions and pci_disable_device
pcmcia: add a few debug statements
pcmcia: remove obsolete and wrong comments
pcmcia: avoid messages on module (un)loading
pcmcia: move driver name to struct pcmcia_driver
pcmcia: remove the "Finally, report what we've done" message
pcmcia: use autoconfiguration feature for ioports and iomem
pcmcia: introduce autoconfiguration feature
pcmcia: Documentation update
pcmcia: convert pcmcia_request_configuration to pcmcia_enable_device
pcmcia: move config_{base,index,regs} to struct pcmcia_device
pcmcia: simplify IntType
pcmcia: simplify Status, ExtStatus register access
pcmcia: remove Pin, Copy configuration register access
pcmcia: move Vpp setup to struct pcmcia_device
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/pcmcia/cs.h | 95 | ||||
| -rw-r--r-- | include/pcmcia/ds.h | 85 | ||||
| -rw-r--r-- | include/pcmcia/ss.h | 1 |
3 files changed, 59 insertions, 122 deletions
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h deleted file mode 100644 index 68d8bde7e8d6..000000000000 --- a/include/pcmcia/cs.h +++ /dev/null | |||
| @@ -1,95 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * cs.h | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * The initial developer of the original code is David A. Hinds | ||
| 9 | * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds | ||
| 10 | * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. | ||
| 11 | * | ||
| 12 | * (C) 1999 David A. Hinds | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _LINUX_CS_H | ||
| 16 | #define _LINUX_CS_H | ||
| 17 | |||
| 18 | #ifdef __KERNEL__ | ||
| 19 | #include <linux/interrupt.h> | ||
| 20 | #endif | ||
| 21 | |||
| 22 | /* ModifyConfiguration */ | ||
| 23 | typedef struct modconf_t { | ||
| 24 | u_int Attributes; | ||
| 25 | u_int Vcc, Vpp1, Vpp2; | ||
| 26 | } modconf_t; | ||
| 27 | |||
| 28 | /* Attributes for ModifyConfiguration */ | ||
| 29 | #define CONF_IRQ_CHANGE_VALID 0x0100 | ||
| 30 | #define CONF_VCC_CHANGE_VALID 0x0200 | ||
| 31 | #define CONF_VPP1_CHANGE_VALID 0x0400 | ||
| 32 | #define CONF_VPP2_CHANGE_VALID 0x0800 | ||
| 33 | #define CONF_IO_CHANGE_WIDTH 0x1000 | ||
| 34 | |||
| 35 | /* For RequestConfiguration */ | ||
| 36 | typedef struct config_req_t { | ||
| 37 | u_int Attributes; | ||
| 38 | u_int Vpp; /* both Vpp1 and Vpp2 */ | ||
| 39 | u_int IntType; | ||
| 40 | u_int ConfigBase; | ||
| 41 | u_char Status, Pin, Copy, ExtStatus; | ||
| 42 | u_char ConfigIndex; | ||
| 43 | u_int Present; | ||
| 44 | } config_req_t; | ||
| 45 | |||
| 46 | /* Attributes for RequestConfiguration */ | ||
| 47 | #define CONF_ENABLE_IRQ 0x01 | ||
| 48 | #define CONF_ENABLE_DMA 0x02 | ||
| 49 | #define CONF_ENABLE_SPKR 0x04 | ||
| 50 | #define CONF_ENABLE_PULSE_IRQ 0x08 | ||
| 51 | #define CONF_VALID_CLIENT 0x100 | ||
| 52 | |||
| 53 | /* IntType field */ | ||
| 54 | #define INT_MEMORY 0x01 | ||
| 55 | #define INT_MEMORY_AND_IO 0x02 | ||
| 56 | #define INT_CARDBUS 0x04 | ||
| 57 | #define INT_ZOOMED_VIDEO 0x08 | ||
| 58 | |||
| 59 | /* Configuration registers present */ | ||
| 60 | #define PRESENT_OPTION 0x001 | ||
| 61 | #define PRESENT_STATUS 0x002 | ||
| 62 | #define PRESENT_PIN_REPLACE 0x004 | ||
| 63 | #define PRESENT_COPY 0x008 | ||
| 64 | #define PRESENT_EXT_STATUS 0x010 | ||
| 65 | #define PRESENT_IOBASE_0 0x020 | ||
| 66 | #define PRESENT_IOBASE_1 0x040 | ||
| 67 | #define PRESENT_IOBASE_2 0x080 | ||
| 68 | #define PRESENT_IOBASE_3 0x100 | ||
| 69 | #define PRESENT_IOSIZE 0x200 | ||
| 70 | |||
| 71 | /* For RequestWindow */ | ||
| 72 | typedef struct win_req_t { | ||
| 73 | u_int Attributes; | ||
| 74 | u_long Base; | ||
| 75 | u_int Size; | ||
| 76 | u_int AccessSpeed; | ||
| 77 | } win_req_t; | ||
| 78 | |||
| 79 | /* Attributes for RequestWindow */ | ||
| 80 | #define WIN_MEMORY_TYPE_CM 0x00 /* default */ | ||
| 81 | #define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */ | ||
| 82 | #define WIN_DATA_WIDTH_8 0x00 /* default */ | ||
| 83 | #define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */ | ||
| 84 | #define WIN_ENABLE 0x01 /* MAP_ACTIVE */ | ||
| 85 | #define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */ | ||
| 86 | |||
| 87 | #define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE | | ||
| 88 | MAP_USE_WAIT */ | ||
| 89 | #define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]: | ||
| 90 | 0x04 -> 0 | ||
| 91 | 0x08 -> 1 | ||
| 92 | 0x0c -> 2 | ||
| 93 | 0x10 -> 3 */ | ||
| 94 | |||
| 95 | #endif /* _LINUX_CS_H */ | ||
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 70c58ed2278c..d830c87ff0a7 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
| @@ -24,9 +24,11 @@ | |||
| 24 | 24 | ||
| 25 | #ifdef __KERNEL__ | 25 | #ifdef __KERNEL__ |
| 26 | #include <linux/device.h> | 26 | #include <linux/device.h> |
| 27 | #include <linux/interrupt.h> | ||
| 27 | #include <pcmcia/ss.h> | 28 | #include <pcmcia/ss.h> |
| 28 | #include <asm/atomic.h> | 29 | #include <asm/atomic.h> |
| 29 | 30 | ||
| 31 | |||
| 30 | /* | 32 | /* |
| 31 | * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus | 33 | * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus |
| 32 | * a.k.a. PCI drivers | 34 | * a.k.a. PCI drivers |
| @@ -36,8 +38,6 @@ struct pcmcia_device; | |||
| 36 | struct config_t; | 38 | struct config_t; |
| 37 | struct net_device; | 39 | struct net_device; |
| 38 | 40 | ||
| 39 | typedef struct resource *window_handle_t; | ||
| 40 | |||
| 41 | /* dynamic device IDs for PCMCIA device drivers. See | 41 | /* dynamic device IDs for PCMCIA device drivers. See |
| 42 | * Documentation/pcmcia/driver.txt for details. | 42 | * Documentation/pcmcia/driver.txt for details. |
| 43 | */ | 43 | */ |
| @@ -47,6 +47,8 @@ struct pcmcia_dynids { | |||
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | struct pcmcia_driver { | 49 | struct pcmcia_driver { |
| 50 | const char *name; | ||
| 51 | |||
| 50 | int (*probe) (struct pcmcia_device *dev); | 52 | int (*probe) (struct pcmcia_device *dev); |
| 51 | void (*remove) (struct pcmcia_device *dev); | 53 | void (*remove) (struct pcmcia_device *dev); |
| 52 | 54 | ||
| @@ -90,15 +92,17 @@ struct pcmcia_device { | |||
| 90 | 92 | ||
| 91 | struct list_head socket_device_list; | 93 | struct list_head socket_device_list; |
| 92 | 94 | ||
| 93 | /* deprecated, will be cleaned up soon */ | ||
| 94 | config_req_t conf; | ||
| 95 | window_handle_t win; | ||
| 96 | |||
| 97 | /* device setup */ | 95 | /* device setup */ |
| 98 | unsigned int irq; | 96 | unsigned int irq; |
| 99 | struct resource *resource[PCMCIA_NUM_RESOURCES]; | 97 | struct resource *resource[PCMCIA_NUM_RESOURCES]; |
| 98 | resource_size_t card_addr; /* for the 1st IOMEM resource */ | ||
| 99 | unsigned int vpp; | ||
| 100 | 100 | ||
| 101 | unsigned int io_lines; /* number of I/O lines */ | 101 | unsigned int config_flags; /* CONF_ENABLE_ flags below */ |
| 102 | unsigned int config_base; | ||
| 103 | unsigned int config_index; | ||
| 104 | unsigned int config_regs; /* PRESENT_ flags below */ | ||
| 105 | unsigned int io_lines; /* number of I/O lines */ | ||
| 102 | 106 | ||
| 103 | /* Is the device suspended? */ | 107 | /* Is the device suspended? */ |
| 104 | u16 suspended:1; | 108 | u16 suspended:1; |
| @@ -174,9 +178,6 @@ int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse); | |||
| 174 | /* loop CIS entries for valid configuration */ | 178 | /* loop CIS entries for valid configuration */ |
| 175 | int pcmcia_loop_config(struct pcmcia_device *p_dev, | 179 | int pcmcia_loop_config(struct pcmcia_device *p_dev, |
| 176 | int (*conf_check) (struct pcmcia_device *p_dev, | 180 | int (*conf_check) (struct pcmcia_device *p_dev, |
| 177 | cistpl_cftable_entry_t *cf, | ||
| 178 | cistpl_cftable_entry_t *dflt, | ||
| 179 | unsigned int vcc, | ||
| 180 | void *priv_data), | 181 | void *priv_data), |
| 181 | void *priv_data); | 182 | void *priv_data); |
| 182 | 183 | ||
| @@ -206,16 +207,17 @@ pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, | |||
| 206 | int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev, | 207 | int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev, |
| 207 | irq_handler_t handler); | 208 | irq_handler_t handler); |
| 208 | 209 | ||
| 209 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, | 210 | int pcmcia_enable_device(struct pcmcia_device *p_dev); |
| 210 | config_req_t *req); | ||
| 211 | 211 | ||
| 212 | int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, | 212 | int pcmcia_request_window(struct pcmcia_device *p_dev, struct resource *res, |
| 213 | window_handle_t *wh); | 213 | unsigned int speed); |
| 214 | int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win); | 214 | int pcmcia_release_window(struct pcmcia_device *p_dev, struct resource *res); |
| 215 | int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win, | 215 | int pcmcia_map_mem_page(struct pcmcia_device *p_dev, struct resource *res, |
| 216 | unsigned int offset); | 216 | unsigned int offset); |
| 217 | 217 | ||
| 218 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); | 218 | int pcmcia_fixup_vpp(struct pcmcia_device *p_dev, unsigned char new_vpp); |
| 219 | int pcmcia_fixup_iowidth(struct pcmcia_device *p_dev); | ||
| 220 | |||
| 219 | void pcmcia_disable_device(struct pcmcia_device *p_dev); | 221 | void pcmcia_disable_device(struct pcmcia_device *p_dev); |
| 220 | 222 | ||
| 221 | /* IO ports */ | 223 | /* IO ports */ |
| @@ -224,15 +226,46 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev); | |||
| 224 | #define IO_DATA_PATH_WIDTH_16 0x08 | 226 | #define IO_DATA_PATH_WIDTH_16 0x08 |
| 225 | #define IO_DATA_PATH_WIDTH_AUTO 0x10 | 227 | #define IO_DATA_PATH_WIDTH_AUTO 0x10 |
| 226 | 228 | ||
| 227 | /* convert flag found in cfgtable to data path width parameter */ | 229 | /* IO memory */ |
| 228 | static inline int pcmcia_io_cfg_data_width(unsigned int flags) | 230 | #define WIN_MEMORY_TYPE_CM 0x00 /* default */ |
| 229 | { | 231 | #define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */ |
| 230 | if (!(flags & CISTPL_IO_8BIT)) | 232 | #define WIN_DATA_WIDTH_8 0x00 /* default */ |
| 231 | return IO_DATA_PATH_WIDTH_16; | 233 | #define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */ |
| 232 | if (!(flags & CISTPL_IO_16BIT)) | 234 | #define WIN_ENABLE 0x01 /* MAP_ACTIVE */ |
| 233 | return IO_DATA_PATH_WIDTH_8; | 235 | #define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */ |
| 234 | return IO_DATA_PATH_WIDTH_AUTO; | 236 | |
| 235 | } | 237 | #define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE | |
| 238 | MAP_USE_WAIT */ | ||
| 239 | #define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]: | ||
| 240 | 0x04 -> 0 | ||
| 241 | 0x08 -> 1 | ||
| 242 | 0x0c -> 2 | ||
| 243 | 0x10 -> 3 */ | ||
| 244 | |||
| 245 | /* config_reg{ister}s present for this PCMCIA device */ | ||
| 246 | #define PRESENT_OPTION 0x001 | ||
| 247 | #define PRESENT_STATUS 0x002 | ||
| 248 | #define PRESENT_PIN_REPLACE 0x004 | ||
| 249 | #define PRESENT_COPY 0x008 | ||
| 250 | #define PRESENT_EXT_STATUS 0x010 | ||
| 251 | #define PRESENT_IOBASE_0 0x020 | ||
| 252 | #define PRESENT_IOBASE_1 0x040 | ||
| 253 | #define PRESENT_IOBASE_2 0x080 | ||
| 254 | #define PRESENT_IOBASE_3 0x100 | ||
| 255 | #define PRESENT_IOSIZE 0x200 | ||
| 256 | |||
| 257 | /* flags to be passed to pcmcia_enable_device() */ | ||
| 258 | #define CONF_ENABLE_IRQ 0x0001 | ||
| 259 | #define CONF_ENABLE_SPKR 0x0002 | ||
| 260 | #define CONF_ENABLE_PULSE_IRQ 0x0004 | ||
| 261 | #define CONF_ENABLE_ESR 0x0008 | ||
| 262 | |||
| 263 | /* flags used by pcmcia_loop_config() autoconfiguration */ | ||
| 264 | #define CONF_AUTO_CHECK_VCC 0x0100 /* check for matching Vcc? */ | ||
| 265 | #define CONF_AUTO_SET_VPP 0x0200 /* set Vpp? */ | ||
| 266 | #define CONF_AUTO_AUDIO 0x0400 /* enable audio line? */ | ||
| 267 | #define CONF_AUTO_SET_IO 0x0800 /* set ->resource[0,1] */ | ||
| 268 | #define CONF_AUTO_SET_IOMEM 0x1000 /* set ->resource[2] */ | ||
| 236 | 269 | ||
| 237 | #endif /* __KERNEL__ */ | 270 | #endif /* __KERNEL__ */ |
| 238 | 271 | ||
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 626b63c33d9e..731cde010f42 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #include <linux/sched.h> /* task_struct, completion */ | 19 | #include <linux/sched.h> /* task_struct, completion */ |
| 20 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
| 21 | 21 | ||
| 22 | #include <pcmcia/cs.h> | ||
| 23 | #ifdef CONFIG_CARDBUS | 22 | #ifdef CONFIG_CARDBUS |
| 24 | #include <linux/pci.h> | 23 | #include <linux/pci.h> |
| 25 | #endif | 24 | #endif |
