diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-07-12 16:58:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-12 19:01:00 -0400 |
commit | 278798357d4a8658067dc9ac399d8ffba8389f03 (patch) | |
tree | faa00e598b8de5ce2401e79824308e32780c191c /drivers/pcmcia/yenta_socket.c | |
parent | c6fd718808df873b5d216d5827ac57ec39820238 (diff) |
[PATCH] yenta: same resources in same structs
drivers/pci/setup-bus.c enumerates the CardBus windows (bus->resources[])
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pcmcia/yenta_socket.c')
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 5e0a9980d2fc..d3807e22fe04 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -539,13 +539,12 @@ static int yenta_sock_suspend(struct pcmcia_socket *sock) | |||
539 | #define PCIBIOS_MIN_CARDBUS_IO PCIBIOS_MIN_IO | 539 | #define PCIBIOS_MIN_CARDBUS_IO PCIBIOS_MIN_IO |
540 | #endif | 540 | #endif |
541 | 541 | ||
542 | static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type) | 542 | static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end) |
543 | { | 543 | { |
544 | struct pci_bus *bus; | 544 | struct pci_bus *bus; |
545 | struct resource *root, *res; | 545 | struct resource *root, *res; |
546 | u32 start, end; | 546 | u32 start, end; |
547 | u32 align, size, min; | 547 | u32 align, size, min; |
548 | unsigned offset; | ||
549 | unsigned mask; | 548 | unsigned mask; |
550 | 549 | ||
551 | res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; | 550 | res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; |
@@ -558,13 +557,12 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
558 | if (type & IORESOURCE_IO) | 557 | if (type & IORESOURCE_IO) |
559 | mask = ~3; | 558 | mask = ~3; |
560 | 559 | ||
561 | offset = 0x1c + 8*nr; | ||
562 | bus = socket->dev->subordinate; | 560 | bus = socket->dev->subordinate; |
563 | res->name = bus->name; | 561 | res->name = bus->name; |
564 | res->flags = type; | 562 | res->flags = type; |
565 | 563 | ||
566 | start = config_readl(socket, offset) & mask; | 564 | start = config_readl(socket, addr_start) & mask; |
567 | end = config_readl(socket, offset+4) | ~mask; | 565 | end = config_readl(socket, addr_end) | ~mask; |
568 | if (start && end > start && !override_bios) { | 566 | if (start && end > start && !override_bios) { |
569 | res->start = start; | 567 | res->start = start; |
570 | res->end = end; | 568 | res->end = end; |
@@ -607,8 +605,8 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
607 | 605 | ||
608 | do { | 606 | do { |
609 | if (allocate_resource(root, res, size, start, end, align, NULL, NULL)==0) { | 607 | if (allocate_resource(root, res, size, start, end, align, NULL, NULL)==0) { |
610 | config_writel(socket, offset, res->start); | 608 | config_writel(socket, addr_start, res->start); |
611 | config_writel(socket, offset+4, res->end); | 609 | config_writel(socket, addr_end, res->end); |
612 | return; | 610 | return; |
613 | } | 611 | } |
614 | size = size/2; | 612 | size = size/2; |
@@ -624,10 +622,14 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
624 | */ | 622 | */ |
625 | static void yenta_allocate_resources(struct yenta_socket *socket) | 623 | static void yenta_allocate_resources(struct yenta_socket *socket) |
626 | { | 624 | { |
627 | yenta_allocate_res(socket, 0, IORESOURCE_MEM|IORESOURCE_PREFETCH); | 625 | yenta_allocate_res(socket, 0, IORESOURCE_IO, |
628 | yenta_allocate_res(socket, 1, IORESOURCE_MEM); | 626 | PCI_CB_IO_BASE_0, PCI_CB_IO_LIMIT_0); |
629 | yenta_allocate_res(socket, 2, IORESOURCE_IO); | 627 | yenta_allocate_res(socket, 1, IORESOURCE_IO, |
630 | yenta_allocate_res(socket, 3, IORESOURCE_IO); | 628 | PCI_CB_IO_BASE_1, PCI_CB_IO_LIMIT_1); |
629 | yenta_allocate_res(socket, 2, IORESOURCE_MEM|IORESOURCE_PREFETCH, | ||
630 | PCI_CB_MEMORY_BASE_0, PCI_CB_MEMORY_LIMIT_0); | ||
631 | yenta_allocate_res(socket, 3, IORESOURCE_MEM, | ||
632 | PCI_CB_MEMORY_BASE_1, PCI_CB_MEMORY_LIMIT_1); | ||
631 | } | 633 | } |
632 | 634 | ||
633 | 635 | ||