summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux/iio
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/linux/iio')
-rw-r--r--kernel/include/linux/iio/buffer.h3
-rw-r--r--kernel/include/linux/iio/common/st_sensors.h6
-rw-r--r--kernel/include/linux/iio/consumer.h2
-rw-r--r--kernel/include/linux/iio/iio.h6
-rw-r--r--kernel/include/linux/iio/sysfs.h3
-rw-r--r--kernel/include/linux/iio/trigger.h3
-rw-r--r--kernel/include/linux/iio/triggered_buffer.h4
-rw-r--r--kernel/include/linux/iio/triggered_event.h11
-rw-r--r--kernel/include/linux/iio/types.h2
9 files changed, 36 insertions, 4 deletions
diff --git a/kernel/include/linux/iio/buffer.h b/kernel/include/linux/iio/buffer.h
index eb8622b78..1600c5582 100644
--- a/kernel/include/linux/iio/buffer.h
+++ b/kernel/include/linux/iio/buffer.h
@@ -29,6 +29,7 @@ struct iio_buffer;
* @set_length: set number of datums in buffer
* @release: called when the last reference to the buffer is dropped,
* should free all resources allocated by the buffer.
+ * @modes: Supported operating modes by this buffer type
*
* The purpose of this structure is to make the buffer element
* modular as event for a given driver, different usecases may require
@@ -51,6 +52,8 @@ struct iio_buffer_access_funcs {
int (*set_length)(struct iio_buffer *buffer, int length);
void (*release)(struct iio_buffer *buffer);
+
+ unsigned int modes;
};
/**
diff --git a/kernel/include/linux/iio/common/st_sensors.h b/kernel/include/linux/iio/common/st_sensors.h
index 2c476acb8..2fe939c73 100644
--- a/kernel/include/linux/iio/common/st_sensors.h
+++ b/kernel/include/linux/iio/common/st_sensors.h
@@ -166,6 +166,7 @@ struct st_sensor_transfer_function {
/**
* struct st_sensor_settings - ST specific sensor settings
* @wai: Contents of WhoAmI register.
+ * @wai_addr: The address of WhoAmI register.
* @sensors_supported: List of supported sensors by struct itself.
* @ch: IIO channels for the sensor.
* @odr: Output data rate register and ODR list available.
@@ -179,6 +180,7 @@ struct st_sensor_transfer_function {
*/
struct st_sensor_settings {
u8 wai;
+ u8 wai_addr;
char sensors_supported[ST_SENSORS_MAX_4WAI][ST_SENSORS_MAX_NAME];
struct iio_chan_spec *ch;
int num_ch;
@@ -269,6 +271,10 @@ void st_sensors_power_enable(struct iio_dev *indio_dev);
void st_sensors_power_disable(struct iio_dev *indio_dev);
+int st_sensors_debugfs_reg_access(struct iio_dev *indio_dev,
+ unsigned reg, unsigned writeval,
+ unsigned *readval);
+
int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr);
int st_sensors_set_dataready_irq(struct iio_dev *indio_dev, bool enable);
diff --git a/kernel/include/linux/iio/consumer.h b/kernel/include/linux/iio/consumer.h
index 26fb8f634..fad58671c 100644
--- a/kernel/include/linux/iio/consumer.h
+++ b/kernel/include/linux/iio/consumer.h
@@ -100,7 +100,7 @@ void iio_channel_stop_all_cb(struct iio_cb_buffer *cb_buff);
/**
* iio_channel_cb_get_channels() - get access to the underlying channels.
- * @cb_buff: The callback buffer from whom we want the channel
+ * @cb_buffer: The callback buffer from whom we want the channel
* information.
*
* This function allows one to obtain information about the channels.
diff --git a/kernel/include/linux/iio/iio.h b/kernel/include/linux/iio/iio.h
index 5ed7771ad..19c94c9ac 100644
--- a/kernel/include/linux/iio/iio.h
+++ b/kernel/include/linux/iio/iio.h
@@ -32,6 +32,7 @@ enum iio_chan_info_enum {
IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
IIO_CHAN_INFO_AVERAGE_RAW,
IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
+ IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
IIO_CHAN_INFO_SAMP_FREQ,
IIO_CHAN_INFO_FREQUENCY,
IIO_CHAN_INFO_PHASE,
@@ -43,6 +44,8 @@ enum iio_chan_info_enum {
IIO_CHAN_INFO_CALIBWEIGHT,
IIO_CHAN_INFO_DEBOUNCE_COUNT,
IIO_CHAN_INFO_DEBOUNCE_TIME,
+ IIO_CHAN_INFO_CALIBEMISSIVITY,
+ IIO_CHAN_INFO_OVERSAMPLING_RATIO,
};
enum iio_shared_by {
@@ -291,6 +294,7 @@ static inline s64 iio_get_time_ns(void)
#define INDIO_BUFFER_TRIGGERED 0x02
#define INDIO_BUFFER_SOFTWARE 0x04
#define INDIO_BUFFER_HARDWARE 0x08
+#define INDIO_EVENT_TRIGGERED 0x10
#define INDIO_ALL_BUFFER_MODES \
(INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE | INDIO_BUFFER_SOFTWARE)
@@ -454,6 +458,7 @@ struct iio_buffer_setup_ops {
* @scan_index_timestamp:[INTERN] cache of the index to the timestamp
* @trig: [INTERN] current device trigger (buffer modes)
* @pollfunc: [DRIVER] function run on trigger being received
+ * @pollfunc_event: [DRIVER] function run on events trigger being received
* @channels: [DRIVER] channel specification structure table
* @num_channels: [DRIVER] number of channels specified in @channels.
* @channel_attr_list: [INTERN] keep track of automatically created channel
@@ -492,6 +497,7 @@ struct iio_dev {
unsigned scan_index_timestamp;
struct iio_trigger *trig;
struct iio_poll_func *pollfunc;
+ struct iio_poll_func *pollfunc_event;
struct iio_chan_spec const *channels;
int num_channels;
diff --git a/kernel/include/linux/iio/sysfs.h b/kernel/include/linux/iio/sysfs.h
index 8a1d18640..9cd8f7472 100644
--- a/kernel/include/linux/iio/sysfs.h
+++ b/kernel/include/linux/iio/sysfs.h
@@ -18,7 +18,8 @@ struct iio_chan_spec;
* struct iio_dev_attr - iio specific device attribute
* @dev_attr: underlying device attribute
* @address: associated register address
- * @l: list head for maintaining list of dynamically created attrs.
+ * @l: list head for maintaining list of dynamically created attrs
+ * @c: specification for the underlying channel
*/
struct iio_dev_attr {
struct device_attribute dev_attr;
diff --git a/kernel/include/linux/iio/trigger.h b/kernel/include/linux/iio/trigger.h
index fa76c79a5..1c9e028e0 100644
--- a/kernel/include/linux/iio/trigger.h
+++ b/kernel/include/linux/iio/trigger.h
@@ -18,6 +18,9 @@ struct iio_subirq {
bool enabled;
};
+struct iio_dev;
+struct iio_trigger;
+
/**
* struct iio_trigger_ops - operations structure for an iio_trigger.
* @owner: used to monitor usage count of the trigger.
diff --git a/kernel/include/linux/iio/triggered_buffer.h b/kernel/include/linux/iio/triggered_buffer.h
index c378ebec6..f72f70d5a 100644
--- a/kernel/include/linux/iio/triggered_buffer.h
+++ b/kernel/include/linux/iio/triggered_buffer.h
@@ -7,8 +7,8 @@ struct iio_dev;
struct iio_buffer_setup_ops;
int iio_triggered_buffer_setup(struct iio_dev *indio_dev,
- irqreturn_t (*pollfunc_bh)(int irq, void *p),
- irqreturn_t (*pollfunc_th)(int irq, void *p),
+ irqreturn_t (*h)(int irq, void *p),
+ irqreturn_t (*thread)(int irq, void *p),
const struct iio_buffer_setup_ops *setup_ops);
void iio_triggered_buffer_cleanup(struct iio_dev *indio_dev);
diff --git a/kernel/include/linux/iio/triggered_event.h b/kernel/include/linux/iio/triggered_event.h
new file mode 100644
index 000000000..8fe853708
--- /dev/null
+++ b/kernel/include/linux/iio/triggered_event.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_IIO_TRIGGERED_EVENT_H_
+#define _LINUX_IIO_TRIGGERED_EVENT_H_
+
+#include <linux/interrupt.h>
+
+int iio_triggered_event_setup(struct iio_dev *indio_dev,
+ irqreturn_t (*h)(int irq, void *p),
+ irqreturn_t (*thread)(int irq, void *p));
+void iio_triggered_event_cleanup(struct iio_dev *indio_dev);
+
+#endif
diff --git a/kernel/include/linux/iio/types.h b/kernel/include/linux/iio/types.h
index 942b6de68..32b579525 100644
--- a/kernel/include/linux/iio/types.h
+++ b/kernel/include/linux/iio/types.h
@@ -17,6 +17,8 @@ enum iio_event_info {
IIO_EV_INFO_VALUE,
IIO_EV_INFO_HYSTERESIS,
IIO_EV_INFO_PERIOD,
+ IIO_EV_INFO_HIGH_PASS_FILTER_3DB,
+ IIO_EV_INFO_LOW_PASS_FILTER_3DB,
};
#define IIO_VAL_INT 1