From a4d0b8e4ffe80e50228eaee694e8dab997dcbec7 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Thu, 23 Feb 2006 00:02:43 +0000 Subject: [PATCH] Patch from abbotti@mev.co.uk (Ian Abbott): 2.6.13 introduced device ID tables for PCMCIA devices. They seem to be required to get automatic module loading to work for PCMCIA on some newer distros. I've patched ni_mio_cs.c and ni_labpc_cs.c to include the device ID tables (only for kernel version 2.6.13 upwards). I don't have enough information to patch the other PCMCIA drivers. --- comedi/drivers/ni_labpc_cs.c | 13 +++++++++++++ comedi/drivers/ni_mio_cs.c | 16 ++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/comedi/drivers/ni_labpc_cs.c b/comedi/drivers/ni_labpc_cs.c index 550977c1..9f39b3fd 100644 --- a/comedi/drivers/ni_labpc_cs.c +++ b/comedi/drivers/ni_labpc_cs.c @@ -707,12 +707,25 @@ static int labpc_event(event_t event, int priority, } /* labpc_event */ /*====================================================================*/ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) +static struct pcmcia_device_id labpc_cs_ids[] = +{ + /* N.B. These IDs should match those in labpc_cs_boards (ni_labpc.c) */ + PCMCIA_DEVICE_MANF_CARD(0x010b, 0x0103), /* daqcard-1200 */ + PCMCIA_DEVICE_NULL +}; + +MODULE_DEVICE_TABLE(pcmcia, labpc_cs_ids); +#endif + struct pcmcia_driver labpc_cs_driver = { .attach = labpc_cs_attach, .detach = labpc_cs_detach, #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) .event = &labpc_event, + .id_table = labpc_cs_ids, #endif .owner = THIS_MODULE, .drv = { diff --git a/comedi/drivers/ni_mio_cs.c b/comedi/drivers/ni_mio_cs.c index 6d2eb690..8a010040 100644 --- a/comedi/drivers/ni_mio_cs.c +++ b/comedi/drivers/ni_mio_cs.c @@ -156,6 +156,7 @@ static ni_board ni_boards[]={ caldac: {mb88341,mb88341}, }, #endif + /* N.B. Update ni_mio_cs_ids[] when entries added above. */ }; @@ -610,12 +611,27 @@ static int ni_getboardtype(comedi_device *dev,dev_link_t *link) MODULE_LICENSE("GPL"); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) +static struct pcmcia_device_id ni_mio_cs_ids[] = +{ + PCMCIA_DEVICE_MANF_CARD(0x010b, 0x010d), /* DAQCard-ai-16xe-50 */ + PCMCIA_DEVICE_MANF_CARD(0x010b, 0x010c), /* DAQCard-ai-16e-4 */ + PCMCIA_DEVICE_MANF_CARD(0x010b, 0x02c4), /* DAQCard-6062E */ + PCMCIA_DEVICE_MANF_CARD(0x010b, 0x075e), /* DAQCard-6024E */ + PCMCIA_DEVICE_MANF_CARD(0x010b, 0x0245), /* DAQCard-6036E */ + PCMCIA_DEVICE_NULL +}; + +MODULE_DEVICE_TABLE(pcmcia, ni_mio_cs_ids); +#endif + struct pcmcia_driver ni_mio_cs_driver = { .attach = &cs_attach, .detach = &cs_detach, #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) .event = &mio_cs_event, + .id_table = ni_mio_cs_ids, #endif .owner = THIS_MODULE, .drv = { -- 2.26.2