aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/iio
diff options
context:
space:
mode:
authorDenis CIOCCA <denis.ciocca@st.com>2013-06-03 10:58:00 -0400
committerJonathan Cameron <jic23@kernel.org>2013-06-05 13:41:23 -0400
commit607a568ab69c5ac345a286267a27294888f8bb5f (patch)
treef52d27c3f06725c7078d6fe876a3a194e45322b4 /include/linux/iio
parent762011d6193f8b9af9b491ded87dde3221d0600a (diff)
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 @@
24#define ST_SENSORS_FULLSCALE_AVL_MAX 10 24#define ST_SENSORS_FULLSCALE_AVL_MAX 10
25 25
26#define ST_SENSORS_NUMBER_ALL_CHANNELS 4 26#define ST_SENSORS_NUMBER_ALL_CHANNELS 4
27#define ST_SENSORS_NUMBER_DATA_CHANNELS 3
28#define ST_SENSORS_ENABLE_ALL_AXIS 0x07 27#define ST_SENSORS_ENABLE_ALL_AXIS 0x07
29#define ST_SENSORS_BYTE_FOR_CHANNEL 2
30#define ST_SENSORS_SCAN_X 0 28#define ST_SENSORS_SCAN_X 0
31#define ST_SENSORS_SCAN_Y 1 29#define ST_SENSORS_SCAN_Y 1
32#define ST_SENSORS_SCAN_Z 2 30#define ST_SENSORS_SCAN_Z 2
@@ -202,6 +200,7 @@ struct st_sensors {
202 * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread. 200 * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread.
203 * @buffer_data: Data used by buffer part. 201 * @buffer_data: Data used by buffer part.
204 * @odr: Output data rate of the sensor [Hz]. 202 * @odr: Output data rate of the sensor [Hz].
203 * num_data_channels: Number of data channels used in buffer.
205 * @get_irq_data_ready: Function to get the IRQ used for data ready signal. 204 * @get_irq_data_ready: Function to get the IRQ used for data ready signal.
206 * @tf: Transfer function structure used by I/O operations. 205 * @tf: Transfer function structure used by I/O operations.
207 * @tb: Transfer buffers and mutex used by I/O operations. 206 * @tb: Transfer buffers and mutex used by I/O operations.
@@ -218,6 +217,7 @@ struct st_sensor_data {
218 char *buffer_data; 217 char *buffer_data;
219 218
220 unsigned int odr; 219 unsigned int odr;
220 unsigned int num_data_channels;
221 221
222 unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev); 222 unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev);
223 223