xref: /OK3568_Linux_fs/kernel/include/linux/iio/iio-opaque.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun 
3*4882a593Smuzhiyun #ifndef _INDUSTRIAL_IO_OPAQUE_H_
4*4882a593Smuzhiyun #define _INDUSTRIAL_IO_OPAQUE_H_
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun /**
7*4882a593Smuzhiyun  * struct iio_dev_opaque - industrial I/O device opaque information
8*4882a593Smuzhiyun  * @indio_dev:			public industrial I/O device information
9*4882a593Smuzhiyun  * @event_interface:		event chrdevs associated with interrupt lines
10*4882a593Smuzhiyun  * @buffer_list:		list of all buffers currently attached
11*4882a593Smuzhiyun  * @channel_attr_list:		keep track of automatically created channel
12*4882a593Smuzhiyun  *				attributes
13*4882a593Smuzhiyun  * @chan_attr_group:		group for all attrs in base directory
14*4882a593Smuzhiyun  * @debugfs_dentry:		device specific debugfs dentry
15*4882a593Smuzhiyun  * @cached_reg_addr:		cached register address for debugfs reads
16*4882a593Smuzhiyun  * @read_buf:			read buffer to be used for the initial reg read
17*4882a593Smuzhiyun  * @read_buf_len:		data length in @read_buf
18*4882a593Smuzhiyun  */
19*4882a593Smuzhiyun struct iio_dev_opaque {
20*4882a593Smuzhiyun 	struct iio_dev			indio_dev;
21*4882a593Smuzhiyun 	struct iio_event_interface	*event_interface;
22*4882a593Smuzhiyun 	struct list_head		buffer_list;
23*4882a593Smuzhiyun 	struct list_head		channel_attr_list;
24*4882a593Smuzhiyun 	struct attribute_group		chan_attr_group;
25*4882a593Smuzhiyun #if defined(CONFIG_DEBUG_FS)
26*4882a593Smuzhiyun 	struct dentry			*debugfs_dentry;
27*4882a593Smuzhiyun 	unsigned			cached_reg_addr;
28*4882a593Smuzhiyun 	char				read_buf[20];
29*4882a593Smuzhiyun 	unsigned int			read_buf_len;
30*4882a593Smuzhiyun #endif
31*4882a593Smuzhiyun };
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun #define to_iio_dev_opaque(indio_dev)		\
34*4882a593Smuzhiyun 	container_of(indio_dev, struct iio_dev_opaque, indio_dev)
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun #endif
37