Staging: comedi: Remove lsampl_t and sampl_t typedefs
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / staging / comedi / comedilib.h
CommitLineData
ed9eccbe
DS
1/*
2 linux/include/comedilib.h
3 header file for kcomedilib
4
5 COMEDI - Linux Control and Measurement Device Interface
6 Copyright (C) 1998-2001 David A. Schleef <ds@schleef.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22*/
23
24#ifndef _LINUX_COMEDILIB_H
25#define _LINUX_COMEDILIB_H
26
02ebd471 27#include "comedi.h"
ed9eccbe
DS
28
29/* Kernel internal stuff. Needed by real-time modules and such. */
30
31#ifndef __KERNEL__
32#error linux/comedilib.h should not be included by non-kernel-space code
33#endif
34
35/* exported functions */
36
37#ifndef KCOMEDILIB_DEPRECATED
38
ed9eccbe
DS
39/* these functions may not be called at real-time priority */
40
0b3fb27f
BP
41void *comedi_open(const char *path);
42int comedi_close(void *dev);
ed9eccbe
DS
43
44/* these functions may be called at any priority, but may fail at
45 real-time priority */
46
0b3fb27f
BP
47int comedi_lock(void *dev, unsigned int subdev);
48int comedi_unlock(void *dev, unsigned int subdev);
ed9eccbe
DS
49
50/* these functions may be called at any priority, but you must hold
51 the lock for the subdevice */
52
53int comedi_loglevel(int loglevel);
54void comedi_perror(const char *s);
55char *comedi_strerror(int errnum);
56int comedi_errno(void);
0b3fb27f 57int comedi_fileno(void *dev);
ed9eccbe 58
0b3fb27f
BP
59int comedi_cancel(void *dev, unsigned int subdev);
60int comedi_register_callback(void *dev, unsigned int subdev,
ed9eccbe
DS
61 unsigned int mask, int (*cb) (unsigned int, void *), void *arg);
62
0b3fb27f
BP
63int comedi_command(void *dev, comedi_cmd *cmd);
64int comedi_command_test(void *dev, comedi_cmd *cmd);
65int comedi_trigger(void *dev, unsigned int subdev, comedi_trig *it);
66int __comedi_trigger(void *dev, unsigned int subdev, comedi_trig *it);
67int comedi_data_write(void *dev, unsigned int subdev, unsigned int chan,
790c5541 68 unsigned int range, unsigned int aref, unsigned int data);
0b3fb27f 69int comedi_data_read(void *dev, unsigned int subdev, unsigned int chan,
790c5541 70 unsigned int range, unsigned int aref, unsigned int *data);
0b3fb27f 71int comedi_data_read_hint(void *dev, unsigned int subdev,
ed9eccbe 72 unsigned int chan, unsigned int range, unsigned int aref);
0b3fb27f 73int comedi_data_read_delayed(void *dev, unsigned int subdev,
ed9eccbe 74 unsigned int chan, unsigned int range, unsigned int aref,
790c5541 75 unsigned int *data, unsigned int nano_sec);
0b3fb27f 76int comedi_dio_config(void *dev, unsigned int subdev, unsigned int chan,
ed9eccbe 77 unsigned int io);
0b3fb27f 78int comedi_dio_read(void *dev, unsigned int subdev, unsigned int chan,
ed9eccbe 79 unsigned int *val);
0b3fb27f 80int comedi_dio_write(void *dev, unsigned int subdev, unsigned int chan,
ed9eccbe 81 unsigned int val);
0b3fb27f 82int comedi_dio_bitfield(void *dev, unsigned int subdev, unsigned int mask,
ed9eccbe 83 unsigned int *bits);
0b3fb27f
BP
84int comedi_get_n_subdevices(void *dev);
85int comedi_get_version_code(void *dev);
86const char *comedi_get_driver_name(void *dev);
87const char *comedi_get_board_name(void *dev);
88int comedi_get_subdevice_type(void *dev, unsigned int subdevice);
89int comedi_find_subdevice_by_type(void *dev, int type, unsigned int subd);
90int comedi_get_n_channels(void *dev, unsigned int subdevice);
790c5541 91unsigned int comedi_get_maxdata(void *dev, unsigned int subdevice, unsigned
ed9eccbe 92 int chan);
0b3fb27f 93int comedi_get_n_ranges(void *dev, unsigned int subdevice, unsigned int
ed9eccbe 94 chan);
0b3fb27f
BP
95int comedi_do_insn(void *dev, comedi_insn *insn);
96int comedi_poll(void *dev, unsigned int subdev);
ed9eccbe
DS
97
98/* DEPRECATED functions */
0b3fb27f 99int comedi_get_rangetype(void *dev, unsigned int subdevice,
ed9eccbe
DS
100 unsigned int chan);
101
102/* ALPHA functions */
0b3fb27f
BP
103unsigned int comedi_get_subdevice_flags(void *dev, unsigned int subdevice);
104int comedi_get_len_chanlist(void *dev, unsigned int subdevice);
105int comedi_get_krange(void *dev, unsigned int subdevice, unsigned int
e0dcef71 106 chan, unsigned int range, comedi_krange *krange);
0b3fb27f
BP
107unsigned int comedi_get_buf_head_pos(void *dev, unsigned int subdevice);
108int comedi_set_user_int_count(void *dev, unsigned int subdevice,
ed9eccbe 109 unsigned int buf_user_count);
0b3fb27f
BP
110int comedi_map(void *dev, unsigned int subdev, void *ptr);
111int comedi_unmap(void *dev, unsigned int subdev);
112int comedi_get_buffer_size(void *dev, unsigned int subdev);
113int comedi_mark_buffer_read(void *dev, unsigned int subdevice,
ed9eccbe 114 unsigned int num_bytes);
0b3fb27f 115int comedi_mark_buffer_written(void *d, unsigned int subdevice,
ed9eccbe 116 unsigned int num_bytes);
0b3fb27f
BP
117int comedi_get_buffer_contents(void *dev, unsigned int subdevice);
118int comedi_get_buffer_offset(void *dev, unsigned int subdevice);
ed9eccbe
DS
119
120#else
121
122/* these functions may not be called at real-time priority */
123
124int comedi_open(unsigned int minor);
125void comedi_close(unsigned int minor);
126
127/* these functions may be called at any priority, but may fail at
128 real-time priority */
129
130int comedi_lock(unsigned int minor, unsigned int subdev);
131int comedi_unlock(unsigned int minor, unsigned int subdev);
132
133/* these functions may be called at any priority, but you must hold
134 the lock for the subdevice */
135
136int comedi_cancel(unsigned int minor, unsigned int subdev);
137int comedi_register_callback(unsigned int minor, unsigned int subdev,
138 unsigned int mask, int (*cb) (unsigned int, void *), void *arg);
139
e0dcef71
GKH
140int comedi_command(unsigned int minor, comedi_cmd *cmd);
141int comedi_command_test(unsigned int minor, comedi_cmd *cmd);
142int comedi_trigger(unsigned int minor, unsigned int subdev, comedi_trig *it);
143int __comedi_trigger(unsigned int minor, unsigned int subdev, comedi_trig *it);
ed9eccbe 144int comedi_data_write(unsigned int dev, unsigned int subdev, unsigned int chan,
790c5541 145 unsigned int range, unsigned int aref, unsigned int data);
ed9eccbe 146int comedi_data_read(unsigned int dev, unsigned int subdev, unsigned int chan,
790c5541 147 unsigned int range, unsigned int aref, unsigned int *data);
ed9eccbe
DS
148int comedi_dio_config(unsigned int dev, unsigned int subdev, unsigned int chan,
149 unsigned int io);
150int comedi_dio_read(unsigned int dev, unsigned int subdev, unsigned int chan,
151 unsigned int *val);
152int comedi_dio_write(unsigned int dev, unsigned int subdev, unsigned int chan,
153 unsigned int val);
154int comedi_dio_bitfield(unsigned int dev, unsigned int subdev,
155 unsigned int mask, unsigned int *bits);
156int comedi_get_n_subdevices(unsigned int dev);
157int comedi_get_version_code(unsigned int dev);
158char *comedi_get_driver_name(unsigned int dev);
159char *comedi_get_board_name(unsigned int minor);
160int comedi_get_subdevice_type(unsigned int minor, unsigned int subdevice);
161int comedi_find_subdevice_by_type(unsigned int minor, int type,
162 unsigned int subd);
163int comedi_get_n_channels(unsigned int minor, unsigned int subdevice);
790c5541 164unsigned int comedi_get_maxdata(unsigned int minor, unsigned int subdevice, unsigned
ed9eccbe
DS
165 int chan);
166int comedi_get_n_ranges(unsigned int minor, unsigned int subdevice, unsigned int
167 chan);
e0dcef71 168int comedi_do_insn(unsigned int minor, comedi_insn *insn);
ed9eccbe
DS
169int comedi_poll(unsigned int minor, unsigned int subdev);
170
171/* DEPRECATED functions */
172int comedi_get_rangetype(unsigned int minor, unsigned int subdevice,
173 unsigned int chan);
174
175/* ALPHA functions */
176unsigned int comedi_get_subdevice_flags(unsigned int minor, unsigned int
177 subdevice);
178int comedi_get_len_chanlist(unsigned int minor, unsigned int subdevice);
179int comedi_get_krange(unsigned int minor, unsigned int subdevice, unsigned int
e0dcef71 180 chan, unsigned int range, comedi_krange *krange);
ed9eccbe
DS
181unsigned int comedi_get_buf_head_pos(unsigned int minor, unsigned int
182 subdevice);
183int comedi_set_user_int_count(unsigned int minor, unsigned int subdevice,
184 unsigned int buf_user_count);
185int comedi_map(unsigned int minor, unsigned int subdev, void **ptr);
186int comedi_unmap(unsigned int minor, unsigned int subdev);
187
188#endif
189
190#endif