aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/sc1200.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/sc1200.c')
-rw-r--r--drivers/ide/pci/sc1200.c43
1 files changed, 4 insertions, 39 deletions
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 523363c93794..9bdc9694d50d 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/sc1200.c Version 0.94 Mar 10 2007 2 * linux/drivers/ide/pci/sc1200.c Version 0.95 Jun 16 2007
3 * 3 *
4 * Copyright (C) 2000-2002 Mark Lord <mlord@pobox.com> 4 * Copyright (C) 2000-2002 Mark Lord <mlord@pobox.com>
5 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 5 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz
@@ -304,7 +304,7 @@ static void sc1200_tuneproc (ide_drive_t *drive, byte pio) /* mode=255 means "au
304 return; 304 return;
305 } 305 }
306 306
307 pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 307 pio = ide_get_best_pio_mode(drive, pio, 4);
308 printk("SC1200: %s: setting PIO mode%d\n", drive->name, pio); 308 printk("SC1200: %s: setting PIO mode%d\n", drive->name, pio);
309 309
310 if (sc1200_set_xfer_mode(drive, XFER_PIO_0 + pio) == 0) 310 if (sc1200_set_xfer_mode(drive, XFER_PIO_0 + pio) == 0)
@@ -390,7 +390,7 @@ static int sc1200_resume (struct pci_dev *dev)
390 // loop over all interfaces that are part of this pci device: 390 // loop over all interfaces that are part of this pci device:
391 // 391 //
392 while ((hwif = lookup_pci_dev(hwif, dev)) != NULL) { 392 while ((hwif = lookup_pci_dev(hwif, dev)) != NULL) {
393 unsigned int basereg, r, d, format; 393 unsigned int basereg, r;
394 sc1200_saved_state_t *ss = (sc1200_saved_state_t *)hwif->config_data; 394 sc1200_saved_state_t *ss = (sc1200_saved_state_t *)hwif->config_data;
395 395
396 // 396 //
@@ -402,41 +402,6 @@ static int sc1200_resume (struct pci_dev *dev)
402 pci_write_config_dword(hwif->pci_dev, basereg + (r<<2), ss->regs[r]); 402 pci_write_config_dword(hwif->pci_dev, basereg + (r<<2), ss->regs[r]);
403 } 403 }
404 } 404 }
405 //
406 // Re-program drive PIO modes
407 //
408 pci_read_config_dword(hwif->pci_dev, basereg+4, &format);
409 format = (format >> 31) & 1;
410 if (format)
411 format += sc1200_get_pci_clock();
412 for (d = 0; d < 2; ++d) {
413 ide_drive_t *drive = &(hwif->drives[d]);
414 if (drive->present) {
415 unsigned int pio, timings;
416 pci_read_config_dword(hwif->pci_dev, basereg+(drive->select.b.unit << 3), &timings);
417 for (pio = 0; pio <= 4; ++pio) {
418 if (sc1200_pio_timings[format][pio] == timings)
419 break;
420 }
421 if (pio > 4)
422 pio = 255; /* autotune */
423 (void)sc1200_tuneproc(drive, pio);
424 }
425 }
426 //
427 // Re-program drive DMA modes
428 //
429 for (d = 0; d < MAX_DRIVES; ++d) {
430 ide_drive_t *drive = &(hwif->drives[d]);
431 if (drive->present && !__ide_dma_bad_drive(drive)) {
432 int enable_dma = drive->using_dma;
433 hwif->dma_off_quietly(drive);
434 if (sc1200_config_dma(drive))
435 enable_dma = 0;
436 if (enable_dma)
437 hwif->dma_host_on(drive);
438 }
439 }
440 } 405 }
441 return 0; 406 return 0;
442} 407}
@@ -471,9 +436,9 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
471static ide_pci_device_t sc1200_chipset __devinitdata = { 436static ide_pci_device_t sc1200_chipset __devinitdata = {
472 .name = "SC1200", 437 .name = "SC1200",
473 .init_hwif = init_hwif_sc1200, 438 .init_hwif = init_hwif_sc1200,
474 .channels = 2,
475 .autodma = AUTODMA, 439 .autodma = AUTODMA,
476 .bootable = ON_BOARD, 440 .bootable = ON_BOARD,
441 .pio_mask = ATA_PIO4,
477}; 442};
478 443
479static int __devinit sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id) 444static int __devinit sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id)