Commit 6bc3d2ac authored by Russell King's avatar Russell King

[ARM] Update DMA usage in Acorn SCSI drivers

Remove the pci_dma functionality from the Acorn SCSI drivers, and
replace with the new DMA API, passing in the generic struct device.
parent c90594ca
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/dma-mapping.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/ecard.h> #include <asm/ecard.h>
...@@ -163,26 +164,27 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -163,26 +164,27 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t direction, fasdmatype_t min_type) fasdmadir_t direction, fasdmatype_t min_type)
{ {
struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
struct device *dev = scsi_get_device(host);
int dmach = host->dma_channel; int dmach = host->dma_channel;
outb(ALATCH_DIS_DMA, info->alatch); outb(ALATCH_DIS_DMA, info->alatch);
if (dmach != NO_DMA && if (dmach != NO_DMA &&
(min_type == fasdma_real_all || SCp->this_residual >= 512)) { (min_type == fasdma_real_all || SCp->this_residual >= 512)) {
int bufs, pci_dir, dma_dir, alatch_dir; int bufs, map_dir, dma_dir, alatch_dir;
bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG); bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
if (direction == DMA_OUT) if (direction == DMA_OUT)
pci_dir = PCI_DMA_TODEVICE, map_dir = DMA_TO_DEVICE,
dma_dir = DMA_MODE_WRITE, dma_dir = DMA_MODE_WRITE,
alatch_dir = ALATCH_DMA_OUT; alatch_dir = ALATCH_DMA_OUT;
else else
pci_dir = PCI_DMA_FROMDEVICE, map_dir = DMA_FROM_DEVICE,
dma_dir = DMA_MODE_READ, dma_dir = DMA_MODE_READ,
alatch_dir = ALATCH_DMA_IN; alatch_dir = ALATCH_DMA_IN;
pci_map_sg(NULL, info->sg, bufs + 1, pci_dir); dma_map_sg(dev, info->sg, bufs + 1, map_dir);
disable_dma(dmach); disable_dma(dmach);
set_dma_sg(dmach, info->sg, bufs + 1); set_dma_sg(dmach, info->sg, bufs + 1);
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/dma-mapping.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -165,22 +166,23 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -165,22 +166,23 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t direction, fasdmatype_t min_type) fasdmadir_t direction, fasdmatype_t min_type)
{ {
struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
struct device *dev = scsi_get_device(host);
int dmach = host->dma_channel; int dmach = host->dma_channel;
if (dmach != NO_DMA && if (dmach != NO_DMA &&
(min_type == fasdma_real_all || SCp->this_residual >= 512)) { (min_type == fasdma_real_all || SCp->this_residual >= 512)) {
int bufs, pci_dir, dma_dir; int bufs, map_dir, dma_dir;
bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG); bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
if (direction == DMA_OUT) if (direction == DMA_OUT)
pci_dir = PCI_DMA_TODEVICE, map_dir = DMA_TO_DEVICE,
dma_dir = DMA_MODE_WRITE; dma_dir = DMA_MODE_WRITE;
else else
pci_dir = PCI_DMA_FROMDEVICE, map_dir = DMA_FROM_DEVICE,
dma_dir = DMA_MODE_READ; dma_dir = DMA_MODE_READ;
pci_map_sg(NULL, info->sg, bufs + 1, pci_dir); dma_map_sg(dev, info->sg, bufs + 1, map_dir);
disable_dma(dmach); disable_dma(dmach);
set_dma_sg(dmach, info->sg, bufs + 1); set_dma_sg(dmach, info->sg, bufs + 1);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/dma-mapping.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/ecard.h> #include <asm/ecard.h>
...@@ -135,22 +136,23 @@ powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -135,22 +136,23 @@ powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t direction, fasdmatype_t min_type) fasdmadir_t direction, fasdmatype_t min_type)
{ {
struct powertec_info *info = (struct powertec_info *)host->hostdata; struct powertec_info *info = (struct powertec_info *)host->hostdata;
struct device *dev = scsi_get_device(host);
int dmach = host->dma_channel; int dmach = host->dma_channel;
if (dmach != NO_DMA && if (dmach != NO_DMA &&
(min_type == fasdma_real_all || SCp->this_residual >= 512)) { (min_type == fasdma_real_all || SCp->this_residual >= 512)) {
int bufs, pci_dir, dma_dir; int bufs, map_dir, dma_dir;
bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG); bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
if (direction == DMA_OUT) if (direction == DMA_OUT)
pci_dir = PCI_DMA_TODEVICE, map_dir = DMA_TO_DEVICE,
dma_dir = DMA_MODE_WRITE; dma_dir = DMA_MODE_WRITE;
else else
pci_dir = PCI_DMA_FROMDEVICE, map_dir = DMA_FROM_DEVICE,
dma_dir = DMA_MODE_READ; dma_dir = DMA_MODE_READ;
pci_map_sg(NULL, info->sg, bufs + 1, pci_dir); dma_map_sg(dev, info->sg, bufs + 1, map_dir);
disable_dma(dmach); disable_dma(dmach);
set_dma_sg(dmach, info->sg, bufs + 1); set_dma_sg(dmach, info->sg, bufs + 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment