Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6.git] / drivers / ata / pata_rb532_cf.c
index 9d61ce5..45f1e10 100644 (file)
 struct rb532_cf_info {
        void __iomem    *iobase;
        unsigned int    gpio_line;
-       int             frozen;
        unsigned int    irq;
 };
 
 /* ------------------------------------------------------------------------ */
 
-static unsigned int rb532_pata_data_xfer(struct ata_device *adev, unsigned char *buf,
-                               unsigned int buflen, int write_data)
-{
-       struct ata_port *ap = adev->link->ap;
-       void __iomem *ioaddr = ap->ioaddr.data_addr;
-       int retlen = buflen;
-
-       if (write_data) {
-               for (; buflen > 0; buflen--, buf++)
-                       writeb(*buf, ioaddr);
-       } else {
-               for (; buflen > 0; buflen--, buf++)
-                       *buf = readb(ioaddr);
-       }
-
-       ata_sff_pause(ap);
-       return retlen;
-}
-
-static void rb532_pata_freeze(struct ata_port *ap)
-{
-       struct rb532_cf_info *info = ap->host->private_data;
-
-       info->frozen = 1;
-}
-
-static void rb532_pata_thaw(struct ata_port *ap)
-{
-       struct rb532_cf_info *info = ap->host->private_data;
-
-       info->frozen = 0;
-}
-
 static irqreturn_t rb532_pata_irq_handler(int irq, void *dev_instance)
 {
        struct ata_host *ah = dev_instance;
@@ -94,8 +60,7 @@ static irqreturn_t rb532_pata_irq_handler(int irq, void *dev_instance)
 
        if (gpio_get_value(info->gpio_line)) {
                set_irq_type(info->irq, IRQ_TYPE_LEVEL_LOW);
-               if (!info->frozen)
-                       ata_sff_interrupt(info->irq, dev_instance);
+               ata_sff_interrupt(info->irq, dev_instance);
        } else {
                set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH);
        }
@@ -105,9 +70,7 @@ static irqreturn_t rb532_pata_irq_handler(int irq, void *dev_instance)
 
 static struct ata_port_operations rb532_pata_port_ops = {
        .inherits               = &ata_sff_port_ops,
-       .sff_data_xfer          = rb532_pata_data_xfer,
-       .freeze                 = rb532_pata_freeze,
-       .thaw                   = rb532_pata_thaw,
+       .sff_data_xfer          = ata_sff_data_xfer32,
 };
 
 /* ------------------------------------------------------------------------ */
@@ -126,7 +89,7 @@ static void rb532_pata_setup_ports(struct ata_host *ah)
        ap = ah->ports[0];
 
        ap->ops         = &rb532_pata_port_ops;
-       ap->pio_mask    = 0x1f; /* PIO4 */
+       ap->pio_mask    = ATA_PIO4;
        ap->flags       = ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO;
 
        ap->ioaddr.cmd_addr     = info->iobase + RB500_CF_REG_BASE;
@@ -141,7 +104,7 @@ static void rb532_pata_setup_ports(struct ata_host *ah)
 
 static __devinit int rb532_pata_driver_probe(struct platform_device *pdev)
 {
-       unsigned int irq;
+       int irq;
        int gpio;
        struct resource *res;
        struct ata_host *ah;
@@ -188,7 +151,7 @@ static __devinit int rb532_pata_driver_probe(struct platform_device *pdev)
        info->irq = irq;
 
        info->iobase = devm_ioremap_nocache(&pdev->dev, res->start,
-                               res->end - res->start + 1);
+                               resource_size(res));
        if (!info->iobase)
                return -ENOMEM;