Commit 4bbed523 authored by Dominik Brodowski's avatar Dominik Brodowski

[PATCH] pcmcia: remove export of pcmcia_release_configuration

Handle the _modifying_ operation sm91c92_cs requires in
pcmcia_modify_configuration, so that the only remaining users
of pcmcia_release_configuration() are within the pcmcia core
module.
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 8661bb5b
...@@ -353,8 +353,7 @@ static void pcmciamtd_release(dev_link_t *link) ...@@ -353,8 +353,7 @@ static void pcmciamtd_release(dev_link_t *link)
} }
pcmcia_release_window(link->win); pcmcia_release_window(link->win);
} }
pcmcia_release_configuration(link->handle); pcmcia_disable_device(link->handle);
link->state &= ~DEV_CONFIG;
} }
......
...@@ -874,11 +874,8 @@ static int smc91c92_suspend(struct pcmcia_device *p_dev) ...@@ -874,11 +874,8 @@ static int smc91c92_suspend(struct pcmcia_device *p_dev)
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
if (link->state & DEV_CONFIG) { if ((link->state & DEV_CONFIG) && (link->open))
if (link->open) netif_device_detach(dev);
netif_device_detach(dev);
pcmcia_release_configuration(link->handle);
}
return 0; return 0;
} }
...@@ -894,7 +891,6 @@ static int smc91c92_resume(struct pcmcia_device *p_dev) ...@@ -894,7 +891,6 @@ static int smc91c92_resume(struct pcmcia_device *p_dev)
if ((smc->manfid == MANFID_MEGAHERTZ) && if ((smc->manfid == MANFID_MEGAHERTZ) &&
(smc->cardid == PRODID_MEGAHERTZ_EM3288)) (smc->cardid == PRODID_MEGAHERTZ_EM3288))
mhz_3288_power(link); mhz_3288_power(link);
pcmcia_request_configuration(link->handle, &link->conf);
if (smc->manfid == MANFID_MOTOROLA) if (smc->manfid == MANFID_MOTOROLA)
mot_config(link); mot_config(link);
if ((smc->manfid == MANFID_OSITECH) && if ((smc->manfid == MANFID_OSITECH) &&
...@@ -963,18 +959,15 @@ static int check_sig(dev_link_t *link) ...@@ -963,18 +959,15 @@ static int check_sig(dev_link_t *link)
} }
if (width) { if (width) {
printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n"); modconf_t mod = {
/* call pcmcia_release_configuration() in _suspend */ .Attributes = CONF_IO_CHANGE_WIDTH,
smc91c92_suspend(link->handle); };
printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n");
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->handle->socket->io[0].res->flags &= ~IO_DATA_PATH_WIDTH; smc91c92_suspend(link->handle);
link->handle->socket->io[0].res->flags |= IO_DATA_PATH_WIDTH_8; pcmcia_modify_configuration(link->handle, &mod);
smc91c92_resume(link->handle);
/* call pcmcia_request_configuration() in _resume, it handles the return check_sig(link);
* flag update */
smc91c92_resume(link->handle);
return check_sig(link);
} }
return -ENODEV; return -ENODEV;
} }
......
...@@ -8,6 +8,8 @@ extern void pcmcia_put_dev(struct pcmcia_device *p_dev); ...@@ -8,6 +8,8 @@ extern void pcmcia_put_dev(struct pcmcia_device *p_dev);
struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function); struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function);
extern int pcmcia_release_configuration(struct pcmcia_device *p_dev);
#ifdef CONFIG_PCMCIA_IOCTL #ifdef CONFIG_PCMCIA_IOCTL
extern void __init pcmcia_setup_ioctl(void); extern void __init pcmcia_setup_ioctl(void);
extern void __exit pcmcia_cleanup_ioctl(void); extern void __exit pcmcia_cleanup_ioctl(void);
......
...@@ -442,6 +442,28 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev, ...@@ -442,6 +442,28 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
(mod->Attributes & CONF_VPP2_CHANGE_VALID)) (mod->Attributes & CONF_VPP2_CHANGE_VALID))
return CS_BAD_VPP; return CS_BAD_VPP;
if (mod->Attributes & CONF_IO_CHANGE_WIDTH) {
pccard_io_map io_off = { 0, 0, 0, 0, 1 };
pccard_io_map io_on;
int i;
io_on.speed = io_speed;
for (i = 0; i < MAX_IO_WIN; i++) {
if (!s->io[i].res)
continue;
io_off.map = i;
io_on.map = i;
io_on.flags = MAP_ACTIVE | IO_DATA_PATH_WIDTH_8;
io_on.start = s->io[i].res->start;
io_on.stop = s->io[i].res->end;
s->ops->set_io_map(s, &io_off);
mdelay(40);
s->ops->set_io_map(s, &io_on);
}
}
return CS_SUCCESS; return CS_SUCCESS;
} /* modify_configuration */ } /* modify_configuration */
EXPORT_SYMBOL(pcmcia_modify_configuration); EXPORT_SYMBOL(pcmcia_modify_configuration);
...@@ -479,7 +501,6 @@ int pcmcia_release_configuration(struct pcmcia_device *p_dev) ...@@ -479,7 +501,6 @@ int pcmcia_release_configuration(struct pcmcia_device *p_dev)
return CS_SUCCESS; return CS_SUCCESS;
} /* pcmcia_release_configuration */ } /* pcmcia_release_configuration */
EXPORT_SYMBOL(pcmcia_release_configuration);
/** pcmcia_release_io /** pcmcia_release_io
......
...@@ -116,10 +116,11 @@ typedef struct modconf_t { ...@@ -116,10 +116,11 @@ typedef struct modconf_t {
} modconf_t; } modconf_t;
/* Attributes for ModifyConfiguration */ /* Attributes for ModifyConfiguration */
#define CONF_IRQ_CHANGE_VALID 0x100 #define CONF_IRQ_CHANGE_VALID 0x0100
#define CONF_VCC_CHANGE_VALID 0x200 #define CONF_VCC_CHANGE_VALID 0x0200
#define CONF_VPP1_CHANGE_VALID 0x400 #define CONF_VPP1_CHANGE_VALID 0x0400
#define CONF_VPP2_CHANGE_VALID 0x800 #define CONF_VPP2_CHANGE_VALID 0x0800
#define CONF_IO_CHANGE_WIDTH 0x1000
/* For RequestConfiguration */ /* For RequestConfiguration */
typedef struct config_req_t { typedef struct config_req_t {
...@@ -378,7 +379,6 @@ int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status); ...@@ -378,7 +379,6 @@ int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status);
int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
int pcmcia_release_configuration(struct pcmcia_device *p_dev);
int pcmcia_release_window(window_handle_t win); int pcmcia_release_window(window_handle_t win);
int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req);
int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment