Add initial configfs support for IIO
Subsystems (4)
v9 cover Add initial configfs support for IIO
This patchset introduces IIO software triggers, offers a way of configuring them via configfs and adds the IIO hrtimer based interrupt source to be used with software triggers.
The arhitecture is now split in 3 parts, to remove all IIO trigger specific parts from IIO configfs core:
(1) IIO configfs - creates the root of the IIO configfs subsys.
(2) IIO software triggers - software trigger implementation, dynamically creating /config/iio/triggers group.
(3) IIO hrtimer trigger - is the first interrupt source for software triggers (with syfs to follow). Each trigger type can implement its own set of attributes.
Lockdep seems to be happy with the locking in configfs patch.
Changes since v8:
* patch 1/5
* dynamically allocate groups as suggested by Christoph
* add kernel-doc documentation to the newly introduced functions
* patch 2/5
* better isolation, here we only create the root of the IIO configfs subys, and let the other modules (e.g software triggers) to create their group.
* patch 3/5
* dynamically create triggers/ group to better isolate the code
* fixes 0-day build warnings and compilation errors.
* patch 4/5
* none
* patch 5/5
* none
Changes since v7:
* patch 1/5
* do not add dentry parameter for create_default_group, we can retrieve it from group.
* call configfs_detach_prep before configfs_detach_group in configfs_unregister_group.
* call link_group/unlink_group under su_mutex lock
* take configfs_dirent_lock when calling configfs_dir_set_ready
* patch 2/5
* export iio_triggers_group, this will be later used by sw triggers
* patch 3/5
* make iio_sw_trigger part of industrialio core
* fix compilation problem reported by Vladimir and Lars. Things didn't get well when having IIO_SW_TRIGGER enabled and IIO_CONFIGFS disabled.
* use format string in config_item_set_name
* make iio_unregister_sw_trigger_type return type void.
* patch 4/5
* none
* patch 5/5
* include a small trigger type sample example.
Changes since v6:
* implemented Lars-Peter's idea (https://lkml.org/lkml/2015/5/13/302)
to switch from /config/iio/triggers/hrtimer-instance1 to /config/iio/triggers/instance1.
Changes since v5: (after Lars comments)
* the most important change is that we moved sampling_frequency attribute from configfs to trigger's directory in /sys.
* couple of const added to strings
* documentation to public API in sw_trigger.h
* replace pr_err with WARN_ONCE in trigger_make_group to avoid spamming kernel log, but without leaving user clueless in case of errors.
* we still need to decide if we get a real gain by adding min/max limits for sampling frequency in /config dir. Anyhow, this can be done in a later patch.
* fix race in hrtimer_remove
Changes since v4:
* patch 1/4
- fixed "new line" nit in industrialio-sw-trigger.c
- added license header in sw_trigger.h o
* patch 2/4
- none
* patch 3/4
- none
* patch 4/4
- removed "Further work" chapter in iio_configfs.txt
- added configfs-iio file in Documentation/ABI/testing
Daniel Baluta (5):
configfs: Allow dynamic group creation
iio: core: Introduce IIO configfs support
iio: core: Introduce IIO software triggers
iio: trigger: Introduce IIO hrtimer based trigger
iio: Documentation: Add IIO configfs documentation
Documentation/ABI/testing/configfs-iio | 21 ++++ Documentation/iio/iio_configfs.txt | 93 +++++++++++++++ drivers/iio/Kconfig | 16 +++ drivers/iio/Makefile | 2 + drivers/iio/industrialio-configfs.c | 50 ++++++++ drivers/iio/industrialio-sw-trigger.c | 206 +++++++++++++++++++++++++++++++++ drivers/iio/trigger/Kconfig | 10 ++ drivers/iio/trigger/Makefile | 2 + drivers/iio/trigger/iio-trig-hrtimer.c | 193 ++++++++++++++++++++++++++++++ fs/configfs/dir.c | 102 ++++++++++++++++ include/linux/configfs.h | 8 ++ include/linux/iio/sw_trigger.h | 71 ++++++++++++ 12 files changed, 774 insertions(+) create mode 100644 Documentation/ABI/testing/configfs-iio create mode 100644 Documentation/iio/iio_configfs.txt create mode 100644 drivers/iio/industrialio-configfs.c create mode 100644 drivers/iio/industrialio-sw-trigger.c create mode 100644 drivers/iio/trigger/iio-trig-hrtimer.c create mode 100644 include/linux/iio/sw_trigger.h
Signature · 1 line
1.9.1
PATCH v9 1/5 configfs: Allow dynamic group creation
We don't want to hardcode default groups at subsystem creation time. We export:
* configfs_register_group
* configfs_unregister_group
to allow drivers to programatically create/destroy groups later, after module init time.
This is needed for IIO configfs support.
--- fs/configfs/dir.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++ include/linux/configfs.h | 8 ++++ 2 files changed, 110 insertions(+)
fs/configfs/dir.c +102 -0
@@ -1636,6 +1636,108 @@ const struct file_operations configfs_dir_operations = { .iterate = configfs_readdir, }; +/** +* configfs_alloc_group() - allocate a configfs group +* @name: group name +* @item_type: config_item associated with the allocated group +* +* Dynamically allocates and initialize a group specified by name and +* config_item_type. We need kzalloc'ed memory because default_group +* is empty. +* +* Return: allocated config group or ERR_PTR() on error +*/ +struct config_group * +configfs_alloc_group (const char *name,struct config_item_type *item_type) +{ +struct config_group *group; + + group =kzalloc (sizeof (*group),GFP_KERNEL ); +if (!group) +return ERR_PTR (-ENOMEM ); +config_group_init_type_name (group, name, item_type); + +return group; +} +EXPORT_SYMBOL (configfs_alloc_group); + +/** +* configfs_free_group() - frees memory for a configfs group +* @group: group to be 'eliberated' +*/ +void configfs_free_group (struct config_group *group) +{ +kfree (group); +} +EXPORT_SYMBOL (configfs_free_group); + +/** +* configfs_register_group - creates a parent-child relation between two groups +* @parent_group: parent group +* @group: child group +* +* link groups, creates dentry for the child and attaches it to the +* parent dentry. +* +* Return: 0 on success, negative errno code on error +*/ +int configfs_register_group (struct config_group *parent_group, +struct config_group *group) +{ +struct configfs_subsystem *subsys = parent_group->cg_subsys; +struct dentry *parent; +int ret; + +mutex_lock (&subsys->su_mutex); +link_group (parent_group, group); +mutex_unlock (&subsys->su_mutex); + + parent = parent_group->cg_item.ci_dentry; + +mutex_lock_nested (&d_inode (parent)->i_mutex,I_MUTEX_PARENT ); + ret =create_default_group (parent_group, group); +if (!ret) { +spin_lock (&configfs_dirent_lock); +configfs_dir_set_ready (group->cg_item.ci_dentry->d_fsdata); +spin_unlock (&configfs_dirent_lock); + } +mutex_unlock (&d_inode (parent)->i_mutex); +return ret; +} +EXPORT_SYMBOL (configfs_register_group); + +/** +* configfs_unregister_group() - unregisters a child group from its parent +* +* @group: parent group to be unregistered +* +* Undoes condigfs_register_group() +*/ +void configfs_unregister_group (struct config_group *group) +{ +struct configfs_subsystem *subsys = group->cg_subsys; +struct dentry *dentry = group->cg_item.ci_dentry; +struct dentry *parent = group->cg_item.ci_parent->ci_dentry; + +mutex_lock_nested (&d_inode (parent)->i_mutex,I_MUTEX_PARENT ); +spin_lock (&configfs_dirent_lock); +configfs_detach_prep (dentry,NULL ); +spin_unlock (&configfs_dirent_lock); + +configfs_detach_group (&group->cg_item); +d_inode (dentry)->i_flags |=S_DEAD ; +dont_mount (dentry); +d_delete (dentry); +mutex_unlock (&d_inode (parent)->i_mutex); + +dput (dentry); + +mutex_lock (&subsys->su_mutex); +unlink_group (group); +mutex_unlock (&subsys->su_mutex); +} +EXPORT_SYMBOL (configfs_unregister_group); +int configfs_register_subsystem (struct configfs_subsystem *subsys) {int err;
include/linux/configfs.h +8 -0
@@ -252,6 +252,14 @@ static inline struct configfs_subsystem *to_configfs_subsystem(struct config_groint configfs_register_subsystem (struct configfs_subsystem *subsys);void configfs_unregister_subsystem (struct configfs_subsystem *subsys); +struct config_group * +configfs_alloc_group (const char *name,struct config_item_type *item_type); +void configfs_free_group (struct config_group *group); + +int configfs_register_group (struct config_group *parent_group, +struct config_group *group); +void configfs_unregister_group (struct config_group *group); +/* These functions can sleep and can alloc with GFP_KERNEL */ /* WARNING: These cannot be called underneath configfs callbacks!! */ int configfs_depend_item (struct configfs_subsystem *subsys,struct config_item *target);
Signature · 1 line
1.9.1
Re: [PATCH v9 1/5] configfs: Allow dynamic group creation
Hi Daniel,
all these functions look great, but can you also move your new iio_sw_trigger_type_configfs_register/unregister functions to the core code as those are the wrappers that everyone would have to write, e.g. something like:
int configfs_register_default_group(struct config_group *parent_group,
const char *name, struct config_item_type *item_type)
{
struct config_group *group;
group = kzalloc(sizeof(*group), GFP_KERNEL);
if (!group)
return -ENOMEM;
config_group_init_type_name(group, name, item_type);
ret = configfs_register_group(parent_group, group);
if (ret)
kfree(group);
return ret;
}and the same on the unregister side?
With that:
Re: [PATCH v9 1/5] configfs: Allow dynamic group creation
Quoted 23 lines · Christoph Hellwig
Hi Daniel,
all these functions look great, but can you also move your new iio_sw_trigger_type_configfs_register/unregister functions to the core code as those are the wrappers that everyone would have to write, e.g. something like:
int configfs_register_default_group(struct
config_group*parent_group,
const char *name, structconfig_item_type*item_type){ struct config_group *group; group = kzalloc(sizeof(*group), GFP_KERNEL); if (!group) return -ENOMEM; config_group_init_type_name(group, name, item_type); ret = configfs_register_group(parent_group, group); if (ret) kfree(group); return ret; }
Quoted 1 line
and the same on the unregister side?
Yes, this is a good idea. Will do!
Quoted 4 lines
With that:
Reviewed-by Christoph Hellwig <[email protected]>
thanks,
Daniel.
Re: [PATCH v9 1/5] configfs: Allow dynamic group creation
In reply to Christoph HellwigChristoph, one question. See below.
Quoted 9 lines · Christoph Hellwig
Hi Daniel,
all these functions look great, but can you also move your new iio_sw_trigger_type_configfs_register/unregister functions to the core code as those are the wrappers that everyone would have to write, e.g. something like:
int configfs_register_default_group(struct
config_group*parent_group,
const char *name, structconfig_item_type*item_type)
Quoted 7 lines
{
struct config_group *group;
group = kzalloc(sizeof(*group), GFP_KERNEL);
if (!group)
return -ENOMEM;
config_group_init_type_name(group, name, item_type);Until this point this is the implementation of configfs_alloc_group.
We have two options:
1) Remove configfs_alloc_group/configfs_free_group as people will directly use our new configfs_register_default_group that does the allocation.
2) Keep configfs_alloc/group/configfs_gree_group and use it here.
I'm in favour of 1) variant, as it makes little sense to have a wrapper over kmalloc + config_group_init_type_name.
thanks,
Daniel.
PATCH v9 2/5 iio: core: Introduce IIO configfs support
In reply to Daniel BalutaThis patch creates the IIO configfs root group. The group will appear under <mount-point>/iio/, usually /config/iio.
We introduce configfs support in IIO in order to be able to easily create IIO objects from userspace. The first supported IIO objects are triggers introduced with next patches.
--- drivers/iio/Kconfig | 8 ++++++ drivers/iio/Makefile | 1 + drivers/iio/industrialio-configfs.c | 50 +++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 drivers/iio/industrialio-configfs.c
drivers/iio/Kconfig +8 -0
@@ -22,6 +22,14 @@ if IIO_BUFFER source "drivers/iio/buffer/Kconfig" endif # IIO_BUFFER +config IIO_CONFIGFS + tristate "Enable IIO configuration via configfs" + select CONFIGFS_FS + help + This allows configuring various IIO bits through configfs + (e.g. software triggers). For more info see + Documentation/iio/iio_configfs.txt. + config IIO_TRIGGER bool "Enable triggered sampling support" help
drivers/iio/Makefile +1 -0
@@ -7,6 +7,7 @@ industrialio-y := industrialio-core.o industrialio-event.o inkern.o industrialio-$(CONFIG_IIO_BUFFER) += industrialio-buffer.o industrialio-$(CONFIG_IIO_TRIGGER) += industrialio-trigger.o +obj-$(CONFIG_IIO_CONFIGFS) += industrialio-configfs.o obj-$(CONFIG_IIO_TRIGGERED_EVENT) += industrialio-triggered-event.o obj-y += accel/
drivers/iio/industrialio-configfs.c new file +50 -0
50 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v9 3/5 iio: core: Introduce IIO software triggers
In reply to Daniel BalutaA software trigger associates an IIO device trigger with a software interrupt source (e.g: timer, sysfs). This patch adds the generic infrastructure for handling software triggers.
Software interrupts sources are kept in a iio_trigger_types_list and registered separately when the associated kernel module is loaded.
Software triggers can be created directly from drivers or from user space via configfs interface.
To sum up, this dynamically creates "triggers" group to be found under /config/iio/triggers and offers the possibility of dynamically creating trigger types group. The first support trigger type is "hrtimer" found under /config/iio/triggers/hrtimer.
--- drivers/iio/Kconfig | 8 ++ drivers/iio/Makefile | 1 + drivers/iio/industrialio-sw-trigger.c | 206 ++++++++++++++++++++++++++++++++++ include/linux/iio/sw_trigger.h | 71 ++++++++++++ 4 files changed, 286 insertions(+) create mode 100644 drivers/iio/industrialio-sw-trigger.c create mode 100644 include/linux/iio/sw_trigger.h
drivers/iio/Kconfig +8 -0
@@ -46,6 +46,14 @@ config IIO_CONSUMERS_PER_TRIGGER This value controls the maximum number of consumers that a given trigger may handle. Default is 2. +config IIO_SW_TRIGGER + tristate "Enable software triggers support" + select IIO_CONFIGFS + help + Provides IIO core support for software triggers. A software + trigger can be created via configfs or directly by a driver + using the API provided. + config IIO_TRIGGERED_EVENT tristate select IIO_TRIGGER
drivers/iio/Makefile +1 -0
@@ -8,6 +8,7 @@ industrialio-$(CONFIG_IIO_BUFFER) += industrialio-buffer.o industrialio-$(CONFIG_IIO_TRIGGER) += industrialio-trigger.o obj-$(CONFIG_IIO_CONFIGFS) += industrialio-configfs.o +obj-$(CONFIG_IIO_SW_TRIGGER) += industrialio-sw-trigger.o obj-$(CONFIG_IIO_TRIGGERED_EVENT) += industrialio-triggered-event.o obj-y += accel/
drivers/iio/industrialio-sw-trigger.c new file +206 -0
206 lines not on this page · raw message
include/linux/iio/sw_trigger.h new file +71 -0
71 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v9 4/5 iio: trigger: Introduce IIO hrtimer based trigger
In reply to Daniel BalutaThis patch registers a new IIO software trigger interrupt source based on high resolution timers.
Notice that if configfs is enabled we create sampling_frequency attribute allowing users to change hrtimer period (1/sampling_frequency).
The IIO hrtimer trigger has a long history, this patch is based on an older version from Marten and Lars-Peter.
--- drivers/iio/trigger/Kconfig | 10 ++ drivers/iio/trigger/Makefile | 2 + drivers/iio/trigger/iio-trig-hrtimer.c | 193 +++++++++++++++++++++++++++++++++ 3 files changed, 205 insertions(+) create mode 100644 drivers/iio/trigger/iio-trig-hrtimer.c
drivers/iio/trigger/Kconfig +10 -0
@@ -5,6 +5,16 @@ menu "Triggers - standalone" +config IIO_HRTIMER_TRIGGER + tristate "High resolution timer trigger" + depends on IIO_SW_TRIGGER + help + Provides a frequency based IIO trigger using high resolution + timers as interrupt source. + + To compile this driver as a module, choose M here: the + module will be called iio-trig-hrtimer. + config IIO_INTERRUPT_TRIGGER tristate "Generic interrupt trigger" help
drivers/iio/trigger/Makefile +2 -0
@@ -3,5 +3,7 @@ # # When adding new entries keep the list in alphabetical order + +obj-$(CONFIG_IIO_HRTIMER_TRIGGER) += iio-trig-hrtimer.o obj-$(CONFIG_IIO_INTERRUPT_TRIGGER) += iio-trig-interrupt.o obj-$(CONFIG_IIO_SYSFS_TRIGGER) += iio-trig-sysfs.o
drivers/iio/trigger/iio-trig-hrtimer.c new file +193 -0
193 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v9 4/5] iio: trigger: Introduce IIO hrtimer based trigger
Quoted 259 lines · Daniel Baluta
This patch registers a new IIO software trigger interrupt source based on high resolution timers.
Notice that if configfs is enabled we create
sampling_frequencyattribute allowing users to change hrtimer period (1/sampling_frequency).The IIO hrtimer trigger has a long history, this patch is based on an older version from Marten and Lars-Peter.
Signed-off-by Lars-Peter Clausen <lars-Qo5EllUWu/[email protected]>Signed-off-by Daniel Baluta <[email protected]>--- drivers/iio/trigger/Kconfig | 10 ++ drivers/iio/trigger/Makefile | 2 + drivers/iio/trigger/iio-trig-hrtimer.c | 193 +++++++++++++++++++++++++++++++++ 3 files changed, 205 insertions(+) create mode 100644 drivers/iio/trigger/iio-trig-hrtimer.cdrivers/iio/trigger/Kconfig +10
-0@@ -5,6 +5,16 @@ menu "Triggers - standalone" +config IIO_HRTIMER_TRIGGER + tristate "High resolution timer trigger" + depends on IIO_SW_TRIGGER + help + Provides a frequency based IIO trigger using high resolution + timers as interrupt source. + + To compile this driver as a module, choose M here: the + module will be called iio-trig-hrtimer. + config IIO_INTERRUPT_TRIGGER tristate "Generic interrupt trigger" helpdrivers/iio/trigger/Makefile +2
-0@@ -3,5 +3,7 @@ # # When adding new entries keep the list in alphabetical order + +obj-$(CONFIG_IIO_HRTIMER_TRIGGER) += iio-trig-hrtimer.o obj-$(CONFIG_IIO_INTERRUPT_TRIGGER) += iio-trig-interrupt.o obj-$(CONFIG_IIO_SYSFS_TRIGGER) += iio-trig-sysfs.odrivers/iio/trigger/iio-trig-hrtimer.c new file +193
-1@@ -0,0 +1,193 @@ +/** +* The industrial I/O periodic hrtimer trigger driver +* +* Copyright (C) Intuitive Aerial AB +* Written by Marten Svanfeldt, marten-4zOpVvZifTgX8gGd4fc/[email protected] +* Copyright (C) 2012, Analog Device Inc. +* Author: Lars-Peter Clausen <lars-Qo5EllUWu/[email protected]> +* Copyright (C) 2015, Intel Corporation +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +*/ +#include <linux/kernel.h> +#include <linux/slab.h> +#include <linux/hrtimer.h> + +#include <linux/iio/iio.h> +#include <linux/iio/trigger.h> +#include <linux/iio/sw_trigger.h> + +/* default sampling frequency - 100Hz */ +#define HRTIMER_DEFAULT_SAMPLING_FREQUENCY 100 + +struct iio_hrtimer_info { +struct iio_sw_trigger swt; +struct hrtimer timer; +unsigned long sampling_frequency; +ktime_t period; +}; + +static struct config_item_type iio_hrtimer_type = { + .ct_owner =THIS_MODULE , +}; + +static +ssize_t iio_hrtimer_show_sampling_frequency (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct iio_trigger *trig =to_iio_trigger (dev); +struct iio_hrtimer_info *info =iio_trigger_get_drvdata (trig); + +return snprintf (buf,PAGE_SIZE ,"%lu\n" , info->sampling_frequency); +} + +static +ssize_t iio_hrtimer_store_sampling_frequency (struct device *dev, +struct device_attribute *attr, +const char *buf,size_t len) +{ +struct iio_trigger *trig =to_iio_trigger (dev); +struct iio_hrtimer_info *info =iio_trigger_get_drvdata (trig); +unsigned long val; +int ret; + + ret =kstrtoul (buf,10 , &val); +if (ret) +return ret; + +if (!val || val >NSEC_PER_SEC ) +return -EINVAL ; + + info->sampling_frequency = val; + info->period =ktime_set (0 ,NSEC_PER_SEC / val); + +return len; +} + +static DEVICE_ATTR(sampling_frequency, S_IRUGO | S_IWUSR, + iio_hrtimer_show_sampling_frequency, + iio_hrtimer_store_sampling_frequency); + +static struct attribute *iio_hrtimer_attrs[] = { + &dev_attr_sampling_frequency.attr, +NULL +}; + +static const struct attribute_group iio_hrtimer_attr_group = { + .attrs = iio_hrtimer_attrs, +}; + +static const struct attribute_group *iio_hrtimer_attr_groups[] = { + &iio_hrtimer_attr_group, +NULL +}; + +static enum hrtimer_restart iio_hrtimer_trig_handler (struct hrtimer *timer) +{ +struct iio_hrtimer_info *info; + + info = container_of(timer, struct iio_hrtimer_info, timer); + +hrtimer_forward_now (timer, info->period); +iio_trigger_poll (info->swt.trigger); + +return HRTIMER_RESTART ; +} + +static int iio_trig_hrtimer_set_state (struct iio_trigger *trig,bool state) +{ +struct iio_hrtimer_info *trig_info; + + trig_info =iio_trigger_get_drvdata (trig); + +if (state) +hrtimer_start (&trig_info->timer, trig_info->period, +HRTIMER_MODE_REL ); +else +hrtimer_cancel (&trig_info->timer); + +return 0 ; +} + +static const struct iio_trigger_ops iio_hrtimer_trigger_ops = { + .owner =THIS_MODULE , + .set_trigger_state = iio_trig_hrtimer_set_state, +}; + +static struct iio_sw_trigger *iio_trig_hrtimer_probe (const char *name) +{ +struct iio_hrtimer_info *trig_info; +int ret; + + trig_info =kzalloc (sizeof (*trig_info),GFP_KERNEL ); +if (!trig_info) +return ERR_PTR (-ENOMEM ); + + trig_info->swt.trigger =iio_trigger_alloc ("%s" , name); +if (!trig_info->swt.trigger) { + ret = -ENOMEM ; + goto err_free_trig_info; + } + +iio_trigger_set_drvdata (trig_info->swt.trigger, trig_info); + trig_info->swt.trigger->ops = &iio_hrtimer_trigger_ops; + trig_info->swt.trigger->dev.groups = iio_hrtimer_attr_groups; + +hrtimer_init (&trig_info->timer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); + trig_info->timer.function = iio_hrtimer_trig_handler; + + trig_info->sampling_frequency =HRTIMER_DEFAULT_SAMPLING_FREQUENCY ; + trig_info->period =ktime_set (0 ,NSEC_PER_SEC / + trig_info->sampling_frequency); + + ret =iio_trigger_register (trig_info->swt.trigger); +if (ret) + goto err_free_trigger; + +iio_swt_group_init_type_name (&trig_info->swt, name, &iio_hrtimer_type); +return &trig_info->swt; +err_free_trigger: +iio_trigger_free (trig_info->swt.trigger); +err_free_trig_info: +kfree (trig_info); + +return ERR_PTR (ret); +} + +static int iio_trig_hrtimer_remove (struct iio_sw_trigger *swt) +{ +struct iio_hrtimer_info *trig_info; + + trig_info =iio_trigger_get_drvdata (swt->trigger); + +iio_trigger_unregister (swt->trigger); + +/* cancel the timer after unreg to make sure no one rearms it */ +hrtimer_cancel (&trig_info->timer); +iio_trigger_free (swt->trigger); +kfree (trig_info); + +return 0 ; +} + +static const struct iio_sw_trigger_ops iio_trig_hrtimer_ops = { + .probe = iio_trig_hrtimer_probe, + .remove = iio_trig_hrtimer_remove, +}; + +static struct iio_sw_trigger_type iio_trig_hrtimer = { + .name ="hrtimer" , + .owner =THIS_MODULE , + .ops = &iio_trig_hrtimer_ops, +}; + +module_iio_sw_trigger_driver (iio_trig_hrtimer); + +MODULE_AUTHOR ("Marten Svanfeldt <marten-4zOpVvZifTgX8gGd4fc/[email protected]>" ); +MODULE_AUTHOR ("Daniel Baluta <[email protected]>" ); +MODULE_DESCRIPTION ("Periodic hrtimer trigger for the IIO subsystem" ); +MODULE_LICENSE ("GPL v2" ); --1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
PATCH v9 5/5 iio: Documentation: Add IIO configfs documentation
In reply to Daniel Baluta--- Documentation/ABI/testing/configfs-iio | 21 ++++++++ Documentation/iio/iio_configfs.txt | 93 ++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 Documentation/ABI/testing/configfs-iio create mode 100644 Documentation/iio/iio_configfs.txt
Documentation/ABI/testing/configfs-iio new file +21 -0
@@ -0,0 +1,21 @@ +What: /config/iio +Date: October 2015 +KernelVersion: 4.4 +Contact: [email protected] +Description: + This represents Industrial IO configuration entry point + directory. It contains sub-groups corresponding to IIO + objects. + +What: /config/iio/triggers +Date: October 2015 +KernelVersion: 4.4 +Description: + Industrial IO software triggers directory. + +What: /config/iio/triggers/hrtimers +Date: October 2015 +KernelVersion: 4.4 +Description: + High resolution timers directory. Creating a directory here + will result in creating a hrtimer trigger in the IIO subsystem.
Documentation/iio/iio_configfs.txt new file +93 -0
93 lines not on this page · raw message
Signature · 1 line
1.9.1