Commit 6238b318 authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Linus Torvalds

[PATCH] pcmcia: make rsrc_nonstatic an independend module

Make rsrc_nonstatic an independent module.
Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent be1f106c
...@@ -80,6 +80,7 @@ config YENTA ...@@ -80,6 +80,7 @@ config YENTA
depends on PCCARD && PCI depends on PCCARD && PCI
#fixme: remove dependendcy on CARDBUS #fixme: remove dependendcy on CARDBUS
depends on CARDBUS depends on CARDBUS
select PCCARD_NONSTATIC
---help--- ---help---
This option enables support for CardBus host bridges. Virtually This option enables support for CardBus host bridges. Virtually
all modern PCMCIA bridges are CardBus compatible. A "bridge" is all modern PCMCIA bridges are CardBus compatible. A "bridge" is
...@@ -94,6 +95,7 @@ config YENTA ...@@ -94,6 +95,7 @@ config YENTA
config PD6729 config PD6729
tristate "Cirrus PD6729 compatible bridge support" tristate "Cirrus PD6729 compatible bridge support"
depends on PCMCIA && PCI depends on PCMCIA && PCI
select PCCARD_NONSTATIC
help help
This provides support for the Cirrus PD6729 PCI-to-PCMCIA bridge This provides support for the Cirrus PD6729 PCI-to-PCMCIA bridge
device, found in some older laptops and PCMCIA card readers. device, found in some older laptops and PCMCIA card readers.
...@@ -101,6 +103,7 @@ config PD6729 ...@@ -101,6 +103,7 @@ config PD6729
config I82092 config I82092
tristate "i82092 compatible bridge support" tristate "i82092 compatible bridge support"
depends on PCMCIA && PCI depends on PCMCIA && PCI
select PCCARD_NONSTATIC
help help
This provides support for the Intel I82092AA PCI-to-PCMCIA bridge device, This provides support for the Intel I82092AA PCI-to-PCMCIA bridge device,
found in some older laptops and more commonly in evaluation boards for the found in some older laptops and more commonly in evaluation boards for the
...@@ -109,6 +112,7 @@ config I82092 ...@@ -109,6 +112,7 @@ config I82092
config I82365 config I82365
tristate "i82365 compatible bridge support" tristate "i82365 compatible bridge support"
depends on PCMCIA && ISA depends on PCMCIA && ISA
select PCCARD_NONSTATIC
help help
Say Y here to include support for ISA-bus PCMCIA host bridges that Say Y here to include support for ISA-bus PCMCIA host bridges that
are register compatible with the Intel i82365. These are found on are register compatible with the Intel i82365. These are found on
...@@ -119,6 +123,7 @@ config I82365 ...@@ -119,6 +123,7 @@ config I82365
config TCIC config TCIC
tristate "Databook TCIC host bridge support" tristate "Databook TCIC host bridge support"
depends on PCMCIA depends on PCMCIA
select PCCARD_NONSTATIC
help help
Say Y here to include support for the Databook TCIC family of PCMCIA Say Y here to include support for the Databook TCIC family of PCMCIA
host bridges. These are only found on a handful of old systems. host bridges. These are only found on a handful of old systems.
...@@ -178,4 +183,8 @@ config M32R_CFC_NUM ...@@ -178,4 +183,8 @@ config M32R_CFC_NUM
help help
Set the number of M32R CF slots. Set the number of M32R CF slots.
config PCCARD_NONSTATIC
tristate
depends on PCCARD
endmenu endmenu
...@@ -6,13 +6,15 @@ ifeq ($(CONFIG_PCMCIA_DEBUG),y) ...@@ -6,13 +6,15 @@ ifeq ($(CONFIG_PCMCIA_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG EXTRA_CFLAGS += -DDEBUG
endif endif
pcmcia_core-y += cs.o cistpl.o rsrc_mgr.o socket_sysfs.o rsrc_nonstatic.o pcmcia_core-y += cs.o cistpl.o rsrc_mgr.o socket_sysfs.o
pcmcia_core-$(CONFIG_CARDBUS) += cardbus.o pcmcia_core-$(CONFIG_CARDBUS) += cardbus.o
obj-$(CONFIG_PCCARD) += pcmcia_core.o obj-$(CONFIG_PCCARD) += pcmcia_core.o
pcmcia-y += ds.o pcmcia_compat.o pcmcia-y += ds.o pcmcia_compat.o
obj-$(CONFIG_PCMCIA) += pcmcia.o obj-$(CONFIG_PCMCIA) += pcmcia.o
obj-$(CONFIG_PCCARD_NONSTATIC) += rsrc_nonstatic.o
# socket drivers # socket drivers
......
...@@ -78,6 +78,7 @@ void release_cis_mem(struct pcmcia_socket *s) ...@@ -78,6 +78,7 @@ void release_cis_mem(struct pcmcia_socket *s)
s->cis_virt = NULL; s->cis_virt = NULL;
} }
} }
EXPORT_SYMBOL(release_cis_mem);
/* /*
* Map the card memory at "card_offset" into virtual space. * Map the card memory at "card_offset" into virtual space.
...@@ -320,6 +321,7 @@ void destroy_cis_cache(struct pcmcia_socket *s) ...@@ -320,6 +321,7 @@ void destroy_cis_cache(struct pcmcia_socket *s)
s->fake_cis = NULL; s->fake_cis = NULL;
} }
} }
EXPORT_SYMBOL(destroy_cis_cache);
/*====================================================================== /*======================================================================
......
...@@ -212,7 +212,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket) ...@@ -212,7 +212,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
{ {
int ret; int ret;
if (!socket || !socket->ops || !socket->dev.dev) if (!socket || !socket->ops || !socket->dev.dev || !socket->resource_ops)
return -EINVAL; return -EINVAL;
cs_dbg(socket, 0, "pcmcia_register_socket(0x%p)\n", socket->ops); cs_dbg(socket, 0, "pcmcia_register_socket(0x%p)\n", socket->ops);
...@@ -250,11 +250,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket) ...@@ -250,11 +250,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
socket->cis_mem.flags = 0; socket->cis_mem.flags = 0;
socket->cis_mem.speed = cis_speed; socket->cis_mem.speed = cis_speed;
/* init resource handling */
if (socket->features & SS_CAP_STATIC_MAP)
socket->resource_ops = &pccard_static_ops;
else
socket->resource_ops = &pccard_nonstatic_ops;
socket->mem_db.next = &socket->mem_db; socket->mem_db.next = &socket->mem_db;
socket->io_db.next = &socket->io_db; socket->io_db.next = &socket->io_db;
......
...@@ -144,8 +144,6 @@ int try_irq(u_int Attributes, int irq, int specific); ...@@ -144,8 +144,6 @@ int try_irq(u_int Attributes, int irq, int specific);
void undo_irq(u_int Attributes, int irq); void undo_irq(u_int Attributes, int irq);
int adjust_resource_info(client_handle_t handle, adjust_t *adj); int adjust_resource_info(client_handle_t handle, adjust_t *adj);
void release_resource_db(struct pcmcia_socket *s); void release_resource_db(struct pcmcia_socket *s);
extern struct pccard_resource_ops pccard_static_ops;
extern struct pccard_resource_ops pccard_nonstatic_ops;
/* In socket_sysfs.c */ /* In socket_sysfs.c */
extern struct class_interface pccard_sysfs_interface; extern struct class_interface pccard_sysfs_interface;
......
...@@ -922,6 +922,7 @@ static int __init init_hs(void) ...@@ -922,6 +922,7 @@ static int __init init_hs(void)
hs_set_voltages(&hs_sockets[i], 0, 0); hs_set_voltages(&hs_sockets[i], 0, 0);
hs_sockets[i].socket.features |= SS_CAP_PCCARD | SS_CAP_STATIC_MAP; /* mappings are fixed in host memory */ hs_sockets[i].socket.features |= SS_CAP_PCCARD | SS_CAP_STATIC_MAP; /* mappings are fixed in host memory */
hs_sockets[i].socket.resource_ops = &pccard_static_ops;
hs_sockets[i].socket.irq_mask = 0xffde;/*0xffff*/ /* IRQs mapped in s/w so can do any, really */ hs_sockets[i].socket.irq_mask = 0xffde;/*0xffff*/ /* IRQs mapped in s/w so can do any, really */
hs_sockets[i].socket.map_size = HD64465_PCC_WINDOW; /* 16MB fixed window size */ hs_sockets[i].socket.map_size = HD64465_PCC_WINDOW; /* 16MB fixed window size */
......
...@@ -162,6 +162,7 @@ static int __devinit i82092aa_pci_probe(struct pci_dev *dev, const struct pci_de ...@@ -162,6 +162,7 @@ static int __devinit i82092aa_pci_probe(struct pci_dev *dev, const struct pci_de
for (i = 0; i<socket_count; i++) { for (i = 0; i<socket_count; i++) {
sockets[i].socket.dev.dev = &dev->dev; sockets[i].socket.dev.dev = &dev->dev;
sockets[i].socket.ops = &i82092aa_operations; sockets[i].socket.ops = &i82092aa_operations;
sockets[i].socket.resource_ops = &pccard_nonstatic_ops;
ret = pcmcia_register_socket(&sockets[i].socket); ret = pcmcia_register_socket(&sockets[i].socket);
if (ret) { if (ret) {
goto err_out_free_sockets; goto err_out_free_sockets;
......
...@@ -1400,6 +1400,7 @@ static int __init init_i82365(void) ...@@ -1400,6 +1400,7 @@ static int __init init_i82365(void)
for (i = 0; i < sockets; i++) { for (i = 0; i < sockets; i++) {
socket[i].socket.dev.dev = &i82365_device.dev; socket[i].socket.dev.dev = &i82365_device.dev;
socket[i].socket.ops = &pcic_operations; socket[i].socket.ops = &pcic_operations;
socket[i].socket.resource_ops = &pccard_nonstatic_ops;
socket[i].socket.owner = THIS_MODULE; socket[i].socket.owner = THIS_MODULE;
socket[i].number = i; socket[i].number = i;
ret = pcmcia_register_socket(&socket[i].socket); ret = pcmcia_register_socket(&socket[i].socket);
......
...@@ -831,6 +831,7 @@ static int __init init_m32r_pcc(void) ...@@ -831,6 +831,7 @@ static int __init init_m32r_pcc(void)
for (i = 0 ; i < pcc_sockets ; i++) { for (i = 0 ; i < pcc_sockets ; i++) {
socket[i].socket.dev.dev = &pcc_device.dev; socket[i].socket.dev.dev = &pcc_device.dev;
socket[i].socket.ops = &pcc_operations; socket[i].socket.ops = &pcc_operations;
socket[i].socket.resource_ops = &pccard_static_ops;
socket[i].socket.owner = THIS_MODULE; socket[i].socket.owner = THIS_MODULE;
socket[i].number = i; socket[i].number = i;
ret = pcmcia_register_socket(&socket[i].socket); ret = pcmcia_register_socket(&socket[i].socket);
......
...@@ -768,6 +768,7 @@ static int __init init_m32r_pcc(void) ...@@ -768,6 +768,7 @@ static int __init init_m32r_pcc(void)
for (i = 0 ; i < pcc_sockets ; i++) { for (i = 0 ; i < pcc_sockets ; i++) {
socket[i].socket.dev.dev = &pcc_device.dev; socket[i].socket.dev.dev = &pcc_device.dev;
socket[i].socket.ops = &pcc_operations; socket[i].socket.ops = &pcc_operations;
socket[i].socket.resource_ops = &pccard_static_ops;
socket[i].socket.owner = THIS_MODULE; socket[i].socket.owner = THIS_MODULE;
socket[i].number = i; socket[i].number = i;
ret = pcmcia_register_socket(&socket[i].socket); ret = pcmcia_register_socket(&socket[i].socket);
......
...@@ -759,6 +759,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev, ...@@ -759,6 +759,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
socket[i].number = i; socket[i].number = i;
socket[i].socket.ops = &pd6729_operations; socket[i].socket.ops = &pd6729_operations;
socket[i].socket.resource_ops = &pccard_nonstatic_ops;
socket[i].socket.dev.dev = &dev->dev; socket[i].socket.dev.dev = &dev->dev;
socket[i].socket.driver_data = &socket[i]; socket[i].socket.driver_data = &socket[i];
} }
......
...@@ -290,3 +290,4 @@ struct pccard_resource_ops pccard_static_ops = { ...@@ -290,3 +290,4 @@ struct pccard_resource_ops pccard_static_ops = {
.adjust_resource = NULL, .adjust_resource = NULL,
.exit = NULL, .exit = NULL,
}; };
EXPORT_SYMBOL(pccard_static_ops);
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
#include <pcmcia/cistpl.h> #include <pcmcia/cistpl.h>
#include "cs_internal.h" #include "cs_internal.h"
MODULE_AUTHOR("David A. Hinds, Dominik Brodowski");
MODULE_LICENSE("GPL");
/* Parameters that can be set with 'insmod' */ /* Parameters that can be set with 'insmod' */
#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444) #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444)
...@@ -769,3 +772,4 @@ struct pccard_resource_ops pccard_nonstatic_ops = { ...@@ -769,3 +772,4 @@ struct pccard_resource_ops pccard_nonstatic_ops = {
.adjust_resource = nonstatic_adjust_resource_info, .adjust_resource = nonstatic_adjust_resource_info,
.exit = nonstatic_release_resource_db, .exit = nonstatic_release_resource_db,
}; };
EXPORT_SYMBOL(pccard_nonstatic_ops);
...@@ -758,6 +758,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops ...@@ -758,6 +758,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
goto out_err_6; goto out_err_6;
skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD; skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
skt->socket.resource_ops = &pccard_static_ops;
skt->socket.irq_mask = 0; skt->socket.irq_mask = 0;
skt->socket.map_size = PAGE_SIZE; skt->socket.map_size = PAGE_SIZE;
skt->socket.pci_irq = skt->irq; skt->socket.pci_irq = skt->irq;
......
...@@ -531,8 +531,9 @@ static int __init init_tcic(void) ...@@ -531,8 +531,9 @@ static int __init init_tcic(void)
for (i = 0; i < sockets; i++) { for (i = 0; i < sockets; i++) {
socket_table[i].socket.ops = &tcic_operations; socket_table[i].socket.ops = &tcic_operations;
socket_table[i].socket.resource_ops = &pccard_nonstatic_ops;
socket_table[i].socket.dev.dev = &tcic_device.dev; socket_table[i].socket.dev.dev = &tcic_device.dev;
ret = pcmcia_register_socket(&socket_table[i].socket); ret = pcmcia_register_socket(&socket_table[i].socket);
if (ret && i) if (ret && i)
pcmcia_unregister_socket(&socket_table[0].socket); pcmcia_unregister_socket(&socket_table[0].socket);
} }
......
...@@ -917,6 +917,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ...@@ -917,6 +917,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
/* prepare pcmcia_socket */ /* prepare pcmcia_socket */
socket->socket.ops = &yenta_socket_operations; socket->socket.ops = &yenta_socket_operations;
socket->socket.resource_ops = &pccard_nonstatic_ops;
socket->socket.dev.dev = &dev->dev; socket->socket.dev.dev = &dev->dev;
socket->socket.driver_data = socket; socket->socket.driver_data = socket;
socket->socket.owner = THIS_MODULE; socket->socket.owner = THIS_MODULE;
......
...@@ -131,6 +131,10 @@ struct pccard_resource_ops { ...@@ -131,6 +131,10 @@ struct pccard_resource_ops {
adjust_t *adj); adjust_t *adj);
void (*exit) (struct pcmcia_socket *s); void (*exit) (struct pcmcia_socket *s);
}; };
/* SS_CAP_STATIC_MAP */
extern struct pccard_resource_ops pccard_static_ops;
/* !SS_CAP_STATIC_MAP */
extern struct pccard_resource_ops pccard_nonstatic_ops;
/* /*
* Calls to set up low-level "Socket Services" drivers * Calls to set up low-level "Socket Services" drivers
......
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