1 // SPDX-License-Identifier: (GPL-2.0 OR MPL-1.1)
3 * Driver for Future Domain-compatible PCMCIA SCSI cards
4 * Copyright 2019 Ondrej Zary
6 * The initial developer of the original code is David A. Hinds
7 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
8 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 #include <linux/module.h>
12 #include <linux/init.h>
13 #include <scsi/scsi_host.h>
14 #include <pcmcia/cistpl.h>
15 #include <pcmcia/ds.h>
18 MODULE_AUTHOR("Ondrej Zary, David Hinds");
19 MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver");
20 MODULE_LICENSE("Dual MPL/GPL");
22 static int fdomain_config_check(struct pcmcia_device
*p_dev
, void *priv_data
)
25 p_dev
->resource
[0]->end
= FDOMAIN_REGION_SIZE
;
26 p_dev
->resource
[0]->flags
&= ~IO_DATA_PATH_WIDTH
;
27 p_dev
->resource
[0]->flags
|= IO_DATA_PATH_WIDTH_AUTO
;
28 return pcmcia_request_io(p_dev
);
31 static int fdomain_probe(struct pcmcia_device
*link
)
36 link
->config_flags
|= CONF_ENABLE_IRQ
| CONF_AUTO_SET_IO
;
37 link
->config_regs
= PRESENT_OPTION
;
39 ret
= pcmcia_loop_config(link
, fdomain_config_check
, NULL
);
43 ret
= pcmcia_enable_device(link
);
47 if (!request_region(link
->resource
[0]->start
, FDOMAIN_REGION_SIZE
,
51 sh
= fdomain_create(link
->resource
[0]->start
, link
->irq
, 7, &link
->dev
);
53 dev_err(&link
->dev
, "Controller initialization failed");
63 release_region(link
->resource
[0]->start
, FDOMAIN_REGION_SIZE
);
65 pcmcia_disable_device(link
);
69 static void fdomain_remove(struct pcmcia_device
*link
)
71 fdomain_destroy(link
->priv
);
72 release_region(link
->resource
[0]->start
, FDOMAIN_REGION_SIZE
);
73 pcmcia_disable_device(link
);
76 static const struct pcmcia_device_id fdomain_ids
[] = {
77 PCMCIA_DEVICE_PROD_ID12("IBM Corp.", "SCSI PCMCIA Card", 0xe3736c88,
79 PCMCIA_DEVICE_PROD_ID1("SCSI PCMCIA Adapter Card", 0x8dacb57e),
80 PCMCIA_DEVICE_PROD_ID12(" SIMPLE TECHNOLOGY Corporation",
81 "SCSI PCMCIA Credit Card Controller",
82 0x182bdafe, 0xc80d106f),
85 MODULE_DEVICE_TABLE(pcmcia
, fdomain_ids
);
87 static struct pcmcia_driver fdomain_cs_driver
= {
90 .probe
= fdomain_probe
,
91 .remove
= fdomain_remove
,
92 .id_table
= fdomain_ids
,
95 module_pcmcia_driver(fdomain_cs_driver
);