Commit a58eef7f authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk/linux-2.5-pcmcia

into home.osdl.org:/home/torvalds/v2.5/linux
parents defec5af 5dda7b29
...@@ -795,16 +795,14 @@ static void __init isa_probe(void) ...@@ -795,16 +795,14 @@ static void __init isa_probe(void)
if (pnp_device_attach(dev) < 0) if (pnp_device_attach(dev) < 0)
continue; continue;
printk("PNP ");
if (pnp_activate_dev(dev) < 0) { if (pnp_activate_dev(dev) < 0) {
printk("activate failed\n"); printk("activate failed\n");
pnp_device_detach(dev); pnp_device_detach(dev);
break; break;
} }
if (pnp_port_valid(dev, 0)) { if (!pnp_port_valid(dev, 0)) {
printk("invalid resources ?\n"); printk("invalid resources ?\n");
pnp_device_detach(dev); pnp_device_detach(dev);
break; break;
......
...@@ -258,6 +258,7 @@ static int ti_override(struct yenta_socket *socket) ...@@ -258,6 +258,7 @@ static int ti_override(struct yenta_socket *socket)
if (new != reg) if (new != reg)
exca_writeb(socket, I365_INTCTL, new); exca_writeb(socket, I365_INTCTL, new);
#if 0
/* /*
* If ISA interrupts don't work, then fall back to routing card * If ISA interrupts don't work, then fall back to routing card
* interrupts to the PCI interrupt of the socket. * interrupts to the PCI interrupt of the socket.
...@@ -282,6 +283,7 @@ static int ti_override(struct yenta_socket *socket) ...@@ -282,6 +283,7 @@ static int ti_override(struct yenta_socket *socket)
config_writeb(socket, TI113X_DEVICE_CONTROL, devctl); config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
} }
} }
#endif
socket->socket.ops->init = ti_init; socket->socket.ops->init = ti_init;
return 0; return 0;
...@@ -327,9 +329,11 @@ static int ti1250_init(struct pcmcia_socket *sock) ...@@ -327,9 +329,11 @@ static int ti1250_init(struct pcmcia_socket *sock)
struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
ti113x_init(sock); ti113x_init(sock);
ti_irqmux(socket) = config_readl(socket, TI122X_IRQMUX); ti_irqmux(socket) = config_readl(socket, TI122X_IRQMUX);
#if 0
ti_irqmux(socket) = (ti_irqmux(socket) & ~0x0f) | 0x02; /* route INTA */ ti_irqmux(socket) = (ti_irqmux(socket) & ~0x0f) | 0x02; /* route INTA */
if (!(ti_sysctl(socket) & TI122X_SCR_INTRTIE)) if (!(ti_sysctl(socket) & TI122X_SCR_INTRTIE))
ti_irqmux(socket) |= 0x20; /* route INTB */ ti_irqmux(socket) |= 0x20; /* route INTB */
#endif
config_writel(socket, TI122X_IRQMUX, ti_irqmux(socket)); config_writel(socket, TI122X_IRQMUX, ti_irqmux(socket));
......
...@@ -752,6 +752,7 @@ static void yenta_close(struct pci_dev *dev) ...@@ -752,6 +752,7 @@ static void yenta_close(struct pci_dev *dev)
iounmap(sock->base); iounmap(sock->base);
yenta_free_resources(sock); yenta_free_resources(sock);
pci_release_regions(dev);
pci_set_drvdata(dev, NULL); pci_set_drvdata(dev, NULL);
} }
...@@ -823,6 +824,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ...@@ -823,6 +824,7 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
{ {
struct yenta_socket *socket; struct yenta_socket *socket;
struct cardbus_override_struct *d; struct cardbus_override_struct *d;
int ret;
socket = kmalloc(sizeof(struct yenta_socket), GFP_KERNEL); socket = kmalloc(sizeof(struct yenta_socket), GFP_KERNEL);
if (!socket) if (!socket)
...@@ -842,11 +844,19 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ...@@ -842,11 +844,19 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
/* /*
* Do some basic sanity checking.. * Do some basic sanity checking..
*/ */
if (pci_enable_device(dev)) if (pci_enable_device(dev)) {
return -1; ret = -EBUSY;
goto free;
}
ret = pci_request_regions(dev, "yenta_socket");
if (ret)
goto disable;
if (!pci_resource_start(dev, 0)) { if (!pci_resource_start(dev, 0)) {
printk("No cardbus resource!\n"); printk("No cardbus resource!\n");
return -1; ret = -ENODEV;
goto release;
} }
/* /*
...@@ -854,8 +864,17 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ...@@ -854,8 +864,17 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
* and request the IRQ. * and request the IRQ.
*/ */
socket->base = ioremap(pci_resource_start(dev, 0), 0x1000); socket->base = ioremap(pci_resource_start(dev, 0), 0x1000);
if (!socket->base) if (!socket->base) {
return -1; ret = -ENOMEM;
goto release;
}
/*
* report the subsystem vendor and device for help debugging
* the irq stuff...
*/
printk(KERN_INFO "Yenta: CardBus bridge found at %s [%04x:%04x]\n",
dev->slot_name, dev->subsystem_vendor, dev->subsystem_device);
yenta_config_init(socket); yenta_config_init(socket);
...@@ -871,9 +890,9 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ...@@ -871,9 +890,9 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
d = cardbus_override; d = cardbus_override;
while (d->override) { while (d->override) {
if ((dev->vendor == d->vendor) && (dev->device == d->device)) { if ((dev->vendor == d->vendor) && (dev->device == d->device)) {
int retval = d->override(socket); ret = d->override(socket);
if (retval < 0) if (ret < 0)
return retval; goto unmap;
} }
d++; d++;
} }
...@@ -895,7 +914,20 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ...@@ -895,7 +914,20 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
printk("Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE)); printk("Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE));
/* Register it with the pcmcia layer.. */ /* Register it with the pcmcia layer.. */
return pcmcia_register_socket(&socket->socket); ret = pcmcia_register_socket(&socket->socket);
if (ret == 0)
goto out;
unmap:
iounmap(socket->base);
release:
pci_release_regions(dev);
disable:
pci_disable_device(dev);
free:
kfree(socket);
out:
return ret;
} }
......
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