diff options
author | Denis CIOCCA <denis.ciocca@st.com> | 2013-06-03 14:58:00 (GMT) |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-06-05 17:41:23 (GMT) |
commit | 607a568ab69c5ac345a286267a27294888f8bb5f (patch) | |
tree | f52d27c3f06725c7078d6fe876a3a194e45322b4 /drivers/iio/magnetometer | |
parent | 762011d6193f8b9af9b491ded87dde3221d0600a (diff) | |
download | linux-fsl-qoriq-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 'drivers/iio/magnetometer')
-rw-r--r-- | drivers/iio/magnetometer/st_magn_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c index 715d616..ebfe8f1 100644 --- a/drivers/iio/magnetometer/st_magn_core.c +++ b/drivers/iio/magnetometer/st_magn_core.c @@ -26,6 +26,8 @@ #include <linux/iio/common/st_sensors.h> #include "st_magn.h" +#define ST_MAGN_NUMBER_DATA_CHANNELS 3 + /* DEFAULT VALUE FOR SENSORS */ #define ST_MAGN_DEFAULT_OUT_X_L_ADDR 0X04 #define ST_MAGN_DEFAULT_OUT_Y_L_ADDR 0X08 @@ -356,6 +358,7 @@ int st_magn_common_probe(struct iio_dev *indio_dev) if (err < 0) goto st_magn_common_probe_error; + mdata->num_data_channels = ST_MAGN_NUMBER_DATA_CHANNELS; mdata->multiread_bit = mdata->sensor->multi_read_bit; indio_dev->channels = mdata->sensor->ch; indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS; |