Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: comedi: fix up a lot of checkpatch.pl warnings

Only clean up some of the easier ones in the .h files

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: David Schleef <ds@schleef.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+703 -671
+546 -516
drivers/staging/comedi/comedi.h
··· 50 50 #define COMEDI_DEVCONF_AUX_DATA2_LENGTH 26 51 51 #define COMEDI_DEVCONF_AUX_DATA1_LENGTH 27 52 52 #define COMEDI_DEVCONF_AUX_DATA0_LENGTH 28 53 - #define COMEDI_DEVCONF_AUX_DATA_HI 29 /*most significant 32 bits of pointer address (if needed) */ 54 - #define COMEDI_DEVCONF_AUX_DATA_LO 30 /*least significant 32 bits of pointer address */ 55 - #define COMEDI_DEVCONF_AUX_DATA_LENGTH 31 /* total data length */ 53 + #define COMEDI_DEVCONF_AUX_DATA_HI 29 /* most significant 32 bits of pointer address (if needed) */ 54 + #define COMEDI_DEVCONF_AUX_DATA_LO 30 /* least significant 32 bits of pointer address */ 55 + #define COMEDI_DEVCONF_AUX_DATA_LENGTH 31 /* total data length */ 56 56 57 57 /* max length of device and driver names */ 58 58 #define COMEDI_NAMELEN 20 ··· 62 62 63 63 /* packs and unpacks a channel/range number */ 64 64 65 - #define CR_PACK(chan,rng,aref) ( (((aref)&0x3)<<24) | (((rng)&0xff)<<16) | (chan) ) 65 + #define CR_PACK(chan, rng, aref) ((((aref)&0x3)<<24) | (((rng)&0xff)<<16) | (chan)) 66 66 #define CR_PACK_FLAGS(chan, range, aref, flags) (CR_PACK(chan, range, aref) | ((flags) & CR_FLAGS_MASK)) 67 67 68 68 #define CR_CHAN(a) ((a)&0xffff) ··· 71 71 72 72 #define CR_FLAGS_MASK 0xfc000000 73 73 #define CR_ALT_FILTER (1<<26) 74 - #define CR_DITHER CR_ALT_FILTER 75 - #define CR_DEGLITCH CR_ALT_FILTER 74 + #define CR_DITHER CR_ALT_FILTER 75 + #define CR_DEGLITCH CR_ALT_FILTER 76 76 #define CR_ALT_SOURCE (1<<27) 77 - #define CR_EDGE (1<<30) 77 + #define CR_EDGE (1<<30) 78 78 #define CR_INVERT (1<<31) 79 79 80 80 #define AREF_GROUND 0x00 /* analog ref = analog ground */ ··· 110 110 #define INSN_MASK_READ 0x4000000 111 111 #define INSN_MASK_SPECIAL 0x2000000 112 112 113 - #define INSN_READ ( 0 | INSN_MASK_READ) 114 - #define INSN_WRITE ( 1 | INSN_MASK_WRITE) 115 - #define INSN_BITS ( 2 | INSN_MASK_READ|INSN_MASK_WRITE) 116 - #define INSN_CONFIG ( 3 | INSN_MASK_READ|INSN_MASK_WRITE) 117 - #define INSN_GTOD ( 4 | INSN_MASK_READ|INSN_MASK_SPECIAL) 118 - #define INSN_WAIT ( 5 | INSN_MASK_WRITE|INSN_MASK_SPECIAL) 119 - #define INSN_INTTRIG ( 6 | INSN_MASK_WRITE|INSN_MASK_SPECIAL) 113 + #define INSN_READ (0 | INSN_MASK_READ) 114 + #define INSN_WRITE (1 | INSN_MASK_WRITE) 115 + #define INSN_BITS (2 | INSN_MASK_READ|INSN_MASK_WRITE) 116 + #define INSN_CONFIG (3 | INSN_MASK_READ|INSN_MASK_WRITE) 117 + #define INSN_GTOD (4 | INSN_MASK_READ|INSN_MASK_SPECIAL) 118 + #define INSN_WAIT (5 | INSN_MASK_WRITE|INSN_MASK_SPECIAL) 119 + #define INSN_INTTRIG (6 | INSN_MASK_WRITE|INSN_MASK_SPECIAL) 120 120 121 121 /* trigger flags */ 122 122 /* These flags are used in comedi_trig structures */ ··· 124 124 #define TRIG_BOGUS 0x0001 /* do the motions */ 125 125 #define TRIG_DITHER 0x0002 /* enable dithering */ 126 126 #define TRIG_DEGLITCH 0x0004 /* enable deglitching */ 127 - //#define TRIG_RT 0x0008 /* perform op in real time */ 127 + /*#define TRIG_RT 0x0008 */ /* perform op in real time */ 128 128 #define TRIG_CONFIG 0x0010 /* perform configuration, not triggering */ 129 129 #define TRIG_WAKE_EOS 0x0020 /* wake up on end-of-scan events */ 130 - //#define TRIG_WRITE 0x0040 /* write to bidirectional devices */ 130 + /*#define TRIG_WRITE 0x0040*/ /* write to bidirectional devices */ 131 131 132 132 /* command flags */ 133 133 /* These flags are used in comedi_cmd structures */ ··· 210 210 211 211 /* subdevice types */ 212 212 213 - enum comedi_subdevice_type { 214 - COMEDI_SUBD_UNUSED, /* unused by driver */ 215 - COMEDI_SUBD_AI, /* analog input */ 216 - COMEDI_SUBD_AO, /* analog output */ 217 - COMEDI_SUBD_DI, /* digital input */ 218 - COMEDI_SUBD_DO, /* digital output */ 219 - COMEDI_SUBD_DIO, /* digital input/output */ 220 - COMEDI_SUBD_COUNTER, /* counter */ 221 - COMEDI_SUBD_TIMER, /* timer */ 222 - COMEDI_SUBD_MEMORY, /* memory, EEPROM, DPRAM */ 223 - COMEDI_SUBD_CALIB, /* calibration DACs */ 224 - COMEDI_SUBD_PROC, /* processor, DSP */ 225 - COMEDI_SUBD_SERIAL, /* serial IO */ 226 - COMEDI_SUBD_PWM /* PWM */ 227 - }; 213 + enum comedi_subdevice_type { 214 + COMEDI_SUBD_UNUSED, /* unused by driver */ 215 + COMEDI_SUBD_AI, /* analog input */ 216 + COMEDI_SUBD_AO, /* analog output */ 217 + COMEDI_SUBD_DI, /* digital input */ 218 + COMEDI_SUBD_DO, /* digital output */ 219 + COMEDI_SUBD_DIO, /* digital input/output */ 220 + COMEDI_SUBD_COUNTER, /* counter */ 221 + COMEDI_SUBD_TIMER, /* timer */ 222 + COMEDI_SUBD_MEMORY, /* memory, EEPROM, DPRAM */ 223 + COMEDI_SUBD_CALIB, /* calibration DACs */ 224 + COMEDI_SUBD_PROC, /* processor, DSP */ 225 + COMEDI_SUBD_SERIAL, /* serial IO */ 226 + COMEDI_SUBD_PWM /* PWM */ 227 + }; 228 228 229 229 /* configuration instructions */ 230 230 231 - enum configuration_ids { 232 - INSN_CONFIG_DIO_INPUT = 0, 233 - INSN_CONFIG_DIO_OUTPUT = 1, 234 - INSN_CONFIG_DIO_OPENDRAIN = 2, 235 - INSN_CONFIG_ANALOG_TRIG = 16, 236 - // INSN_CONFIG_WAVEFORM = 17, 237 - // INSN_CONFIG_TRIG = 18, 238 - // INSN_CONFIG_COUNTER = 19, 239 - INSN_CONFIG_ALT_SOURCE = 20, 240 - INSN_CONFIG_DIGITAL_TRIG = 21, 241 - INSN_CONFIG_BLOCK_SIZE = 22, 242 - INSN_CONFIG_TIMER_1 = 23, 243 - INSN_CONFIG_FILTER = 24, 244 - INSN_CONFIG_CHANGE_NOTIFY = 25, 231 + enum configuration_ids { 232 + INSN_CONFIG_DIO_INPUT = 0, 233 + INSN_CONFIG_DIO_OUTPUT = 1, 234 + INSN_CONFIG_DIO_OPENDRAIN = 2, 235 + INSN_CONFIG_ANALOG_TRIG = 16, 236 + /* INSN_CONFIG_WAVEFORM = 17, */ 237 + /* INSN_CONFIG_TRIG = 18, */ 238 + /* INSN_CONFIG_COUNTER = 19, */ 239 + INSN_CONFIG_ALT_SOURCE = 20, 240 + INSN_CONFIG_DIGITAL_TRIG = 21, 241 + INSN_CONFIG_BLOCK_SIZE = 22, 242 + INSN_CONFIG_TIMER_1 = 23, 243 + INSN_CONFIG_FILTER = 24, 244 + INSN_CONFIG_CHANGE_NOTIFY = 25, 245 245 246 - /*ALPHA*/ INSN_CONFIG_SERIAL_CLOCK = 26, 247 - INSN_CONFIG_BIDIRECTIONAL_DATA = 27, 248 - INSN_CONFIG_DIO_QUERY = 28, 249 - INSN_CONFIG_PWM_OUTPUT = 29, 250 - INSN_CONFIG_GET_PWM_OUTPUT = 30, 251 - INSN_CONFIG_ARM = 31, 252 - INSN_CONFIG_DISARM = 32, 253 - INSN_CONFIG_GET_COUNTER_STATUS = 33, 254 - INSN_CONFIG_RESET = 34, 255 - INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR = 1001, // Use CTR as single pulsegenerator 256 - INSN_CONFIG_GPCT_PULSE_TRAIN_GENERATOR = 1002, // Use CTR as pulsetraingenerator 257 - INSN_CONFIG_GPCT_QUADRATURE_ENCODER = 1003, // Use the counter as encoder 258 - INSN_CONFIG_SET_GATE_SRC = 2001, // Set gate source 259 - INSN_CONFIG_GET_GATE_SRC = 2002, // Get gate source 260 - INSN_CONFIG_SET_CLOCK_SRC = 2003, // Set master clock source 261 - INSN_CONFIG_GET_CLOCK_SRC = 2004, // Get master clock source 262 - INSN_CONFIG_SET_OTHER_SRC = 2005, // Set other source 263 - // INSN_CONFIG_GET_OTHER_SRC = 2006, // Get other source 264 - INSN_CONFIG_GET_HARDWARE_BUFFER_SIZE, // Get size in bytes of subdevice's on-board fifos used during streaming input/output 265 - INSN_CONFIG_SET_COUNTER_MODE = 4097, 266 - INSN_CONFIG_8254_SET_MODE = INSN_CONFIG_SET_COUNTER_MODE, /* deprecated */ 267 - INSN_CONFIG_8254_READ_STATUS = 4098, 268 - INSN_CONFIG_SET_ROUTING = 4099, 269 - INSN_CONFIG_GET_ROUTING = 4109, 246 + /*ALPHA*/ INSN_CONFIG_SERIAL_CLOCK = 26, 247 + INSN_CONFIG_BIDIRECTIONAL_DATA = 27, 248 + INSN_CONFIG_DIO_QUERY = 28, 249 + INSN_CONFIG_PWM_OUTPUT = 29, 250 + INSN_CONFIG_GET_PWM_OUTPUT = 30, 251 + INSN_CONFIG_ARM = 31, 252 + INSN_CONFIG_DISARM = 32, 253 + INSN_CONFIG_GET_COUNTER_STATUS = 33, 254 + INSN_CONFIG_RESET = 34, 255 + INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR = 1001, /* Use CTR as single pulsegenerator */ 256 + INSN_CONFIG_GPCT_PULSE_TRAIN_GENERATOR = 1002, /* Use CTR as pulsetraingenerator */ 257 + INSN_CONFIG_GPCT_QUADRATURE_ENCODER = 1003, /* Use the counter as encoder */ 258 + INSN_CONFIG_SET_GATE_SRC = 2001, /* Set gate source */ 259 + INSN_CONFIG_GET_GATE_SRC = 2002, /* Get gate source */ 260 + INSN_CONFIG_SET_CLOCK_SRC = 2003, /* Set master clock source */ 261 + INSN_CONFIG_GET_CLOCK_SRC = 2004, /* Get master clock source */ 262 + INSN_CONFIG_SET_OTHER_SRC = 2005, /* Set other source */ 263 + /* INSN_CONFIG_GET_OTHER_SRC = 2006,*/ /* Get other source */ 264 + INSN_CONFIG_GET_HARDWARE_BUFFER_SIZE, /* Get size in bytes of 265 + subdevice's on-board fifos 266 + used during streaming 267 + input/output */ 268 + INSN_CONFIG_SET_COUNTER_MODE = 4097, 269 + INSN_CONFIG_8254_SET_MODE = INSN_CONFIG_SET_COUNTER_MODE, /* deprecated */ 270 + INSN_CONFIG_8254_READ_STATUS = 4098, 271 + INSN_CONFIG_SET_ROUTING = 4099, 272 + INSN_CONFIG_GET_ROUTING = 4109, 270 273 /* PWM */ 271 - INSN_CONFIG_PWM_SET_PERIOD = 5000, /* sets frequency */ 272 - INSN_CONFIG_PWM_GET_PERIOD = 5001, /* gets frequency */ 273 - INSN_CONFIG_GET_PWM_STATUS = 5002, /* is it running? */ 274 - INSN_CONFIG_PWM_SET_H_BRIDGE = 5003, /* sets H bridge: duty cycle and sign bit for a relay at the same time*/ 275 - INSN_CONFIG_PWM_GET_H_BRIDGE = 5004 /* gets H bridge data: duty cycle and the sign bit */ 276 - }; 274 + INSN_CONFIG_PWM_SET_PERIOD = 5000, /* sets frequency */ 275 + INSN_CONFIG_PWM_GET_PERIOD = 5001, /* gets frequency */ 276 + INSN_CONFIG_GET_PWM_STATUS = 5002, /* is it running? */ 277 + INSN_CONFIG_PWM_SET_H_BRIDGE = 5003, /* sets H bridge: duty cycle and sign bit for a relay at the same time*/ 278 + INSN_CONFIG_PWM_GET_H_BRIDGE = 5004 /* gets H bridge data: duty cycle and the sign bit */ 279 + }; 277 280 278 - enum comedi_io_direction { 279 - COMEDI_INPUT = 0, 280 - COMEDI_OUTPUT = 1, 281 - COMEDI_OPENDRAIN = 2 282 - }; 281 + enum comedi_io_direction { 282 + COMEDI_INPUT = 0, 283 + COMEDI_OUTPUT = 1, 284 + COMEDI_OPENDRAIN = 2 285 + }; 283 286 284 - enum comedi_support_level 285 - { 286 - COMEDI_UNKNOWN_SUPPORT = 0, 287 - COMEDI_SUPPORTED, 288 - COMEDI_UNSUPPORTED 289 - }; 287 + enum comedi_support_level { 288 + COMEDI_UNKNOWN_SUPPORT = 0, 289 + COMEDI_SUPPORTED, 290 + COMEDI_UNSUPPORTED 291 + }; 290 292 291 293 /* ioctls */ 292 294 293 295 #define CIO 'd' 294 - #define COMEDI_DEVCONFIG _IOW(CIO,0,comedi_devconfig) 295 - #define COMEDI_DEVINFO _IOR(CIO,1,comedi_devinfo) 296 - #define COMEDI_SUBDINFO _IOR(CIO,2,comedi_subdinfo) 297 - #define COMEDI_CHANINFO _IOR(CIO,3,comedi_chaninfo) 298 - #define COMEDI_TRIG _IOWR(CIO,4,comedi_trig) 299 - #define COMEDI_LOCK _IO(CIO,5) 300 - #define COMEDI_UNLOCK _IO(CIO,6) 301 - #define COMEDI_CANCEL _IO(CIO,7) 302 - #define COMEDI_RANGEINFO _IOR(CIO,8,comedi_rangeinfo) 303 - #define COMEDI_CMD _IOR(CIO,9,comedi_cmd) 304 - #define COMEDI_CMDTEST _IOR(CIO,10,comedi_cmd) 305 - #define COMEDI_INSNLIST _IOR(CIO,11,comedi_insnlist) 306 - #define COMEDI_INSN _IOR(CIO,12,comedi_insn) 307 - #define COMEDI_BUFCONFIG _IOR(CIO,13,comedi_bufconfig) 308 - #define COMEDI_BUFINFO _IOWR(CIO,14,comedi_bufinfo) 309 - #define COMEDI_POLL _IO(CIO,15) 296 + #define COMEDI_DEVCONFIG _IOW(CIO, 0, comedi_devconfig) 297 + #define COMEDI_DEVINFO _IOR(CIO, 1, comedi_devinfo) 298 + #define COMEDI_SUBDINFO _IOR(CIO, 2, comedi_subdinfo) 299 + #define COMEDI_CHANINFO _IOR(CIO, 3, comedi_chaninfo) 300 + #define COMEDI_TRIG _IOWR(CIO, 4, comedi_trig) 301 + #define COMEDI_LOCK _IO(CIO, 5) 302 + #define COMEDI_UNLOCK _IO(CIO, 6) 303 + #define COMEDI_CANCEL _IO(CIO, 7) 304 + #define COMEDI_RANGEINFO _IOR(CIO, 8, comedi_rangeinfo) 305 + #define COMEDI_CMD _IOR(CIO, 9, comedi_cmd) 306 + #define COMEDI_CMDTEST _IOR(CIO, 10, comedi_cmd) 307 + #define COMEDI_INSNLIST _IOR(CIO, 11, comedi_insnlist) 308 + #define COMEDI_INSN _IOR(CIO, 12, comedi_insn) 309 + #define COMEDI_BUFCONFIG _IOR(CIO, 13, comedi_bufconfig) 310 + #define COMEDI_BUFINFO _IOWR(CIO, 14, comedi_bufinfo) 311 + #define COMEDI_POLL _IO(CIO, 15) 310 312 311 313 /* structures */ 312 314 313 - typedef struct comedi_trig_struct comedi_trig; 314 - typedef struct comedi_cmd_struct comedi_cmd; 315 - typedef struct comedi_insn_struct comedi_insn; 316 - typedef struct comedi_insnlist_struct comedi_insnlist; 317 - typedef struct comedi_chaninfo_struct comedi_chaninfo; 318 - typedef struct comedi_subdinfo_struct comedi_subdinfo; 319 - typedef struct comedi_devinfo_struct comedi_devinfo; 320 - typedef struct comedi_devconfig_struct comedi_devconfig; 321 - typedef struct comedi_rangeinfo_struct comedi_rangeinfo; 322 - typedef struct comedi_krange_struct comedi_krange; 323 - typedef struct comedi_bufconfig_struct comedi_bufconfig; 324 - typedef struct comedi_bufinfo_struct comedi_bufinfo; 315 + typedef struct comedi_trig_struct comedi_trig; 316 + typedef struct comedi_cmd_struct comedi_cmd; 317 + typedef struct comedi_insn_struct comedi_insn; 318 + typedef struct comedi_insnlist_struct comedi_insnlist; 319 + typedef struct comedi_chaninfo_struct comedi_chaninfo; 320 + typedef struct comedi_subdinfo_struct comedi_subdinfo; 321 + typedef struct comedi_devinfo_struct comedi_devinfo; 322 + typedef struct comedi_devconfig_struct comedi_devconfig; 323 + typedef struct comedi_rangeinfo_struct comedi_rangeinfo; 324 + typedef struct comedi_krange_struct comedi_krange; 325 + typedef struct comedi_bufconfig_struct comedi_bufconfig; 326 + typedef struct comedi_bufinfo_struct comedi_bufinfo; 325 327 326 - struct comedi_trig_struct { 327 - unsigned int subdev; /* subdevice */ 328 - unsigned int mode; /* mode */ 329 - unsigned int flags; 330 - unsigned int n_chan; /* number of channels */ 331 - unsigned int *chanlist; /* channel/range list */ 332 - sampl_t *data; /* data list, size depends on subd flags */ 333 - unsigned int n; /* number of scans */ 334 - unsigned int trigsrc; 335 - unsigned int trigvar; 336 - unsigned int trigvar1; 337 - unsigned int data_len; 338 - unsigned int unused[3]; 339 - }; 328 + struct comedi_trig_struct { 329 + unsigned int subdev; /* subdevice */ 330 + unsigned int mode; /* mode */ 331 + unsigned int flags; 332 + unsigned int n_chan; /* number of channels */ 333 + unsigned int *chanlist; /* channel/range list */ 334 + sampl_t *data; /* data list, size depends on subd flags */ 335 + unsigned int n; /* number of scans */ 336 + unsigned int trigsrc; 337 + unsigned int trigvar; 338 + unsigned int trigvar1; 339 + unsigned int data_len; 340 + unsigned int unused[3]; 341 + }; 340 342 341 - struct comedi_insn_struct { 342 - unsigned int insn; 343 - unsigned int n; 344 - lsampl_t *data; 345 - unsigned int subdev; 346 - unsigned int chanspec; 347 - unsigned int unused[3]; 348 - }; 343 + struct comedi_insn_struct { 344 + unsigned int insn; 345 + unsigned int n; 346 + lsampl_t *data; 347 + unsigned int subdev; 348 + unsigned int chanspec; 349 + unsigned int unused[3]; 350 + }; 349 351 350 - struct comedi_insnlist_struct { 351 - unsigned int n_insns; 352 - comedi_insn *insns; 353 - }; 352 + struct comedi_insnlist_struct { 353 + unsigned int n_insns; 354 + comedi_insn *insns; 355 + }; 354 356 355 - struct comedi_cmd_struct { 356 - unsigned int subdev; 357 - unsigned int flags; 357 + struct comedi_cmd_struct { 358 + unsigned int subdev; 359 + unsigned int flags; 358 360 359 - unsigned int start_src; 360 - unsigned int start_arg; 361 + unsigned int start_src; 362 + unsigned int start_arg; 361 363 362 - unsigned int scan_begin_src; 363 - unsigned int scan_begin_arg; 364 + unsigned int scan_begin_src; 365 + unsigned int scan_begin_arg; 364 366 365 - unsigned int convert_src; 366 - unsigned int convert_arg; 367 + unsigned int convert_src; 368 + unsigned int convert_arg; 367 369 368 - unsigned int scan_end_src; 369 - unsigned int scan_end_arg; 370 + unsigned int scan_end_src; 371 + unsigned int scan_end_arg; 370 372 371 - unsigned int stop_src; 372 - unsigned int stop_arg; 373 + unsigned int stop_src; 374 + unsigned int stop_arg; 373 375 374 - unsigned int *chanlist; /* channel/range list */ 375 - unsigned int chanlist_len; 376 + unsigned int *chanlist; /* channel/range list */ 377 + unsigned int chanlist_len; 376 378 377 - sampl_t *data; /* data list, size depends on subd flags */ 378 - unsigned int data_len; 379 - }; 379 + sampl_t *data; /* data list, size depends on subd flags */ 380 + unsigned int data_len; 381 + }; 380 382 381 - struct comedi_chaninfo_struct { 382 - unsigned int subdev; 383 - lsampl_t *maxdata_list; 384 - unsigned int *flaglist; 385 - unsigned int *rangelist; 386 - unsigned int unused[4]; 387 - }; 383 + struct comedi_chaninfo_struct { 384 + unsigned int subdev; 385 + lsampl_t *maxdata_list; 386 + unsigned int *flaglist; 387 + unsigned int *rangelist; 388 + unsigned int unused[4]; 389 + }; 388 390 389 - struct comedi_rangeinfo_struct { 390 - unsigned int range_type; 391 - void *range_ptr; 392 - }; 391 + struct comedi_rangeinfo_struct { 392 + unsigned int range_type; 393 + void *range_ptr; 394 + }; 393 395 394 - struct comedi_krange_struct { 395 - int min; /* fixed point, multiply by 1e-6 */ 396 - int max; /* fixed point, multiply by 1e-6 */ 397 - unsigned int flags; 398 - }; 396 + struct comedi_krange_struct { 397 + int min; /* fixed point, multiply by 1e-6 */ 398 + int max; /* fixed point, multiply by 1e-6 */ 399 + unsigned int flags; 400 + }; 399 401 400 402 401 - struct comedi_subdinfo_struct { 402 - unsigned int type; 403 - unsigned int n_chan; 404 - unsigned int subd_flags; 405 - unsigned int timer_type; 406 - unsigned int len_chanlist; 407 - lsampl_t maxdata; 408 - unsigned int flags; /* channel flags */ 409 - unsigned int range_type; /* lookup in kernel */ 410 - unsigned int settling_time_0; 411 - unsigned insn_bits_support; /* see support_level enum for values*/ 412 - unsigned int unused[8]; 413 - }; 403 + struct comedi_subdinfo_struct { 404 + unsigned int type; 405 + unsigned int n_chan; 406 + unsigned int subd_flags; 407 + unsigned int timer_type; 408 + unsigned int len_chanlist; 409 + lsampl_t maxdata; 410 + unsigned int flags; /* channel flags */ 411 + unsigned int range_type; /* lookup in kernel */ 412 + unsigned int settling_time_0; 413 + unsigned insn_bits_support; /* see support_level enum for values*/ 414 + unsigned int unused[8]; 415 + }; 414 416 415 - struct comedi_devinfo_struct { 416 - unsigned int version_code; 417 - unsigned int n_subdevs; 418 - char driver_name[COMEDI_NAMELEN]; 419 - char board_name[COMEDI_NAMELEN]; 420 - int read_subdevice; 421 - int write_subdevice; 422 - int unused[30]; 423 - }; 417 + struct comedi_devinfo_struct { 418 + unsigned int version_code; 419 + unsigned int n_subdevs; 420 + char driver_name[COMEDI_NAMELEN]; 421 + char board_name[COMEDI_NAMELEN]; 422 + int read_subdevice; 423 + int write_subdevice; 424 + int unused[30]; 425 + }; 424 426 425 - struct comedi_devconfig_struct { 426 - char board_name[COMEDI_NAMELEN]; 427 - int options[COMEDI_NDEVCONFOPTS]; 428 - }; 427 + struct comedi_devconfig_struct { 428 + char board_name[COMEDI_NAMELEN]; 429 + int options[COMEDI_NDEVCONFOPTS]; 430 + }; 429 431 430 - struct comedi_bufconfig_struct { 431 - unsigned int subdevice; 432 - unsigned int flags; 432 + struct comedi_bufconfig_struct { 433 + unsigned int subdevice; 434 + unsigned int flags; 433 435 434 - unsigned int maximum_size; 435 - unsigned int size; 436 + unsigned int maximum_size; 437 + unsigned int size; 436 438 437 - unsigned int unused[4]; 438 - }; 439 + unsigned int unused[4]; 440 + }; 439 441 440 - struct comedi_bufinfo_struct { 441 - unsigned int subdevice; 442 - unsigned int bytes_read; 442 + struct comedi_bufinfo_struct { 443 + unsigned int subdevice; 444 + unsigned int bytes_read; 443 445 444 - unsigned int buf_write_ptr; 445 - unsigned int buf_read_ptr; 446 - unsigned int buf_write_count; 447 - unsigned int buf_read_count; 446 + unsigned int buf_write_ptr; 447 + unsigned int buf_read_ptr; 448 + unsigned int buf_write_count; 449 + unsigned int buf_read_count; 448 450 449 - unsigned int bytes_written; 451 + unsigned int bytes_written; 450 452 451 - unsigned int unused[4]; 452 - }; 453 + unsigned int unused[4]; 454 + }; 453 455 454 456 /* range stuff */ 455 457 456 - #define __RANGE(a,b) ((((a)&0xffff)<<16)|((b)&0xffff)) 458 + #define __RANGE(a, b) ((((a)&0xffff)<<16)|((b)&0xffff)) 457 459 458 460 #define RANGE_OFFSET(a) (((a)>>16)&0xffff) 459 461 #define RANGE_LENGTH(b) ((b)&0xffff) ··· 496 494 497 495 0 ID: INSN_CONFIG_8254_READ_STATUS 498 496 1 <-- Status byte returned here. 499 - B7=Output 500 - B6=NULL Count 501 - B5-B0 Current mode. 497 + B7 = Output 498 + B6 = NULL Count 499 + B5 - B0 Current mode. 502 500 503 501 */ 504 502 505 - enum i8254_mode { 506 - I8254_MODE0 = (0 << 1), /* Interrupt on terminal count */ 507 - I8254_MODE1 = (1 << 1), /* Hardware retriggerable one-shot */ 508 - I8254_MODE2 = (2 << 1), /* Rate generator */ 509 - I8254_MODE3 = (3 << 1), /* Square wave mode */ 510 - I8254_MODE4 = (4 << 1), /* Software triggered strobe */ 511 - I8254_MODE5 = (5 << 1), /* Hardware triggered strobe (retriggerable) */ 512 - I8254_BCD = 1, /* use binary-coded decimal instead of binary (pretty useless) */ 513 - I8254_BINARY = 0 514 - }; 503 + enum i8254_mode { 504 + I8254_MODE0 = (0 << 1), /* Interrupt on terminal count */ 505 + I8254_MODE1 = (1 << 1), /* Hardware retriggerable one-shot */ 506 + I8254_MODE2 = (2 << 1), /* Rate generator */ 507 + I8254_MODE3 = (3 << 1), /* Square wave mode */ 508 + I8254_MODE4 = (4 << 1), /* Software triggered strobe */ 509 + I8254_MODE5 = (5 << 1), /* Hardware triggered strobe (retriggerable) */ 510 + I8254_BCD = 1, /* use binary-coded decimal instead of binary (pretty useless) */ 511 + I8254_BINARY = 0 512 + }; 515 513 516 - static inline unsigned NI_USUAL_PFI_SELECT(unsigned pfi_channel) { 517 - if (pfi_channel < 10) 518 - return 0x1 + pfi_channel; 519 - else 520 - return 0xb + pfi_channel; 521 - } static inline unsigned NI_USUAL_RTSI_SELECT(unsigned rtsi_channel) { 522 - if (rtsi_channel < 7) 523 - return 0xb + rtsi_channel; 524 - else 525 - return 0x1b; 526 - } 527 - /* mode bits for NI general-purpose counters, set with INSN_CONFIG_SET_COUNTER_MODE */ 514 + static inline unsigned NI_USUAL_PFI_SELECT(unsigned pfi_channel) 515 + { 516 + if (pfi_channel < 10) 517 + return 0x1 + pfi_channel; 518 + else 519 + return 0xb + pfi_channel; 520 + } 521 + static inline unsigned NI_USUAL_RTSI_SELECT(unsigned rtsi_channel) 522 + { 523 + if (rtsi_channel < 7) 524 + return 0xb + rtsi_channel; 525 + else 526 + return 0x1b; 527 + } 528 + /* mode bits for NI general-purpose counters, set with 529 + * INSN_CONFIG_SET_COUNTER_MODE */ 528 530 #define NI_GPCT_COUNTING_MODE_SHIFT 16 529 531 #define NI_GPCT_INDEX_PHASE_BITSHIFT 20 530 532 #define NI_GPCT_COUNTING_DIRECTION_SHIFT 24 531 - enum ni_gpct_mode_bits { 532 - NI_GPCT_GATE_ON_BOTH_EDGES_BIT = 0x4, 533 - NI_GPCT_EDGE_GATE_MODE_MASK = 0x18, 534 - NI_GPCT_EDGE_GATE_STARTS_STOPS_BITS = 0x0, 535 - NI_GPCT_EDGE_GATE_STOPS_STARTS_BITS = 0x8, 536 - NI_GPCT_EDGE_GATE_STARTS_BITS = 0x10, 537 - NI_GPCT_EDGE_GATE_NO_STARTS_NO_STOPS_BITS = 0x18, 538 - NI_GPCT_STOP_MODE_MASK = 0x60, 539 - NI_GPCT_STOP_ON_GATE_BITS = 0x00, 540 - NI_GPCT_STOP_ON_GATE_OR_TC_BITS = 0x20, 541 - NI_GPCT_STOP_ON_GATE_OR_SECOND_TC_BITS = 0x40, 542 - NI_GPCT_LOAD_B_SELECT_BIT = 0x80, 543 - NI_GPCT_OUTPUT_MODE_MASK = 0x300, 544 - NI_GPCT_OUTPUT_TC_PULSE_BITS = 0x100, 545 - NI_GPCT_OUTPUT_TC_TOGGLE_BITS = 0x200, 546 - NI_GPCT_OUTPUT_TC_OR_GATE_TOGGLE_BITS = 0x300, 547 - NI_GPCT_HARDWARE_DISARM_MASK = 0xc00, 548 - NI_GPCT_NO_HARDWARE_DISARM_BITS = 0x000, 549 - NI_GPCT_DISARM_AT_TC_BITS = 0x400, 550 - NI_GPCT_DISARM_AT_GATE_BITS = 0x800, 551 - NI_GPCT_DISARM_AT_TC_OR_GATE_BITS = 0xc00, 552 - NI_GPCT_LOADING_ON_TC_BIT = 0x1000, 553 - NI_GPCT_LOADING_ON_GATE_BIT = 0x4000, 554 - NI_GPCT_COUNTING_MODE_MASK = 0x7 << NI_GPCT_COUNTING_MODE_SHIFT, 555 - NI_GPCT_COUNTING_MODE_NORMAL_BITS = 556 - 0x0 << NI_GPCT_COUNTING_MODE_SHIFT, 557 - NI_GPCT_COUNTING_MODE_QUADRATURE_X1_BITS = 558 - 0x1 << NI_GPCT_COUNTING_MODE_SHIFT, 559 - NI_GPCT_COUNTING_MODE_QUADRATURE_X2_BITS = 560 - 0x2 << NI_GPCT_COUNTING_MODE_SHIFT, 561 - NI_GPCT_COUNTING_MODE_QUADRATURE_X4_BITS = 562 - 0x3 << NI_GPCT_COUNTING_MODE_SHIFT, 563 - NI_GPCT_COUNTING_MODE_TWO_PULSE_BITS = 564 - 0x4 << NI_GPCT_COUNTING_MODE_SHIFT, 565 - NI_GPCT_COUNTING_MODE_SYNC_SOURCE_BITS = 566 - 0x6 << NI_GPCT_COUNTING_MODE_SHIFT, 567 - NI_GPCT_INDEX_PHASE_MASK = 0x3 << NI_GPCT_INDEX_PHASE_BITSHIFT, 568 - NI_GPCT_INDEX_PHASE_LOW_A_LOW_B_BITS = 569 - 0x0 << NI_GPCT_INDEX_PHASE_BITSHIFT, 570 - NI_GPCT_INDEX_PHASE_LOW_A_HIGH_B_BITS = 571 - 0x1 << NI_GPCT_INDEX_PHASE_BITSHIFT, 572 - NI_GPCT_INDEX_PHASE_HIGH_A_LOW_B_BITS = 573 - 0x2 << NI_GPCT_INDEX_PHASE_BITSHIFT, 574 - NI_GPCT_INDEX_PHASE_HIGH_A_HIGH_B_BITS = 575 - 0x3 << NI_GPCT_INDEX_PHASE_BITSHIFT, 576 - NI_GPCT_INDEX_ENABLE_BIT = 0x400000, 577 - NI_GPCT_COUNTING_DIRECTION_MASK = 578 - 0x3 << NI_GPCT_COUNTING_DIRECTION_SHIFT, 579 - NI_GPCT_COUNTING_DIRECTION_DOWN_BITS = 580 - 0x00 << NI_GPCT_COUNTING_DIRECTION_SHIFT, 581 - NI_GPCT_COUNTING_DIRECTION_UP_BITS = 582 - 0x1 << NI_GPCT_COUNTING_DIRECTION_SHIFT, 583 - NI_GPCT_COUNTING_DIRECTION_HW_UP_DOWN_BITS = 584 - 0x2 << NI_GPCT_COUNTING_DIRECTION_SHIFT, 585 - NI_GPCT_COUNTING_DIRECTION_HW_GATE_BITS = 586 - 0x3 << NI_GPCT_COUNTING_DIRECTION_SHIFT, 587 - NI_GPCT_RELOAD_SOURCE_MASK = 0xc000000, 588 - NI_GPCT_RELOAD_SOURCE_FIXED_BITS = 0x0, 589 - NI_GPCT_RELOAD_SOURCE_SWITCHING_BITS = 0x4000000, 590 - NI_GPCT_RELOAD_SOURCE_GATE_SELECT_BITS = 0x8000000, 591 - NI_GPCT_OR_GATE_BIT = 0x10000000, 592 - NI_GPCT_INVERT_OUTPUT_BIT = 0x20000000 593 - }; 533 + enum ni_gpct_mode_bits { 534 + NI_GPCT_GATE_ON_BOTH_EDGES_BIT = 0x4, 535 + NI_GPCT_EDGE_GATE_MODE_MASK = 0x18, 536 + NI_GPCT_EDGE_GATE_STARTS_STOPS_BITS = 0x0, 537 + NI_GPCT_EDGE_GATE_STOPS_STARTS_BITS = 0x8, 538 + NI_GPCT_EDGE_GATE_STARTS_BITS = 0x10, 539 + NI_GPCT_EDGE_GATE_NO_STARTS_NO_STOPS_BITS = 0x18, 540 + NI_GPCT_STOP_MODE_MASK = 0x60, 541 + NI_GPCT_STOP_ON_GATE_BITS = 0x00, 542 + NI_GPCT_STOP_ON_GATE_OR_TC_BITS = 0x20, 543 + NI_GPCT_STOP_ON_GATE_OR_SECOND_TC_BITS = 0x40, 544 + NI_GPCT_LOAD_B_SELECT_BIT = 0x80, 545 + NI_GPCT_OUTPUT_MODE_MASK = 0x300, 546 + NI_GPCT_OUTPUT_TC_PULSE_BITS = 0x100, 547 + NI_GPCT_OUTPUT_TC_TOGGLE_BITS = 0x200, 548 + NI_GPCT_OUTPUT_TC_OR_GATE_TOGGLE_BITS = 0x300, 549 + NI_GPCT_HARDWARE_DISARM_MASK = 0xc00, 550 + NI_GPCT_NO_HARDWARE_DISARM_BITS = 0x000, 551 + NI_GPCT_DISARM_AT_TC_BITS = 0x400, 552 + NI_GPCT_DISARM_AT_GATE_BITS = 0x800, 553 + NI_GPCT_DISARM_AT_TC_OR_GATE_BITS = 0xc00, 554 + NI_GPCT_LOADING_ON_TC_BIT = 0x1000, 555 + NI_GPCT_LOADING_ON_GATE_BIT = 0x4000, 556 + NI_GPCT_COUNTING_MODE_MASK = 0x7 << NI_GPCT_COUNTING_MODE_SHIFT, 557 + NI_GPCT_COUNTING_MODE_NORMAL_BITS = 558 + 0x0 << NI_GPCT_COUNTING_MODE_SHIFT, 559 + NI_GPCT_COUNTING_MODE_QUADRATURE_X1_BITS = 560 + 0x1 << NI_GPCT_COUNTING_MODE_SHIFT, 561 + NI_GPCT_COUNTING_MODE_QUADRATURE_X2_BITS = 562 + 0x2 << NI_GPCT_COUNTING_MODE_SHIFT, 563 + NI_GPCT_COUNTING_MODE_QUADRATURE_X4_BITS = 564 + 0x3 << NI_GPCT_COUNTING_MODE_SHIFT, 565 + NI_GPCT_COUNTING_MODE_TWO_PULSE_BITS = 566 + 0x4 << NI_GPCT_COUNTING_MODE_SHIFT, 567 + NI_GPCT_COUNTING_MODE_SYNC_SOURCE_BITS = 568 + 0x6 << NI_GPCT_COUNTING_MODE_SHIFT, 569 + NI_GPCT_INDEX_PHASE_MASK = 0x3 << NI_GPCT_INDEX_PHASE_BITSHIFT, 570 + NI_GPCT_INDEX_PHASE_LOW_A_LOW_B_BITS = 571 + 0x0 << NI_GPCT_INDEX_PHASE_BITSHIFT, 572 + NI_GPCT_INDEX_PHASE_LOW_A_HIGH_B_BITS = 573 + 0x1 << NI_GPCT_INDEX_PHASE_BITSHIFT, 574 + NI_GPCT_INDEX_PHASE_HIGH_A_LOW_B_BITS = 575 + 0x2 << NI_GPCT_INDEX_PHASE_BITSHIFT, 576 + NI_GPCT_INDEX_PHASE_HIGH_A_HIGH_B_BITS = 577 + 0x3 << NI_GPCT_INDEX_PHASE_BITSHIFT, 578 + NI_GPCT_INDEX_ENABLE_BIT = 0x400000, 579 + NI_GPCT_COUNTING_DIRECTION_MASK = 580 + 0x3 << NI_GPCT_COUNTING_DIRECTION_SHIFT, 581 + NI_GPCT_COUNTING_DIRECTION_DOWN_BITS = 582 + 0x00 << NI_GPCT_COUNTING_DIRECTION_SHIFT, 583 + NI_GPCT_COUNTING_DIRECTION_UP_BITS = 584 + 0x1 << NI_GPCT_COUNTING_DIRECTION_SHIFT, 585 + NI_GPCT_COUNTING_DIRECTION_HW_UP_DOWN_BITS = 586 + 0x2 << NI_GPCT_COUNTING_DIRECTION_SHIFT, 587 + NI_GPCT_COUNTING_DIRECTION_HW_GATE_BITS = 588 + 0x3 << NI_GPCT_COUNTING_DIRECTION_SHIFT, 589 + NI_GPCT_RELOAD_SOURCE_MASK = 0xc000000, 590 + NI_GPCT_RELOAD_SOURCE_FIXED_BITS = 0x0, 591 + NI_GPCT_RELOAD_SOURCE_SWITCHING_BITS = 0x4000000, 592 + NI_GPCT_RELOAD_SOURCE_GATE_SELECT_BITS = 0x8000000, 593 + NI_GPCT_OR_GATE_BIT = 0x10000000, 594 + NI_GPCT_INVERT_OUTPUT_BIT = 0x20000000 595 + }; 594 596 595 597 /* Bits for setting a clock source with 596 598 * INSN_CONFIG_SET_CLOCK_SRC when using NI general-purpose counters. */ 597 - enum ni_gpct_clock_source_bits { 598 - NI_GPCT_CLOCK_SRC_SELECT_MASK = 0x3f, 599 - NI_GPCT_TIMEBASE_1_CLOCK_SRC_BITS = 0x0, 600 - NI_GPCT_TIMEBASE_2_CLOCK_SRC_BITS = 0x1, 601 - NI_GPCT_TIMEBASE_3_CLOCK_SRC_BITS = 0x2, 602 - NI_GPCT_LOGIC_LOW_CLOCK_SRC_BITS = 0x3, 603 - NI_GPCT_NEXT_GATE_CLOCK_SRC_BITS = 0x4, 604 - NI_GPCT_NEXT_TC_CLOCK_SRC_BITS = 0x5, 605 - NI_GPCT_SOURCE_PIN_i_CLOCK_SRC_BITS = 0x6, /* NI 660x-specific */ 606 - NI_GPCT_PXI10_CLOCK_SRC_BITS = 0x7, 607 - NI_GPCT_PXI_STAR_TRIGGER_CLOCK_SRC_BITS = 0x8, 608 - NI_GPCT_ANALOG_TRIGGER_OUT_CLOCK_SRC_BITS = 0x9, 609 - NI_GPCT_PRESCALE_MODE_CLOCK_SRC_MASK = 0x30000000, 610 - NI_GPCT_NO_PRESCALE_CLOCK_SRC_BITS = 0x0, 611 - NI_GPCT_PRESCALE_X2_CLOCK_SRC_BITS = 0x10000000, /* divide source by 2 */ 612 - NI_GPCT_PRESCALE_X8_CLOCK_SRC_BITS = 0x20000000, /* divide source by 8 */ 613 - NI_GPCT_INVERT_CLOCK_SRC_BIT = 0x80000000 614 - }; 615 - static inline unsigned NI_GPCT_SOURCE_PIN_CLOCK_SRC_BITS(unsigned n) { /* NI 660x-specific */ 616 - return 0x10 + n; 617 - } 618 - static inline unsigned NI_GPCT_RTSI_CLOCK_SRC_BITS(unsigned n) { 619 - return 0x18 + n; 620 - } 621 - static inline unsigned NI_GPCT_PFI_CLOCK_SRC_BITS(unsigned n) { /* no pfi on NI 660x */ 622 - return 0x20 + n; 623 - } 599 + enum ni_gpct_clock_source_bits { 600 + NI_GPCT_CLOCK_SRC_SELECT_MASK = 0x3f, 601 + NI_GPCT_TIMEBASE_1_CLOCK_SRC_BITS = 0x0, 602 + NI_GPCT_TIMEBASE_2_CLOCK_SRC_BITS = 0x1, 603 + NI_GPCT_TIMEBASE_3_CLOCK_SRC_BITS = 0x2, 604 + NI_GPCT_LOGIC_LOW_CLOCK_SRC_BITS = 0x3, 605 + NI_GPCT_NEXT_GATE_CLOCK_SRC_BITS = 0x4, 606 + NI_GPCT_NEXT_TC_CLOCK_SRC_BITS = 0x5, 607 + NI_GPCT_SOURCE_PIN_i_CLOCK_SRC_BITS = 0x6, /* NI 660x-specific */ 608 + NI_GPCT_PXI10_CLOCK_SRC_BITS = 0x7, 609 + NI_GPCT_PXI_STAR_TRIGGER_CLOCK_SRC_BITS = 0x8, 610 + NI_GPCT_ANALOG_TRIGGER_OUT_CLOCK_SRC_BITS = 0x9, 611 + NI_GPCT_PRESCALE_MODE_CLOCK_SRC_MASK = 0x30000000, 612 + NI_GPCT_NO_PRESCALE_CLOCK_SRC_BITS = 0x0, 613 + NI_GPCT_PRESCALE_X2_CLOCK_SRC_BITS = 0x10000000, /* divide source by 2 */ 614 + NI_GPCT_PRESCALE_X8_CLOCK_SRC_BITS = 0x20000000, /* divide source by 8 */ 615 + NI_GPCT_INVERT_CLOCK_SRC_BIT = 0x80000000 616 + }; 617 + static inline unsigned NI_GPCT_SOURCE_PIN_CLOCK_SRC_BITS(unsigned n) 618 + { 619 + /* NI 660x-specific */ 620 + return 0x10 + n; 621 + } 622 + static inline unsigned NI_GPCT_RTSI_CLOCK_SRC_BITS(unsigned n) 623 + { 624 + return 0x18 + n; 625 + } 626 + static inline unsigned NI_GPCT_PFI_CLOCK_SRC_BITS(unsigned n) 627 + { 628 + /* no pfi on NI 660x */ 629 + return 0x20 + n; 630 + } 624 631 625 632 /* Possibilities for setting a gate source with 626 633 INSN_CONFIG_SET_GATE_SRC when using NI general-purpose counters. 627 634 May be bitwise-or'd with CR_EDGE or CR_INVERT. */ 628 - enum ni_gpct_gate_select { 629 - /* m-series gates */ 630 - NI_GPCT_TIMESTAMP_MUX_GATE_SELECT = 0x0, 631 - NI_GPCT_AI_START2_GATE_SELECT = 0x12, 632 - NI_GPCT_PXI_STAR_TRIGGER_GATE_SELECT = 0x13, 633 - NI_GPCT_NEXT_OUT_GATE_SELECT = 0x14, 634 - NI_GPCT_AI_START1_GATE_SELECT = 0x1c, 635 - NI_GPCT_NEXT_SOURCE_GATE_SELECT = 0x1d, 636 - NI_GPCT_ANALOG_TRIGGER_OUT_GATE_SELECT = 0x1e, 637 - NI_GPCT_LOGIC_LOW_GATE_SELECT = 0x1f, 638 - /* more gates for 660x */ 639 - NI_GPCT_SOURCE_PIN_i_GATE_SELECT = 0x100, 640 - NI_GPCT_GATE_PIN_i_GATE_SELECT = 0x101, 641 - /* more gates for 660x "second gate" */ 642 - NI_GPCT_UP_DOWN_PIN_i_GATE_SELECT = 0x201, 643 - NI_GPCT_SELECTED_GATE_GATE_SELECT = 0x21e, 644 - /* m-series "second gate" sources are unknown, 645 - we should add them here with an offset of 0x300 when known. */ 646 - NI_GPCT_DISABLED_GATE_SELECT = 0x8000, 647 - }; 648 - static inline unsigned NI_GPCT_GATE_PIN_GATE_SELECT(unsigned n) { 649 - return 0x102 + n; 650 - } 651 - static inline unsigned NI_GPCT_RTSI_GATE_SELECT(unsigned n) { 652 - return NI_USUAL_RTSI_SELECT(n); 653 - } 654 - static inline unsigned NI_GPCT_PFI_GATE_SELECT(unsigned n) { 655 - return NI_USUAL_PFI_SELECT(n); 656 - } 657 - static inline unsigned NI_GPCT_UP_DOWN_PIN_GATE_SELECT(unsigned n) { 658 - return 0x202 + n; 659 - } 635 + enum ni_gpct_gate_select { 636 + /* m-series gates */ 637 + NI_GPCT_TIMESTAMP_MUX_GATE_SELECT = 0x0, 638 + NI_GPCT_AI_START2_GATE_SELECT = 0x12, 639 + NI_GPCT_PXI_STAR_TRIGGER_GATE_SELECT = 0x13, 640 + NI_GPCT_NEXT_OUT_GATE_SELECT = 0x14, 641 + NI_GPCT_AI_START1_GATE_SELECT = 0x1c, 642 + NI_GPCT_NEXT_SOURCE_GATE_SELECT = 0x1d, 643 + NI_GPCT_ANALOG_TRIGGER_OUT_GATE_SELECT = 0x1e, 644 + NI_GPCT_LOGIC_LOW_GATE_SELECT = 0x1f, 645 + /* more gates for 660x */ 646 + NI_GPCT_SOURCE_PIN_i_GATE_SELECT = 0x100, 647 + NI_GPCT_GATE_PIN_i_GATE_SELECT = 0x101, 648 + /* more gates for 660x "second gate" */ 649 + NI_GPCT_UP_DOWN_PIN_i_GATE_SELECT = 0x201, 650 + NI_GPCT_SELECTED_GATE_GATE_SELECT = 0x21e, 651 + /* m-series "second gate" sources are unknown, 652 + we should add them here with an offset of 0x300 when known. */ 653 + NI_GPCT_DISABLED_GATE_SELECT = 0x8000, 654 + }; 655 + static inline unsigned NI_GPCT_GATE_PIN_GATE_SELECT(unsigned n) 656 + { 657 + return 0x102 + n; 658 + } 659 + static inline unsigned NI_GPCT_RTSI_GATE_SELECT(unsigned n) 660 + { 661 + return NI_USUAL_RTSI_SELECT(n); 662 + } 663 + static inline unsigned NI_GPCT_PFI_GATE_SELECT(unsigned n) 664 + { 665 + return NI_USUAL_PFI_SELECT(n); 666 + } 667 + static inline unsigned NI_GPCT_UP_DOWN_PIN_GATE_SELECT(unsigned n) 668 + { 669 + return 0x202 + n; 670 + } 660 671 661 672 /* Possibilities for setting a source with 662 673 INSN_CONFIG_SET_OTHER_SRC when using NI general-purpose counters. */ 663 - enum ni_gpct_other_index { 664 - NI_GPCT_SOURCE_ENCODER_A, 665 - NI_GPCT_SOURCE_ENCODER_B, 666 - NI_GPCT_SOURCE_ENCODER_Z 667 - }; 668 - enum ni_gpct_other_select { 669 - /* m-series gates */ 670 - // Still unknown, probably only need NI_GPCT_PFI_OTHER_SELECT 671 - NI_GPCT_DISABLED_OTHER_SELECT = 0x8000, 672 - }; 673 - static inline unsigned NI_GPCT_PFI_OTHER_SELECT(unsigned n) { 674 - return NI_USUAL_PFI_SELECT(n); 675 - } 674 + enum ni_gpct_other_index { 675 + NI_GPCT_SOURCE_ENCODER_A, 676 + NI_GPCT_SOURCE_ENCODER_B, 677 + NI_GPCT_SOURCE_ENCODER_Z 678 + }; 679 + enum ni_gpct_other_select { 680 + /* m-series gates */ 681 + /* Still unknown, probably only need NI_GPCT_PFI_OTHER_SELECT */ 682 + NI_GPCT_DISABLED_OTHER_SELECT = 0x8000, 683 + }; 684 + static inline unsigned NI_GPCT_PFI_OTHER_SELECT(unsigned n) 685 + { 686 + return NI_USUAL_PFI_SELECT(n); 687 + } 676 688 677 689 /* start sources for ni general-purpose counters for use with 678 690 INSN_CONFIG_ARM */ 679 - enum ni_gpct_arm_source { 680 - NI_GPCT_ARM_IMMEDIATE = 0x0, 681 - NI_GPCT_ARM_PAIRED_IMMEDIATE = 0x1, /* Start both the counter and the adjacent paired counter simultaneously */ 682 - /* NI doesn't document bits for selecting hardware arm triggers. If 683 - the NI_GPCT_ARM_UNKNOWN bit is set, we will pass the least significant 684 - bits (3 bits for 660x or 5 bits for m-series) through to the hardware. 685 - This will at least allow someone to figure out what the bits do later. */ 686 - NI_GPCT_ARM_UNKNOWN = 0x1000, 687 - }; 691 + enum ni_gpct_arm_source { 692 + NI_GPCT_ARM_IMMEDIATE = 0x0, 693 + NI_GPCT_ARM_PAIRED_IMMEDIATE = 0x1, /* Start both the counter and 694 + the adjacent paired counter 695 + simultaneously */ 696 + /* NI doesn't document bits for selecting hardware arm triggers. If 697 + * the NI_GPCT_ARM_UNKNOWN bit is set, we will pass the least 698 + * significant bits (3 bits for 660x or 5 bits for m-series) through to 699 + * the hardware. This will at least allow someone to figure out what 700 + * the bits do later. */ 701 + NI_GPCT_ARM_UNKNOWN = 0x1000, 702 + }; 688 703 689 704 /* digital filtering options for ni 660x for use with INSN_CONFIG_FILTER. */ 690 - enum ni_gpct_filter_select { 691 - NI_GPCT_FILTER_OFF = 0x0, 692 - NI_GPCT_FILTER_TIMEBASE_3_SYNC = 0x1, 693 - NI_GPCT_FILTER_100x_TIMEBASE_1 = 0x2, 694 - NI_GPCT_FILTER_20x_TIMEBASE_1 = 0x3, 695 - NI_GPCT_FILTER_10x_TIMEBASE_1 = 0x4, 696 - NI_GPCT_FILTER_2x_TIMEBASE_1 = 0x5, 697 - NI_GPCT_FILTER_2x_TIMEBASE_3 = 0x6 698 - }; 705 + enum ni_gpct_filter_select { 706 + NI_GPCT_FILTER_OFF = 0x0, 707 + NI_GPCT_FILTER_TIMEBASE_3_SYNC = 0x1, 708 + NI_GPCT_FILTER_100x_TIMEBASE_1 = 0x2, 709 + NI_GPCT_FILTER_20x_TIMEBASE_1 = 0x3, 710 + NI_GPCT_FILTER_10x_TIMEBASE_1 = 0x4, 711 + NI_GPCT_FILTER_2x_TIMEBASE_1 = 0x5, 712 + NI_GPCT_FILTER_2x_TIMEBASE_3 = 0x6 713 + }; 699 714 700 - /* PFI digital filtering options for ni m-series for use with INSN_CONFIG_FILTER. */ 701 - enum ni_pfi_filter_select { 702 - NI_PFI_FILTER_OFF = 0x0, 703 - NI_PFI_FILTER_125ns = 0x1, 704 - NI_PFI_FILTER_6425ns = 0x2, 705 - NI_PFI_FILTER_2550us = 0x3 706 - }; 715 + /* PFI digital filtering options for ni m-series for use with 716 + * INSN_CONFIG_FILTER. */ 717 + enum ni_pfi_filter_select { 718 + NI_PFI_FILTER_OFF = 0x0, 719 + NI_PFI_FILTER_125ns = 0x1, 720 + NI_PFI_FILTER_6425ns = 0x2, 721 + NI_PFI_FILTER_2550us = 0x3 722 + }; 707 723 708 724 /* master clock sources for ni mio boards and INSN_CONFIG_SET_CLOCK_SRC */ 709 - enum ni_mio_clock_source { 710 - NI_MIO_INTERNAL_CLOCK = 0, 711 - NI_MIO_RTSI_CLOCK = 1, /* doesn't work for m-series, use NI_MIO_PLL_RTSI_CLOCK() */ 712 - /* the NI_MIO_PLL_* sources are m-series only */ 713 - NI_MIO_PLL_PXI_STAR_TRIGGER_CLOCK = 2, 714 - NI_MIO_PLL_PXI10_CLOCK = 3, 715 - NI_MIO_PLL_RTSI0_CLOCK = 4 716 - }; 717 - static inline unsigned NI_MIO_PLL_RTSI_CLOCK(unsigned rtsi_channel) { 718 - return NI_MIO_PLL_RTSI0_CLOCK + rtsi_channel; 719 - } 725 + enum ni_mio_clock_source { 726 + NI_MIO_INTERNAL_CLOCK = 0, 727 + NI_MIO_RTSI_CLOCK = 1, /* doesn't work for m-series, use 728 + NI_MIO_PLL_RTSI_CLOCK() */ 729 + /* the NI_MIO_PLL_* sources are m-series only */ 730 + NI_MIO_PLL_PXI_STAR_TRIGGER_CLOCK = 2, 731 + NI_MIO_PLL_PXI10_CLOCK = 3, 732 + NI_MIO_PLL_RTSI0_CLOCK = 4 733 + }; 734 + static inline unsigned NI_MIO_PLL_RTSI_CLOCK(unsigned rtsi_channel) 735 + { 736 + return NI_MIO_PLL_RTSI0_CLOCK + rtsi_channel; 737 + } 720 738 721 739 /* Signals which can be routed to an NI RTSI pin with INSN_CONFIG_SET_ROUTING. 722 740 The numbers assigned are not arbitrary, they correspond to the bits required 723 741 to program the board. */ 724 - enum ni_rtsi_routing { 725 - NI_RTSI_OUTPUT_ADR_START1 = 0, 726 - NI_RTSI_OUTPUT_ADR_START2 = 1, 727 - NI_RTSI_OUTPUT_SCLKG = 2, 728 - NI_RTSI_OUTPUT_DACUPDN = 3, 729 - NI_RTSI_OUTPUT_DA_START1 = 4, 730 - NI_RTSI_OUTPUT_G_SRC0 = 5, 731 - NI_RTSI_OUTPUT_G_GATE0 = 6, 732 - NI_RTSI_OUTPUT_RGOUT0 = 7, 733 - NI_RTSI_OUTPUT_RTSI_BRD_0 = 8, 734 - NI_RTSI_OUTPUT_RTSI_OSC = 12 /* pre-m-series always have RTSI clock on line 7 */ 735 - }; 736 - static inline unsigned NI_RTSI_OUTPUT_RTSI_BRD(unsigned n) { 737 - return NI_RTSI_OUTPUT_RTSI_BRD_0 + n; 738 - } 742 + enum ni_rtsi_routing { 743 + NI_RTSI_OUTPUT_ADR_START1 = 0, 744 + NI_RTSI_OUTPUT_ADR_START2 = 1, 745 + NI_RTSI_OUTPUT_SCLKG = 2, 746 + NI_RTSI_OUTPUT_DACUPDN = 3, 747 + NI_RTSI_OUTPUT_DA_START1 = 4, 748 + NI_RTSI_OUTPUT_G_SRC0 = 5, 749 + NI_RTSI_OUTPUT_G_GATE0 = 6, 750 + NI_RTSI_OUTPUT_RGOUT0 = 7, 751 + NI_RTSI_OUTPUT_RTSI_BRD_0 = 8, 752 + NI_RTSI_OUTPUT_RTSI_OSC = 12 /* pre-m-series always have RTSI clock 753 + on line 7 */ 754 + }; 755 + static inline unsigned NI_RTSI_OUTPUT_RTSI_BRD(unsigned n) 756 + { 757 + return NI_RTSI_OUTPUT_RTSI_BRD_0 + n; 758 + } 739 759 740 - /* Signals which can be routed to an NI PFI pin on an m-series board 741 - with INSN_CONFIG_SET_ROUTING. These numbers are also returned 742 - by INSN_CONFIG_GET_ROUTING on pre-m-series boards, even though 743 - their routing cannot be changed. The numbers assigned are 744 - not arbitrary, they correspond to the bits required 745 - to program the board. */ 746 - enum ni_pfi_routing { 747 - NI_PFI_OUTPUT_PFI_DEFAULT = 0, 748 - NI_PFI_OUTPUT_AI_START1 = 1, 749 - NI_PFI_OUTPUT_AI_START2 = 2, 750 - NI_PFI_OUTPUT_AI_CONVERT = 3, 751 - NI_PFI_OUTPUT_G_SRC1 = 4, 752 - NI_PFI_OUTPUT_G_GATE1 = 5, 753 - NI_PFI_OUTPUT_AO_UPDATE_N = 6, 754 - NI_PFI_OUTPUT_AO_START1 = 7, 755 - NI_PFI_OUTPUT_AI_START_PULSE = 8, 756 - NI_PFI_OUTPUT_G_SRC0 = 9, 757 - NI_PFI_OUTPUT_G_GATE0 = 10, 758 - NI_PFI_OUTPUT_EXT_STROBE = 11, 759 - NI_PFI_OUTPUT_AI_EXT_MUX_CLK = 12, 760 - NI_PFI_OUTPUT_GOUT0 = 13, 761 - NI_PFI_OUTPUT_GOUT1 = 14, 762 - NI_PFI_OUTPUT_FREQ_OUT = 15, 763 - NI_PFI_OUTPUT_PFI_DO = 16, 764 - NI_PFI_OUTPUT_I_ATRIG = 17, 765 - NI_PFI_OUTPUT_RTSI0 = 18, 766 - NI_PFI_OUTPUT_PXI_STAR_TRIGGER_IN = 26, 767 - NI_PFI_OUTPUT_SCXI_TRIG1 = 27, 768 - NI_PFI_OUTPUT_DIO_CHANGE_DETECT_RTSI = 28, 769 - NI_PFI_OUTPUT_CDI_SAMPLE = 29, 770 - NI_PFI_OUTPUT_CDO_UPDATE = 30 771 - }; 772 - static inline unsigned NI_PFI_OUTPUT_RTSI(unsigned rtsi_channel) { 773 - return NI_PFI_OUTPUT_RTSI0 + rtsi_channel; 774 - } 760 + /* Signals which can be routed to an NI PFI pin on an m-series board with 761 + * INSN_CONFIG_SET_ROUTING. These numbers are also returned by 762 + * INSN_CONFIG_GET_ROUTING on pre-m-series boards, even though their routing 763 + * cannot be changed. The numbers assigned are not arbitrary, they correspond 764 + * to the bits required to program the board. */ 765 + enum ni_pfi_routing { 766 + NI_PFI_OUTPUT_PFI_DEFAULT = 0, 767 + NI_PFI_OUTPUT_AI_START1 = 1, 768 + NI_PFI_OUTPUT_AI_START2 = 2, 769 + NI_PFI_OUTPUT_AI_CONVERT = 3, 770 + NI_PFI_OUTPUT_G_SRC1 = 4, 771 + NI_PFI_OUTPUT_G_GATE1 = 5, 772 + NI_PFI_OUTPUT_AO_UPDATE_N = 6, 773 + NI_PFI_OUTPUT_AO_START1 = 7, 774 + NI_PFI_OUTPUT_AI_START_PULSE = 8, 775 + NI_PFI_OUTPUT_G_SRC0 = 9, 776 + NI_PFI_OUTPUT_G_GATE0 = 10, 777 + NI_PFI_OUTPUT_EXT_STROBE = 11, 778 + NI_PFI_OUTPUT_AI_EXT_MUX_CLK = 12, 779 + NI_PFI_OUTPUT_GOUT0 = 13, 780 + NI_PFI_OUTPUT_GOUT1 = 14, 781 + NI_PFI_OUTPUT_FREQ_OUT = 15, 782 + NI_PFI_OUTPUT_PFI_DO = 16, 783 + NI_PFI_OUTPUT_I_ATRIG = 17, 784 + NI_PFI_OUTPUT_RTSI0 = 18, 785 + NI_PFI_OUTPUT_PXI_STAR_TRIGGER_IN = 26, 786 + NI_PFI_OUTPUT_SCXI_TRIG1 = 27, 787 + NI_PFI_OUTPUT_DIO_CHANGE_DETECT_RTSI = 28, 788 + NI_PFI_OUTPUT_CDI_SAMPLE = 29, 789 + NI_PFI_OUTPUT_CDO_UPDATE = 30 790 + }; 791 + static inline unsigned NI_PFI_OUTPUT_RTSI(unsigned rtsi_channel) 792 + { 793 + return NI_PFI_OUTPUT_RTSI0 + rtsi_channel; 794 + } 775 795 776 796 /* Signals which can be routed to output on a NI PFI pin on a 660x board 777 797 with INSN_CONFIG_SET_ROUTING. The numbers assigned are ··· 801 777 to program the board. Lines 0 to 7 can only be set to 802 778 NI_660X_PFI_OUTPUT_DIO. Lines 32 to 39 can only be set to 803 779 NI_660X_PFI_OUTPUT_COUNTER. */ 804 - enum ni_660x_pfi_routing { 805 - NI_660X_PFI_OUTPUT_COUNTER = 1, // counter 806 - NI_660X_PFI_OUTPUT_DIO = 2, // static digital output 807 - }; 780 + enum ni_660x_pfi_routing { 781 + NI_660X_PFI_OUTPUT_COUNTER = 1, /* counter */ 782 + NI_660X_PFI_OUTPUT_DIO = 2, /* static digital output */ 783 + }; 808 784 809 - /* NI External Trigger lines. These values are not arbitrary, but are related to 810 - the bits required to program the board (offset by 1 for historical reasons). */ 811 - static inline unsigned NI_EXT_PFI(unsigned pfi_channel) { 812 - return NI_USUAL_PFI_SELECT(pfi_channel) - 1; 813 - } 814 - static inline unsigned NI_EXT_RTSI(unsigned rtsi_channel) { 815 - return NI_USUAL_RTSI_SELECT(rtsi_channel) - 1; 816 - } 785 + /* NI External Trigger lines. These values are not arbitrary, but are related 786 + * to the bits required to program the board (offset by 1 for historical 787 + * reasons). */ 788 + static inline unsigned NI_EXT_PFI(unsigned pfi_channel) 789 + { 790 + return NI_USUAL_PFI_SELECT(pfi_channel) - 1; 791 + } 792 + static inline unsigned NI_EXT_RTSI(unsigned rtsi_channel) 793 + { 794 + return NI_USUAL_RTSI_SELECT(rtsi_channel) - 1; 795 + } 817 796 818 797 /* status bits for INSN_CONFIG_GET_COUNTER_STATUS */ 819 - enum comedi_counter_status_flags { 820 - COMEDI_COUNTER_ARMED = 0x1, 821 - COMEDI_COUNTER_COUNTING = 0x2, 822 - COMEDI_COUNTER_TERMINAL_COUNT = 0x4, 823 - }; 798 + enum comedi_counter_status_flags { 799 + COMEDI_COUNTER_ARMED = 0x1, 800 + COMEDI_COUNTER_COUNTING = 0x2, 801 + COMEDI_COUNTER_TERMINAL_COUNT = 0x4, 802 + }; 824 803 825 - /* Clock sources for CDIO subdevice on NI m-series boards. 826 - Used as the scan_begin_arg for a comedi_command. These 827 - sources may also be bitwise-or'd with CR_INVERT to change polarity. */ 828 - enum ni_m_series_cdio_scan_begin_src { 829 - NI_CDIO_SCAN_BEGIN_SRC_GROUND = 0, 830 - NI_CDIO_SCAN_BEGIN_SRC_AI_START = 18, 831 - NI_CDIO_SCAN_BEGIN_SRC_AI_CONVERT = 19, 832 - NI_CDIO_SCAN_BEGIN_SRC_PXI_STAR_TRIGGER = 20, 833 - NI_CDIO_SCAN_BEGIN_SRC_G0_OUT = 28, 834 - NI_CDIO_SCAN_BEGIN_SRC_G1_OUT = 29, 835 - NI_CDIO_SCAN_BEGIN_SRC_ANALOG_TRIGGER = 30, 836 - NI_CDIO_SCAN_BEGIN_SRC_AO_UPDATE = 31, 837 - NI_CDIO_SCAN_BEGIN_SRC_FREQ_OUT = 32, 838 - NI_CDIO_SCAN_BEGIN_SRC_DIO_CHANGE_DETECT_IRQ = 33 839 - }; 840 - static inline unsigned NI_CDIO_SCAN_BEGIN_SRC_PFI(unsigned pfi_channel) { 841 - return NI_USUAL_PFI_SELECT(pfi_channel); 842 - } 843 - static inline unsigned NI_CDIO_SCAN_BEGIN_SRC_RTSI(unsigned 844 - rtsi_channel) { 845 - return NI_USUAL_RTSI_SELECT(rtsi_channel); 846 - } 804 + /* Clock sources for CDIO subdevice on NI m-series boards. Used as the 805 + * scan_begin_arg for a comedi_command. These sources may also be bitwise-or'd 806 + * with CR_INVERT to change polarity. */ 807 + enum ni_m_series_cdio_scan_begin_src { 808 + NI_CDIO_SCAN_BEGIN_SRC_GROUND = 0, 809 + NI_CDIO_SCAN_BEGIN_SRC_AI_START = 18, 810 + NI_CDIO_SCAN_BEGIN_SRC_AI_CONVERT = 19, 811 + NI_CDIO_SCAN_BEGIN_SRC_PXI_STAR_TRIGGER = 20, 812 + NI_CDIO_SCAN_BEGIN_SRC_G0_OUT = 28, 813 + NI_CDIO_SCAN_BEGIN_SRC_G1_OUT = 29, 814 + NI_CDIO_SCAN_BEGIN_SRC_ANALOG_TRIGGER = 30, 815 + NI_CDIO_SCAN_BEGIN_SRC_AO_UPDATE = 31, 816 + NI_CDIO_SCAN_BEGIN_SRC_FREQ_OUT = 32, 817 + NI_CDIO_SCAN_BEGIN_SRC_DIO_CHANGE_DETECT_IRQ = 33 818 + }; 819 + static inline unsigned NI_CDIO_SCAN_BEGIN_SRC_PFI(unsigned pfi_channel) 820 + { 821 + return NI_USUAL_PFI_SELECT(pfi_channel); 822 + } 823 + static inline unsigned NI_CDIO_SCAN_BEGIN_SRC_RTSI(unsigned rtsi_channel) 824 + { 825 + return NI_USUAL_RTSI_SELECT(rtsi_channel); 826 + } 847 827 848 - /* scan_begin_src for scan_begin_arg==TRIG_EXT with analog output command 849 - on NI boards. These scan begin sources can also be bitwise-or'd with 850 - CR_INVERT to change polarity. */ 851 - static inline unsigned NI_AO_SCAN_BEGIN_SRC_PFI(unsigned pfi_channel) { 852 - return NI_USUAL_PFI_SELECT(pfi_channel); 853 - } 854 - static inline unsigned NI_AO_SCAN_BEGIN_SRC_RTSI(unsigned rtsi_channel) { 855 - return NI_USUAL_RTSI_SELECT(rtsi_channel); 856 - } 828 + /* scan_begin_src for scan_begin_arg==TRIG_EXT with analog output command on NI 829 + * boards. These scan begin sources can also be bitwise-or'd with CR_INVERT to 830 + * change polarity. */ 831 + static inline unsigned NI_AO_SCAN_BEGIN_SRC_PFI(unsigned pfi_channel) 832 + { 833 + return NI_USUAL_PFI_SELECT(pfi_channel); 834 + } 835 + static inline unsigned NI_AO_SCAN_BEGIN_SRC_RTSI(unsigned rtsi_channel) 836 + { 837 + return NI_USUAL_RTSI_SELECT(rtsi_channel); 838 + } 857 839 858 840 /* Bits for setting a clock source with 859 841 * INSN_CONFIG_SET_CLOCK_SRC when using NI frequency output subdevice. */ 860 - enum ni_freq_out_clock_source_bits { 861 - NI_FREQ_OUT_TIMEBASE_1_DIV_2_CLOCK_SRC, // 10 MHz 862 - NI_FREQ_OUT_TIMEBASE_2_CLOCK_SRC // 100 KHz 863 - }; 842 + enum ni_freq_out_clock_source_bits { 843 + NI_FREQ_OUT_TIMEBASE_1_DIV_2_CLOCK_SRC, /* 10 MHz */ 844 + NI_FREQ_OUT_TIMEBASE_2_CLOCK_SRC /* 100 KHz */ 845 + }; 864 846 865 847 /* Values for setting a clock source with INSN_CONFIG_SET_CLOCK_SRC for 866 848 * 8254 counter subdevices on Amplicon DIO boards (amplc_dio200 driver). */
+4 -4
drivers/staging/comedi/comedi_compat32.h
··· 36 36 37 37 extern long comedi_compat_ioctl(struct file *file, unsigned int cmd, 38 38 unsigned long arg); 39 - #define comedi_register_ioctl32() do{}while(0) 40 - #define comedi_unregister_ioctl32() do{}while(0) 39 + #define comedi_register_ioctl32() do {} while (0) 40 + #define comedi_unregister_ioctl32() do {} while (0) 41 41 42 42 #else /* HAVE_COMPAT_IOCTL */ 43 43 ··· 50 50 #else /* CONFIG_COMPAT */ 51 51 52 52 #define comedi_compat_ioctl 0 /* NULL */ 53 - #define comedi_register_ioctl32() do{}while(0) 54 - #define comedi_unregister_ioctl32() do{}while(0) 53 + #define comedi_register_ioctl32() do {} while (0) 54 + #define comedi_unregister_ioctl32() do {} while (0) 55 55 56 56 #endif /* CONFIG_COMPAT */ 57 57
+1 -1
drivers/staging/comedi/comedi_fops.h
··· 5 5 extern struct class *comedi_class; 6 6 extern const struct file_operations comedi_fops; 7 7 8 - #endif //_COMEDI_FOPS_H 8 + #endif /* _COMEDI_FOPS_H */
+17 -17
drivers/staging/comedi/comedi_rt.h
··· 45 45 #ifdef CONFIG_COMEDI_RTL 46 46 #include <rtl_core.h> 47 47 #include <rtl_time.h> 48 - //#ifdef RTLINUX_VERSION_CODE 48 + /* #ifdef RTLINUX_VERSION_CODE */ 49 49 #include <rtl_sync.h> 50 - //#endif 50 + /* #endif */ 51 51 #define rt_printk rtl_printf 52 52 #endif 53 53 #ifdef CONFIG_COMEDI_FUSION 54 - #define rt_printk(format, args...) printk(format , ## args ) 54 + #define rt_printk(format, args...) printk(format , ## args) 55 55 #endif /* CONFIG_COMEDI_FUSION */ 56 56 #ifdef CONFIG_PRIORITY_IRQ 57 57 #define rt_printk printk ··· 59 59 60 60 int comedi_request_irq(unsigned int irq, irqreturn_t(*handler) (int, 61 61 void *PT_REGS_ARG), unsigned long flags, const char *device, 62 - comedi_device * dev_id); 63 - void comedi_free_irq(unsigned int irq, comedi_device * dev_id); 62 + comedi_device *dev_id); 63 + void comedi_free_irq(unsigned int irq, comedi_device *dev_id); 64 64 void comedi_rt_init(void); 65 65 void comedi_rt_cleanup(void); 66 - int comedi_switch_to_rt(comedi_device * dev); 67 - void comedi_switch_to_non_rt(comedi_device * dev); 68 - void comedi_rt_pend_wakeup(wait_queue_head_t * q); 66 + int comedi_switch_to_rt(comedi_device *dev); 67 + void comedi_switch_to_non_rt(comedi_device *dev); 68 + void comedi_rt_pend_wakeup(wait_queue_head_t *q); 69 69 extern int rt_pend_call(void (*func) (int arg1, void *arg2), int arg1, 70 70 void *arg2); 71 71 72 72 #else 73 73 74 - #define comedi_request_irq(a,b,c,d,e) request_irq(a,b,c,d,e) 75 - #define comedi_free_irq(a,b) free_irq(a,b) 76 - #define comedi_rt_init() do{}while(0) 77 - #define comedi_rt_cleanup() do{}while(0) 74 + #define comedi_request_irq(a, b, c, d, e) request_irq(a, b, c, d, e) 75 + #define comedi_free_irq(a, b) free_irq(a, b) 76 + #define comedi_rt_init() do {} while (0) 77 + #define comedi_rt_cleanup() do {} while (0) 78 78 #define comedi_switch_to_rt(a) (-1) 79 - #define comedi_switch_to_non_rt(a) do{}while(0) 80 - #define comedi_rt_pend_wakeup(a) do{}while(0) 79 + #define comedi_switch_to_non_rt(a) do {} while (0) 80 + #define comedi_rt_pend_wakeup(a) do {} while (0) 81 81 82 - #define rt_printk(format,args...) printk(format,##args) 82 + #define rt_printk(format, args...) printk(format, ##args) 83 83 84 84 #endif 85 85 ··· 89 89 #define comedi_spin_lock_irqsave(lock_ptr, flags) \ 90 90 (flags = __comedi_spin_lock_irqsave(lock_ptr)) 91 91 92 - static inline unsigned long __comedi_spin_lock_irqsave(spinlock_t * lock_ptr) 92 + static inline unsigned long __comedi_spin_lock_irqsave(spinlock_t *lock_ptr) 93 93 { 94 94 unsigned long flags; 95 95 ··· 112 112 return flags; 113 113 } 114 114 115 - static inline void comedi_spin_unlock_irqrestore(spinlock_t * lock_ptr, 115 + static inline void comedi_spin_unlock_irqrestore(spinlock_t *lock_ptr, 116 116 unsigned long flags) 117 117 { 118 118
+83 -75
drivers/staging/comedi/comedidev.h
··· 39 39 #include <linux/mm.h> 40 40 #include <linux/interrupt.h> 41 41 #include <linux/dma-mapping.h> 42 - #include <asm/uaccess.h> 43 - #include <asm/io.h> 42 + #include <linux/uaccess.h> 43 + #include <linux/io.h> 44 44 45 45 #include "comedi.h" 46 46 47 - #define DPRINTK(format, args...) do{ \ 48 - if(comedi_debug)printk("comedi: " format , ## args ); \ 49 - } while(0) 47 + #define DPRINTK(format, args...) do { \ 48 + if (comedi_debug) \ 49 + printk(KERN_DEBUG "comedi: " format , ## args); \ 50 + } while (0) 50 51 51 - #define COMEDI_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 52 - #define COMEDI_VERSION_CODE COMEDI_VERSION(COMEDI_MAJORVERSION,COMEDI_MINORVERSION,COMEDI_MICROVERSION) 52 + #define COMEDI_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) 53 + #define COMEDI_VERSION_CODE COMEDI_VERSION(COMEDI_MAJORVERSION, COMEDI_MINORVERSION, COMEDI_MICROVERSION) 53 54 #define COMEDI_RELEASE VERSION 54 55 55 56 #define COMEDI_INITCLEANUP_NOMODULE(x) \ ··· 83 82 static struct pci_driver comedi_driver ## _pci_driver = \ 84 83 { \ 85 84 .id_table = pci_id_table, \ 86 - .probe = & comedi_driver ## _pci_probe, \ 87 - .remove = __devexit_p(& comedi_driver ## _pci_remove) \ 85 + .probe = &comedi_driver ## _pci_probe, \ 86 + .remove = __devexit_p(&comedi_driver ## _pci_remove) \ 88 87 }; \ 89 88 static int __init comedi_driver ## _init_module(void) \ 90 89 { \ 91 90 int retval; \ 92 - retval = comedi_driver_register(& comedi_driver); \ 93 - if(retval < 0) return retval; \ 94 - comedi_driver ## _pci_driver.name = (char*)comedi_driver.driver_name; \ 95 - return pci_register_driver(& comedi_driver ## _pci_driver); \ 91 + retval = comedi_driver_register(&comedi_driver); \ 92 + if (retval < 0) \ 93 + return retval; \ 94 + comedi_driver ## _pci_driver.name = (char *)comedi_driver.driver_name; \ 95 + return pci_register_driver(&comedi_driver ## _pci_driver); \ 96 96 } \ 97 97 static void __exit comedi_driver ## _cleanup_module(void) \ 98 98 { \ 99 - pci_unregister_driver(& comedi_driver ## _pci_driver); \ 100 - comedi_driver_unregister(& comedi_driver); \ 99 + pci_unregister_driver(&comedi_driver ## _pci_driver); \ 100 + comedi_driver_unregister(&comedi_driver); \ 101 101 } \ 102 102 module_init(comedi_driver ## _init_module); \ 103 103 module_exit(comedi_driver ## _cleanup_module); ··· 179 177 int (*do_cmdtest) (comedi_device *, comedi_subdevice *, comedi_cmd *); 180 178 int (*poll) (comedi_device *, comedi_subdevice *); 181 179 int (*cancel) (comedi_device *, comedi_subdevice *); 182 - //int (*do_lock)(comedi_device *,comedi_subdevice *); 183 - //int (*do_unlock)(comedi_device *,comedi_subdevice *); 180 + /* int (*do_lock)(comedi_device *,comedi_subdevice *); */ 181 + /* int (*do_unlock)(comedi_device *,comedi_subdevice *); */ 184 182 185 183 /* called when the buffer changes */ 186 - int (*buf_change) (comedi_device * dev, comedi_subdevice * s, 184 + int (*buf_change) (comedi_device *dev, comedi_subdevice *s, 187 185 unsigned long new_size); 188 186 189 - void (*munge) (comedi_device * dev, comedi_subdevice * s, void *data, 187 + void (*munge) (comedi_device *dev, comedi_subdevice *s, void *data, 190 188 unsigned int num_bytes, unsigned int start_chan_index); 191 189 enum dma_data_direction async_dma_dir; 192 190 ··· 236 234 237 235 wait_queue_head_t wait_head; 238 236 239 - // callback stuff 237 + /* callback stuff */ 240 238 unsigned int cb_mask; 241 239 int (*cb_func) (unsigned int flags, void *); 242 240 void *cb_arg; 243 241 244 - int (*inttrig) (comedi_device * dev, comedi_subdevice * s, 245 - unsigned int x); 242 + int (*inttrig) (comedi_device *dev, comedi_subdevice *s, 243 + unsigned int x); 246 244 }; 247 245 248 246 struct comedi_driver_struct { ··· 267 265 268 266 device_create_result_type *class_dev; 269 267 int minor; 270 - /* hw_dev is passed to dma_alloc_coherent when allocating async buffers for subdevices 271 - that have async_dma_dir set to something other than DMA_NONE */ 268 + /* hw_dev is passed to dma_alloc_coherent when allocating async buffers 269 + * for subdevices that have async_dma_dir set to something other than 270 + * DMA_NONE */ 272 271 struct device *hw_dev; 273 272 274 273 const char *board_name; ··· 292 289 293 290 struct fasync_struct *async_queue; 294 291 295 - void (*open) (comedi_device * dev); 296 - void (*close) (comedi_device * dev); 292 + void (*open) (comedi_device *dev); 293 + void (*close) (comedi_device *dev); 297 294 }; 298 295 299 296 struct comedi_device_file_info { ··· 305 302 #ifdef CONFIG_COMEDI_DEBUG 306 303 extern int comedi_debug; 307 304 #else 308 - static const int comedi_debug = 0; 305 + static const int comedi_debug; 309 306 #endif 310 307 311 308 /* 312 309 * function prototypes 313 310 */ 314 311 315 - void comedi_event(comedi_device * dev, comedi_subdevice * s); 316 - void comedi_error(const comedi_device * dev, const char *s); 312 + void comedi_event(comedi_device *dev, comedi_subdevice *s); 313 + void comedi_error(const comedi_device *dev, const char *s); 317 314 318 315 /* we can expand the number of bits used to encode devices/subdevices into 319 316 the minor number soon, after more distros support > 8 bit minor numbers ··· 325 322 static const unsigned COMEDI_SUBDEVICE_MINOR_SHIFT = 4; 326 323 static const unsigned COMEDI_SUBDEVICE_MINOR_OFFSET = 1; 327 324 328 - struct comedi_device_file_info* comedi_get_device_file_info(unsigned minor); 325 + struct comedi_device_file_info *comedi_get_device_file_info(unsigned minor); 329 326 330 - static inline comedi_subdevice* comedi_get_read_subdevice(const struct comedi_device_file_info *info) 327 + static inline comedi_subdevice *comedi_get_read_subdevice( 328 + const struct comedi_device_file_info *info) 331 329 { 332 - if(info->read_subdevice) return info->read_subdevice; 333 - if(info->device == NULL) return NULL; 330 + if (info->read_subdevice) 331 + return info->read_subdevice; 332 + if (info->device == NULL) 333 + return NULL; 334 334 return info->device->read_subdev; 335 335 } 336 336 337 - static inline comedi_subdevice* comedi_get_write_subdevice(const struct comedi_device_file_info *info) 337 + static inline comedi_subdevice *comedi_get_write_subdevice( 338 + const struct comedi_device_file_info *info) 338 339 { 339 - if(info->write_subdevice) return info->write_subdevice; 340 - if(info->device == NULL) return NULL; 340 + if (info->write_subdevice) 341 + return info->write_subdevice; 342 + if (info->device == NULL) 343 + return NULL; 341 344 return info->device->write_subdev; 342 345 } 343 346 344 - void comedi_device_detach(comedi_device * dev); 345 - int comedi_device_attach(comedi_device * dev, comedi_devconfig * it); 347 + void comedi_device_detach(comedi_device *dev); 348 + int comedi_device_attach(comedi_device *dev, comedi_devconfig *it); 346 349 int comedi_driver_register(comedi_driver *); 347 350 int comedi_driver_unregister(comedi_driver *); 348 351 ··· 357 348 void start_polling(comedi_device *); 358 349 void stop_polling(comedi_device *); 359 350 360 - int comedi_buf_alloc(comedi_device * dev, comedi_subdevice * s, unsigned long 351 + int comedi_buf_alloc(comedi_device *dev, comedi_subdevice *s, unsigned long 361 352 new_size); 362 353 363 354 #ifdef CONFIG_PROC_FS ··· 376 367 enum subdevice_runflags { 377 368 SRF_USER = 0x00000001, 378 369 SRF_RT = 0x00000002, 379 - /* indicates an COMEDI_CB_ERROR event has occurred since the last command was started */ 370 + /* indicates an COMEDI_CB_ERROR event has occurred since the last 371 + * command was started */ 380 372 SRF_ERROR = 0x00000004, 381 373 SRF_RUNNING = 0x08000000 382 374 }; ··· 386 376 various internal comedi functions 387 377 */ 388 378 389 - int do_rangeinfo_ioctl(comedi_device * dev, comedi_rangeinfo * arg); 390 - int check_chanlist(comedi_subdevice * s, int n, unsigned int *chanlist); 391 - void comedi_set_subdevice_runflags(comedi_subdevice * s, unsigned mask, 379 + int do_rangeinfo_ioctl(comedi_device *dev, comedi_rangeinfo *arg); 380 + int check_chanlist(comedi_subdevice *s, int n, unsigned int *chanlist); 381 + void comedi_set_subdevice_runflags(comedi_subdevice *s, unsigned mask, 392 382 unsigned bits); 393 - unsigned comedi_get_subdevice_runflags(comedi_subdevice * s); 394 - int insn_inval(comedi_device * dev, comedi_subdevice * s, 395 - comedi_insn * insn, lsampl_t * data); 383 + unsigned comedi_get_subdevice_runflags(comedi_subdevice *s); 384 + int insn_inval(comedi_device *dev, comedi_subdevice *s, 385 + comedi_insn *insn, lsampl_t *data); 396 386 397 387 /* range stuff */ 398 388 399 - #define RANGE(a,b) {(a)*1e6,(b)*1e6,0} 400 - #define RANGE_ext(a,b) {(a)*1e6,(b)*1e6,RF_EXTERNAL} 401 - #define RANGE_mA(a,b) {(a)*1e6,(b)*1e6,UNIT_mA} 402 - #define RANGE_unitless(a,b) {(a)*1e6,(b)*1e6,0} /* XXX */ 403 - #define BIP_RANGE(a) {-(a)*1e6,(a)*1e6,0} 404 - #define UNI_RANGE(a) {0,(a)*1e6,0} 389 + #define RANGE(a, b) {(a)*1e6, (b)*1e6, 0} 390 + #define RANGE_ext(a, b) {(a)*1e6, (b)*1e6, RF_EXTERNAL} 391 + #define RANGE_mA(a, b) {(a)*1e6, (b)*1e6, UNIT_mA} 392 + #define RANGE_unitless(a, b) {(a)*1e6, (b)*1e6, 0} /* XXX */ 393 + #define BIP_RANGE(a) {-(a)*1e6, (a)*1e6, 0} 394 + #define UNI_RANGE(a) {0, (a)*1e6, 0} 405 395 406 396 extern const comedi_lrange range_bipolar10; 407 397 extern const comedi_lrange range_bipolar5; ··· 425 415 426 416 /* some silly little inline functions */ 427 417 428 - static inline int alloc_subdevices(comedi_device * dev, 429 - unsigned int num_subdevices) 418 + static inline int alloc_subdevices(comedi_device *dev, 419 + unsigned int num_subdevices) 430 420 { 431 421 unsigned i; 432 422 ··· 444 434 return 0; 445 435 } 446 436 447 - static inline int alloc_private(comedi_device * dev, int size) 437 + static inline int alloc_private(comedi_device *dev, int size) 448 438 { 449 439 dev->private = kzalloc(size, GFP_KERNEL); 450 440 if (!dev->private) ··· 452 442 return 0; 453 443 } 454 444 455 - static inline unsigned int bytes_per_sample(const comedi_subdevice * subd) 445 + static inline unsigned int bytes_per_sample(const comedi_subdevice *subd) 456 446 { 457 447 if (subd->subdev_flags & SDF_LSAMPL) 458 448 return sizeof(lsampl_t); ··· 462 452 463 453 /* must be used in attach to set dev->hw_dev if you wish to dma directly 464 454 into comedi's buffer */ 465 - static inline void comedi_set_hw_dev(comedi_device * dev, struct device *hw_dev) 455 + static inline void comedi_set_hw_dev(comedi_device *dev, struct device *hw_dev) 466 456 { 467 - if (dev->hw_dev) { 457 + if (dev->hw_dev) 468 458 put_device(dev->hw_dev); 469 - } 459 + 470 460 dev->hw_dev = hw_dev; 471 461 if (dev->hw_dev) { 472 462 dev->hw_dev = get_device(dev->hw_dev); ··· 474 464 } 475 465 } 476 466 477 - int comedi_buf_put(comedi_async * async, sampl_t x); 478 - int comedi_buf_get(comedi_async * async, sampl_t * x); 467 + int comedi_buf_put(comedi_async *async, sampl_t x); 468 + int comedi_buf_get(comedi_async *async, sampl_t *x); 479 469 480 - unsigned int comedi_buf_write_n_available(comedi_async * async); 481 - unsigned int comedi_buf_write_alloc(comedi_async * async, unsigned int nbytes); 482 - unsigned int comedi_buf_write_alloc_strict(comedi_async * async, 470 + unsigned int comedi_buf_write_n_available(comedi_async *async); 471 + unsigned int comedi_buf_write_alloc(comedi_async *async, unsigned int nbytes); 472 + unsigned int comedi_buf_write_alloc_strict(comedi_async *async, 483 473 unsigned int nbytes); 484 - unsigned comedi_buf_write_free(comedi_async * async, unsigned int nbytes); 485 - unsigned comedi_buf_read_alloc(comedi_async * async, unsigned nbytes); 486 - unsigned comedi_buf_read_free(comedi_async * async, unsigned int nbytes); 487 - unsigned int comedi_buf_read_n_available(comedi_async * async); 488 - void comedi_buf_memcpy_to(comedi_async * async, unsigned int offset, 474 + unsigned comedi_buf_write_free(comedi_async *async, unsigned int nbytes); 475 + unsigned comedi_buf_read_alloc(comedi_async *async, unsigned nbytes); 476 + unsigned comedi_buf_read_free(comedi_async *async, unsigned int nbytes); 477 + unsigned int comedi_buf_read_n_available(comedi_async *async); 478 + void comedi_buf_memcpy_to(comedi_async *async, unsigned int offset, 489 479 const void *source, unsigned int num_bytes); 490 - void comedi_buf_memcpy_from(comedi_async * async, unsigned int offset, 480 + void comedi_buf_memcpy_from(comedi_async *async, unsigned int offset, 491 481 void *destination, unsigned int num_bytes); 492 - static inline unsigned comedi_buf_write_n_allocated(comedi_async * async) 482 + static inline unsigned comedi_buf_write_n_allocated(comedi_async *async) 493 483 { 494 484 return async->buf_write_alloc_count - async->buf_write_count; 495 485 } 496 - static inline unsigned comedi_buf_read_n_allocated(comedi_async * async) 486 + static inline unsigned comedi_buf_read_n_allocated(comedi_async *async) 497 487 { 498 488 return async->buf_read_alloc_count - async->buf_read_count; 499 489 } 500 490 501 - void comedi_reset_async_buf(comedi_async * async); 491 + void comedi_reset_async_buf(comedi_async *async); 502 492 503 493 static inline void *comedi_aux_data(int options[], int n) 504 494 { ··· 532 522 int comedi_pci_auto_config(struct pci_dev *pcidev, const char *board_name); 533 523 void comedi_pci_auto_unconfig(struct pci_dev *pcidev); 534 524 535 - //#ifdef CONFIG_COMEDI_RT 536 525 #include "comedi_rt.h" 537 - //#endif 538 526 539 527 #endif /* _COMEDIDEV_H */
+52 -52
drivers/staging/comedi/comedilib.h
··· 41 41 /* these functions may not be called at real-time priority */ 42 42 43 43 comedi_t *comedi_open(const char *path); 44 - int comedi_close(comedi_t * dev); 44 + int comedi_close(comedi_t *dev); 45 45 46 46 /* these functions may be called at any priority, but may fail at 47 47 real-time priority */ 48 48 49 - int comedi_lock(comedi_t * dev, unsigned int subdev); 50 - int comedi_unlock(comedi_t * dev, unsigned int subdev); 49 + int comedi_lock(comedi_t *dev, unsigned int subdev); 50 + int comedi_unlock(comedi_t *dev, unsigned int subdev); 51 51 52 52 /* these functions may be called at any priority, but you must hold 53 53 the lock for the subdevice */ ··· 56 56 void comedi_perror(const char *s); 57 57 char *comedi_strerror(int errnum); 58 58 int comedi_errno(void); 59 - int comedi_fileno(comedi_t * dev); 59 + int comedi_fileno(comedi_t *dev); 60 60 61 - int comedi_cancel(comedi_t * dev, unsigned int subdev); 62 - int comedi_register_callback(comedi_t * dev, unsigned int subdev, 61 + int comedi_cancel(comedi_t *dev, unsigned int subdev); 62 + int comedi_register_callback(comedi_t *dev, unsigned int subdev, 63 63 unsigned int mask, int (*cb) (unsigned int, void *), void *arg); 64 64 65 - int comedi_command(comedi_t * dev, comedi_cmd * cmd); 66 - int comedi_command_test(comedi_t * dev, comedi_cmd * cmd); 67 - int comedi_trigger(comedi_t * dev, unsigned int subdev, comedi_trig * it); 68 - int __comedi_trigger(comedi_t * dev, unsigned int subdev, comedi_trig * it); 69 - int comedi_data_write(comedi_t * dev, unsigned int subdev, unsigned int chan, 65 + int comedi_command(comedi_t *dev, comedi_cmd *cmd); 66 + int comedi_command_test(comedi_t *dev, comedi_cmd *cmd); 67 + int comedi_trigger(comedi_t *dev, unsigned int subdev, comedi_trig *it); 68 + int __comedi_trigger(comedi_t *dev, unsigned int subdev, comedi_trig *it); 69 + int comedi_data_write(comedi_t *dev, unsigned int subdev, unsigned int chan, 70 70 unsigned int range, unsigned int aref, lsampl_t data); 71 - int comedi_data_read(comedi_t * dev, unsigned int subdev, unsigned int chan, 72 - unsigned int range, unsigned int aref, lsampl_t * data); 73 - int comedi_data_read_hint(comedi_t * dev, unsigned int subdev, 71 + int comedi_data_read(comedi_t *dev, unsigned int subdev, unsigned int chan, 72 + unsigned int range, unsigned int aref, lsampl_t *data); 73 + int comedi_data_read_hint(comedi_t *dev, unsigned int subdev, 74 74 unsigned int chan, unsigned int range, unsigned int aref); 75 - int comedi_data_read_delayed(comedi_t * dev, unsigned int subdev, 75 + int comedi_data_read_delayed(comedi_t *dev, unsigned int subdev, 76 76 unsigned int chan, unsigned int range, unsigned int aref, 77 - lsampl_t * data, unsigned int nano_sec); 78 - int comedi_dio_config(comedi_t * dev, unsigned int subdev, unsigned int chan, 77 + lsampl_t *data, unsigned int nano_sec); 78 + int comedi_dio_config(comedi_t *dev, unsigned int subdev, unsigned int chan, 79 79 unsigned int io); 80 - int comedi_dio_read(comedi_t * dev, unsigned int subdev, unsigned int chan, 80 + int comedi_dio_read(comedi_t *dev, unsigned int subdev, unsigned int chan, 81 81 unsigned int *val); 82 - int comedi_dio_write(comedi_t * dev, unsigned int subdev, unsigned int chan, 82 + int comedi_dio_write(comedi_t *dev, unsigned int subdev, unsigned int chan, 83 83 unsigned int val); 84 - int comedi_dio_bitfield(comedi_t * dev, unsigned int subdev, unsigned int mask, 84 + int comedi_dio_bitfield(comedi_t *dev, unsigned int subdev, unsigned int mask, 85 85 unsigned int *bits); 86 - int comedi_get_n_subdevices(comedi_t * dev); 87 - int comedi_get_version_code(comedi_t * dev); 88 - const char *comedi_get_driver_name(comedi_t * dev); 89 - const char *comedi_get_board_name(comedi_t * dev); 90 - int comedi_get_subdevice_type(comedi_t * dev, unsigned int subdevice); 91 - int comedi_find_subdevice_by_type(comedi_t * dev, int type, unsigned int subd); 92 - int comedi_get_n_channels(comedi_t * dev, unsigned int subdevice); 93 - lsampl_t comedi_get_maxdata(comedi_t * dev, unsigned int subdevice, unsigned 86 + int comedi_get_n_subdevices(comedi_t *dev); 87 + int comedi_get_version_code(comedi_t *dev); 88 + const char *comedi_get_driver_name(comedi_t *dev); 89 + const char *comedi_get_board_name(comedi_t *dev); 90 + int comedi_get_subdevice_type(comedi_t *dev, unsigned int subdevice); 91 + int comedi_find_subdevice_by_type(comedi_t *dev, int type, unsigned int subd); 92 + int comedi_get_n_channels(comedi_t *dev, unsigned int subdevice); 93 + lsampl_t comedi_get_maxdata(comedi_t *dev, unsigned int subdevice, unsigned 94 94 int chan); 95 - int comedi_get_n_ranges(comedi_t * dev, unsigned int subdevice, unsigned int 95 + int comedi_get_n_ranges(comedi_t *dev, unsigned int subdevice, unsigned int 96 96 chan); 97 - int comedi_do_insn(comedi_t * dev, comedi_insn * insn); 98 - int comedi_poll(comedi_t * dev, unsigned int subdev); 97 + int comedi_do_insn(comedi_t *dev, comedi_insn *insn); 98 + int comedi_poll(comedi_t *dev, unsigned int subdev); 99 99 100 100 /* DEPRECATED functions */ 101 - int comedi_get_rangetype(comedi_t * dev, unsigned int subdevice, 101 + int comedi_get_rangetype(comedi_t *dev, unsigned int subdevice, 102 102 unsigned int chan); 103 103 104 104 /* ALPHA functions */ 105 - unsigned int comedi_get_subdevice_flags(comedi_t * dev, unsigned int subdevice); 106 - int comedi_get_len_chanlist(comedi_t * dev, unsigned int subdevice); 107 - int comedi_get_krange(comedi_t * dev, unsigned int subdevice, unsigned int 108 - chan, unsigned int range, comedi_krange * krange); 109 - unsigned int comedi_get_buf_head_pos(comedi_t * dev, unsigned int subdevice); 110 - int comedi_set_user_int_count(comedi_t * dev, unsigned int subdevice, 105 + unsigned int comedi_get_subdevice_flags(comedi_t *dev, unsigned int subdevice); 106 + int comedi_get_len_chanlist(comedi_t *dev, unsigned int subdevice); 107 + int comedi_get_krange(comedi_t *dev, unsigned int subdevice, unsigned int 108 + chan, unsigned int range, comedi_krange *krange); 109 + unsigned int comedi_get_buf_head_pos(comedi_t *dev, unsigned int subdevice); 110 + int comedi_set_user_int_count(comedi_t *dev, unsigned int subdevice, 111 111 unsigned int buf_user_count); 112 - int comedi_map(comedi_t * dev, unsigned int subdev, void *ptr); 113 - int comedi_unmap(comedi_t * dev, unsigned int subdev); 114 - int comedi_get_buffer_size(comedi_t * dev, unsigned int subdev); 115 - int comedi_mark_buffer_read(comedi_t * dev, unsigned int subdevice, 112 + int comedi_map(comedi_t *dev, unsigned int subdev, void *ptr); 113 + int comedi_unmap(comedi_t *dev, unsigned int subdev); 114 + int comedi_get_buffer_size(comedi_t *dev, unsigned int subdev); 115 + int comedi_mark_buffer_read(comedi_t *dev, unsigned int subdevice, 116 116 unsigned int num_bytes); 117 - int comedi_mark_buffer_written(comedi_t * d, unsigned int subdevice, 117 + int comedi_mark_buffer_written(comedi_t *d, unsigned int subdevice, 118 118 unsigned int num_bytes); 119 - int comedi_get_buffer_contents(comedi_t * dev, unsigned int subdevice); 120 - int comedi_get_buffer_offset(comedi_t * dev, unsigned int subdevice); 119 + int comedi_get_buffer_contents(comedi_t *dev, unsigned int subdevice); 120 + int comedi_get_buffer_offset(comedi_t *dev, unsigned int subdevice); 121 121 122 122 #else 123 123 ··· 139 139 int comedi_register_callback(unsigned int minor, unsigned int subdev, 140 140 unsigned int mask, int (*cb) (unsigned int, void *), void *arg); 141 141 142 - int comedi_command(unsigned int minor, comedi_cmd * cmd); 143 - int comedi_command_test(unsigned int minor, comedi_cmd * cmd); 144 - int comedi_trigger(unsigned int minor, unsigned int subdev, comedi_trig * it); 145 - int __comedi_trigger(unsigned int minor, unsigned int subdev, comedi_trig * it); 142 + int comedi_command(unsigned int minor, comedi_cmd *cmd); 143 + int comedi_command_test(unsigned int minor, comedi_cmd *cmd); 144 + int comedi_trigger(unsigned int minor, unsigned int subdev, comedi_trig *it); 145 + int __comedi_trigger(unsigned int minor, unsigned int subdev, comedi_trig *it); 146 146 int comedi_data_write(unsigned int dev, unsigned int subdev, unsigned int chan, 147 147 unsigned int range, unsigned int aref, lsampl_t data); 148 148 int comedi_data_read(unsigned int dev, unsigned int subdev, unsigned int chan, 149 - unsigned int range, unsigned int aref, lsampl_t * data); 149 + unsigned int range, unsigned int aref, lsampl_t *data); 150 150 int comedi_dio_config(unsigned int dev, unsigned int subdev, unsigned int chan, 151 151 unsigned int io); 152 152 int comedi_dio_read(unsigned int dev, unsigned int subdev, unsigned int chan, ··· 167 167 int chan); 168 168 int comedi_get_n_ranges(unsigned int minor, unsigned int subdevice, unsigned int 169 169 chan); 170 - int comedi_do_insn(unsigned int minor, comedi_insn * insn); 170 + int comedi_do_insn(unsigned int minor, comedi_insn *insn); 171 171 int comedi_poll(unsigned int minor, unsigned int subdev); 172 172 173 173 /* DEPRECATED functions */ ··· 179 179 subdevice); 180 180 int comedi_get_len_chanlist(unsigned int minor, unsigned int subdevice); 181 181 int comedi_get_krange(unsigned int minor, unsigned int subdevice, unsigned int 182 - chan, unsigned int range, comedi_krange * krange); 182 + chan, unsigned int range, comedi_krange *krange); 183 183 unsigned int comedi_get_buf_head_pos(unsigned int minor, unsigned int 184 184 subdevice); 185 185 int comedi_set_user_int_count(unsigned int minor, unsigned int subdevice,
-6
drivers/staging/comedi/wrapper.h
··· 19 19 #ifndef __COMPAT_LINUX_WRAPPER_H_ 20 20 #define __COMPAT_LINUX_WRAPPER_H_ 21 21 22 - #include <linux/version.h> 23 - 24 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) 25 22 #define mem_map_reserve(p) set_bit(PG_reserved, &((p)->flags)) 26 23 #define mem_map_unreserve(p) clear_bit(PG_reserved, &((p)->flags)) 27 - #else 28 - #include_next <linux/wrapper.h> 29 - #endif 30 24 31 25 #endif /* __COMPAT_LINUX_WRAPPER_H_ */