Lines Matching refs:drive
80 static void cs5536_program_dtc(ide_drive_t *drive, u8 tim)
82 struct pci_dev *pdev = to_pci_dev(drive->hwif->dev);
83 int dshift = (drive->dn & 1) ? IDE_D1_SHIFT : IDE_D0_SHIFT;
117 * @drive: ATA device
120 static void cs5536_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
135 ide_drive_t *pair = ide_get_pair_dev(drive);
136 int cshift = (drive->dn & 1) ? IDE_CAST_D1_SHIFT : IDE_CAST_D0_SHIFT;
137 unsigned long timings = (unsigned long)ide_get_drivedata(drive);
139 const u8 pio = drive->pio_mode - XFER_PIO_0;
147 ide_set_drivedata(drive, (void *)timings);
149 cs5536_program_dtc(drive, drv_timings[pio]);
165 * @drive: ATA device
168 static void cs5536_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
179 int dshift = (drive->dn & 1) ? IDE_D1_SHIFT : IDE_D0_SHIFT;
180 unsigned long timings = (unsigned long)ide_get_drivedata(drive);
182 const u8 mode = drive->dma_mode;
193 ide_set_drivedata(drive, (void *)timings);
199 static void cs5536_dma_start(ide_drive_t *drive)
201 unsigned long timings = (unsigned long)ide_get_drivedata(drive);
203 if (drive->current_speed < XFER_UDMA_0 &&
205 cs5536_program_dtc(drive, timings >> 8);
207 ide_dma_start(drive);
210 static int cs5536_dma_end(ide_drive_t *drive)
212 int ret = ide_dma_end(drive);
213 unsigned long timings = (unsigned long)ide_get_drivedata(drive);
215 if (drive->current_speed < XFER_UDMA_0 &&
217 cs5536_program_dtc(drive, timings & IDE_DRV_MASK);