aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/pdc202xx_new.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/pdc202xx_new.c')
-rw-r--r--drivers/ide/pci/pdc202xx_new.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 95600681bd3a..ad0bdcb0c02b 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -146,19 +146,16 @@ static struct udma_timing {
146 { 0x1a, 0x01, 0xcb }, /* UDMA mode 6 */ 146 { 0x1a, 0x01, 0xcb }, /* UDMA mode 6 */
147}; 147};
148 148
149static int pdcnew_tune_chipset(ide_drive_t *drive, const u8 speed) 149static void pdcnew_set_mode(ide_drive_t *drive, const u8 speed)
150{ 150{
151 ide_hwif_t *hwif = HWIF(drive); 151 ide_hwif_t *hwif = HWIF(drive);
152 u8 adj = (drive->dn & 1) ? 0x08 : 0x00; 152 u8 adj = (drive->dn & 1) ? 0x08 : 0x00;
153 153
154 /* 154 /*
155 * Issue SETFEATURES_XFER to the drive first. PDC202xx hardware will 155 * IDE core issues SETFEATURES_XFER to the drive first (thanks to
156 * IDE_HFLAG_POST_SET_MODE in ->host_flags). PDC202xx hardware will
156 * automatically set the timing registers based on 100 MHz PLL output. 157 * automatically set the timing registers based on 100 MHz PLL output.
157 */ 158 *
158 if (ide_config_drive_speed(drive, speed))
159 return 1;
160
161 /*
162 * As we set up the PLL to output 133 MHz for UltraDMA/133 capable 159 * As we set up the PLL to output 133 MHz for UltraDMA/133 capable
163 * chips, we must override the default register settings... 160 * chips, we must override the default register settings...
164 */ 161 */
@@ -211,13 +208,11 @@ static int pdcnew_tune_chipset(ide_drive_t *drive, const u8 speed)
211 208
212 set_indexed_reg(hwif, 0x10 + adj, tmp & 0x7f); 209 set_indexed_reg(hwif, 0x10 + adj, tmp & 0x7f);
213 } 210 }
214
215 return 0;
216} 211}
217 212
218static void pdcnew_set_pio_mode(ide_drive_t *drive, const u8 pio) 213static void pdcnew_set_pio_mode(ide_drive_t *drive, const u8 pio)
219{ 214{
220 (void)pdcnew_tune_chipset(drive, XFER_PIO_0 + pio); 215 pdcnew_set_mode(drive, XFER_PIO_0 + pio);
221} 216}
222 217
223static u8 pdcnew_cable_detect(ide_hwif_t *hwif) 218static u8 pdcnew_cable_detect(ide_hwif_t *hwif)
@@ -490,9 +485,9 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
490 hwif->autodma = 0; 485 hwif->autodma = 0;
491 486
492 hwif->set_pio_mode = &pdcnew_set_pio_mode; 487 hwif->set_pio_mode = &pdcnew_set_pio_mode;
488 hwif->set_dma_mode = &pdcnew_set_mode;
493 489
494 hwif->quirkproc = &pdcnew_quirkproc; 490 hwif->quirkproc = &pdcnew_quirkproc;
495 hwif->speedproc = &pdcnew_tune_chipset;
496 hwif->resetproc = &pdcnew_reset; 491 hwif->resetproc = &pdcnew_reset;
497 492
498 hwif->err_stops_fifo = 1; 493 hwif->err_stops_fifo = 1;
@@ -583,6 +578,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
583 .bootable = OFF_BOARD, 578 .bootable = OFF_BOARD,
584 .pio_mask = ATA_PIO4, 579 .pio_mask = ATA_PIO4,
585 .udma_mask = 0x3f, /* udma0-5 */ 580 .udma_mask = 0x3f, /* udma0-5 */
581 .host_flags = IDE_HFLAG_POST_SET_MODE,
586 },{ /* 1 */ 582 },{ /* 1 */
587 .name = "PDC20269", 583 .name = "PDC20269",
588 .init_setup = init_setup_pdcnew, 584 .init_setup = init_setup_pdcnew,
@@ -592,6 +588,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
592 .bootable = OFF_BOARD, 588 .bootable = OFF_BOARD,
593 .pio_mask = ATA_PIO4, 589 .pio_mask = ATA_PIO4,
594 .udma_mask = 0x7f, /* udma0-6*/ 590 .udma_mask = 0x7f, /* udma0-6*/
591 .host_flags = IDE_HFLAG_POST_SET_MODE,
595 },{ /* 2 */ 592 },{ /* 2 */
596 .name = "PDC20270", 593 .name = "PDC20270",
597 .init_setup = init_setup_pdc20270, 594 .init_setup = init_setup_pdc20270,
@@ -601,6 +598,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
601 .bootable = OFF_BOARD, 598 .bootable = OFF_BOARD,
602 .pio_mask = ATA_PIO4, 599 .pio_mask = ATA_PIO4,
603 .udma_mask = 0x3f, /* udma0-5 */ 600 .udma_mask = 0x3f, /* udma0-5 */
601 .host_flags = IDE_HFLAG_POST_SET_MODE,
604 },{ /* 3 */ 602 },{ /* 3 */
605 .name = "PDC20271", 603 .name = "PDC20271",
606 .init_setup = init_setup_pdcnew, 604 .init_setup = init_setup_pdcnew,
@@ -610,6 +608,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
610 .bootable = OFF_BOARD, 608 .bootable = OFF_BOARD,
611 .pio_mask = ATA_PIO4, 609 .pio_mask = ATA_PIO4,
612 .udma_mask = 0x7f, /* udma0-6*/ 610 .udma_mask = 0x7f, /* udma0-6*/
611 .host_flags = IDE_HFLAG_POST_SET_MODE,
613 },{ /* 4 */ 612 },{ /* 4 */
614 .name = "PDC20275", 613 .name = "PDC20275",
615 .init_setup = init_setup_pdcnew, 614 .init_setup = init_setup_pdcnew,
@@ -619,6 +618,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
619 .bootable = OFF_BOARD, 618 .bootable = OFF_BOARD,
620 .pio_mask = ATA_PIO4, 619 .pio_mask = ATA_PIO4,
621 .udma_mask = 0x7f, /* udma0-6*/ 620 .udma_mask = 0x7f, /* udma0-6*/
621 .host_flags = IDE_HFLAG_POST_SET_MODE,
622 },{ /* 5 */ 622 },{ /* 5 */
623 .name = "PDC20276", 623 .name = "PDC20276",
624 .init_setup = init_setup_pdc20276, 624 .init_setup = init_setup_pdc20276,
@@ -628,6 +628,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
628 .bootable = OFF_BOARD, 628 .bootable = OFF_BOARD,
629 .pio_mask = ATA_PIO4, 629 .pio_mask = ATA_PIO4,
630 .udma_mask = 0x7f, /* udma0-6*/ 630 .udma_mask = 0x7f, /* udma0-6*/
631 .host_flags = IDE_HFLAG_POST_SET_MODE,
631 },{ /* 6 */ 632 },{ /* 6 */
632 .name = "PDC20277", 633 .name = "PDC20277",
633 .init_setup = init_setup_pdcnew, 634 .init_setup = init_setup_pdcnew,
@@ -637,6 +638,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
637 .bootable = OFF_BOARD, 638 .bootable = OFF_BOARD,
638 .pio_mask = ATA_PIO4, 639 .pio_mask = ATA_PIO4,
639 .udma_mask = 0x7f, /* udma0-6*/ 640 .udma_mask = 0x7f, /* udma0-6*/
641 .host_flags = IDE_HFLAG_POST_SET_MODE,
640 } 642 }
641}; 643};
642 644