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>
This commit is contained in:
parent
c5038fc05d
commit
d7b174500e
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
|
|
||||||
#define DRV_NAME "pata_pcmcia"
|
#define DRV_NAME "pata_pcmcia"
|
||||||
#define DRV_VERSION "0.3.2"
|
#define DRV_VERSION "0.3.3"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Private data structure to glue stuff together
|
* 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)
|
||||||
/**
|
/**
|
||||||
* pcmcia_init_one - attach a PCMCIA interface
|
* pcmcia_init_one - attach a PCMCIA interface
|
||||||
* @pdev: pcmcia device
|
* @pdev: pcmcia device
|
||||||
* @ops: operations for this device
|
|
||||||
*
|
*
|
||||||
* Register a PCMCIA IDE interface. Such interfaces are PIO 0 and
|
* Register a PCMCIA IDE interface. Such interfaces are PIO 0 and
|
||||||
* shared IRQ.
|
* shared IRQ.
|
||||||
|
@ -217,9 +216,10 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
|
||||||
cistpl_cftable_entry_t dflt;
|
cistpl_cftable_entry_t dflt;
|
||||||
} *stk = NULL;
|
} *stk = NULL;
|
||||||
cistpl_cftable_entry_t *cfg;
|
cistpl_cftable_entry_t *cfg;
|
||||||
int pass, last_ret = 0, last_fn = 0, is_kme = 0, ret = -ENOMEM;
|
int pass, last_ret = 0, last_fn = 0, is_kme = 0, ret = -ENOMEM, p;
|
||||||
unsigned long io_base, ctl_base;
|
unsigned long io_base, ctl_base;
|
||||||
void __iomem *io_addr, *ctl_addr;
|
void __iomem *io_addr, *ctl_addr;
|
||||||
|
int n_ports = 1;
|
||||||
|
|
||||||
struct ata_port_operations *ops = &pcmcia_port_ops;
|
struct ata_port_operations *ops = &pcmcia_port_ops;
|
||||||
|
|
||||||
|
@ -348,7 +348,7 @@ next_entry:
|
||||||
/* FIXME: Could be more ports at base + 0x10 but we only deal with
|
/* FIXME: Could be more ports at base + 0x10 but we only deal with
|
||||||
one right now */
|
one right now */
|
||||||
if (pdev->io.NumPorts1 >= 0x20)
|
if (pdev->io.NumPorts1 >= 0x20)
|
||||||
printk(KERN_WARNING DRV_NAME ": second channel not yet supported.\n");
|
n_ports = 2;
|
||||||
|
|
||||||
if (pdev->manf_id == 0x0097 && pdev->card_id == 0x1620)
|
if (pdev->manf_id == 0x0097 && pdev->card_id == 0x1620)
|
||||||
ops = &pcmcia_8bit_port_ops;
|
ops = &pcmcia_8bit_port_ops;
|
||||||
|
@ -357,20 +357,23 @@ next_entry:
|
||||||
* sane.
|
* sane.
|
||||||
*/
|
*/
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
host = ata_host_alloc(&pdev->dev, 1);
|
host = ata_host_alloc(&pdev->dev, n_ports);
|
||||||
if (!host)
|
if (!host)
|
||||||
goto failed;
|
goto failed;
|
||||||
ap = host->ports[0];
|
|
||||||
|
for (p = 0; p < n_ports; p++) {
|
||||||
|
ap = host->ports[p];
|
||||||
|
|
||||||
ap->ops = ops;
|
ap->ops = ops;
|
||||||
ap->pio_mask = 1; /* ISA so PIO 0 cycles */
|
ap->pio_mask = 1; /* ISA so PIO 0 cycles */
|
||||||
ap->flags |= ATA_FLAG_SLAVE_POSS;
|
ap->flags |= ATA_FLAG_SLAVE_POSS;
|
||||||
ap->ioaddr.cmd_addr = io_addr;
|
ap->ioaddr.cmd_addr = io_addr + 0x10 * p;
|
||||||
ap->ioaddr.altstatus_addr = ctl_addr;
|
ap->ioaddr.altstatus_addr = ctl_addr + 0x10 * p;
|
||||||
ap->ioaddr.ctl_addr = ctl_addr;
|
ap->ioaddr.ctl_addr = ctl_addr + 0x10 * p;
|
||||||
ata_std_ports(&ap->ioaddr);
|
ata_std_ports(&ap->ioaddr);
|
||||||
|
|
||||||
ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", io_base, ctl_base);
|
ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", io_base, ctl_base);
|
||||||
|
}
|
||||||
|
|
||||||
/* activate */
|
/* activate */
|
||||||
ret = ata_host_activate(host, pdev->irq.AssignedIRQ, ata_interrupt,
|
ret = ata_host_activate(host, pdev->irq.AssignedIRQ, ata_interrupt,
|
||||||
|
|
Loading…
Reference in a new issue