diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-19 18:32:30 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-19 18:32:30 -0400 |
commit | caea7602f309cbd55ba609800fd3c3e5d19ab684 (patch) | |
tree | fbf1fab750452317a1a38f9ec38b18ad6b1323c3 /drivers/ide/pci/amd74xx.c | |
parent | 272a370900e5d2ae84662338397bb7b2375ff5cf (diff) |
ide: add IDE_HFLAG_{IO_32BIT,UNMASK_IRQS} host flags
Add IDE_HFLAG_{IO_32BIT,UNMASK_IRQS} host flag to tell ide_pci_setup_ports()
to set drive->{io_32bit,unmask} for both drives on the interface. Convert
amd74xx, sl82c105 and via82cxxx host drivers to use these new host flags.
While at it:
* Add IDE_HFLAGS_AMD define (amd74xx host driver).
* Add IDE_HFLAGS_VIA define (via82cxxx host driver).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/amd74xx.c')
-rw-r--r-- | drivers/ide/pci/amd74xx.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 7cafefbf6c1b..f6aa1d7f3fc3 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c | |||
@@ -242,19 +242,12 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch | |||
242 | 242 | ||
243 | static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) | 243 | static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) |
244 | { | 244 | { |
245 | int i; | ||
246 | |||
247 | if (hwif->irq == 0) /* 0 is bogus but will do for now */ | 245 | if (hwif->irq == 0) /* 0 is bogus but will do for now */ |
248 | hwif->irq = pci_get_legacy_ide_irq(hwif->pci_dev, hwif->channel); | 246 | hwif->irq = pci_get_legacy_ide_irq(hwif->pci_dev, hwif->channel); |
249 | 247 | ||
250 | hwif->set_pio_mode = &amd_set_pio_mode; | 248 | hwif->set_pio_mode = &amd_set_pio_mode; |
251 | hwif->set_dma_mode = &amd_set_drive; | 249 | hwif->set_dma_mode = &amd_set_drive; |
252 | 250 | ||
253 | for (i = 0; i < 2; i++) { | ||
254 | hwif->drives[i].io_32bit = 1; | ||
255 | hwif->drives[i].unmask = 1; | ||
256 | } | ||
257 | |||
258 | if (!hwif->dma_base) | 251 | if (!hwif->dma_base) |
259 | return; | 252 | return; |
260 | 253 | ||
@@ -270,16 +263,21 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) | |||
270 | } | 263 | } |
271 | } | 264 | } |
272 | 265 | ||
266 | #define IDE_HFLAGS_AMD \ | ||
267 | (IDE_HFLAG_PIO_NO_BLACKLIST | \ | ||
268 | IDE_HFLAG_PIO_NO_DOWNGRADE | \ | ||
269 | IDE_HFLAG_POST_SET_MODE | \ | ||
270 | IDE_HFLAG_IO_32BIT | \ | ||
271 | IDE_HFLAG_UNMASK_IRQS | \ | ||
272 | IDE_HFLAG_BOOTABLE) | ||
273 | |||
273 | #define DECLARE_AMD_DEV(name_str) \ | 274 | #define DECLARE_AMD_DEV(name_str) \ |
274 | { \ | 275 | { \ |
275 | .name = name_str, \ | 276 | .name = name_str, \ |
276 | .init_chipset = init_chipset_amd74xx, \ | 277 | .init_chipset = init_chipset_amd74xx, \ |
277 | .init_hwif = init_hwif_amd74xx, \ | 278 | .init_hwif = init_hwif_amd74xx, \ |
278 | .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \ | 279 | .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \ |
279 | .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | \ | 280 | .host_flags = IDE_HFLAGS_AMD, \ |
280 | IDE_HFLAG_PIO_NO_DOWNGRADE | \ | ||
281 | IDE_HFLAG_POST_SET_MODE | \ | ||
282 | IDE_HFLAG_BOOTABLE, \ | ||
283 | .pio_mask = ATA_PIO5, \ | 281 | .pio_mask = ATA_PIO5, \ |
284 | .swdma_mask = ATA_SWDMA2, \ | 282 | .swdma_mask = ATA_SWDMA2, \ |
285 | .mwdma_mask = ATA_MWDMA2, \ | 283 | .mwdma_mask = ATA_MWDMA2, \ |
@@ -291,10 +289,7 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) | |||
291 | .init_chipset = init_chipset_amd74xx, \ | 289 | .init_chipset = init_chipset_amd74xx, \ |
292 | .init_hwif = init_hwif_amd74xx, \ | 290 | .init_hwif = init_hwif_amd74xx, \ |
293 | .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \ | 291 | .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \ |
294 | .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | \ | 292 | .host_flags = IDE_HFLAGS_AMD, \ |
295 | IDE_HFLAG_PIO_NO_DOWNGRADE | \ | ||
296 | IDE_HFLAG_POST_SET_MODE | \ | ||
297 | IDE_HFLAG_BOOTABLE, \ | ||
298 | .pio_mask = ATA_PIO5, \ | 293 | .pio_mask = ATA_PIO5, \ |
299 | .swdma_mask = ATA_SWDMA2, \ | 294 | .swdma_mask = ATA_SWDMA2, \ |
300 | .mwdma_mask = ATA_MWDMA2, \ | 295 | .mwdma_mask = ATA_MWDMA2, \ |