Skip to contentSkip to conversation

iio: core : events ABI for specifying period

PATCH In review Srinivas Pandruvada 2 participants 3 messages Jul 8, 2014 – Jul 11, 2014 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: core : events ABI for specifying period

The iio sysfs ABI defines a way to specify period for roc and thresholds.
What: /sys/.../events/in_accel_x_thresh_rising_period
What: /sys/.../events/in_accel_x_thresh_falling_period
what: /sys/.../events/in_accel_x_roc_rising_period
What: /sys/.../events/in_accel_x_roc_falling_period

But there is no way to add period with the current event info enum.

Added IIO_EV_INFO_PERIOD and corresponding string.

---
 drivers/iio/industrialio-event.c | 1 +
 include/linux/iio/types.h        | 1 +
 2 files changed, 2 insertions(+)
drivers/iio/industrialio-event.c +1 -0
index bfbf4d4..0c1e37e 100644
@@ -209,6 +209,7 @@ static const char * const iio_ev_info_text[] = {
 	[IIO_EV_INFO_ENABLE] = "en",
 	[IIO_EV_INFO_VALUE] = "value",
 	[IIO_EV_INFO_HYSTERESIS] = "hysteresis",
+	[IIO_EV_INFO_PERIOD] = "period",
 };
 
 static enum iio_event_direction iio_ev_attr_dir(struct iio_dev_attr *attr)
include/linux/iio/types.h +1 -0
index d09c40d..4a2af8a 100644
@@ -74,6 +74,7 @@ enum iio_event_info {
 	IIO_EV_INFO_ENABLE,
 	IIO_EV_INFO_VALUE,
 	IIO_EV_INFO_HYSTERESIS,
+	IIO_EV_INFO_PERIOD,
 };
 
 enum iio_event_direction {
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 11 lines · Srinivas Pandruvada

The iio sysfs ABI defines a way to specify period for roc and thresholds.
What: /sys/.../events/in_accel_x_thresh_rising_period
What: /sys/.../events/in_accel_x_thresh_falling_period
what: /sys/.../events/in_accel_x_roc_rising_period
What: /sys/.../events/in_accel_x_roc_falling_period

But there is no way to add period with the current event info enum.

Added IIO_EV_INFO_PERIOD and corresponding string.

One of several even related element that haven't gotten added yet but we'll do them as and when anyone cares.

Thanks,

Jonathan

Quoted 30 lines
---
  drivers/iio/industrialio-event.c | 1 +
  include/linux/iio/types.h        | 1 +
  2 files changed, 2 insertions(+)
drivers/iio/industrialio-event.c +1 -0
index bfbf4d4..0c1e37e 100644
@@ -209,6 +209,7 @@ static const char * const iio_ev_info_text[] = {
  	[IIO_EV_INFO_ENABLE] = "en",
  	[IIO_EV_INFO_VALUE] = "value",
  	[IIO_EV_INFO_HYSTERESIS] = "hysteresis",
+	[IIO_EV_INFO_PERIOD] = "period",
  };
 
  static enum iio_event_direction iio_ev_attr_dir(struct iio_dev_attr *attr)
include/linux/iio/types.h +1 -0
index d09c40d..4a2af8a 100644
@@ -74,6 +74,7 @@ enum iio_event_info {
  	IIO_EV_INFO_ENABLE,
  	IIO_EV_INFO_VALUE,
  	IIO_EV_INFO_HYSTERESIS,
+	IIO_EV_INFO_PERIOD,
  };
 
  enum iio_event_direction {
#2 lore raw
Quoted 7 lines · Jonathan Cameron
Quoted 6 lines · Srinivas Pandruvada

The iio sysfs ABI defines a way to specify period for roc and thresholds.

What:        /sys/.../events/in_accel_x_thresh_rising_period
What:        /sys/.../events/in_accel_x_thresh_falling_period
what:        /sys/.../events/in_accel_x_roc_rising_period
What:        /sys/.../events/in_accel_x_roc_falling_period
Quoted 7 lines
Quoted 5 lines

But there is no way to add period with the current event info enum.

Added IIO_EV_INFO_PERIOD and corresponding string.

One of several even related element that haven't gotten added yet but we'll do them as and when anyone cares.

Sure, I will submit a driver using this soon.

Thanks,
Srinivas

Quoted 38 lines

Thanks,

Jonathan

Quoted 32 lines
---
  drivers/iio/industrialio-event.c | 1 +
  include/linux/iio/types.h        | 1 +
  2 files changed, 2 insertions(+)
drivers/iio/industrialio-event.c +1 -0
index bfbf4d4..0c1e37e 100644
@@ -209,6 +209,7 @@ static const char * const iio_ev_info_text[] = {
      [IIO_EV_INFO_ENABLE] = "en",
      [IIO_EV_INFO_VALUE] = "value",
      [IIO_EV_INFO_HYSTERESIS] = "hysteresis",
+    [IIO_EV_INFO_PERIOD] = "period",
  };
 
  static enum iio_event_direction iio_ev_attr_dir(struct iio_dev_attr

*attr)

include/linux/iio/types.h +1 -0
index d09c40d..4a2af8a 100644
@@ -74,6 +74,7 @@ enum iio_event_info {
      IIO_EV_INFO_ENABLE,
      IIO_EV_INFO_VALUE,
      IIO_EV_INFO_HYSTERESIS,
+    IIO_EV_INFO_PERIOD,
  };
 
  enum iio_event_direction {