44 #include <linux/slab.h>
45 #include "../comedidev.h"
55 static struct pcmcia_device *pcmcia_cur_dev;
76 .name =
"daqcard-dio24",
82 .name =
"ni_daq_dio24",
92 #define thisboard ((const struct dio24_board_struct *)dev->board_ptr)
99 #define devpriv ((struct dio24_private *)dev->private)
102 .driver_name =
"ni_daq_dio24",
104 .attach = dio24_attach,
105 .detach = dio24_detach,
107 .board_name = &dio24_boards[0].
name,
116 unsigned int irq = 0;
118 struct pcmcia_device *
link;
128 link = pcmcia_cur_dev;
131 iobase = link->resource[0]->start;
137 pr_err(
"bug! couldn't determine board type\n");
149 pr_err(
"io base address is zero!\n");
187 static void dio24_config(
struct pcmcia_device *
link);
188 static void dio24_release(
struct pcmcia_device *link);
189 static int dio24_cs_suspend(
struct pcmcia_device *p_dev);
190 static int dio24_cs_resume(
struct pcmcia_device *p_dev);
192 static int dio24_cs_attach(
struct pcmcia_device *);
193 static void dio24_cs_detach(
struct pcmcia_device *);
198 struct bus_operations *
bus;
201 static int dio24_cs_attach(
struct pcmcia_device *link)
207 dev_dbg(&link->dev,
"dio24_cs_attach()\n");
216 pcmcia_cur_dev =
link;
223 static void dio24_cs_detach(
struct pcmcia_device *link)
232 static int dio24_pcmcia_config_loop(
struct pcmcia_device *p_dev,
235 if (p_dev->config_index == 0)
241 static void dio24_config(
struct pcmcia_device *link)
247 dev_dbg(&link->dev,
"dio24_config\n");
249 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_AUDIO |
252 ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop,
NULL);
254 dev_warn(&link->dev,
"no configuration found\n");
273 static void dio24_release(
struct pcmcia_device *link)
275 dev_dbg(&link->dev,
"dio24_release\n");
280 static int dio24_cs_suspend(
struct pcmcia_device *link)
289 static int dio24_cs_resume(
struct pcmcia_device *link)
301 PCMCIA_DEVICE_MANF_CARD(0x010b, 0x475c),
308 "PCMCIA DAQ-Card DIO-24");
311 static struct pcmcia_driver dio24_cs_driver = {
312 .probe = dio24_cs_attach,
313 .remove = dio24_cs_detach,
314 .suspend = dio24_cs_suspend,
315 .resume = dio24_cs_resume,
316 .id_table = dio24_cs_ids,
318 .name =
"ni_daq_dio24",
321 static int __init init_dio24_cs(
void)
323 printk(
"ni_daq_dio24: HOLA SOY YO!\n");
328 static void __exit exit_dio24_cs(
void)
337 ret = init_dio24_cs();