linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Baluta <daniel.baluta@intel.com>
To: jic23@kernel.org
Cc: jlbec@evilplan.org, lars@metafoo.de, knaack.h@gmx.de,
	pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, octavian.purdila@intel.com,
	daniel.baluta@intel.com
Subject: [PATCH 3/3] iio: Documentation: Add initial documentaton for IIO
Date: Wed, 25 Mar 2015 19:00:32 +0200	[thread overview]
Message-ID: <1427302832-9336-4-git-send-email-daniel.baluta@intel.com> (raw)
In-Reply-To: <1427302832-9336-1-git-send-email-daniel.baluta@intel.com>

This file wants to be a starting point document for anyone wanting
to use IIO configfs support or adding new IIO configfs functionality.

Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
---
 Documentation/iio/iio_configfs.txt | 74 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 Documentation/iio/iio_configfs.txt

diff --git a/Documentation/iio/iio_configfs.txt b/Documentation/iio/iio_configfs.txt
new file mode 100644
index 0000000..494f4ff
--- /dev/null
+++ b/Documentation/iio/iio_configfs.txt
@@ -0,0 +1,74 @@
+Industrial IIO configfs support
+
+1. Overview
+
+Configfs is a filesystem-based manager of kernel objects. IIO uses some
+objects that could be easily configured using configfs (e.g: devices,
+triggers).
+
+See Documentation/filesystems/configfs/configfs.txt for more information about
+how configfs works.
+
+2. Usage
+
+In order to use configfs support in IIO we need to select it at compile time
+via CONFIG_IIO_CONFIGFS config option.
+
+Then, mount the configfs filesystem (usually under /config directory):
+
+$ mkdir /config
+$ mount -t configfs none /config
+
+At this point, all default IIO groups will be creatd and can be accessed under
+/config/iio. Next chapters will describe available IIO configurable objects.
+
+2.1. Software triggers creation and destruction
+
+One of the IIO default configfs groups is the "triggers" groups. It is
+automagically accessible when the configfs is mounted and can be found under
+/config/iio/triggers.
+
+2.1.1. Trigger creation
+
+As simply as:
+
+$ mkdir /config/triggers/my_trigger
+
+This will create a directory associated with a trigger. To understand how this
+works we first need to see "my_triggers"'s attributes:
+
+$ ls /config/triggers/my_trigger
+activate            sampling_frequency  type
+
+Available types for triggers are:
+	* none, this is a default dummy trigger that does nothing.
+	* hrtimer, this is trigger based on high resolution timer.
+
+Order of operations in order to create a "hrtimer" trigger:
+
+$ echo hrtimer > /config/triggers/my_trigger/type
+$ echo 1 > /config/triggers/my_trigger/activate
+$ echo 100 > /config/triggers/my_trigger/sampling_frequency
+
+At this point the trigger can be used by an IIO device.
+
+2.1.2 Trigger destruction
+
+$ echo 1 > /config/triggers/my_trigger/activate
+
+3. Misc
+
+In order to add a new trigger type, one need to implement a driver that creates
+an instance of struct iio_configfs_ops (see iio_configfs_trigger.h header file
+in include/linux/iio) and then support it in iio_trigger_set_configfs_ops
+function from industrialiio-configfs.c file.
+
+These are the existing drivers implementing new trigger types:
+	* hrtimer => iio/trigger/iio-trig-hrtimer.c
+
+4. Further work
+
+* IIO dummy device creation
+* Mappings to 'soft' in kernel users such as iio_input and iio_hwmon
+* IIO on IIO drivers
+
-- 
1.9.1

  parent reply	other threads:[~2015-03-25 17:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 17:00 [PATCH 0/3] Add configfs support for software triggers in IIO Daniel Baluta
2015-03-25 17:00 ` [PATCH 1/3] iio: configfs: Add configfs support to IIO Daniel Baluta
2015-03-25 17:23   ` Peter Meerwald
2015-03-25 20:14   ` Paul Bolle
2015-03-26 10:13     ` Daniel Baluta
2015-03-27 17:17   ` Lars-Peter Clausen
2015-03-28 11:50     ` Jonathan Cameron
2015-03-31 13:20       ` Daniel Baluta
2015-03-25 17:00 ` [PATCH 2/3] iio: trigger: Add support for highres timer trigger Daniel Baluta
2015-03-25 17:00 ` Daniel Baluta [this message]
2015-03-25 17:22   ` [PATCH 3/3] iio: Documentation: Add initial documentaton for IIO Peter Meerwald
2015-03-25 19:28     ` Daniel Baluta
2015-03-28 11:53       ` Jonathan Cameron
2015-03-31 14:33         ` Daniel Baluta
2015-03-28 11:54   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427302832-9336-4-git-send-email-daniel.baluta@intel.com \
    --to=daniel.baluta@intel.com \
    --cc=jic23@kernel.org \
    --cc=jlbec@evilplan.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=octavian.purdila@intel.com \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).