lkml.org 
[lkml]   [2010]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 65/68] triflex: convert to ide2libata
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] triflex: convert to ide2libata

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/triflex.c | 57 +++++---------------------------------------------
1 file changed, 6 insertions(+), 51 deletions(-)

Index: b/drivers/ide/triflex.c
===================================================================
--- a/drivers/ide/triflex.c
+++ b/drivers/ide/triflex.c
@@ -34,62 +34,17 @@

#define DRV_NAME "triflex"

-static void triflex_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
-{
- struct pci_dev *dev = to_pci_dev(hwif->dev);
- u32 triflex_timings = 0;
- u16 timing = 0;
- u8 channel_offset = hwif->channel ? 0x74 : 0x70, unit = drive->dn & 1;
-
- pci_read_config_dword(dev, channel_offset, &triflex_timings);
-
- switch (drive->dma_mode) {
- case XFER_MW_DMA_2:
- timing = 0x0103;
- break;
- case XFER_MW_DMA_1:
- timing = 0x0203;
- break;
- case XFER_MW_DMA_0:
- timing = 0x0808;
- break;
- case XFER_SW_DMA_2:
- case XFER_SW_DMA_1:
- case XFER_SW_DMA_0:
- timing = 0x0f0f;
- break;
- case XFER_PIO_4:
- timing = 0x0202;
- break;
- case XFER_PIO_3:
- timing = 0x0204;
- break;
- case XFER_PIO_2:
- timing = 0x0404;
- break;
- case XFER_PIO_1:
- timing = 0x0508;
- break;
- case XFER_PIO_0:
- timing = 0x0808;
- break;
- }
-
- triflex_timings &= ~(0xFFFF << (16 * unit));
- triflex_timings |= (timing << (16 * unit));
-
- pci_write_config_dword(dev, channel_offset, triflex_timings);
-}
+#include <linux/ide2libata.h>
+#include "../ata/pata_triflex.h"

-static void triflex_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
+static void triflex_set_dmamode(ide_hwif_t *hwif, ide_drive_t *drive)
{
- drive->dma_mode = drive->pio_mode;
- triflex_set_mode(hwif, drive);
+ triflex_load_timing(hwif, drive, drive->dma_mode);
}

static const struct ide_port_ops triflex_port_ops = {
- .set_pio_mode = triflex_set_pio_mode,
- .set_dma_mode = triflex_set_mode,
+ .set_pio_mode = triflex_set_piomode,
+ .set_dma_mode = triflex_set_dmamode,
};

static const struct ide_port_info triflex_device __devinitdata = {

\
 
 \ /
  Last update: 2010-01-29 17:15    [W:0.300 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site