19 #include <linux/kernel.h>
20 #include <linux/module.h>
22 #include <linux/ptrace.h>
23 #include <linux/slab.h>
24 #include <linux/string.h>
46 static int teles_cs_config(
struct pcmcia_device *
link)
__devinit;
47 static void teles_cs_release(
struct pcmcia_device *
link);
48 static void teles_detach(
struct pcmcia_device *p_dev)
__devexit;
51 struct pcmcia_device *
p_dev;
60 dev_dbg(&link->dev,
"teles_attach()\n");
64 if (!local)
return -
ENOMEM;
70 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
72 return teles_cs_config(link);
75 static void __devexit teles_detach(
struct pcmcia_device *link)
79 dev_dbg(&link->dev,
"teles_detach(0x%p)\n", link);
82 teles_cs_release(link);
87 static int teles_cs_configcheck(
struct pcmcia_device *p_dev,
void *priv_data)
92 p_dev->resource[0]->end = 96;
93 p_dev->resource[0]->flags &= IO_DATA_PATH_WIDTH;
94 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
96 if ((p_dev->resource[0]->end) && p_dev->resource[0]->start) {
102 for (j = 0x2f0; j > 0x100; j -= 0x10) {
103 p_dev->resource[0]->start =
j;
111 static int __devinit teles_cs_config(
struct pcmcia_device *link)
116 dev_dbg(&link->dev,
"teles_config(0x%p)\n", link);
118 i = pcmcia_loop_config(link, teles_cs_configcheck,
NULL);
129 icard.
para[0] = link->irq;
130 icard.
para[1] = link->resource[0]->start;
136 printk(
KERN_ERR "teles_cs: failed to initialize Teles PCMCIA %d at i/o %#x\n",
137 i, (
unsigned int) link->resource[0]->start);
138 teles_cs_release(link);
146 teles_cs_release(link);
150 static void teles_cs_release(
struct pcmcia_device *link)
154 dev_dbg(&link->dev,
"teles_cs_release(0x%p)\n", link);
166 static int teles_suspend(
struct pcmcia_device *link)
175 static int teles_resume(
struct pcmcia_device *link)
186 PCMCIA_DEVICE_PROD_ID12(
"TELES",
"S0/PC", 0x67b50eae, 0xe9e70119),
191 static struct pcmcia_driver teles_cs_driver = {
194 .probe = teles_probe,
196 .id_table = teles_ids,
197 .suspend = teles_suspend,
198 .resume = teles_resume,
201 static int __init init_teles_cs(
void)
206 static void __exit exit_teles_cs(
void)