]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/amd74xx.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux...
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / amd74xx.c
index 8c52bc9eaa5910575d70c123e86ffd3edd1ecc55..f7c883808b0201238a79c1accbfa5eb4708d3e77 100644 (file)
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/ioport.h>
-#include <linux/blkdev.h>
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/ide.h>
-#include <asm/io.h>
 
 #include "ide-timing.h"
 
@@ -199,35 +196,34 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev,
        return dev->irq;
 }
 
+static u8 __devinit amd_cable_detect(ide_hwif_t *hwif)
+{
+       if ((amd_80w >> hwif->channel) & 1)
+               return ATA_CBL_PATA80;
+       else
+               return ATA_CBL_PATA40;
+}
+
 static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
 {
        struct pci_dev *dev = to_pci_dev(hwif->dev);
 
        if (hwif->irq == 0) /* 0 is bogus but will do for now */
                hwif->irq = pci_get_legacy_ide_irq(dev, hwif->channel);
-
-       hwif->set_pio_mode = &amd_set_pio_mode;
-       hwif->set_dma_mode = &amd_set_drive;
-
-       if (!hwif->dma_base)
-               return;
-
-       if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
-               if ((amd_80w >> hwif->channel) & 1)
-                       hwif->cbl = ATA_CBL_PATA80;
-               else
-                       hwif->cbl = ATA_CBL_PATA40;
-       }
 }
 
+static const struct ide_port_ops amd_port_ops = {
+       .set_pio_mode           = amd_set_pio_mode,
+       .set_dma_mode           = amd_set_drive,
+       .cable_detect           = amd_cable_detect,
+};
+
 #define IDE_HFLAGS_AMD \
        (IDE_HFLAG_PIO_NO_BLACKLIST | \
-        IDE_HFLAG_PIO_NO_DOWNGRADE | \
         IDE_HFLAG_ABUSE_SET_DMA_MODE | \
         IDE_HFLAG_POST_SET_MODE | \
         IDE_HFLAG_IO_32BIT | \
-        IDE_HFLAG_UNMASK_IRQS | \
-        IDE_HFLAG_BOOTABLE)
+        IDE_HFLAG_UNMASK_IRQS)
 
 #define DECLARE_AMD_DEV(name_str, swdma, udma)                         \
        {                                                               \
@@ -235,6 +231,7 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
                .init_chipset   = init_chipset_amd74xx,                 \
                .init_hwif      = init_hwif_amd74xx,                    \
                .enablebits     = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \
+               .port_ops       = &amd_port_ops,                        \
                .host_flags     = IDE_HFLAGS_AMD,                       \
                .pio_mask       = ATA_PIO5,                             \
                .swdma_mask     = swdma,                                \
@@ -248,6 +245,7 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
                .init_chipset   = init_chipset_amd74xx,                 \
                .init_hwif      = init_hwif_amd74xx,                    \
                .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \
+               .port_ops       = &amd_port_ops,                        \
                .host_flags     = IDE_HFLAGS_AMD,                       \
                .pio_mask       = ATA_PIO5,                             \
                .swdma_mask     = ATA_SWDMA2,                           \