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.c56
1 files changed, 8 insertions, 48 deletions
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 77a9aaa7dab9..236a03144a27 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -92,26 +92,6 @@ static u8 pdcnew_ratemask(ide_drive_t *drive)
92 return mode; 92 return mode;
93} 93}
94 94
95static int check_in_drive_lists(ide_drive_t *drive, const char **list)
96{
97 struct hd_driveid *id = drive->id;
98
99 if (pdc_quirk_drives == list) {
100 while (*list) {
101 if (strstr(id->model, *list++)) {
102 return 2;
103 }
104 }
105 } else {
106 while (*list) {
107 if (!strcmp(*list++,id->model)) {
108 return 1;
109 }
110 }
111 }
112 return 0;
113}
114
115/** 95/**
116 * get_indexed_reg - Get indexed register 96 * get_indexed_reg - Get indexed register
117 * @hwif: for the port address 97 * @hwif: for the port address
@@ -249,13 +229,6 @@ static int pdcnew_tune_chipset(ide_drive_t *drive, u8 speed)
249 return err; 229 return err;
250} 230}
251 231
252/* 0 1 2 3 4 5 6 7 8
253 * 960, 480, 390, 300, 240, 180, 120, 90, 60
254 * 180, 150, 120, 90, 60
255 * DMA_Speed
256 * 180, 120, 90, 90, 90, 60, 30
257 * 11, 5, 4, 3, 2, 1, 0
258 */
259static void pdcnew_tune_drive(ide_drive_t *drive, u8 pio) 232static void pdcnew_tune_drive(ide_drive_t *drive, u8 pio)
260{ 233{
261 pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 234 pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
@@ -313,12 +286,10 @@ static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
313 286
314 drive->init_speed = 0; 287 drive->init_speed = 0;
315 288
316 if (id && (id->capability & 1) && drive->autodma) { 289 if ((id->capability & 1) && drive->autodma) {
317 290
318 if (ide_use_dma(drive)) { 291 if (ide_use_dma(drive) && config_chipset_for_dma(drive))
319 if (config_chipset_for_dma(drive)) 292 return hwif->ide_dma_on(drive);
320 return hwif->ide_dma_on(drive);
321 }
322 293
323 goto fast_ata_pio; 294 goto fast_ata_pio;
324 295
@@ -333,21 +304,12 @@ fast_ata_pio:
333 304
334static int pdcnew_quirkproc(ide_drive_t *drive) 305static int pdcnew_quirkproc(ide_drive_t *drive)
335{ 306{
336 return check_in_drive_lists(drive, pdc_quirk_drives); 307 const char **list, *model = drive->id->model;
337}
338 308
339static int pdcnew_ide_dma_lostirq(ide_drive_t *drive) 309 for (list = pdc_quirk_drives; *list != NULL; list++)
340{ 310 if (strstr(model, *list) != NULL)
341 if (HWIF(drive)->resetproc != NULL) 311 return 2;
342 HWIF(drive)->resetproc(drive); 312 return 0;
343 return __ide_dma_lostirq(drive);
344}
345
346static int pdcnew_ide_dma_timeout(ide_drive_t *drive)
347{
348 if (HWIF(drive)->resetproc != NULL)
349 HWIF(drive)->resetproc(drive);
350 return __ide_dma_timeout(drive);
351} 313}
352 314
353static void pdcnew_reset(ide_drive_t *drive) 315static void pdcnew_reset(ide_drive_t *drive)
@@ -599,8 +561,6 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
599 hwif->err_stops_fifo = 1; 561 hwif->err_stops_fifo = 1;
600 562
601 hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate; 563 hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate;
602 hwif->ide_dma_lostirq = &pdcnew_ide_dma_lostirq;
603 hwif->ide_dma_timeout = &pdcnew_ide_dma_timeout;
604 564
605 if (!hwif->udma_four) 565 if (!hwif->udma_four)
606 hwif->udma_four = pdcnew_cable_detect(hwif) ? 0 : 1; 566 hwif->udma_four = pdcnew_cable_detect(hwif) ? 0 : 1;