summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 23:44:36 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 23:44:36 +0200
commitefa3db1bb70c45a384419fdc257723cb167905ff (patch)
treee85ff456eea22b3da28f92ae26f2f714d0bc31db /drivers
parent9567b349f7e7dd7e2483db99ee8e4a6fe0caca38 (diff)
scc_pata: add ->{in,out}put_data methods (take 2)
v2: * Update ->{in,out}_data methods to take 'struct request *rq' argument (thanks to Stephen Rothwell for catching it). There should be no functional changes caused by this patch. Cc: Kou Ishizaki <kou.ishizaki@toshiba.co.jp> Cc: Akira Iguchi <akira2.iguchi@toshiba.co.jp> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/pci/scc_pata.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index ad7cdf9060ca..a7a2c58482a2 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -618,6 +618,38 @@ static int __devinit init_setup_scc(struct pci_dev *dev,
return rc;
}
+static void scc_input_data(ide_drive_t *drive, struct request *rq,
+ void *buf, unsigned int len)
+{
+ unsigned long data_addr = drive->hwif->io_ports.data_addr;
+
+ len++;
+
+ if (drive->io_32bit) {
+ scc_ide_insl(data_addr, buf, len / 4);
+
+ if ((len & 3) >= 2)
+ scc_ide_insw(data_addr, (u8 *)buf + (len & ~3), 1);
+ } else
+ scc_ide_insw(data_addr, buf, len / 2);
+}
+
+static void scc_output_data(ide_drive_t *drive, struct request *rq,
+ void *buf, unsigned int len)
+{
+ unsigned long data_addr = drive->hwif->io_ports.data_addr;
+
+ len++;
+
+ if (drive->io_32bit) {
+ scc_ide_outsl(data_addr, buf, len / 4);
+
+ if ((len & 3) >= 2)
+ scc_ide_outsw(data_addr, (u8 *)buf + (len & ~3), 1);
+ } else
+ scc_ide_outsw(data_addr, buf, len / 2);
+}
+
/**
* init_mmio_iops_scc - set up the iops for MMIO
* @hwif: interface to set up
@@ -632,6 +664,9 @@ static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif)
ide_set_hwifdata(hwif, ports);
+ hwif->input_data = scc_input_data;
+ hwif->output_data = scc_output_data;
+
hwif->INB = scc_ide_inb;
hwif->INW = scc_ide_inw;
hwif->INSW = scc_ide_insw;