aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/alim15x3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/alim15x3.c')
-rw-r--r--drivers/ide/pci/alim15x3.c33
1 files changed, 8 insertions, 25 deletions
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index d04b966b4347..88f084eae193 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -283,14 +283,14 @@ static int ali_get_info (char *buffer, char **addr, off_t offset, int count)
283#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) */ 283#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) */
284 284
285/** 285/**
286 * ali_tune_pio - set host controller for PIO mode 286 * ali_set_pio_mode - set host controller for PIO mode
287 * @drive: drive 287 * @drive: drive
288 * @pio: PIO mode number 288 * @pio: PIO mode number
289 * 289 *
290 * Program the controller for the given PIO mode. 290 * Program the controller for the given PIO mode.
291 */ 291 */
292 292
293static void ali_tune_pio(ide_drive_t *drive, const u8 pio) 293static void ali_set_pio_mode(ide_drive_t *drive, const u8 pio)
294{ 294{
295 ide_hwif_t *hwif = HWIF(drive); 295 ide_hwif_t *hwif = HWIF(drive);
296 struct pci_dev *dev = hwif->pci_dev; 296 struct pci_dev *dev = hwif->pci_dev;
@@ -358,21 +358,6 @@ static void ali_tune_pio(ide_drive_t *drive, const u8 pio)
358} 358}
359 359
360/** 360/**
361 * ali_set_pio_mode - set up drive for PIO mode
362 * @drive: drive to tune
363 * @pio: desired mode
364 *
365 * Program the controller with the desired PIO timing for the given drive.
366 * Then set up the drive itself.
367 */
368
369static void ali_set_pio_mode(ide_drive_t *drive, const u8 pio)
370{
371 ali_tune_pio(drive, pio);
372 (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio);
373}
374
375/**
376 * ali_udma_filter - compute UDMA mask 361 * ali_udma_filter - compute UDMA mask
377 * @drive: IDE device 362 * @drive: IDE device
378 * 363 *
@@ -401,15 +386,14 @@ static u8 ali_udma_filter(ide_drive_t *drive)
401} 386}
402 387
403/** 388/**
404 * ali15x3_tune_chipset - set up chipset/drive for new speed 389 * ali_set_dma_mode - set host controller for DMA mode
405 * @drive: drive to configure for 390 * @drive: drive
406 * @speed: desired speed 391 * @speed: DMA mode
407 * 392 *
408 * Configure the hardware for the desired IDE transfer mode. 393 * Configure the hardware for the desired IDE transfer mode.
409 * We also do the needed drive configuration through helpers
410 */ 394 */
411 395
412static int ali15x3_tune_chipset(ide_drive_t *drive, const u8 speed) 396static void ali_set_dma_mode(ide_drive_t *drive, const u8 speed)
413{ 397{
414 ide_hwif_t *hwif = HWIF(drive); 398 ide_hwif_t *hwif = HWIF(drive);
415 struct pci_dev *dev = hwif->pci_dev; 399 struct pci_dev *dev = hwif->pci_dev;
@@ -419,7 +403,7 @@ static int ali15x3_tune_chipset(ide_drive_t *drive, const u8 speed)
419 int m5229_udma = (hwif->channel) ? 0x57 : 0x56; 403 int m5229_udma = (hwif->channel) ? 0x57 : 0x56;
420 404
421 if (speed < XFER_PIO_0) 405 if (speed < XFER_PIO_0)
422 return 1; 406 return;
423 407
424 if (speed == XFER_UDMA_6) 408 if (speed == XFER_UDMA_6)
425 speed1 = 0x47; 409 speed1 = 0x47;
@@ -450,7 +434,6 @@ static int ali15x3_tune_chipset(ide_drive_t *drive, const u8 speed)
450 pci_write_config_byte(dev, 0x4b, tmpbyte); 434 pci_write_config_byte(dev, 0x4b, tmpbyte);
451 } 435 }
452 } 436 }
453 return (ide_config_drive_speed(drive, speed));
454} 437}
455 438
456/** 439/**
@@ -699,7 +682,7 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
699{ 682{
700 hwif->autodma = 0; 683 hwif->autodma = 0;
701 hwif->set_pio_mode = &ali_set_pio_mode; 684 hwif->set_pio_mode = &ali_set_pio_mode;
702 hwif->speedproc = &ali15x3_tune_chipset; 685 hwif->set_dma_mode = &ali_set_dma_mode;
703 hwif->udma_filter = &ali_udma_filter; 686 hwif->udma_filter = &ali_udma_filter;
704 687
705 /* don't use LBA48 DMA on ALi devices before rev 0xC5 */ 688 /* don't use LBA48 DMA on ALi devices before rev 0xC5 */