summaryrefslogtreecommitdiff
path: root/drivers/scsi/g_NCR5380.h
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2016-10-10 07:46:52 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2016-11-09 01:29:47 +0300
commitb61bacbc2bf5df11f227bd9bd97b3bace4dc9108 (patch)
tree2b0c1de1aac1c29bd7ef5916458aec948642e071 /drivers/scsi/g_NCR5380.h
parent1e879e8fa9f62e18d79bfc339050bf8fed7a81e4 (diff)
downloadlinux-b61bacbc2bf5df11f227bd9bd97b3bace4dc9108.tar.xz
scsi: g_NCR5380: Merge g_NCR5380 and g_NCR5380_mmio drivers
Merge the port-mapped IO and memory-mapped IO support (with the help of ioport_map) into the g_NCR5380 module and delete g_NCR5380_mmio. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/g_NCR5380.h')
-rw-r--r--drivers/scsi/g_NCR5380.h33
1 files changed, 9 insertions, 24 deletions
diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h
index b175b9234458..2b77782439f1 100644
--- a/drivers/scsi/g_NCR5380.h
+++ b/drivers/scsi/g_NCR5380.h
@@ -14,44 +14,30 @@
#ifndef GENERIC_NCR5380_H
#define GENERIC_NCR5380_H
-#ifndef SCSI_G_NCR5380_MEM
#define DRV_MODULE_NAME "g_NCR5380"
#define NCR5380_read(reg) \
- inb(instance->io_port + (reg))
+ ioread8(((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \
+ ((struct NCR5380_hostdata *)shost_priv(instance))->offset + \
+ (reg))
#define NCR5380_write(reg, value) \
- outb(value, instance->io_port + (reg))
+ iowrite8(value, ((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \
+ ((struct NCR5380_hostdata *)shost_priv(instance))->offset + \
+ (reg))
#define NCR5380_implementation_fields \
+ int offset; \
+ void __iomem *iomem; \
+ resource_size_t iomem_size; \
int c400_ctl_status; \
int c400_blk_cnt; \
int c400_host_buf; \
int io_width;
-#else
-/* therefore SCSI_G_NCR5380_MEM */
-#define DRV_MODULE_NAME "g_NCR5380_mmio"
-
#define NCR53C400_mem_base 0x3880
#define NCR53C400_host_buffer 0x3900
#define NCR53C400_region_size 0x3a00
-#define NCR5380_read(reg) \
- readb(((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \
- NCR53C400_mem_base + (reg))
-#define NCR5380_write(reg, value) \
- writeb(value, ((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \
- NCR53C400_mem_base + (reg))
-
-#define NCR5380_implementation_fields \
- void __iomem *iomem; \
- resource_size_t iomem_size; \
- int c400_ctl_status; \
- int c400_blk_cnt; \
- int c400_host_buf;
-
-#endif
-
#define NCR5380_dma_xfer_len(instance, cmd, phase) \
generic_NCR5380_dma_xfer_len(instance, cmd)
#define NCR5380_dma_recv_setup generic_NCR5380_pread
@@ -73,4 +59,3 @@
#define BOARD_HP_C2502 4
#endif /* GENERIC_NCR5380_H */
-