i2c-eg20t: change timeout value 50msec to 1000msec
[zen-stable.git] / drivers / staging / iio / trigger_consumer.h
blob60d64b3569458a7f33c96ea27caa4df908ca9d59
1 /* The industrial I/O core, trigger consumer functions
3 * Copyright (c) 2008-2011 Jonathan Cameron
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 */
10 /**
11 * struct iio_poll_func - poll function pair
13 * @indio_dev: data specific to device (passed into poll func)
14 * @h: the function that is actually run on trigger
15 * @thread: threaded interrupt part
16 * @type: the type of interrupt (basically if oneshot)
17 * @name: name used to identify the trigger consumer.
18 * @irq: the corresponding irq as allocated from the
19 * trigger pool
20 * @timestamp: some devices need a timestamp grabbed as soon
21 * as possible after the trigger - hence handler
22 * passes it via here.
23 **/
24 struct iio_poll_func {
25 struct iio_dev *indio_dev;
26 irqreturn_t (*h)(int irq, void *p);
27 irqreturn_t (*thread)(int irq, void *p);
28 int type;
29 char *name;
30 int irq;
31 s64 timestamp;
35 struct iio_poll_func
36 *iio_alloc_pollfunc(irqreturn_t (*h)(int irq, void *p),
37 irqreturn_t (*thread)(int irq, void *p),
38 int type,
39 struct iio_dev *indio_dev,
40 const char *fmt,
41 ...);
42 void iio_dealloc_pollfunc(struct iio_poll_func *pf);
43 irqreturn_t iio_pollfunc_store_time(int irq, void *p);
45 void iio_trigger_notify_done(struct iio_trigger *trig);
48 * Two functions for common case where all that happens is a pollfunc
49 * is attached and detached from a trigger
51 int iio_triggered_buffer_postenable(struct iio_dev *indio_dev);
52 int iio_triggered_buffer_predisable(struct iio_dev *indio_dev);