1 /* SPDX-License-Identifier: GPL-2.0 */ 2 3 #ifndef _INDUSTRIAL_IO_OPAQUE_H_ 4 #define _INDUSTRIAL_IO_OPAQUE_H_ 5 6 /** 7 * struct iio_dev_opaque - industrial I/O device opaque information 8 * @indio_dev: public industrial I/O device information 9 * @event_interface: event chrdevs associated with interrupt lines 10 * @attached_buffers: array of buffers statically attached by the driver 11 * @attached_buffers_cnt: number of buffers in the array of statically attached buffers 12 * @buffer_ioctl_handler: ioctl() handler for this IIO device's buffer interface 13 * @buffer_list: list of all buffers currently attached 14 * @channel_attr_list: keep track of automatically created channel 15 * attributes 16 * @chan_attr_group: group for all attrs in base directory 17 * @ioctl_handlers: ioctl handlers registered with the core handler 18 * @groups: attribute groups 19 * @groupcounter: index of next attribute group 20 * @legacy_scan_el_group: attribute group for legacy scan elements attribute group 21 * @legacy_buffer_group: attribute group for legacy buffer attributes group 22 * @debugfs_dentry: device specific debugfs dentry 23 * @cached_reg_addr: cached register address for debugfs reads 24 * @read_buf: read buffer to be used for the initial reg read 25 * @read_buf_len: data length in @read_buf 26 */ 27 struct iio_dev_opaque { 28 struct iio_dev indio_dev; 29 struct iio_event_interface *event_interface; 30 struct iio_buffer **attached_buffers; 31 unsigned int attached_buffers_cnt; 32 struct iio_ioctl_handler *buffer_ioctl_handler; 33 struct list_head buffer_list; 34 struct list_head channel_attr_list; 35 struct attribute_group chan_attr_group; 36 struct list_head ioctl_handlers; 37 const struct attribute_group **groups; 38 int groupcounter; 39 struct attribute_group legacy_scan_el_group; 40 struct attribute_group legacy_buffer_group; 41 #if defined(CONFIG_DEBUG_FS) 42 struct dentry *debugfs_dentry; 43 unsigned cached_reg_addr; 44 char read_buf[20]; 45 unsigned int read_buf_len; 46 #endif 47 }; 48 49 #define to_iio_dev_opaque(indio_dev) \ 50 container_of(indio_dev, struct iio_dev_opaque, indio_dev) 51 52 #endif 53