Lines Matching +full:drive +full:- +full:mode
2 * Copyright (C) 2000-2002 Mark Lord <mlord@pobox.com>
66 * Here are the standard PIO mode 0-4 timings for each "format".
67 * Format-0 uses fast data reg timings, with slower command reg timings.
68 * Format-1 uses fast timings for all registers, but won't work with all drives.
81 static void sc1200_tunepio(ide_drive_t *drive, u8 pio) in sc1200_tunepio() argument
83 ide_hwif_t *hwif = drive->hwif; in sc1200_tunepio()
84 struct pci_dev *pdev = to_pci_dev(hwif->dev); in sc1200_tunepio()
85 unsigned int basereg = hwif->channel ? 0x50 : 0x40, format = 0; in sc1200_tunepio()
91 pci_write_config_dword(pdev, basereg + ((drive->dn & 1) << 3), in sc1200_tunepio()
98 * different timings can still be chosen for each drive. We could
101 * by looking at our mate drive to see what it is capable of, before
102 * choosing a mode for our own drive.
104 static u8 sc1200_udma_filter(ide_drive_t *drive) in sc1200_udma_filter() argument
106 ide_hwif_t *hwif = drive->hwif; in sc1200_udma_filter()
107 ide_drive_t *mate = ide_get_pair_dev(drive); in sc1200_udma_filter()
109 u8 mask = hwif->ultra_mask; in sc1200_udma_filter()
113 mateid = mate->id; in sc1200_udma_filter()
126 static void sc1200_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive) in sc1200_set_dma_mode() argument
128 struct pci_dev *dev = to_pci_dev(hwif->dev); in sc1200_set_dma_mode()
131 unsigned int basereg = hwif->channel ? 0x50 : 0x40; in sc1200_set_dma_mode()
132 const u8 mode = drive->dma_mode; in sc1200_set_dma_mode() local
149 * Note that each DMA mode has several timings associated with it. in sc1200_set_dma_mode()
153 if (mode >= XFER_UDMA_0) in sc1200_set_dma_mode()
154 timings = udma_timing[pci_clock][mode - XFER_UDMA_0]; in sc1200_set_dma_mode()
156 timings = mwdma_timing[pci_clock][mode - XFER_MW_DMA_0]; in sc1200_set_dma_mode()
158 if ((drive->dn & 1) == 0) { in sc1200_set_dma_mode()
171 static int sc1200_dma_end(ide_drive_t *drive) in sc1200_dma_end() argument
173 ide_hwif_t *hwif = drive->hwif; in sc1200_dma_end()
174 unsigned long dma_base = hwif->dma_base; in sc1200_dma_end()
191 * for both the chipset and drive.
197 static void sc1200_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) in sc1200_set_pio_mode() argument
199 int mode = -1; in sc1200_set_pio_mode() local
200 const u8 pio = drive->pio_mode - XFER_PIO_0; in sc1200_set_pio_mode()
203 * bad abuse of ->set_pio_mode interface in sc1200_set_pio_mode()
206 case 200: mode = XFER_UDMA_0; break; in sc1200_set_pio_mode()
207 case 201: mode = XFER_UDMA_1; break; in sc1200_set_pio_mode()
208 case 202: mode = XFER_UDMA_2; break; in sc1200_set_pio_mode()
209 case 100: mode = XFER_MW_DMA_0; break; in sc1200_set_pio_mode()
210 case 101: mode = XFER_MW_DMA_1; break; in sc1200_set_pio_mode()
211 case 102: mode = XFER_MW_DMA_2; break; in sc1200_set_pio_mode()
213 if (mode != -1) { in sc1200_set_pio_mode()
214 printk("SC1200: %s: changing (U)DMA mode\n", drive->name); in sc1200_set_pio_mode()
215 ide_dma_off_quietly(drive); in sc1200_set_pio_mode()
216 if (ide_set_dma_mode(drive, mode) == 0 && in sc1200_set_pio_mode()
217 (drive->dev_flags & IDE_DFLAG_USING_DMA)) in sc1200_set_pio_mode()
218 hwif->dma_ops->dma_host_set(drive, 1); in sc1200_set_pio_mode()
222 sc1200_tunepio(drive, pio); in sc1200_set_pio_mode()
239 struct sc1200_saved_state *ss = host->host_priv; in sc1200_suspend()
247 pci_read_config_dword(dev, 0x40 + r * 4, &ss->regs[r]); in sc1200_suspend()
258 struct sc1200_saved_state *ss = host->host_priv; in sc1200_resume()
271 pci_write_config_dword(dev, 0x40 + r * 4, ss->regs[r]); in sc1200_resume()
314 return -ENOMEM; in sc1200_init_one()