summaryrefslogtreecommitdiffstats
path: root/include/linux/iio
diff options
context:
space:
mode:
authorDenis CIOCCA <denis.ciocca@st.com>2013-06-03 15:58:00 +0100
committerJonathan Cameron <jic23@kernel.org>2013-06-05 18:41:23 +0100
commit607a568ab69c5ac345a286267a27294888f8bb5f (patch)
treef52d27c3f06725c7078d6fe876a3a194e45322b4 /include/linux/iio
parent762011d6193f8b9af9b491ded87dde3221d0600a (diff)
downloadlinux-607a568ab69c5ac345a286267a27294888f8bb5f.tar.gz
linux-607a568ab69c5ac345a286267a27294888f8bb5f.tar.xz
iio:common: Removed stuff macros, added num_data_channels on st_sensors struct and added support on one-shot sysfs reads to 3 byte channel
This patch introduce num_data_channels variable on st_sensors struct to manage different type of channels (size or number) in st_sensors_get_buffer_element function. Removed ST_SENSORS_NUMBER_DATA_CHANNELS and ST_SENSORS_BYTE_FOR_CHANNEL and used struct iio_chan_spec const *ch to catch data. Added 3 byte channel data support on one-shot reads. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux/iio')
-rw-r--r--include/linux/iio/common/st_sensors.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
index 5ffd763702dc..72b26940730d 100644
--- a/include/linux/iio/common/st_sensors.h
+++ b/include/linux/iio/common/st_sensors.h
@@ -24,9 +24,7 @@
#define ST_SENSORS_FULLSCALE_AVL_MAX 10
#define ST_SENSORS_NUMBER_ALL_CHANNELS 4
-#define ST_SENSORS_NUMBER_DATA_CHANNELS 3
#define ST_SENSORS_ENABLE_ALL_AXIS 0x07
-#define ST_SENSORS_BYTE_FOR_CHANNEL 2
#define ST_SENSORS_SCAN_X 0
#define ST_SENSORS_SCAN_Y 1
#define ST_SENSORS_SCAN_Z 2
@@ -202,6 +200,7 @@ struct st_sensors {
* @multiread_bit: Use or not particular bit for [I2C/SPI] multiread.
* @buffer_data: Data used by buffer part.
* @odr: Output data rate of the sensor [Hz].
+ * num_data_channels: Number of data channels used in buffer.
* @get_irq_data_ready: Function to get the IRQ used for data ready signal.
* @tf: Transfer function structure used by I/O operations.
* @tb: Transfer buffers and mutex used by I/O operations.
@@ -218,6 +217,7 @@ struct st_sensor_data {
char *buffer_data;
unsigned int odr;
+ unsigned int num_data_channels;
unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev);