From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Barinov Subject: Re: [PATCH v7 5/5] iio: Documentation: Add IIO configfs documentation Date: Mon, 17 Aug 2015 15:01:57 +0300 Message-ID: <55D1CD35.7040404@cogentembedded.com> References: <1439246562-17515-1-git-send-email-daniel.baluta@intel.com> <1439246562-17515-6-git-send-email-daniel.baluta@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org, knaack.h-Mmb7MZpHnFY@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, pebolle-IWqWACnzNjzz+pZb47iToQ@public.gmane.org, patrick.porlan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, adriana.reus-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, constantin.musca-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, marten-4zOpVvZifTgX8gGd4fc/mEEOCMrvLtNR@public.gmane.org, cristina.opriceana-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org, hch-jcswGhMUV9g@public.gmane.org, viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org To: Daniel Baluta , jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, jlbec-aKy9MeLSZ9dg9hUCZPvPmw@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Return-path: In-Reply-To: <1439246562-17515-6-git-send-email-daniel.baluta-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Sender: linux-iio-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org Hi Daniel, Find minor comments. Regards, Vladimir On 11.08.2015 01:42, Daniel Baluta wrote: > Signed-off-by: Daniel Baluta > --- > Documentation/ABI/testing/configfs-iio | 20 ++++++++++++ > Documentation/iio/iio_configfs.txt | 57 ++++++++++++++++++++++++++++++++++ > 2 files changed, 77 insertions(+) > create mode 100644 Documentation/ABI/testing/configfs-iio > create mode 100644 Documentation/iio/iio_configfs.txt > > diff --git a/Documentation/ABI/testing/configfs-iio b/Documentation/ABI/testing/configfs-iio > new file mode 100644 > index 0000000..1fd7cf4 > --- /dev/null > +++ b/Documentation/ABI/testing/configfs-iio > @@ -0,0 +1,20 @@ > +What: /config/iio > +Date: May 2015 > +KernelVersion: 4.2 > +Contact: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > +Description: > + This represents Industrial IO configuration entry point > + directory. It contains sub-groups corresponding to IIO > + objects. > + > +What: /config/iio/triggers > +Date: August 2015 > +KernelVersion: 4.2 > +Description: > + Industrial IO software triggers directory. > + > +What: /config/iio/triggers/hrtimer > +Date: August 2015 > +KernelVersion: 4.2 > +Description: > + Industrial IO hrtimer based software triggers directory. > diff --git a/Documentation/iio/iio_configfs.txt b/Documentation/iio/iio_configfs.txt > new file mode 100644 > index 0000000..7c56997 > --- /dev/null > +++ b/Documentation/iio/iio_configfs.txt > @@ -0,0 +1,57 @@ > +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 created and can be accessed > +under /config/iio. Next chapters will describe available IIO configuration > +objects. > + > +3. Software triggers > + > +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. > + > +Software triggers are created under /config/iio/triggers directory. There > +must exist an associated kernel module that implements a software trigger type. > + > +We support now the following software trigger types: > + * hrtimer, uses high resolution timers as interrupt source implemened > + by the iio-trig-hrtimer.c module. > + > +3.1 Software triggers creation and destruction > + > +As simply as: > + > +$ insmod iio-trig-hrtimer.ko > +$ ls /config/triggers ls /config/iio/triggers/ > +hrtimer > +$ mkdir /config/triggers/hrtimer/trig1 mkdir /config/iio/triggers/hrtimer/trig1 This is confusing: $ cat /sys/bus//iio/devices/trigger0/name trig1 How may I know that this is a hrtimer trigger in case I've enabled couple of triggers or when sw_trigger support extends with other then hrtimer trigger? > + > +$ rmdir /config/triggers/hrtimer/trig1 ditto > +$ rmmod iio-trig-hrtimer > + > +Each trigger can have one or more attributes specific to the trigger type. > + > +3.2 "hrtimer" trigger types attributes > + > +"hrtimer" trigger type doesn't have any configurable attribute from /config dir, > +but hrtimer triggers have the sampling_frequency attribute under /sys/bus/iio/devices/triggerX > +directory.