37 #include <linux/module.h>
39 #include <linux/kernel.h>
40 #include <linux/slab.h>
41 #include <linux/string.h>
43 #include <scsi/scsi.h>
62 static int reconnect = 1;
64 static int synchronous = 1;
65 static int reset_delay = 100;
66 static int ext_trans = 0;
84 static void aha152x_release_cs(
struct pcmcia_device *
link);
85 static void aha152x_detach(
struct pcmcia_device *p_dev);
86 static int aha152x_config_cs(
struct pcmcia_device *
link);
88 static int aha152x_probe(
struct pcmcia_device *
link)
92 dev_dbg(&link->dev,
"aha152x_attach()\n");
100 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
101 link->config_regs = PRESENT_OPTION;
103 return aha152x_config_cs(link);
108 static void aha152x_detach(
struct pcmcia_device *link)
110 dev_dbg(&link->dev,
"aha152x_detach\n");
112 aha152x_release_cs(link);
120 static int aha152x_config_check(
struct pcmcia_device *p_dev,
void *priv_data)
122 p_dev->io_lines = 10;
125 if ((p_dev->resource[0]->end < 0x20) &&
126 (p_dev->resource[1]->end >= 0x20))
127 p_dev->resource[0]->start = p_dev->resource[1]->start;
129 if (p_dev->resource[0]->start >= 0xffff)
132 p_dev->resource[1]->start = p_dev->resource[1]->end = 0;
133 p_dev->resource[0]->end = 0x20;
134 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
135 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
140 static int aha152x_config_cs(
struct pcmcia_device *link)
147 dev_dbg(&link->dev,
"aha152x_config\n");
149 ret = pcmcia_loop_config(link, aha152x_config_check,
NULL);
162 s.conf =
"PCMCIA setup";
163 s.io_port = link->resource[0]->start;
166 s.reconnect = reconnect;
168 s.synchronous = synchronous;
169 s.delay = reset_delay;
171 s.ext_trans = ext_trans;
184 aha152x_release_cs(link);
188 static void aha152x_release_cs(
struct pcmcia_device *link)
196 static int aha152x_resume(
struct pcmcia_device *link)
206 PCMCIA_DEVICE_PROD_ID123(
"New Media",
"SCSI",
"Bus Toaster", 0xcdf7e4cc, 0x35f26476, 0xa8851d6e),
207 PCMCIA_DEVICE_PROD_ID123(
"NOTEWORTHY",
"SCSI",
"Bus Toaster", 0xad89c6e8, 0x35f26476, 0xa8851d6e),
208 PCMCIA_DEVICE_PROD_ID12(
"Adaptec, Inc.",
"APA-1460 SCSI Host Adapter", 0x24ba9738, 0x3a3c3d20),
209 PCMCIA_DEVICE_PROD_ID12(
"New Media Corporation",
"Multimedia Sound/SCSI", 0x085a850b, 0x80a6535c),
210 PCMCIA_DEVICE_PROD_ID12(
"NOTEWORTHY",
"NWCOMB02 SCSI/AUDIO COMBO CARD", 0xad89c6e8, 0x5f9a615b),
215 static struct pcmcia_driver aha152x_cs_driver = {
217 .name =
"aha152x_cs",
218 .probe = aha152x_probe,
219 .remove = aha152x_detach,
220 .id_table = aha152x_ids,
221 .resume = aha152x_resume,
224 static int __init init_aha152x_cs(
void)
229 static void __exit exit_aha152x_cs(
void)