diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-07-28 04:59:06 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-09-29 11:20:21 -0400 |
commit | cdb138080b78146d1cdadba9f5dadbeb97445b91 (patch) | |
tree | fae26f709ed0f19648db79059234faf9fa028051 /include/pcmcia/ds.h | |
parent | 899611ee7d373e5eeda08e9a8632684e1ebbbf00 (diff) |
pcmcia: do not use win_req_t when calling pcmcia_request_window()
Instead of win_req_t, drivers are now requested to fill out
struct pcmcia_device *p_dev->resource[2,3,4,5] for up to four iomem
ranges. After a call to pcmcia_request_window(), the windows found there
are reserved and may be used until pcmcia_release_window() is called.
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-mtd@lists.infradead.org
CC: Jiri Kosina <jkosina@suse.cz>
CC: linux-scsi@vger.kernel.org
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'include/pcmcia/ds.h')
-rw-r--r-- | include/pcmcia/ds.h | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 70c58ed2278c..6f7cb38d8850 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
@@ -36,8 +36,6 @@ struct pcmcia_device; | |||
36 | struct config_t; | 36 | struct config_t; |
37 | struct net_device; | 37 | struct net_device; |
38 | 38 | ||
39 | typedef struct resource *window_handle_t; | ||
40 | |||
41 | /* dynamic device IDs for PCMCIA device drivers. See | 39 | /* dynamic device IDs for PCMCIA device drivers. See |
42 | * Documentation/pcmcia/driver.txt for details. | 40 | * Documentation/pcmcia/driver.txt for details. |
43 | */ | 41 | */ |
@@ -92,7 +90,6 @@ struct pcmcia_device { | |||
92 | 90 | ||
93 | /* deprecated, will be cleaned up soon */ | 91 | /* deprecated, will be cleaned up soon */ |
94 | config_req_t conf; | 92 | config_req_t conf; |
95 | window_handle_t win; | ||
96 | 93 | ||
97 | /* device setup */ | 94 | /* device setup */ |
98 | unsigned int irq; | 95 | unsigned int irq; |
@@ -209,10 +206,10 @@ int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev, | |||
209 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, | 206 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, |
210 | config_req_t *req); | 207 | config_req_t *req); |
211 | 208 | ||
212 | int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, | 209 | int pcmcia_request_window(struct pcmcia_device *p_dev, struct resource *res, |
213 | window_handle_t *wh); | 210 | unsigned int speed); |
214 | int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win); | 211 | 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, | 212 | int pcmcia_map_mem_page(struct pcmcia_device *p_dev, struct resource *res, |
216 | unsigned int offset); | 213 | unsigned int offset); |
217 | 214 | ||
218 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); | 215 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); |
@@ -234,6 +231,23 @@ static inline int pcmcia_io_cfg_data_width(unsigned int flags) | |||
234 | return IO_DATA_PATH_WIDTH_AUTO; | 231 | return IO_DATA_PATH_WIDTH_AUTO; |
235 | } | 232 | } |
236 | 233 | ||
234 | /* IO memory */ | ||
235 | #define WIN_MEMORY_TYPE_CM 0x00 /* default */ | ||
236 | #define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */ | ||
237 | #define WIN_DATA_WIDTH_8 0x00 /* default */ | ||
238 | #define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */ | ||
239 | #define WIN_ENABLE 0x01 /* MAP_ACTIVE */ | ||
240 | #define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */ | ||
241 | |||
242 | #define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE | | ||
243 | MAP_USE_WAIT */ | ||
244 | #define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]: | ||
245 | 0x04 -> 0 | ||
246 | 0x08 -> 1 | ||
247 | 0x0c -> 2 | ||
248 | 0x10 -> 3 */ | ||
249 | |||
250 | |||
237 | #endif /* __KERNEL__ */ | 251 | #endif /* __KERNEL__ */ |
238 | 252 | ||
239 | #endif /* _LINUX_DS_H */ | 253 | #endif /* _LINUX_DS_H */ |