diff options
Diffstat (limited to 'include/linux/iio/buffer.h')
| -rw-r--r-- | include/linux/iio/buffer.h | 76 |
1 files changed, 2 insertions, 74 deletions
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 519392763393..b65850a41127 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h | |||
| @@ -25,9 +25,7 @@ struct iio_buffer; | |||
| 25 | * available. | 25 | * available. |
| 26 | * @request_update: if a parameter change has been marked, update underlying | 26 | * @request_update: if a parameter change has been marked, update underlying |
| 27 | * storage. | 27 | * storage. |
| 28 | * @get_bytes_per_datum:get current bytes per datum | ||
| 29 | * @set_bytes_per_datum:set number of bytes per datum | 28 | * @set_bytes_per_datum:set number of bytes per datum |
| 30 | * @get_length: get number of datums in buffer | ||
| 31 | * @set_length: set number of datums in buffer | 29 | * @set_length: set number of datums in buffer |
| 32 | * @release: called when the last reference to the buffer is dropped, | 30 | * @release: called when the last reference to the buffer is dropped, |
| 33 | * should free all resources allocated by the buffer. | 31 | * should free all resources allocated by the buffer. |
| @@ -49,9 +47,7 @@ struct iio_buffer_access_funcs { | |||
| 49 | 47 | ||
| 50 | int (*request_update)(struct iio_buffer *buffer); | 48 | int (*request_update)(struct iio_buffer *buffer); |
| 51 | 49 | ||
| 52 | int (*get_bytes_per_datum)(struct iio_buffer *buffer); | ||
| 53 | int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd); | 50 | int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd); |
| 54 | int (*get_length)(struct iio_buffer *buffer); | ||
| 55 | int (*set_length)(struct iio_buffer *buffer, int length); | 51 | int (*set_length)(struct iio_buffer *buffer, int length); |
| 56 | 52 | ||
| 57 | void (*release)(struct iio_buffer *buffer); | 53 | void (*release)(struct iio_buffer *buffer); |
| @@ -85,10 +81,11 @@ struct iio_buffer { | |||
| 85 | bool scan_timestamp; | 81 | bool scan_timestamp; |
| 86 | const struct iio_buffer_access_funcs *access; | 82 | const struct iio_buffer_access_funcs *access; |
| 87 | struct list_head scan_el_dev_attr_list; | 83 | struct list_head scan_el_dev_attr_list; |
| 84 | struct attribute_group buffer_group; | ||
| 88 | struct attribute_group scan_el_group; | 85 | struct attribute_group scan_el_group; |
| 89 | wait_queue_head_t pollq; | 86 | wait_queue_head_t pollq; |
| 90 | bool stufftoread; | 87 | bool stufftoread; |
| 91 | const struct attribute_group *attrs; | 88 | const struct attribute **attrs; |
| 92 | struct list_head demux_list; | 89 | struct list_head demux_list; |
| 93 | void *demux_bounce; | 90 | void *demux_bounce; |
| 94 | struct list_head buffer_list; | 91 | struct list_head buffer_list; |
| @@ -117,15 +114,6 @@ int iio_scan_mask_query(struct iio_dev *indio_dev, | |||
| 117 | struct iio_buffer *buffer, int bit); | 114 | struct iio_buffer *buffer, int bit); |
| 118 | 115 | ||
| 119 | /** | 116 | /** |
| 120 | * iio_scan_mask_set() - set particular bit in the scan mask | ||
| 121 | * @indio_dev IIO device structure | ||
| 122 | * @buffer: the buffer whose scan mask we are interested in | ||
| 123 | * @bit: the bit to be set. | ||
| 124 | **/ | ||
| 125 | int iio_scan_mask_set(struct iio_dev *indio_dev, | ||
| 126 | struct iio_buffer *buffer, int bit); | ||
| 127 | |||
| 128 | /** | ||
| 129 | * iio_push_to_buffers() - push to a registered buffer. | 117 | * iio_push_to_buffers() - push to a registered buffer. |
| 130 | * @indio_dev: iio_dev structure for device. | 118 | * @indio_dev: iio_dev structure for device. |
| 131 | * @data: Full scan. | 119 | * @data: Full scan. |
| @@ -159,56 +147,6 @@ static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev, | |||
| 159 | 147 | ||
| 160 | int iio_update_demux(struct iio_dev *indio_dev); | 148 | int iio_update_demux(struct iio_dev *indio_dev); |
| 161 | 149 | ||
| 162 | /** | ||
| 163 | * iio_buffer_register() - register the buffer with IIO core | ||
| 164 | * @indio_dev: device with the buffer to be registered | ||
| 165 | * @channels: the channel descriptions used to construct buffer | ||
| 166 | * @num_channels: the number of channels | ||
| 167 | **/ | ||
| 168 | int iio_buffer_register(struct iio_dev *indio_dev, | ||
| 169 | const struct iio_chan_spec *channels, | ||
| 170 | int num_channels); | ||
| 171 | |||
| 172 | /** | ||
| 173 | * iio_buffer_unregister() - unregister the buffer from IIO core | ||
| 174 | * @indio_dev: the device with the buffer to be unregistered | ||
| 175 | **/ | ||
| 176 | void iio_buffer_unregister(struct iio_dev *indio_dev); | ||
| 177 | |||
| 178 | /** | ||
| 179 | * iio_buffer_read_length() - attr func to get number of datums in the buffer | ||
| 180 | **/ | ||
| 181 | ssize_t iio_buffer_read_length(struct device *dev, | ||
| 182 | struct device_attribute *attr, | ||
| 183 | char *buf); | ||
| 184 | /** | ||
| 185 | * iio_buffer_write_length() - attr func to set number of datums in the buffer | ||
| 186 | **/ | ||
| 187 | ssize_t iio_buffer_write_length(struct device *dev, | ||
| 188 | struct device_attribute *attr, | ||
| 189 | const char *buf, | ||
| 190 | size_t len); | ||
| 191 | /** | ||
| 192 | * iio_buffer_store_enable() - attr to turn the buffer on | ||
| 193 | **/ | ||
| 194 | ssize_t iio_buffer_store_enable(struct device *dev, | ||
| 195 | struct device_attribute *attr, | ||
| 196 | const char *buf, | ||
| 197 | size_t len); | ||
| 198 | /** | ||
| 199 | * iio_buffer_show_enable() - attr to see if the buffer is on | ||
| 200 | **/ | ||
| 201 | ssize_t iio_buffer_show_enable(struct device *dev, | ||
| 202 | struct device_attribute *attr, | ||
| 203 | char *buf); | ||
| 204 | #define IIO_BUFFER_LENGTH_ATTR DEVICE_ATTR(length, S_IRUGO | S_IWUSR, \ | ||
| 205 | iio_buffer_read_length, \ | ||
| 206 | iio_buffer_write_length) | ||
| 207 | |||
| 208 | #define IIO_BUFFER_ENABLE_ATTR DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, \ | ||
| 209 | iio_buffer_show_enable, \ | ||
| 210 | iio_buffer_store_enable) | ||
| 211 | |||
| 212 | bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, | 150 | bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev, |
| 213 | const unsigned long *mask); | 151 | const unsigned long *mask); |
| 214 | 152 | ||
| @@ -232,16 +170,6 @@ static inline void iio_device_attach_buffer(struct iio_dev *indio_dev, | |||
| 232 | 170 | ||
| 233 | #else /* CONFIG_IIO_BUFFER */ | 171 | #else /* CONFIG_IIO_BUFFER */ |
| 234 | 172 | ||
| 235 | static inline int iio_buffer_register(struct iio_dev *indio_dev, | ||
| 236 | const struct iio_chan_spec *channels, | ||
| 237 | int num_channels) | ||
| 238 | { | ||
| 239 | return 0; | ||
| 240 | } | ||
| 241 | |||
| 242 | static inline void iio_buffer_unregister(struct iio_dev *indio_dev) | ||
| 243 | {} | ||
| 244 | |||
| 245 | static inline void iio_buffer_get(struct iio_buffer *buffer) {} | 173 | static inline void iio_buffer_get(struct iio_buffer *buffer) {} |
| 246 | static inline void iio_buffer_put(struct iio_buffer *buffer) {} | 174 | static inline void iio_buffer_put(struct iio_buffer *buffer) {} |
| 247 | 175 | ||
