aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/it821x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/it821x.c')
-rw-r--r--drivers/ide/pci/it821x.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index a38ec47423a0..6ab04115286b 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -418,7 +418,7 @@ static void it821x_set_dma_mode(ide_drive_t *drive, const u8 speed)
418} 418}
419 419
420/** 420/**
421 * ata66_it821x - check for 80 pin cable 421 * it821x_cable_detect - cable detection
422 * @hwif: interface to check 422 * @hwif: interface to check
423 * 423 *
424 * Check for the presence of an ATA66 capable cable on the 424 * Check for the presence of an ATA66 capable cable on the
@@ -426,7 +426,7 @@ static void it821x_set_dma_mode(ide_drive_t *drive, const u8 speed)
426 * the needed logic onboard. 426 * the needed logic onboard.
427 */ 427 */
428 428
429static u8 __devinit ata66_it821x(ide_hwif_t *hwif) 429static u8 __devinit it821x_cable_detect(ide_hwif_t *hwif)
430{ 430{
431 /* The reference driver also only does disk side */ 431 /* The reference driver also only does disk side */
432 return ATA_CBL_PATA80; 432 return ATA_CBL_PATA80;
@@ -511,6 +511,11 @@ static void __devinit it821x_quirkproc(ide_drive_t *drive)
511 511
512} 512}
513 513
514static struct ide_dma_ops it821x_pass_through_dma_ops = {
515 .dma_start = it821x_dma_start,
516 .dma_end = it821x_dma_end,
517};
518
514/** 519/**
515 * init_hwif_it821x - set up hwif structs 520 * init_hwif_it821x - set up hwif structs
516 * @hwif: interface to set up 521 * @hwif: interface to set up
@@ -527,8 +532,6 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
527 struct it821x_dev *idev = itdevs[hwif->channel]; 532 struct it821x_dev *idev = itdevs[hwif->channel];
528 u8 conf; 533 u8 conf;
529 534
530 hwif->quirkproc = &it821x_quirkproc;
531
532 ide_set_hwifdata(hwif, idev); 535 ide_set_hwifdata(hwif, idev);
533 536
534 pci_read_config_byte(dev, 0x50, &conf); 537 pci_read_config_byte(dev, 0x50, &conf);
@@ -563,17 +566,11 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
563 } 566 }
564 567
565 if (idev->smart == 0) { 568 if (idev->smart == 0) {
566 hwif->set_pio_mode = &it821x_set_pio_mode;
567 hwif->set_dma_mode = &it821x_set_dma_mode;
568
569 /* MWDMA/PIO clock switching for pass through mode */ 569 /* MWDMA/PIO clock switching for pass through mode */
570 hwif->dma_start = &it821x_dma_start; 570 hwif->dma_ops = &it821x_pass_through_dma_ops;
571 hwif->ide_dma_end = &it821x_dma_end;
572 } else 571 } else
573 hwif->host_flags |= IDE_HFLAG_NO_SET_MODE; 572 hwif->host_flags |= IDE_HFLAG_NO_SET_MODE;
574 573
575 hwif->cable_detect = ata66_it821x;
576
577 if (hwif->dma_base == 0) 574 if (hwif->dma_base == 0)
578 return; 575 return;
579 576
@@ -613,12 +610,20 @@ static unsigned int __devinit init_chipset_it821x(struct pci_dev *dev, const cha
613 return 0; 610 return 0;
614} 611}
615 612
613static const struct ide_port_ops it821x_port_ops = {
614 /* it821x_set_{pio,dma}_mode() are only used in pass-through mode */
615 .set_pio_mode = it821x_set_pio_mode,
616 .set_dma_mode = it821x_set_dma_mode,
617 .quirkproc = it821x_quirkproc,
618 .cable_detect = it821x_cable_detect,
619};
616 620
617#define DECLARE_ITE_DEV(name_str) \ 621#define DECLARE_ITE_DEV(name_str) \
618 { \ 622 { \
619 .name = name_str, \ 623 .name = name_str, \
620 .init_chipset = init_chipset_it821x, \ 624 .init_chipset = init_chipset_it821x, \
621 .init_hwif = init_hwif_it821x, \ 625 .init_hwif = init_hwif_it821x, \
626 .port_ops = &it821x_port_ops, \
622 .pio_mask = ATA_PIO4, \ 627 .pio_mask = ATA_PIO4, \
623 } 628 }
624 629