mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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: [email protected] CC: [email protected] CC: [email protected] CC: Jiri Kosina <[email protected]> CC: [email protected] Tested-by: Wolfram Sang <[email protected]> Signed-off-by: Dominik Brodowski <[email protected]>
This commit is contained in:
parent
899611ee7d
commit
cdb138080b
16 changed files with 241 additions and 277 deletions
|
|
@ -68,28 +68,4 @@ typedef struct config_req_t {
|
|||
#define PRESENT_IOBASE_3 0x100
|
||||
#define PRESENT_IOSIZE 0x200
|
||||
|
||||
/* For RequestWindow */
|
||||
typedef struct win_req_t {
|
||||
u_int Attributes;
|
||||
u_long Base;
|
||||
u_int Size;
|
||||
u_int AccessSpeed;
|
||||
} win_req_t;
|
||||
|
||||
/* Attributes for RequestWindow */
|
||||
#define WIN_MEMORY_TYPE_CM 0x00 /* default */
|
||||
#define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */
|
||||
#define WIN_DATA_WIDTH_8 0x00 /* default */
|
||||
#define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */
|
||||
#define WIN_ENABLE 0x01 /* MAP_ACTIVE */
|
||||
#define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */
|
||||
|
||||
#define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE |
|
||||
MAP_USE_WAIT */
|
||||
#define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]:
|
||||
0x04 -> 0
|
||||
0x08 -> 1
|
||||
0x0c -> 2
|
||||
0x10 -> 3 */
|
||||
|
||||
#endif /* _LINUX_CS_H */
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ struct pcmcia_device;
|
|||
struct config_t;
|
||||
struct net_device;
|
||||
|
||||
typedef struct resource *window_handle_t;
|
||||
|
||||
/* dynamic device IDs for PCMCIA device drivers. See
|
||||
* Documentation/pcmcia/driver.txt for details.
|
||||
*/
|
||||
|
|
@ -92,7 +90,6 @@ struct pcmcia_device {
|
|||
|
||||
/* deprecated, will be cleaned up soon */
|
||||
config_req_t conf;
|
||||
window_handle_t win;
|
||||
|
||||
/* device setup */
|
||||
unsigned int irq;
|
||||
|
|
@ -209,10 +206,10 @@ int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
|
|||
int pcmcia_request_configuration(struct pcmcia_device *p_dev,
|
||||
config_req_t *req);
|
||||
|
||||
int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req,
|
||||
window_handle_t *wh);
|
||||
int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win);
|
||||
int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,
|
||||
int pcmcia_request_window(struct pcmcia_device *p_dev, struct resource *res,
|
||||
unsigned int speed);
|
||||
int pcmcia_release_window(struct pcmcia_device *p_dev, struct resource *res);
|
||||
int pcmcia_map_mem_page(struct pcmcia_device *p_dev, struct resource *res,
|
||||
unsigned int offset);
|
||||
|
||||
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)
|
|||
return IO_DATA_PATH_WIDTH_AUTO;
|
||||
}
|
||||
|
||||
/* IO memory */
|
||||
#define WIN_MEMORY_TYPE_CM 0x00 /* default */
|
||||
#define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */
|
||||
#define WIN_DATA_WIDTH_8 0x00 /* default */
|
||||
#define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */
|
||||
#define WIN_ENABLE 0x01 /* MAP_ACTIVE */
|
||||
#define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */
|
||||
|
||||
#define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE |
|
||||
MAP_USE_WAIT */
|
||||
#define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]:
|
||||
0x04 -> 0
|
||||
0x08 -> 1
|
||||
0x0c -> 2
|
||||
0x10 -> 3 */
|
||||
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_DS_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue