IIO: TRIGGER: New sysfs based trigger
Subsystems (3)
PATCH 1/1 IIO: TRIGGER: New sysfs based trigger
From: Michael Hennerich <[email protected]>
This patch adds a new trigger that can be invoked by writing
the sysfs file: trigger_now. This approach can be valuable during automated testing or in situations, where other trigger methods are not applicable. For example no RTC or spare GPIOs.
Last but not least we can allow user space applications to produce triggers.
IIO: TRIGGER: Apply review feedback by Greg Kroah-Hartman
Changes since v1:
Add sysfs documentation.
Change license notice.
Add module alias.
Add more Kconfig help text
--- .../iio/Documentation/sysfs-bus-iio-trigger-sysfs | 11 ++ drivers/staging/iio/trigger/Kconfig | 10 ++ drivers/staging/iio/trigger/Makefile | 1 + drivers/staging/iio/trigger/iio-trig-sysfs.c | 108 ++++++++++++++++++++ 4 files changed, 130 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/Documentation/sysfs-bus-iio-trigger-sysfs create mode 100644 drivers/staging/iio/trigger/iio-trig-sysfs.c
drivers/staging/iio/Documentation/sysfs-bus-iio-trigger-sysfs new file +11 -0
@@ -0,0 +1,11 @@ +What: /sys/bus/iio/devices/triggerX/trigger_now +KernelVersion: 2.6.38 +Contact: [email protected] +Description: + This file is provided by the iio-trig-sysfs stand-alone trigger + driver. Writing this file with any value triggers an event + driven driver, associated with this trigger, to capture data + into an in kernel buffer. This approach can be valuable during + automated testing or in situations, where other trigger methods + are not applicable. For example no RTC or spare GPIOs. + X is the IIO index of the trigger.
drivers/staging/iio/trigger/Kconfig +10 -0
@@ -18,4 +18,14 @@ config IIO_GPIO_TRIGGER help Provides support for using GPIO pins as IIO triggers. +config IIO_SYSFS_TRIGGER + tristate "SYSFS trigger" + depends on SYSFS + help + Provides support for using SYSFS entry as IIO triggers. + If unsure, say N (but it's safe to say "Y"). + + To compile this driver as a module, choose M here: the + module will be called iio-trig-sysfs. + endif # IIO_TRIGGER
drivers/staging/iio/trigger/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-$(CONFIG_IIO_PERIODIC_RTC_TRIGGER) += iio-trig-periodic-rtc.o obj-$(CONFIG_IIO_GPIO_TRIGGER) += iio-trig-gpio.o +obj-$(CONFIG_IIO_SYSFS_TRIGGER) += iio-trig-sysfs.o
drivers/staging/iio/trigger/iio-trig-sysfs.c new file +108 -0
108 lines not on this page · raw message
--
1.6.0.2
Re: [PATCH] Staging: IIO: TRIGGER: New sysfs based trigger
Quoted 9 lines · On Mon, Feb 07, 2011 at 11:05:46AM +0100, [email protected] wrote:
From: Michael Hennerich <[email protected]>
This patch adds a new trigger that can be invoked by writing
the sysfs file:trigger_now. This approach can be valuable during automated testing or in situations, where other trigger methods are not applicable. For example no RTC or spare GPIOs.
Last but not least we can allow user space applications to produce triggers.IIO: TRIGGER: Apply review feedback by Greg Kroah-Hartman
Well, I don't really like it, as I still don't know, as a distro maintainer, if I need to enable this or not, and there's no auto-load capability, but hey, my distro(s) don't enable these drivers anyway, so I don't have to worry about it :)
thanks,
greg k-h