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 * @buffer_list: list of all buffers currently attached 11 * @channel_attr_list: keep track of automatically created channel 12 * attributes 13 * @chan_attr_group: group for all attrs in base directory 14 * @debugfs_dentry: device specific debugfs dentry 15 * @cached_reg_addr: cached register address for debugfs reads 16 * @read_buf: read buffer to be used for the initial reg read 17 * @read_buf_len: data length in @read_buf 18 */ 19 struct iio_dev_opaque { 20 struct iio_dev indio_dev; 21 struct iio_event_interface *event_interface; 22 struct list_head buffer_list; 23 struct list_head channel_attr_list; 24 struct attribute_group chan_attr_group; 25 #if defined(CONFIG_DEBUG_FS) 26 struct dentry *debugfs_dentry; 27 unsigned cached_reg_addr; 28 char read_buf[20]; 29 unsigned int read_buf_len; 30 #endif 31 }; 32 33 #define to_iio_dev_opaque(indio_dev) \ 34 container_of(indio_dev, struct iio_dev_opaque, indio_dev) 35 36 #endif 37