]> err.no Git - linux-2.6/blobdiff - drivers/ide/pci/amd74xx.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6] / drivers / ide / pci / amd74xx.c
index d6d58d217142ab5feca8d83c01e105cbcaa7a8c3..efcf54338be7b9c63543f496f3548d71d8825be2 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"
 
@@ -182,7 +179,7 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev,
  * Determine the system bus clock.
  */
 
-       amd_clock = system_bus_clock() * 1000;
+       amd_clock = (ide_pci_clk ? ide_pci_clk : system_bus_clock()) * 1000;
 
        switch (amd_clock) {
                case 33000: amd_clock = 33333; break;
@@ -213,21 +210,20 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
 
        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;
-
-       hwif->cable_detect = amd_cable_detect;
 }
 
+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,                           \