diff options
author | Denis CIOCCA <denis.ciocca@st.com> | 2013-06-03 10:58:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-06-05 13:41:23 -0400 |
commit | 607a568ab69c5ac345a286267a27294888f8bb5f (patch) | |
tree | f52d27c3f06725c7078d6fe876a3a194e45322b4 /drivers/iio/gyro | |
parent | 762011d6193f8b9af9b491ded87dde3221d0600a (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 'drivers/iio/gyro')
-rw-r--r-- | drivers/iio/gyro/st_gyro_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c index 9bae46bcccee..f9ed3488c314 100644 --- a/drivers/iio/gyro/st_gyro_core.c +++ b/drivers/iio/gyro/st_gyro_core.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/iio/common/st_sensors.h> | 27 | #include <linux/iio/common/st_sensors.h> |
28 | #include "st_gyro.h" | 28 | #include "st_gyro.h" |
29 | 29 | ||
30 | #define ST_GYRO_NUMBER_DATA_CHANNELS 3 | ||
31 | |||
30 | /* DEFAULT VALUE FOR SENSORS */ | 32 | /* DEFAULT VALUE FOR SENSORS */ |
31 | #define ST_GYRO_DEFAULT_OUT_X_L_ADDR 0x28 | 33 | #define ST_GYRO_DEFAULT_OUT_X_L_ADDR 0x28 |
32 | #define ST_GYRO_DEFAULT_OUT_Y_L_ADDR 0x2a | 34 | #define ST_GYRO_DEFAULT_OUT_Y_L_ADDR 0x2a |
@@ -313,6 +315,7 @@ int st_gyro_common_probe(struct iio_dev *indio_dev) | |||
313 | if (err < 0) | 315 | if (err < 0) |
314 | goto st_gyro_common_probe_error; | 316 | goto st_gyro_common_probe_error; |
315 | 317 | ||
318 | gdata->num_data_channels = ST_GYRO_NUMBER_DATA_CHANNELS; | ||
316 | gdata->multiread_bit = gdata->sensor->multi_read_bit; | 319 | gdata->multiread_bit = gdata->sensor->multi_read_bit; |
317 | indio_dev->channels = gdata->sensor->ch; | 320 | indio_dev->channels = gdata->sensor->ch; |
318 | indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS; | 321 | indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS; |