13 #include <linux/kernel.h>
14 #include <linux/module.h>
16 #include <linux/ptrace.h>
17 #include <linux/slab.h>
18 #include <linux/string.h>
38 #define INFO(args...) printk(KERN_INFO "sl811_cs: " args)
45 struct pcmcia_device *
p_dev;
48 static void sl811_cs_release(
struct pcmcia_device *
link);
52 static void release_platform_dev(
struct device *
dev)
54 dev_dbg(dev,
"sl811_cs platform_dev release\n");
83 .platform_data = &platform_data,
84 .release = release_platform_dev,
86 .resource = resources,
93 if (platform_dev.
dev.parent)
95 platform_dev.
dev.parent = parent;
98 resources[0].
start = irq;
100 resources[1].
start = base_addr;
101 resources[1].
end = base_addr;
103 resources[2].
start = base_addr + 1;
104 resources[2].
end = base_addr + 1;
116 static void sl811_cs_detach(
struct pcmcia_device *
link)
118 dev_dbg(&link->dev,
"sl811_cs_detach\n");
120 sl811_cs_release(link);
126 static void sl811_cs_release(
struct pcmcia_device *
link)
128 dev_dbg(&link->dev,
"sl811_cs_release\n");
134 static int sl811_cs_config_check(
struct pcmcia_device *p_dev,
void *priv_data)
136 if (p_dev->config_index == 0)
143 static int sl811_cs_config(
struct pcmcia_device *
link)
145 struct device *parent = &link->dev;
148 dev_dbg(&link->dev,
"sl811_cs_config\n");
150 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP |
151 CONF_AUTO_CHECK_VCC | CONF_AUTO_SET_IO;
153 if (pcmcia_loop_config(link, sl811_cs_config_check,
NULL))
157 if (resource_size(link->resource[0]) < 2)
167 if (sl811_hc_init(parent, link->resource[0]->start, link->irq)
171 sl811_cs_release(link);
177 static int sl811_cs_probe(
struct pcmcia_device *link)
187 return sl811_cs_config(link);
191 PCMCIA_DEVICE_MANF_CARD(0xc015, 0x0001),
196 static struct pcmcia_driver sl811_cs_driver = {
199 .probe = sl811_cs_probe,
200 .remove = sl811_cs_detach,
201 .id_table = sl811_ids,
206 static int __init init_sl811_cs(
void)
212 static void __exit exit_sl811_cs(
void)