Skip to contentSkip to conversation

IIO: TRIGGER: New sysfs based trigger

PATCH New [email protected] 1 participant 1 message Feb 3, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

---
 .../iio/Documentation/sysfs-bus-iio-trigger-sysfs  |   11 ++
 drivers/staging/iio/trigger/Kconfig                |    6 +
 drivers/staging/iio/trigger/Makefile               |    1 +
 drivers/staging/iio/trigger/iio-trig-sysfs.c       |  108 ++++++++++++++++++++
 4 files changed, 126 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
new file mode 100644
index 0000000..5235e6c
@@ -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 +6 -0
index d842a58..c185e47 100644
@@ -18,4 +18,10 @@ 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.
+
 endif # IIO_TRIGGER
drivers/staging/iio/trigger/Makefile +1 -0
index 10aeca5..504b9c0 100644
@@ -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

Signature · 1 line
1.6.0.2