]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/staging/comedi/drivers/ni_labpc.h
Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / drivers / staging / comedi / drivers / ni_labpc.h
1 /*
2  * Header for ni_labpc ISA/PCMCIA/PCI drivers
3  *
4  * Copyright (C) 2003 Frank Mori Hess <fmhess@users.sourceforge.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  */
16
17 #ifndef _NI_LABPC_H
18 #define _NI_LABPC_H
19
20 enum transfer_type { fifo_not_empty_transfer, fifo_half_full_transfer,
21         isa_dma_transfer
22 };
23
24 struct labpc_boardinfo {
25         const char *name;
26         int ai_speed;                   /* maximum input speed in ns */
27         unsigned ai_scan_up:1;          /* can auto scan up in ai channels */
28         unsigned has_ao:1;              /* has analog outputs */
29         unsigned is_labpc1200:1;        /* has extra regs compared to pc+ */
30 };
31
32 struct labpc_private {
33         struct comedi_isadma *dma;
34         struct comedi_8254 *counter;
35
36         /*  number of data points left to be taken */
37         unsigned long long count;
38         /*  software copys of bits written to command registers */
39         unsigned int cmd1;
40         unsigned int cmd2;
41         unsigned int cmd3;
42         unsigned int cmd4;
43         unsigned int cmd5;
44         unsigned int cmd6;
45         /*  store last read of board status registers */
46         unsigned int stat1;
47         unsigned int stat2;
48
49         /* we are using dma/fifo-half-full/etc. */
50         enum transfer_type current_transfer;
51         /*
52          * function pointers so we can use inb/outb or readb/writeb as
53          * appropriate
54          */
55         unsigned int (*read_byte)(struct comedi_device *, unsigned long reg);
56         void (*write_byte)(struct comedi_device *,
57                            unsigned int byte, unsigned long reg);
58 };
59
60 int labpc_common_attach(struct comedi_device *dev,
61                         unsigned int irq, unsigned long isr_flags);
62 void labpc_common_detach(struct comedi_device *dev);
63
64 #endif /* _NI_LABPC_H */