Commit 4bedcccc authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] ide: merge amd74xx.h into amd74xx.c

While at it add DECLARE_AMD_DEV() and DECLARE_NV_DEV() macros
(ala piix.h:DECLARE_PIIX_DEV() added by jgarzik).

Acked by Vojtech.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 75751416
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
#include <asm/io.h> #include <asm/io.h>
#include "ide-timing.h" #include "ide-timing.h"
#include "amd74xx.h"
#define DISPLAY_AMD_TIMINGS
#define AMD_IDE_ENABLE (0x00 + amd_config->base) #define AMD_IDE_ENABLE (0x00 + amd_config->base)
#define AMD_IDE_CONFIG (0x01 + amd_config->base) #define AMD_IDE_CONFIG (0x01 + amd_config->base)
...@@ -441,6 +442,45 @@ static void __init init_hwif_amd74xx(ide_hwif_t *hwif) ...@@ -441,6 +442,45 @@ static void __init init_hwif_amd74xx(ide_hwif_t *hwif)
hwif->drives[1].autodma = hwif->autodma; hwif->drives[1].autodma = hwif->autodma;
} }
#define DECLARE_AMD_DEV(name_str) \
{ \
.name = name_str, \
.init_chipset = init_chipset_amd74xx, \
.init_hwif = init_hwif_amd74xx, \
.channels = 2, \
.autodma = AUTODMA, \
.enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \
.bootable = ON_BOARD, \
}
#define DECLARE_NV_DEV(name_str) \
{ \
.name = name_str, \
.init_chipset = init_chipset_amd74xx, \
.init_hwif = init_hwif_amd74xx, \
.channels = 2, \
.autodma = AUTODMA, \
.enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \
.bootable = ON_BOARD, \
}
static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
/* 0 */ DECLARE_AMD_DEV("AMD7401"),
/* 1 */ DECLARE_AMD_DEV("AMD7409"),
/* 2 */ DECLARE_AMD_DEV("AMD7411"),
/* 3 */ DECLARE_AMD_DEV("AMD7441"),
/* 4 */ DECLARE_AMD_DEV("AMD8111"),
/* 5 */ DECLARE_NV_DEV("NFORCE"),
/* 6 */ DECLARE_NV_DEV("NFORCE2"),
/* 7 */ DECLARE_NV_DEV("NFORCE2S"),
/* 8 */ DECLARE_NV_DEV("NFORCE2S-SATA"),
/* 9 */ DECLARE_NV_DEV("NFORCE3"),
/* 10 */ DECLARE_NV_DEV("NFORCE3S"),
/* 11 */ DECLARE_NV_DEV("NFORCE3S-SATA"),
/* 12 */ DECLARE_NV_DEV("NFORCE3S-SATA2")
};
static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id) static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
{ {
amd_chipset = amd74xx_chipsets + id->driver_data; amd_chipset = amd74xx_chipsets + id->driver_data;
......
#ifndef AMD74XX_H
#define AMD74XX_H
#include <linux/config.h>
#include <linux/pci.h>
#include <linux/ide.h>
#define DISPLAY_AMD_TIMINGS
static unsigned int init_chipset_amd74xx(struct pci_dev *, const char *);
static void init_hwif_amd74xx(ide_hwif_t *);
static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
{ /* 0 */
.name = "AMD7401",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
.bootable = ON_BOARD,
},{ /* 1 */
.name = "AMD7409",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
.bootable = ON_BOARD,
},{ /* 2 */
.name = "AMD7411",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
.bootable = ON_BOARD,
},{ /* 3 */
.name = "AMD7441",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
.bootable = ON_BOARD,
},{ /* 4 */
.name = "AMD8111",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.autodma = AUTODMA,
.channels = 2,
.enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
.bootable = ON_BOARD,
},
{ /* 5 */
.name = "NFORCE",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
.bootable = ON_BOARD,
},
{ /* 6 */
.name = "NFORCE2",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
.bootable = ON_BOARD,
},
{ /* 7 */
.name = "NFORCE2S",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
.bootable = ON_BOARD,
},
{ /* 8 */
.name = "NFORCE2S-SATA",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
.bootable = ON_BOARD,
},
{ /* 9 */
.name = "NFORCE3",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
.bootable = ON_BOARD,
},
{ /* 10 */
.name = "NFORCE3S",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
.bootable = ON_BOARD,
},
{ /* 11 */
.name = "NFORCE3S-SATA",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
.bootable = ON_BOARD,
},
{ /* 12 */
.name = "NFORCE3S-SATA2",
.init_chipset = init_chipset_amd74xx,
.init_hwif = init_hwif_amd74xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
.bootable = ON_BOARD,
}
};
#endif /* AMD74XX_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment