aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_pcmcia.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-11-19 09:43:07 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-23 05:24:15 -0500
commitd7b174500e5750099537c7f0bc4873f06b6c1b9a (patch)
tree62fa79e8378a236b59be57db2be09ae19b9c8ac3 /drivers/ata/pata_pcmcia.c
parentc5038fc05d4aa4ae0671776199459690e4c973cb (diff)
pata_pcmcia: Minor cleanups and support for dual channel cards
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_pcmcia.c')
-rw-r--r--drivers/ata/pata_pcmcia.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index bbd4d70b92de..ceba93b7754e 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -42,7 +42,7 @@
42 42
43 43
44#define DRV_NAME "pata_pcmcia" 44#define DRV_NAME "pata_pcmcia"
45#define DRV_VERSION "0.3.2" 45#define DRV_VERSION "0.3.3"
46 46
47/* 47/*
48 * Private data structure to glue stuff together 48 * Private data structure to glue stuff together
@@ -198,7 +198,6 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
198/** 198/**
199 * pcmcia_init_one - attach a PCMCIA interface 199 * pcmcia_init_one - attach a PCMCIA interface
200 * @pdev: pcmcia device 200 * @pdev: pcmcia device
201 * @ops: operations for this device
202 * 201 *
203 * Register a PCMCIA IDE interface. Such interfaces are PIO 0 and 202 * Register a PCMCIA IDE interface. Such interfaces are PIO 0 and
204 * shared IRQ. 203 * shared IRQ.
@@ -217,9 +216,10 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
217 cistpl_cftable_entry_t dflt; 216 cistpl_cftable_entry_t dflt;
218 } *stk = NULL; 217 } *stk = NULL;
219 cistpl_cftable_entry_t *cfg; 218 cistpl_cftable_entry_t *cfg;
220 int pass, last_ret = 0, last_fn = 0, is_kme = 0, ret = -ENOMEM; 219 int pass, last_ret = 0, last_fn = 0, is_kme = 0, ret = -ENOMEM, p;
221 unsigned long io_base, ctl_base; 220 unsigned long io_base, ctl_base;
222 void __iomem *io_addr, *ctl_addr; 221 void __iomem *io_addr, *ctl_addr;
222 int n_ports = 1;
223 223
224 struct ata_port_operations *ops = &pcmcia_port_ops; 224 struct ata_port_operations *ops = &pcmcia_port_ops;
225 225
@@ -348,7 +348,7 @@ next_entry:
348 /* FIXME: Could be more ports at base + 0x10 but we only deal with 348 /* FIXME: Could be more ports at base + 0x10 but we only deal with
349 one right now */ 349 one right now */
350 if (pdev->io.NumPorts1 >= 0x20) 350 if (pdev->io.NumPorts1 >= 0x20)
351 printk(KERN_WARNING DRV_NAME ": second channel not yet supported.\n"); 351 n_ports = 2;
352 352
353 if (pdev->manf_id == 0x0097 && pdev->card_id == 0x1620) 353 if (pdev->manf_id == 0x0097 && pdev->card_id == 0x1620)
354 ops = &pcmcia_8bit_port_ops; 354 ops = &pcmcia_8bit_port_ops;
@@ -357,20 +357,23 @@ next_entry:
357 * sane. 357 * sane.
358 */ 358 */
359 ret = -ENOMEM; 359 ret = -ENOMEM;
360 host = ata_host_alloc(&pdev->dev, 1); 360 host = ata_host_alloc(&pdev->dev, n_ports);
361 if (!host) 361 if (!host)
362 goto failed; 362 goto failed;
363 ap = host->ports[0];
364 363
365 ap->ops = ops; 364 for (p = 0; p < n_ports; p++) {
366 ap->pio_mask = 1; /* ISA so PIO 0 cycles */ 365 ap = host->ports[p];
367 ap->flags |= ATA_FLAG_SLAVE_POSS;
368 ap->ioaddr.cmd_addr = io_addr;
369 ap->ioaddr.altstatus_addr = ctl_addr;
370 ap->ioaddr.ctl_addr = ctl_addr;
371 ata_std_ports(&ap->ioaddr);
372 366
373 ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", io_base, ctl_base); 367 ap->ops = ops;
368 ap->pio_mask = 1; /* ISA so PIO 0 cycles */
369 ap->flags |= ATA_FLAG_SLAVE_POSS;
370 ap->ioaddr.cmd_addr = io_addr + 0x10 * p;
371 ap->ioaddr.altstatus_addr = ctl_addr + 0x10 * p;
372 ap->ioaddr.ctl_addr = ctl_addr + 0x10 * p;
373 ata_std_ports(&ap->ioaddr);
374
375 ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", io_base, ctl_base);
376 }
374 377
375 /* activate */ 378 /* activate */
376 ret = ata_host_activate(host, pdev->irq.AssignedIRQ, ata_interrupt, 379 ret = ata_host_activate(host, pdev->irq.AssignedIRQ, ata_interrupt,