diff options
Diffstat (limited to 'drivers/staging/iio/ring_generic.h')
-rw-r--r-- | drivers/staging/iio/ring_generic.h | 73 |
1 files changed, 45 insertions, 28 deletions
diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h index d9261897f33..93b91b28a02 100644 --- a/drivers/staging/iio/ring_generic.h +++ b/drivers/staging/iio/ring_generic.h @@ -25,9 +25,12 @@ int iio_push_ring_event(struct iio_ring_buffer *ring_buf, int event_code, s64 timestamp); /** - * iio_push_or_escallate_ring_event() - escallate or add as appropriate + * iio_push_or_escallate_ring_event() - escalate or add as appropriate + * @ring_buf: ring buffer that is the event source + * @event_code: event indentification code + * @timestamp: time of event * - * Typical usecase is to escallate a 50% ring full to 75% full if noone has yet + * Typical usecase is to escalate a 50% ring full to 75% full if noone has yet * read the first event. Clearly the 50% full is no longer of interest in * typical use case. **/ @@ -37,10 +40,6 @@ int iio_push_or_escallate_ring_event(struct iio_ring_buffer *ring_buf, /** * struct iio_ring_access_funcs - access functions for ring buffers. - * @create: perform allocation - * @init: get ring buffer ready for use - * @_exit: reverse steps in init - * @_free: deallocate ring buffer * @mark_in_use: reference counting, typically to prevent module removal * @unmark_in_use: reduce reference count when no longer using ring buffer * @store_to: actually store stuff to the ring buffer @@ -60,7 +59,7 @@ int iio_push_or_escallate_ring_event(struct iio_ring_buffer *ring_buf, * * The purpose of this structure is to make the ring buffer element * modular as event for a given driver, different usecases may require - * different ring designs (space efficiency vs speed for example. + * different ring designs (space efficiency vs speed for example). * * It is worth noting that a given ring implementation may only support a small * proportion of these functions. The core code 'should' cope fine with any of @@ -91,23 +90,25 @@ struct iio_ring_access_funcs { /** * struct iio_ring_buffer - general ring buffer structure - * @length: [DEVICE]number of datums in ring - * @bpd: [DEVICE]size of individual datum including timestamp - * @loopcount: [INTERN]number of times the ring has looped - * @access_minor_name: [INTERN]store of name of the access chrdev minor number - * sysfs attribute - * @access_handler: [INTERN]chrdev access handling - * @event_minor_name: [INTERN]store of name of the event chrdev minor number - * sysfs attribute - * @ev_int: [INTERN]chrdev interface for the event chrdev - * @shared_ev_pointer: [INTERN]the shared event pointer to allow escalation of + * @dev: ring buffer device struct + * @access_dev: system device struct for the chrdev + * @indio_dev: industrial I/O device structure + * @owner: module that owns the ring buffer (for ref counting) + * @id: unique id number + * @access_id: device id number + * @length: [DEVICE] number of datums in ring + * @bpd: [DEVICE] size of individual datum including timestamp + * @loopcount: [INTERN] number of times the ring has looped + * @access_handler: [INTERN] chrdev access handling + * @ev_int: [INTERN] chrdev interface for the event chrdev + * @shared_ev_pointer: [INTERN] the shared event pointer to allow escalation of * events - * @ring_access: [DRIVER]ring access functions associated with the + * @access: [DRIVER] ring access functions associated with the * implementation. - * @ring_prenable: [DRIVER] function to run prior to marking ring enabled - * @ring_postenable: [DRIVER] function to run after marking ring enabled - * @ring_predisable: [DRIVER] function to run prior to marking ring disabled - * @ring_postdisable: [DRIVER] function to run after marking ring disabled + * @preenable: [DRIVER] function to run prior to marking ring enabled + * @postenable: [DRIVER] function to run after marking ring enabled + * @predisable: [DRIVER] function to run prior to marking ring disabled + * @postdisable: [DRIVER] function to run after marking ring disabled **/ struct iio_ring_buffer { struct device dev; @@ -133,7 +134,10 @@ void iio_ring_buffer_init(struct iio_ring_buffer *ring, struct iio_dev *dev_info); /** - * __iio_init_ring_buffer() - initialize common elements of ring buffers. + * __iio_init_ring_buffer() - initialize common elements of ring buffers + * @ring: ring buffer that is the event source + * @bytes_per_datum: size of individual datum including timestamp + * @length: number of datums in ring **/ static inline void __iio_init_ring_buffer(struct iio_ring_buffer *ring, int bytes_per_datum, int length) @@ -171,7 +175,11 @@ struct iio_scan_el { container_of(_dev_attr, struct iio_scan_el, dev_attr); /** - * iio_scan_el_store() - sysfs scan element selection interface. + * iio_scan_el_store() - sysfs scan element selection interface + * @dev: the target device + * @attr: the device attribute that is being processed + * @buf: input from userspace + * @len: length of input * * A generic function used to enable various scan elements. In some * devices explicit read commands for each channel mean this is merely @@ -184,12 +192,15 @@ ssize_t iio_scan_el_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len); /** * iio_scal_el_show() - sysfs interface to query whether a scan element is - * is enabled or not. + * is enabled or not + * @dev: the target device + * @attr: the device attribute that is being processed + * @buf: output buffer **/ ssize_t iio_scan_el_show(struct device *dev, struct device_attribute *attr, char *buf); /** - * IIO_SCAN_EL: - declare and initialize a scan element without control func + * IIO_SCAN_EL - declare and initialize a scan element without control func * @_name: identifying name. Resulting struct is iio_scan_el_##_name, * sysfs element, scan_en_##_name. * @_number: unique id number for the scan element. @@ -214,8 +225,14 @@ ssize_t iio_scan_el_ts_store(struct device *dev, struct device_attribute *attr, ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr, char *buf); /** - * IIO_SCAN_EL_C: - declare and initialize a scan element with a control func + * IIO_SCAN_EL_C - declare and initialize a scan element with a control func * + * @_name: identifying name. Resulting struct is iio_scan_el_##_name, + * sysfs element, scan_en_##_name. + * @_number: unique id number for the scan element. + * @_bits: number of bits in the scan element result (used in mixed bit + * length devices). + * @_label: indentification variable used by drivers. Often a reg address. * @_controlfunc: function used to notify hardware of whether state changes **/ #define IIO_SCAN_EL_C(_name, _number, _bits, _label, _controlfunc) \ @@ -230,7 +247,7 @@ ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr, .set_state = _controlfunc, \ } /** - * IIO_SCAN_EL_TIMESTAMP: - declare a special scan element for timestamps + * IIO_SCAN_EL_TIMESTAMP - declare a special scan element for timestamps * * Odd one out. Handled slightly differently from other scan elements. **/ |