aboutsummaryrefslogtreecommitdiffstats
path: root/include/pcmcia/ds.h
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-24 11:23:51 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-08-03 03:04:11 -0400
commit90abdc3b973229bae98dd96649d9f7106cc177a4 (patch)
tree5c1a7a131b65560dd73b5103118d8c7631bd76a4 /include/pcmcia/ds.h
parent9a017a910346afd88ec2e065989903bf211a7d37 (diff)
pcmcia: do not use io_req_t when calling pcmcia_request_io()
Instead of io_req_t, drivers are now requested to fill out struct pcmcia_device *p_dev->resource[0,1] for up to two ioport ranges. After a call to pcmcia_request_io(), the ports found there are reserved, after calling pcmcia_request_configuration(), they may be used. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-ide@vger.kernel.org CC: linux-usb@vger.kernel.org CC: laforge@gnumonks.org CC: linux-mtd@lists.infradead.org CC: alsa-devel@alsa-project.org CC: linux-serial@vger.kernel.org CC: Michael Buesch <mb@bu3sch.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/) Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'include/pcmcia/ds.h')
-rw-r--r--include/pcmcia/ds.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 3dafd7db34df..0748bec0a87a 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -80,7 +80,6 @@ struct pcmcia_device {
80 struct list_head socket_device_list; 80 struct list_head socket_device_list;
81 81
82 /* deprecated, will be cleaned up soon */ 82 /* deprecated, will be cleaned up soon */
83 io_req_t io;
84 config_req_t conf; 83 config_req_t conf;
85 window_handle_t win; 84 window_handle_t win;
86 85
@@ -88,6 +87,8 @@ struct pcmcia_device {
88 unsigned int irq; 87 unsigned int irq;
89 struct resource *resource[MAX_IO_WIN]; 88 struct resource *resource[MAX_IO_WIN];
90 89
90 unsigned int io_lines; /* number of I/O lines */
91
91 /* Is the device suspended? */ 92 /* Is the device suspended? */
92 u16 suspended:1; 93 u16 suspended:1;
93 94
@@ -179,7 +180,7 @@ int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val);
179int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val); 180int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val);
180 181
181/* device configuration */ 182/* device configuration */
182int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); 183int pcmcia_request_io(struct pcmcia_device *p_dev);
183 184
184int __must_check 185int __must_check
185__pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, 186__pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
@@ -206,6 +207,22 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,
206int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); 207int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
207void pcmcia_disable_device(struct pcmcia_device *p_dev); 208void pcmcia_disable_device(struct pcmcia_device *p_dev);
208 209
210/* IO ports */
211#define IO_DATA_PATH_WIDTH 0x18
212#define IO_DATA_PATH_WIDTH_8 0x00
213#define IO_DATA_PATH_WIDTH_16 0x08
214#define IO_DATA_PATH_WIDTH_AUTO 0x10
215
216/* convert flag found in cfgtable to data path width parameter */
217static inline int pcmcia_io_cfg_data_width(unsigned int flags)
218{
219 if (!(flags & CISTPL_IO_8BIT))
220 return IO_DATA_PATH_WIDTH_16;
221 if (!(flags & CISTPL_IO_16BIT))
222 return IO_DATA_PATH_WIDTH_8;
223 return IO_DATA_PATH_WIDTH_AUTO;
224}
225
209#endif /* __KERNEL__ */ 226#endif /* __KERNEL__ */
210 227
211#endif /* _LINUX_DS_H */ 228#endif /* _LINUX_DS_H */