1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>struct iio_dev</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Industrial I/O driver developer's guide"><link rel="up" href="iiosubsys.html#iiodevice" title="Industrial I/O devices"><link rel="prev" href="iiosubsys.html" title="Chapter 2. Industrial I/O core"><link rel="next" href="API-iio-device-alloc.html" title="iio_device_alloc"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct iio_dev</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="iiosubsys.html">Prev</a> </td><th width="60%" align="center"> Industrial I/O devices </th><td width="20%" align="right"> <a accesskey="n" href="API-iio-device-alloc.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-iio-dev"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct iio_dev — 2 industrial I/O device 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting"> 4struct iio_dev { 5 int id; 6 int modes; 7 int currentmode; 8 struct device dev; 9 struct iio_event_interface * event_interface; 10 struct iio_buffer * buffer; 11 struct list_head buffer_list; 12 int scan_bytes; 13 struct mutex mlock; 14 const unsigned long * available_scan_masks; 15 unsigned masklength; 16 const unsigned long * active_scan_mask; 17 bool scan_timestamp; 18 unsigned scan_index_timestamp; 19 struct iio_trigger * trig; 20 struct iio_poll_func * pollfunc; 21 struct iio_poll_func * pollfunc_event; 22 struct iio_chan_spec const * channels; 23 int num_channels; 24 struct list_head channel_attr_list; 25 struct attribute_group chan_attr_group; 26 const char * name; 27 const struct iio_info * info; 28 struct mutex info_exist_lock; 29 const struct iio_buffer_setup_ops * setup_ops; 30 struct cdev chrdev; 31#define IIO_MAX_GROUPS 6 32 const struct attribute_group * groups[IIO_MAX_GROUPS + 1]; 33 int groupcounter; 34 unsigned long flags; 35#if defined(CONFIG_DEBUG_FS) 36 struct dentry * debugfs_dentry; 37 unsigned cached_reg_addr; 38#endif 39}; </pre></div><div class="refsect1"><a name="id-1.4.3.2.5"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">id</span></dt><dd><p> 40[INTERN] used to identify device internally 41 </p></dd><dt><span class="term">modes</span></dt><dd><p> 42[DRIVER] operating modes supported by device 43 </p></dd><dt><span class="term">currentmode</span></dt><dd><p> 44[DRIVER] current operating mode 45 </p></dd><dt><span class="term">dev</span></dt><dd><p> 46[DRIVER] device structure, should be assigned a parent 47and owner 48 </p></dd><dt><span class="term">event_interface</span></dt><dd><p> 49[INTERN] event chrdevs associated with interrupt lines 50 </p></dd><dt><span class="term">buffer</span></dt><dd><p> 51[DRIVER] any buffer present 52 </p></dd><dt><span class="term">buffer_list</span></dt><dd><p> 53[INTERN] list of all buffers currently attached 54 </p></dd><dt><span class="term">scan_bytes</span></dt><dd><p> 55[INTERN] num bytes captured to be fed to buffer demux 56 </p></dd><dt><span class="term">mlock</span></dt><dd><p> 57[INTERN] lock used to prevent simultaneous device state 58changes 59 </p></dd><dt><span class="term">available_scan_masks</span></dt><dd><p> 60[DRIVER] optional array of allowed bitmasks 61 </p></dd><dt><span class="term">masklength</span></dt><dd><p> 62[INTERN] the length of the mask established from 63channels 64 </p></dd><dt><span class="term">active_scan_mask</span></dt><dd><p> 65[INTERN] union of all scan masks requested by buffers 66 </p></dd><dt><span class="term">scan_timestamp</span></dt><dd><p> 67[INTERN] set if any buffers have requested timestamp 68 </p></dd><dt><span class="term">scan_index_timestamp</span></dt><dd><p> 69[INTERN] cache of the index to the timestamp 70 </p></dd><dt><span class="term">trig</span></dt><dd><p> 71[INTERN] current device trigger (buffer modes) 72 </p></dd><dt><span class="term">pollfunc</span></dt><dd><p> 73[DRIVER] function run on trigger being received 74 </p></dd><dt><span class="term">pollfunc_event</span></dt><dd><p> 75[DRIVER] function run on events trigger being received 76 </p></dd><dt><span class="term">channels</span></dt><dd><p> 77[DRIVER] channel specification structure table 78 </p></dd><dt><span class="term">num_channels</span></dt><dd><p> 79[DRIVER] number of channels specified in <em class="parameter"><code>channels</code></em>. 80 </p></dd><dt><span class="term">channel_attr_list</span></dt><dd><p> 81[INTERN] keep track of automatically created channel 82attributes 83 </p></dd><dt><span class="term">chan_attr_group</span></dt><dd><p> 84[INTERN] group for all attrs in base directory 85 </p></dd><dt><span class="term">name</span></dt><dd><p> 86[DRIVER] name of the device. 87 </p></dd><dt><span class="term">info</span></dt><dd><p> 88[DRIVER] callbacks and constant info from driver 89 </p></dd><dt><span class="term">info_exist_lock</span></dt><dd><p> 90[INTERN] lock to prevent use during removal 91 </p></dd><dt><span class="term">setup_ops</span></dt><dd><p> 92[DRIVER] callbacks to call before and after buffer 93enable/disable 94 </p></dd><dt><span class="term">chrdev</span></dt><dd><p> 95[INTERN] associated character device 96 </p></dd><dt><span class="term">groups[IIO_MAX_GROUPS + 1]</span></dt><dd><p> 97[INTERN] attribute groups 98 </p></dd><dt><span class="term">groupcounter</span></dt><dd><p> 99[INTERN] index of next attribute group 100 </p></dd><dt><span class="term">flags</span></dt><dd><p> 101[INTERN] file ops related flags including busy flag. 102 </p></dd><dt><span class="term">debugfs_dentry</span></dt><dd><p> 103[INTERN] device specific debugfs dentry. 104 </p></dd><dt><span class="term">cached_reg_addr</span></dt><dd><p> 105[INTERN] cached register address for debugfs reads. 106 </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="iiosubsys.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="iiosubsys.html#iiodevice">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-iio-device-alloc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Industrial I/O core </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">iio_device_alloc</span></td></tr></table></div></body></html> 107