Lines Matching +full:ctrl +full:- +full:module
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright 1995-2002, Russell King
7 #include <linux/module.h>
17 #define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata)
31 unsigned ctrl
39 #define CTRL 0x16fc macro
48 u8 __iomem *base = hostdata->io; in cumanascsi_pwrite()
49 u8 __iomem *dma = hostdata->pdma_io + 0x2000; in cumanascsi_pwrite()
53 writeb(0x02, base + CTRL); in cumanascsi_pwrite()
72 len -= 32; in cumanascsi_pwrite()
78 writeb(0x12, base + CTRL); in cumanascsi_pwrite()
89 if(--len == 0) in cumanascsi_pwrite()
99 if(--len == 0) in cumanascsi_pwrite()
104 writeb(hostdata->ctrl | 0x40, base + CTRL); in cumanascsi_pwrite()
107 return -1; in cumanascsi_pwrite()
115 u8 __iomem *base = hostdata->io; in cumanascsi_pread()
116 u8 __iomem *dma = hostdata->pdma_io + 0x2000; in cumanascsi_pread()
120 writeb(0x00, base + CTRL); in cumanascsi_pread()
138 len -= 32; in cumanascsi_pread()
144 writeb(0x10, base + CTRL); in cumanascsi_pread()
155 if(--len == 0) in cumanascsi_pread()
165 if(--len == 0) in cumanascsi_pread()
170 writeb(hostdata->ctrl | 0x40, base + CTRL); in cumanascsi_pread()
173 return -1; in cumanascsi_pread()
180 return cmd->transfersize; in cumanascsi_dma_xfer_len()
186 u8 __iomem *base = hostdata->io; in cumanascsi_read()
189 writeb(0, base + CTRL); in cumanascsi_read()
193 hostdata->ctrl = 0x40; in cumanascsi_read()
194 writeb(0x40, base + CTRL); in cumanascsi_read()
202 u8 __iomem *base = hostdata->io; in cumanascsi_write()
204 writeb(0, base + CTRL); in cumanascsi_write()
208 hostdata->ctrl = 0x40; in cumanascsi_write()
209 writeb(0x40, base + CTRL); in cumanascsi_write()
215 .module = THIS_MODULE,
216 .name = "Cumana 16-bit SCSI",
225 .proc_name = "CumanaSCSI-1",
228 .dma_boundary = PAGE_SIZE - 1,
243 ret = -ENOMEM; in cumanascsi1_probe()
247 priv(host)->io = ioremap(ecard_resource_start(ec, ECARD_RES_IOCSLOW), in cumanascsi1_probe()
249 priv(host)->pdma_io = ioremap(ecard_resource_start(ec, ECARD_RES_MEMC), in cumanascsi1_probe()
251 if (!priv(host)->io || !priv(host)->pdma_io) { in cumanascsi1_probe()
252 ret = -ENOMEM; in cumanascsi1_probe()
256 host->irq = ec->irq; in cumanascsi1_probe()
264 priv(host)->ctrl = 0; in cumanascsi1_probe()
265 writeb(0, priv(host)->io + CTRL); in cumanascsi1_probe()
267 ret = request_irq(host->irq, cumanascsi_intr, 0, in cumanascsi1_probe()
268 "CumanaSCSI-1", host); in cumanascsi1_probe()
271 host->host_no, host->irq, ret); in cumanascsi1_probe()
275 ret = scsi_add_host(host, &ec->dev); in cumanascsi1_probe()
283 free_irq(host->irq, host); in cumanascsi1_probe()
287 iounmap(priv(host)->io); in cumanascsi1_probe()
288 iounmap(priv(host)->pdma_io); in cumanascsi1_probe()
299 void __iomem *base = priv(host)->io; in cumanascsi1_remove()
300 void __iomem *dma = priv(host)->pdma_io; in cumanascsi1_remove()
305 free_irq(host->irq, host); in cumanascsi1_remove()
340 MODULE_DESCRIPTION("Cumana SCSI-1 driver for Acorn machines");