37 #include <linux/kernel.h>
38 #include <linux/module.h>
40 #include <linux/ptrace.h>
41 #include <linux/slab.h>
42 #include <linux/string.h>
48 #include <linux/parport.h>
64 #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
71 #define FORCE_EPP_MODE 0x08
79 static void parport_detach(
struct pcmcia_device *p_dev);
80 static int parport_config(
struct pcmcia_device *
link);
81 static void parport_cs_release(
struct pcmcia_device *);
83 static int parport_probe(
struct pcmcia_device *
link)
87 dev_dbg(&link->dev,
"parport_attach()\n");
95 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
97 return parport_config(link);
100 static void parport_detach(
struct pcmcia_device *link)
102 dev_dbg(&link->dev,
"parport_detach\n");
104 parport_cs_release(link);
109 static int parport_config_check(
struct pcmcia_device *p_dev,
void *priv_data)
111 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
112 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
113 p_dev->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
114 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
119 static int parport_config(
struct pcmcia_device *link)
125 dev_dbg(&link->dev,
"parport_config\n");
130 ret = pcmcia_loop_config(link, parport_config_check,
NULL);
141 link->resource[1]->start,
146 "0x%3x, irq %u failed\n",
147 (
unsigned int) link->resource[0]->start,
161 parport_cs_release(link);
165 static void parport_cs_release(
struct pcmcia_device *link)
169 dev_dbg(&link->dev,
"parport_release\n");
182 PCMCIA_DEVICE_FUNC_ID(3),
183 PCMCIA_MFC_DEVICE_PROD_ID12(1,
"Elan",
"Serial+Parallel Port: SP230",0x3beb8cf2,0xdb9e58bc),
184 PCMCIA_DEVICE_MANF_CARD(0x0137, 0x0003),
189 static struct pcmcia_driver parport_cs_driver = {
191 .name =
"parport_cs",
192 .probe = parport_probe,
193 .remove = parport_detach,
194 .id_table = parport_ids,
197 static int __init init_parport_cs(
void)
202 static void __exit exit_parport_cs(
void)