~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/staging/iio/Documentation/iio_utils.h

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
#define IIO_MAX_NAME_LENGTH 30
18
18
 
19
 
#define IIO_EV_CLASS_BUFFER             0
20
 
#define IIO_BUFFER_EVENT_CODE(code)             \
21
 
        (IIO_EV_CLASS_BUFFER | (code << 8))
22
 
 
23
 
#define IIO_EVENT_CODE_RING_50_FULL     IIO_BUFFER_EVENT_CODE(0)
24
 
#define IIO_EVENT_CODE_RING_75_FULL     IIO_BUFFER_EVENT_CODE(1)
25
 
#define IIO_EVENT_CODE_RING_100_FULL    IIO_BUFFER_EVENT_CODE(2)
26
 
 
27
 
 
28
19
#define FORMAT_SCAN_ELEMENTS_DIR "%s:buffer0/scan_elements"
29
20
#define FORMAT_TYPE_FILE "%s_type"
30
21
 
31
22
const char *iio_dir = "/sys/bus/iio/devices/";
32
23
 
33
 
struct iio_event_data {
34
 
        int id;
35
 
        __s64 timestamp;
36
 
};
37
 
 
38
24
/**
39
25
 * iioutils_break_up_name() - extract generic name from full channel name
40
26
 * @full_name: the full channel name
85
71
        unsigned index;
86
72
        unsigned bytes;
87
73
        unsigned bits_used;
 
74
        unsigned shift;
88
75
        uint64_t mask;
89
76
        unsigned is_signed;
90
77
        unsigned enabled;
103
90
inline int iioutils_get_type(unsigned *is_signed,
104
91
                             unsigned *bytes,
105
92
                             unsigned *bits_used,
 
93
                             unsigned *shift,
106
94
                             uint64_t *mask,
107
95
                             const char *device_dir,
108
96
                             const char *name,
157
145
                                goto error_free_filename;
158
146
                        }
159
147
                        fscanf(sysfsfp,
160
 
                               "%c%u/%u", &signchar, bits_used, &padint);
 
148
                               "%c%u/%u>>%u", &signchar, bits_used,
 
149
                               &padint, shift);
161
150
                        *bytes = padint / 8;
162
151
                        if (*bits_used == 64)
163
152
                                *mask = ~0;
395
384
                        ret = iioutils_get_type(&current->is_signed,
396
385
                                                &current->bytes,
397
386
                                                &current->bits_used,
 
387
                                                &current->shift,
398
388
                                                &current->mask,
399
389
                                                device_dir,
400
390
                                                current->name,