Lines Matching refs:drive

83 	u16	udma[2];		/* Cached UDMA values (per drive) */
105 * @drive: drive to tune
112 static void it821x_program(ide_drive_t *drive, u16 timing)
114 ide_hwif_t *hwif = drive->hwif;
131 * @drive: drive to tune
134 * Program the UDMA timing for this drive according to the
138 static void it821x_program_udma(ide_drive_t *drive, u16 timing)
140 ide_hwif_t *hwif = drive->hwif;
144 u8 unit = drive->dn & 1, conf;
162 * @drive: drive to set up
168 static void it821x_clock_strategy(ide_drive_t *drive)
170 ide_hwif_t *hwif = drive->hwif;
173 ide_drive_t *pair = ide_get_pair_dev(drive);
175 u8 unit = drive->dn & 1, v;
213 * Reprogram the UDMA/PIO of the pair drive for the switch
221 * Reprogram the UDMA/PIO of our drive for the switch.
225 it821x_program_udma(drive, itdev->udma[unit]);
226 it821x_program(drive, itdev->pio[unit]);
233 * @drive: drive
239 static void it821x_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
242 ide_drive_t *pair = ide_get_pair_dev(drive);
243 const u8 pio = drive->pio_mode - XFER_PIO_0;
244 u8 unit = drive->dn & 1, set_pio = pio;
266 it821x_clock_strategy(drive);
267 it821x_program(drive, itdev->pio[unit]);
272 * @drive: drive to set up
281 static void it821x_tune_mwdma(ide_drive_t *drive, u8 mode_wanted)
283 ide_hwif_t *hwif = drive->hwif;
286 u8 unit = drive->dn & 1, channel = hwif->channel, conf;
304 it821x_clock_strategy(drive);
306 /* it821x_program(drive, itdev->mwdma[unit]); */
311 * @drive: drive to set up
318 static void it821x_tune_udma(ide_drive_t *drive, u8 mode_wanted)
320 ide_hwif_t *hwif = drive->hwif;
323 u8 unit = drive->dn & 1, channel = hwif->channel, conf;
343 it821x_clock_strategy(drive);
344 it821x_program_udma(drive, itdev->udma[unit]);
350 * @drive: drive for DMA
361 static void it821x_dma_start(ide_drive_t *drive)
363 ide_hwif_t *hwif = drive->hwif;
365 u8 unit = drive->dn & 1;
368 it821x_program(drive, itdev->mwdma[unit]);
370 it821x_program_udma(drive, itdev->udma[unit]);
371 ide_dma_start(drive);
376 * @drive: drive for DMA stop
383 static int it821x_dma_end(ide_drive_t *drive)
385 ide_hwif_t *hwif = drive->hwif;
387 int ret = ide_dma_end(drive);
388 u8 unit = drive->dn & 1;
391 it821x_program(drive, itdev->pio[unit]);
398 * @drive: drive
403 static void it821x_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
405 const u8 speed = drive->dma_mode;
413 it821x_tune_udma(drive, speed - XFER_UDMA_0);
415 it821x_tune_mwdma(drive, speed - XFER_MW_DMA_0);
435 * @drive: drive
437 * This callback is run after the drive has been probed but
442 static void it821x_quirkproc(ide_drive_t *drive)
444 struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif);
445 u16 *id = drive->id;
454 drive->dev_flags |= IDE_DFLAG_UNMASK;
474 drive->name, id[147] ? "Bootable " : "",
495 drive->name);
505 drive->current_speed = XFER_MW_DMA_0;