Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 1 | /* The industrial I/O core |
| 2 | * |
| 3 | *Copyright (c) 2008 Jonathan Cameron |
| 4 | * |
| 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 | * |
| 9 | * General attributes |
| 10 | */ |
| 11 | |
| 12 | #ifndef _INDUSTRIAL_IO_SYSFS_H_ |
| 13 | #define _INDUSTRIAL_IO_SYSFS_H_ |
| 14 | |
| 15 | #include "iio.h" |
| 16 | |
| 17 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 18 | * struct iio_event_attr - event control attribute |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 19 | * @dev_attr: underlying device attribute |
| 20 | * @mask: mask for the event when detecting |
| 21 | * @listel: list header to allow addition to list of event handlers |
| 22 | */ |
| 23 | struct iio_event_attr { |
| 24 | struct device_attribute dev_attr; |
| 25 | int mask; |
| 26 | struct iio_event_handler_list *listel; |
| 27 | }; |
| 28 | |
| 29 | #define to_iio_event_attr(_dev_attr) \ |
| 30 | container_of(_dev_attr, struct iio_event_attr, dev_attr) |
| 31 | |
| 32 | /** |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 33 | * struct iio_dev_attr - iio specific device attribute |
| 34 | * @dev_attr: underlying device attribute |
| 35 | * @address: associated register address |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 36 | * @val2: secondary attribute value |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 37 | */ |
| 38 | struct iio_dev_attr { |
| 39 | struct device_attribute dev_attr; |
| 40 | int address; |
| 41 | int val2; |
| 42 | }; |
| 43 | |
| 44 | #define to_iio_dev_attr(_dev_attr) \ |
| 45 | container_of(_dev_attr, struct iio_dev_attr, dev_attr) |
| 46 | |
| 47 | ssize_t iio_read_const_attr(struct device *dev, |
| 48 | struct device_attribute *attr, |
| 49 | char *len); |
| 50 | |
| 51 | /** |
| 52 | * struct iio_const_attr - constant device specific attribute |
| 53 | * often used for things like available modes |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 54 | * @string: attribute string |
| 55 | * @dev_attr: underlying device attribute |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 56 | */ |
| 57 | struct iio_const_attr { |
| 58 | const char *string; |
| 59 | struct device_attribute dev_attr; |
| 60 | }; |
| 61 | |
| 62 | #define to_iio_const_attr(_dev_attr) \ |
| 63 | container_of(_dev_attr, struct iio_const_attr, dev_attr) |
| 64 | |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 65 | /* Some attributes will be hard coded (device dependent) and not require an |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 66 | address, in these cases pass a negative */ |
| 67 | #define IIO_ATTR(_name, _mode, _show, _store, _addr) \ |
| 68 | { .dev_attr = __ATTR(_name, _mode, _show, _store), \ |
| 69 | .address = _addr } |
| 70 | |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 71 | #define IIO_DEVICE_ATTR(_name, _mode, _show, _store, _addr) \ |
| 72 | struct iio_dev_attr iio_dev_attr_##_name \ |
| 73 | = IIO_ATTR(_name, _mode, _show, _store, _addr) |
| 74 | |
Jonathan Cameron | ad313b1 | 2010-05-04 14:42:56 +0100 | [diff] [blame] | 75 | #define IIO_DEVICE_ATTR_NAMED(_vname, _name, _mode, _show, _store, _addr) \ |
| 76 | struct iio_dev_attr iio_dev_attr_##_vname \ |
| 77 | = IIO_ATTR(_name, _mode, _show, _store, _addr) |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 78 | |
| 79 | #define IIO_DEVICE_ATTR_2(_name, _mode, _show, _store, _addr, _val2) \ |
| 80 | struct iio_dev_attr iio_dev_attr_##_name \ |
| 81 | = IIO_ATTR_2(_name, _mode, _show, _store, _addr, _val2) |
| 82 | |
| 83 | #define IIO_CONST_ATTR(_name, _string) \ |
| 84 | struct iio_const_attr iio_const_attr_##_name \ |
| 85 | = { .string = _string, \ |
| 86 | .dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)} |
| 87 | |
Jonathan Cameron | fc5d0e4 | 2010-10-08 12:14:08 +0100 | [diff] [blame] | 88 | #define IIO_CONST_ATTR_NAMED(_vname, _name, _string) \ |
| 89 | struct iio_const_attr iio_const_attr_##_vname \ |
| 90 | = { .string = _string, \ |
| 91 | .dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)} |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 92 | /* Generic attributes of onetype or another */ |
| 93 | |
| 94 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 95 | * IIO_DEV_ATTR_REV - revision number for the device |
| 96 | * @_show: output method for the attribute |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 97 | * |
| 98 | * Very much device dependent. |
| 99 | **/ |
| 100 | #define IIO_DEV_ATTR_REV(_show) \ |
| 101 | IIO_DEVICE_ATTR(revision, S_IRUGO, _show, NULL, 0) |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 102 | |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 103 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 104 | * IIO_DEV_ATTR_NAME - chip type dependent identifier |
| 105 | * @_show: output method for the attribute |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 106 | **/ |
| 107 | #define IIO_DEV_ATTR_NAME(_show) \ |
| 108 | IIO_DEVICE_ATTR(name, S_IRUGO, _show, NULL, 0) |
| 109 | |
| 110 | /** |
Barry Song | 4f0cd86 | 2010-10-27 21:44:03 -0400 | [diff] [blame] | 111 | * IIO_DEV_ATTR_RESET: resets the device |
| 112 | **/ |
| 113 | #define IIO_DEV_ATTR_RESET(_store) \ |
Greg Kroah-Hartman | 983bbfd | 2010-12-10 10:56:18 -0800 | [diff] [blame] | 114 | IIO_DEVICE_ATTR(reset, S_IWUSR, NULL, _store, 0) |
Barry Song | 4f0cd86 | 2010-10-27 21:44:03 -0400 | [diff] [blame] | 115 | |
| 116 | /** |
Manuel Stahl | 51a0a5b | 2010-08-31 11:32:54 +0200 | [diff] [blame] | 117 | * IIO_CONST_ATTR_NAME - constant identifier |
| 118 | * @_string: the name |
| 119 | **/ |
| 120 | #define IIO_CONST_ATTR_NAME(_string) \ |
| 121 | IIO_CONST_ATTR(name, _string) |
| 122 | |
| 123 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 124 | * IIO_DEV_ATTR_SAMP_FREQ - sets any internal clock frequency |
| 125 | * @_mode: sysfs file mode/permissions |
| 126 | * @_show: output method for the attribute |
| 127 | * @_store: input method for the attribute |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 128 | **/ |
| 129 | #define IIO_DEV_ATTR_SAMP_FREQ(_mode, _show, _store) \ |
| 130 | IIO_DEVICE_ATTR(sampling_frequency, _mode, _show, _store, 0) |
| 131 | |
| 132 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 133 | * IIO_DEV_ATTR_AVAIL_SAMP_FREQ - list available sampling frequencies |
| 134 | * @_show: output method for the attribute |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 135 | * |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 136 | * May be mode dependent on some devices |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 137 | **/ |
Jonathan Cameron | ff7723e | 2010-05-04 14:42:57 +0100 | [diff] [blame] | 138 | /* Deprecated */ |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 139 | #define IIO_DEV_ATTR_AVAIL_SAMP_FREQ(_show) \ |
| 140 | IIO_DEVICE_ATTR(available_sampling_frequency, S_IRUGO, _show, NULL, 0) |
| 141 | |
Jonathan Cameron | ff7723e | 2010-05-04 14:42:57 +0100 | [diff] [blame] | 142 | #define IIO_DEV_ATTR_SAMP_FREQ_AVAIL(_show) \ |
| 143 | IIO_DEVICE_ATTR(sampling_frequency_available, S_IRUGO, _show, NULL, 0) |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 144 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 145 | * IIO_CONST_ATTR_AVAIL_SAMP_FREQ - list available sampling frequencies |
| 146 | * @_string: frequency string for the attribute |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 147 | * |
| 148 | * Constant version |
| 149 | **/ |
Jonathan Cameron | ff7723e | 2010-05-04 14:42:57 +0100 | [diff] [blame] | 150 | #define IIO_CONST_ATTR_SAMP_FREQ_AVAIL(_string) \ |
| 151 | IIO_CONST_ATTR(sampling_frequency_available, _string) |
| 152 | |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 153 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 154 | * IIO_DEV_ATTR_SW_RING_ENABLE - enable software ring buffer |
| 155 | * @_show: output method for the attribute |
| 156 | * @_store: input method for the attribute |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 157 | * |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 158 | * Success may be dependent on attachment of trigger previously. |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 159 | **/ |
| 160 | #define IIO_DEV_ATTR_SW_RING_ENABLE(_show, _store) \ |
| 161 | IIO_DEVICE_ATTR(sw_ring_enable, S_IRUGO | S_IWUSR, _show, _store, 0) |
| 162 | |
| 163 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 164 | * IIO_DEV_ATTR_HW_RING_ENABLE - enable hardware ring buffer |
| 165 | * @_show: output method for the attribute |
| 166 | * @_store: input method for the attribute |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 167 | * |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 168 | * This is a different attribute from the software one as one can envision |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 169 | * schemes where a combination of the two may be used. |
| 170 | **/ |
| 171 | #define IIO_DEV_ATTR_HW_RING_ENABLE(_show, _store) \ |
| 172 | IIO_DEVICE_ATTR(hw_ring_enable, S_IRUGO | S_IWUSR, _show, _store, 0) |
| 173 | |
Jonathan Cameron | ff7723e | 2010-05-04 14:42:57 +0100 | [diff] [blame] | 174 | #define IIO_DEV_ATTR_TEMP_RAW(_show) \ |
| 175 | IIO_DEVICE_ATTR(temp_raw, S_IRUGO, _show, NULL, 0) |
| 176 | |
Manuel Stahl | 51a0a5b | 2010-08-31 11:32:54 +0200 | [diff] [blame] | 177 | #define IIO_CONST_ATTR_TEMP_OFFSET(_string) \ |
| 178 | IIO_CONST_ATTR(temp_offset, _string) |
| 179 | |
| 180 | #define IIO_CONST_ATTR_TEMP_SCALE(_string) \ |
| 181 | IIO_CONST_ATTR(temp_scale, _string) |
| 182 | |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 183 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 184 | * IIO_EVENT_SH - generic shared event handler |
| 185 | * @_name: event name |
| 186 | * @_handler: handler function to be called |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 187 | * |
| 188 | * This is used in cases where more than one event may result from a single |
| 189 | * handler. Often the case that some alarm register must be read and multiple |
| 190 | * alarms may have been triggered. |
| 191 | **/ |
| 192 | #define IIO_EVENT_SH(_name, _handler) \ |
| 193 | static struct iio_event_handler_list \ |
| 194 | iio_event_##_name = { \ |
| 195 | .handler = _handler, \ |
| 196 | .refcount = 0, \ |
| 197 | .exist_lock = __MUTEX_INITIALIZER(iio_event_##_name \ |
| 198 | .exist_lock), \ |
| 199 | .list = { \ |
| 200 | .next = &iio_event_##_name.list, \ |
| 201 | .prev = &iio_event_##_name.list, \ |
| 202 | }, \ |
| 203 | }; |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 204 | |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 205 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 206 | * IIO_EVENT_ATTR_SH - generic shared event attribute |
| 207 | * @_name: event name |
| 208 | * @_ev_list: event handler list |
| 209 | * @_show: output method for the attribute |
| 210 | * @_store: input method for the attribute |
| 211 | * @_mask: mask used when detecting the event |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 212 | * |
| 213 | * An attribute with an associated IIO_EVENT_SH |
| 214 | **/ |
| 215 | #define IIO_EVENT_ATTR_SH(_name, _ev_list, _show, _store, _mask) \ |
| 216 | static struct iio_event_attr \ |
| 217 | iio_event_attr_##_name \ |
| 218 | = { .dev_attr = __ATTR(_name, S_IRUGO | S_IWUSR, \ |
| 219 | _show, _store), \ |
| 220 | .mask = _mask, \ |
| 221 | .listel = &_ev_list }; |
| 222 | |
Jonathan Cameron | 7e29a0d | 2010-06-26 12:54:22 +0100 | [diff] [blame] | 223 | #define IIO_EVENT_ATTR_NAMED_SH(_vname, _name, _ev_list, _show, _store, _mask) \ |
| 224 | static struct iio_event_attr \ |
| 225 | iio_event_attr_##_vname \ |
| 226 | = { .dev_attr = __ATTR(_name, S_IRUGO | S_IWUSR, \ |
| 227 | _show, _store), \ |
| 228 | .mask = _mask, \ |
| 229 | .listel = &_ev_list }; |
| 230 | |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 231 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 232 | * IIO_EVENT_ATTR - non-shared event attribute |
| 233 | * @_name: event name |
| 234 | * @_show: output method for the attribute |
| 235 | * @_store: input method for the attribute |
| 236 | * @_mask: mask used when detecting the event |
| 237 | * @_handler: handler function to be called |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 238 | **/ |
| 239 | #define IIO_EVENT_ATTR(_name, _show, _store, _mask, _handler) \ |
Jonathan Cameron | 3bbb49a | 2010-06-26 12:54:20 +0100 | [diff] [blame] | 240 | IIO_EVENT_SH(_name, _handler); \ |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 241 | static struct \ |
| 242 | iio_event_attr \ |
| 243 | iio_event_attr_##_name \ |
| 244 | = { .dev_attr = __ATTR(_name, S_IRUGO | S_IWUSR, \ |
| 245 | _show, _store), \ |
| 246 | .mask = _mask, \ |
| 247 | .listel = &iio_event_##_name }; \ |
| 248 | |
| 249 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 250 | * IIO_EVENT_ATTR_DATA_RDY - event driven by data ready signal |
| 251 | * @_show: output method for the attribute |
| 252 | * @_store: input method for the attribute |
| 253 | * @_mask: mask used when detecting the event |
| 254 | * @_handler: handler function to be called |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 255 | * |
| 256 | * Not typically implemented in devices where full triggering support |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 257 | * has been implemented. |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 258 | **/ |
| 259 | #define IIO_EVENT_ATTR_DATA_RDY(_show, _store, _mask, _handler) \ |
| 260 | IIO_EVENT_ATTR(data_rdy, _show, _store, _mask, _handler) |
| 261 | |
Jonathan Cameron | f4704d7 | 2010-10-08 12:14:00 +0100 | [diff] [blame] | 262 | #define IIO_EV_CLASS_BUFFER 0 |
| 263 | #define IIO_EV_CLASS_IN 1 |
| 264 | #define IIO_EV_CLASS_ACCEL 2 |
| 265 | #define IIO_EV_CLASS_GYRO 3 |
| 266 | #define IIO_EV_CLASS_MAGN 4 |
| 267 | #define IIO_EV_CLASS_LIGHT 5 |
| 268 | #define IIO_EV_CLASS_PROXIMITY 6 |
| 269 | |
| 270 | #define IIO_EV_MOD_X 0 |
| 271 | #define IIO_EV_MOD_Y 1 |
| 272 | #define IIO_EV_MOD_Z 2 |
Jonathan Cameron | de9fe32 | 2010-10-08 12:14:03 +0100 | [diff] [blame] | 273 | #define IIO_EV_MOD_X_AND_Y 3 |
| 274 | #define IIO_EV_MOD_X_ANX_Z 4 |
| 275 | #define IIO_EV_MOD_Y_AND_Z 5 |
| 276 | #define IIO_EV_MOD_X_AND_Y_AND_Z 6 |
| 277 | #define IIO_EV_MOD_X_OR_Y 7 |
| 278 | #define IIO_EV_MOD_X_OR_Z 8 |
| 279 | #define IIO_EV_MOD_Y_OR_Z 9 |
| 280 | #define IIO_EV_MOD_X_OR_Y_OR_Z 10 |
Jonathan Cameron | f4704d7 | 2010-10-08 12:14:00 +0100 | [diff] [blame] | 281 | |
| 282 | #define IIO_EV_TYPE_THRESH 0 |
| 283 | #define IIO_EV_TYPE_MAG 1 |
| 284 | #define IIO_EV_TYPE_ROC 2 |
| 285 | |
| 286 | #define IIO_EV_DIR_EITHER 0 |
| 287 | #define IIO_EV_DIR_RISING 1 |
| 288 | #define IIO_EV_DIR_FALLING 2 |
| 289 | |
| 290 | #define IIO_EVENT_CODE(channelclass, orient_bit, number, \ |
| 291 | modifier, type, direction) \ |
| 292 | (channelclass | (orient_bit << 8) | ((number) << 9) | \ |
| 293 | ((modifier) << 13) | ((type) << 16) | ((direction) << 24)) |
| 294 | |
| 295 | #define IIO_MOD_EVENT_CODE(channelclass, number, modifier, \ |
| 296 | type, direction) \ |
| 297 | IIO_EVENT_CODE(channelclass, 1, number, modifier, type, direction) |
| 298 | |
| 299 | #define IIO_UNMOD_EVENT_CODE(channelclass, number, type, direction) \ |
| 300 | IIO_EVENT_CODE(channelclass, 0, number, 0, type, direction) |
| 301 | |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 302 | |
Jonathan Cameron | 4be2de4 | 2010-10-08 12:14:06 +0100 | [diff] [blame] | 303 | #define IIO_BUFFER_EVENT_CODE(code) \ |
| 304 | (IIO_EV_CLASS_BUFFER | (code << 8)) |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 305 | |
| 306 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 307 | * IIO_EVENT_ATTR_RING_50_FULL - ring buffer event to indicate 50% full |
| 308 | * @_show: output method for the attribute |
| 309 | * @_store: input method for the attribute |
| 310 | * @_mask: mask used when detecting the event |
| 311 | * @_handler: handler function to be called |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 312 | **/ |
| 313 | #define IIO_EVENT_ATTR_RING_50_FULL(_show, _store, _mask, _handler) \ |
| 314 | IIO_EVENT_ATTR(ring_50_full, _show, _store, _mask, _handler) |
| 315 | |
| 316 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 317 | * IIO_EVENT_ATTR_RING_50_FULL_SH - shared ring event to indicate 50% full |
| 318 | * @_evlist: event handler list |
| 319 | * @_show: output method for the attribute |
| 320 | * @_store: input method for the attribute |
| 321 | * @_mask: mask used when detecting the event |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 322 | **/ |
| 323 | #define IIO_EVENT_ATTR_RING_50_FULL_SH(_evlist, _show, _store, _mask) \ |
| 324 | IIO_EVENT_ATTR_SH(ring_50_full, _evlist, _show, _store, _mask) |
| 325 | |
| 326 | /** |
Randy Dunlap | 4c57260 | 2009-10-04 19:34:02 -0700 | [diff] [blame] | 327 | * IIO_EVENT_ATTR_RING_75_FULL_SH - shared ring event to indicate 75% full |
| 328 | * @_evlist: event handler list |
| 329 | * @_show: output method for the attribute |
| 330 | * @_store: input method for the attribute |
| 331 | * @_mask: mask used when detecting the event |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 332 | **/ |
| 333 | #define IIO_EVENT_ATTR_RING_75_FULL_SH(_evlist, _show, _store, _mask) \ |
| 334 | IIO_EVENT_ATTR_SH(ring_75_full, _evlist, _show, _store, _mask) |
| 335 | |
Jonathan Cameron | 4be2de4 | 2010-10-08 12:14:06 +0100 | [diff] [blame] | 336 | #define IIO_EVENT_CODE_RING_50_FULL IIO_BUFFER_EVENT_CODE(0) |
| 337 | #define IIO_EVENT_CODE_RING_75_FULL IIO_BUFFER_EVENT_CODE(1) |
| 338 | #define IIO_EVENT_CODE_RING_100_FULL IIO_BUFFER_EVENT_CODE(2) |
Jonathan Cameron | 847ec80 | 2009-08-18 18:06:19 +0100 | [diff] [blame] | 339 | |
| 340 | #endif /* _INDUSTRIAL_IO_SYSFS_H_ */ |