3 #include <linux/module.h>
6 #include <linux/kernel.h>
8 #include <linux/errno.h>
9 #include <linux/slab.h>
26 static void ixj_detach(
struct pcmcia_device *p_dev);
27 static int ixj_config(
struct pcmcia_device *
link);
28 static void ixj_cs_release(
struct pcmcia_device *
link);
30 static int ixj_probe(
struct pcmcia_device *p_dev)
32 dev_dbg(&p_dev->dev,
"ixj_attach()\n");
39 return ixj_config(p_dev);
42 static void ixj_detach(
struct pcmcia_device *
link)
44 dev_dbg(&link->dev,
"ixj_detach\n");
51 static void ixj_get_serial(
struct pcmcia_device *
link,
IXJ *
j)
55 dev_dbg(&link->dev,
"ixj_get_serial\n");
57 str = link->prod_id[0];
61 str = link->prod_id[1];
65 str = link->prod_id[2];
69 for (i =
strlen(str) - 1; i >= 0; i--) {
81 j->
serial += (str[
i] - 48) * place;
89 j->
serial += (str[
i] - 55) * place;
97 j->
serial += (str[
i] - 87) * place;
100 place = place * 0x10;
102 str = link->prod_id[3];
105 printk(
" version %s\n", str);
110 static int ixj_config_check(
struct pcmcia_device *p_dev,
void *priv_data)
112 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
113 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
114 p_dev->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
115 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
121 static int ixj_config(
struct pcmcia_device * link)
127 dev_dbg(&link->dev,
"ixj_config\n");
129 link->config_flags = CONF_AUTO_SET_IO;
131 if (pcmcia_loop_config(link, ixj_config_check,
NULL))
141 link->resource[0]->start + 0x10);
144 ixj_get_serial(link, j);
148 ixj_cs_release(link);
152 static void ixj_cs_release(
struct pcmcia_device *link)
155 dev_dbg(&link->dev,
"ixj_cs_release\n");
161 PCMCIA_DEVICE_MANF_CARD(0x0257, 0x0600),
166 static struct pcmcia_driver ixj_driver = {
170 .remove = ixj_detach,
174 static int __init ixj_pcmcia_init(
void)
179 static void ixj_pcmcia_exit(
void)