]> rtime.felk.cvut.cz Git - mcf548x/linux.git/blob - drivers/staging/iio/adc/adc.h
Initial 2.6.37
[mcf548x/linux.git] / drivers / staging / iio / adc / adc.h
1 /*
2  * adc.h - sysfs attributes associated with ADCs
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 as published by
6  * the Free Software Foundation.
7  *
8  * Copyright (c) 2008 Jonathan Cameron <jic23@cam.ac.uk>
9  *
10  */
11
12 /* Deprecated */
13 #define IIO_DEV_ATTR_ADC(_num, _show, _addr)                    \
14   IIO_DEVICE_ATTR(adc_##_num, S_IRUGO, _show, NULL, _addr)
15
16 #define IIO_DEV_ATTR_IN_RAW(_num, _show, _addr)                         \
17         IIO_DEVICE_ATTR(in##_num##_raw, S_IRUGO, _show, NULL, _addr)
18
19 #define IIO_DEV_ATTR_IN_NAMED_RAW(_num, _name, _show, _addr)            \
20         IIO_DEVICE_ATTR(in##_num##_##_name##_raw, S_IRUGO, _show, NULL, _addr)
21
22 #define IIO_DEV_ATTR_IN_DIFF_RAW(_nump, _numn, _show, _addr)            \
23         IIO_DEVICE_ATTR_NAMED(in##_nump##min##_numn##_raw,              \
24                               in##_nump-in##_numn##_raw,                \
25                               S_IRUGO,                                  \
26                               _show,                                    \
27                               NULL,                                     \
28                               _addr)
29
30
31 #define IIO_CONST_ATTR_IN_NAMED_OFFSET(_num, _name, _string)    \
32         IIO_CONST_ATTR(in##_num##_##_name##_offset, _string)
33
34 #define IIO_CONST_ATTR_IN_NAMED_SCALE(_num, _name, _string)     \
35         IIO_CONST_ATTR(in##_num##_##_name##_scale, _string)
36
37 #define IIO_EVENT_CODE_IN_HIGH_THRESH(a)                                \
38         IIO_UNMOD_EVENT_CODE(IIO_EV_CLASS_IN, a, IIO_EV_TYPE_THRESH,    \
39                              IIO_EV_DIR_RISING)
40 #define IIO_EVENT_CODE_IN_LOW_THRESH(a)                              \
41         IIO_UNMOD_EVENT_CODE(IIO_EV_CLASS_IN, a, IIO_EV_TYPE_THRESH, \
42                              IIO_EV_DIR_FALLING)