---
name: "struct_iio_dev"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/struct_iio_dev"
---

# struct\_iio\_dev(9)

industrial I/O device

## NAME

struct\_iio\_dev - industrial I/O device

## SYNOPSIS

```
struct iio_dev {
  int id;
  int modes;
  int currentmode;
  struct device dev;
  struct iio_event_interface * event_interface;
  struct iio_buffer * buffer;
  struct list_head buffer_list;
  int scan_bytes;
  struct mutex mlock;
  const unsigned long * available_scan_masks;
  unsigned masklength;
  const unsigned long * active_scan_mask;
  bool scan_timestamp;
  unsigned scan_index_timestamp;
  struct iio_trigger * trig;
  struct iio_poll_func * pollfunc;
  struct iio_poll_func * pollfunc_event;
  struct iio_chan_spec const * channels;
  int num_channels;
  struct list_head channel_attr_list;
  struct attribute_group chan_attr_group;
  const char * name;
  const struct iio_info * info;
  clockid_t clock_id;
  struct mutex info_exist_lock;
  const struct iio_buffer_setup_ops * setup_ops;
  struct cdev chrdev;
#define IIO_MAX_GROUPS 6
  const struct attribute_group * groups[IIO_MAX_GROUPS + 1];
  int groupcounter;
  unsigned long flags;
#if defined(CONFIG_DEBUG_FS)
  struct dentry * debugfs_dentry;
  unsigned cached_reg_addr;
#endif
};
```

## MEMBERS

id

\[INTERN\] used to identify device internally

modes

\[DRIVER\] operating modes supported by device

currentmode

\[DRIVER\] current operating mode

dev

\[DRIVER\] device structure, should be assigned a parent and owner

event\_interface

\[INTERN\] event chrdevs associated with interrupt lines

buffer

\[DRIVER\] any buffer present

buffer\_list

\[INTERN\] list of all buffers currently attached

scan\_bytes

\[INTERN\] num bytes captured to be fed to buffer demux

mlock

\[DRIVER\] lock used to prevent simultaneous device state changes

available\_scan\_masks

\[DRIVER\] optional array of allowed bitmasks

masklength

\[INTERN\] the length of the mask established from channels

active\_scan\_mask

\[INTERN\] union of all scan masks requested by buffers

scan\_timestamp

\[INTERN\] set if any buffers have requested timestamp

scan\_index\_timestamp

\[INTERN\] cache of the index to the timestamp

trig

\[INTERN\] current device trigger (buffer modes) *trig\_readonly* \[INTERN\] mark the current trigger immutable

pollfunc

\[DRIVER\] function run on trigger being received

pollfunc\_event

\[DRIVER\] function run on events trigger being received

channels

\[DRIVER\] channel specification structure table

num\_channels

\[DRIVER\] number of channels specified in *channels*.

channel\_attr\_list

\[INTERN\] keep track of automatically created channel attributes

chan\_attr\_group

\[INTERN\] group for all attrs in base directory

name

\[DRIVER\] name of the device.

info

\[DRIVER\] callbacks and constant info from driver

clock\_id

\[INTERN\] timestamping clock posix identifier

info\_exist\_lock

\[INTERN\] lock to prevent use during removal

setup\_ops

\[DRIVER\] callbacks to call before and after buffer enable/disable

chrdev

\[INTERN\] associated character device

groups\[IIO\_MAX\_GROUPS + 1\]

\[INTERN\] attribute groups

groupcounter

\[INTERN\] index of next attribute group

flags

\[INTERN\] file ops related flags including busy flag.

debugfs\_dentry

\[INTERN\] device specific debugfs dentry.

cached\_reg\_addr

\[INTERN\] cached register address for debugfs reads.

## AUTHOR

**Daniel Baluta** \<daniel.baluta@intel.com\>

Author.

## COPYRIGHT
