diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-08-16 13:32:24 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-08-16 13:32:24 +0900 |
commit | bbcf6e8b66ab2fb5ddab4d0fe40c2e6a5ebe5301 (patch) | |
tree | 071fa9f86dc04a16570be367d04cff3b00c694ad /drivers/staging/comedi/drivers/ni_labpc_cs.c | |
parent | sh: Use __GFP_ZERO for dma_generic_alloc_coherent(). (diff) | |
parent | Linux 2.6.36-rc1 (diff) | |
download | linux-dev-bbcf6e8b66ab2fb5ddab4d0fe40c2e6a5ebe5301.tar.xz linux-dev-bbcf6e8b66ab2fb5ddab4d0fe40c2e6a5ebe5301.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
arch/sh/include/asm/Kbuild
drivers/Makefile
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/ni_labpc_cs.c')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc_cs.c | 73 |
1 files changed, 18 insertions, 55 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c index 163245ebb311..68c4ecbd93ae 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_cs.c +++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c @@ -71,7 +71,6 @@ NI manuals: #include "comedi_fc.h" #include "ni_labpc.h" -#include <pcmcia/cs_types.h> #include <pcmcia/cs.h> #include <pcmcia/cistpl.h> #include <pcmcia/cisreg.h> @@ -143,7 +142,7 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it) link = pcmcia_cur_dev; /* XXX hack */ if (!link) return -EIO; - iobase = link->io.BasePort1; + iobase = link->resource[0]->start; irq = link->irq; break; default: @@ -189,14 +188,6 @@ static void labpc_cs_detach(struct pcmcia_device *); less on other parts of the kernel. */ -/* - The dev_info variable is the "key" that is used to match up this - device driver with appropriate cards, through the card configuration - database. -*/ - -static const dev_info_t dev_info = "daqcard-1200"; - struct local_info_t { struct pcmcia_device *link; int stop; @@ -286,9 +277,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, unsigned int vcc, void *priv_data) { - win_req_t *req = priv_data; - memreq_t map; - if (cfg->index == 0) return -ENODEV; @@ -302,44 +290,25 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, p_dev->conf.Attributes |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; /* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; + p_dev->resource[0]->end = p_dev->resource[1]->end = 0; if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; - if (!(io->flags & CISTPL_IO_8BIT)) - p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; - if (!(io->flags & CISTPL_IO_16BIT)) - p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; - p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; - p_dev->io.BasePort1 = io->win[0].base; - p_dev->io.NumPorts1 = io->win[0].len; + p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; + p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; + p_dev->resource[0]->flags |= + pcmcia_io_cfg_data_width(io->flags); + p_dev->resource[0]->start = io->win[0].base; + p_dev->resource[0]->end = io->win[0].len; if (io->nwin > 1) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1].base; - p_dev->io.NumPorts2 = io->win[1].len; + p_dev->resource[1]->flags = p_dev->resource[0]->flags; + p_dev->resource[1]->start = io->win[1].base; + p_dev->resource[1]->end = io->win[1].len; } /* This reserves IO space but doesn't actually enable it */ - if (pcmcia_request_io(p_dev, &p_dev->io) != 0) + if (pcmcia_request_io(p_dev) != 0) return -ENODEV; } - if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { - cistpl_mem_t *mem = - (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; - req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM; - req->Attributes |= WIN_ENABLE; - req->Base = mem->win[0].host_addr; - req->Size = mem->win[0].len; - if (req->Size < 0x1000) - req->Size = 0x1000; - req->AccessSpeed = 0; - if (pcmcia_request_window(p_dev, req, &p_dev->win)) - return -ENODEV; - map.Page = 0; - map.CardOffset = mem->win[0].card_addr; - if (pcmcia_map_mem_page(p_dev, p_dev->win, &map)) - return -ENODEV; - } /* If we got this far, we're cool! */ return 0; } @@ -348,11 +317,10 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, static void labpc_config(struct pcmcia_device *link) { int ret; - win_req_t req; dev_dbg(&link->dev, "labpc_config\n"); - ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, &req); + ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, NULL); if (ret) { dev_warn(&link->dev, "no configuration found\n"); goto failed; @@ -374,15 +342,10 @@ static void labpc_config(struct pcmcia_device *link) dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex); if (link->conf.Attributes & CONF_ENABLE_IRQ) printk(", irq %d", link->irq); - if (link->io.NumPorts1) - printk(", io 0x%04x-0x%04x", link->io.BasePort1, - link->io.BasePort1 + link->io.NumPorts1 - 1); - if (link->io.NumPorts2) - printk(" & 0x%04x-0x%04x", link->io.BasePort2, - link->io.BasePort2 + link->io.NumPorts2 - 1); - if (link->win) - printk(", mem 0x%06lx-0x%06lx", req.Base, - req.Base + req.Size - 1); + if (link->resource[0]) + printk(" & %pR", link->resource[0]); + if (link->resource[1]) + printk(" & %pR", link->resource[1]); printk("\n"); return; @@ -449,7 +412,7 @@ struct pcmcia_driver labpc_cs_driver = { .id_table = labpc_cs_ids, .owner = THIS_MODULE, .drv = { - .name = dev_info, + .name = "daqcard-1200", }, }; |