aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-21 13:58:51 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-21 13:58:51 -0400
commit1f31c3f0e1f3a272a95fa2026505a6c13c80488e (patch)
tree243a0bdae65ed14d563ece6211b402c2f056f8f3
parent9a3c4145af32125c5ee39c0272662b47307a8323 (diff)
parent9b2a4d35a6ceaf217be61ed8eb3c16986244f640 (diff)
Merge tag 'iio-fixes-for-3.16e' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes: Fifth set of fixes for IIO in the 3.16 cycle. One nasty one that has been around a long time and a couple of non compliant ABI fixes. * The demux code used to split out desired channels for devices that only support reading sets of channels at one time had a bug where it was building it's conversion tables against the wrong bitmap resulting in it never actually demuxing anything. This is an old bug, but will be effecting an increasing number of drivers as it is often used to avoid some fiddly code in the individual drivers. * bma180 and mma8452 weren't obeying the ABI wrt to units for acceleration. Were in G rather than m/s^2. A little input check was missing from bma180 that might lead to acceptance of incorrect values. This last one is minor but might lead to incorrect userspace code working and problems in the future.
-rw-r--r--drivers/iio/accel/bma180.c8
-rw-r--r--drivers/iio/industrialio-buffer.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
index a7e68c81f89d..a077cc86421b 100644
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c
@@ -68,13 +68,13 @@
68/* Defaults values */ 68/* Defaults values */
69#define BMA180_DEF_PMODE 0 69#define BMA180_DEF_PMODE 0
70#define BMA180_DEF_BW 20 70#define BMA180_DEF_BW 20
71#define BMA180_DEF_SCALE 250 71#define BMA180_DEF_SCALE 2452
72 72
73/* Available values for sysfs */ 73/* Available values for sysfs */
74#define BMA180_FLP_FREQ_AVAILABLE \ 74#define BMA180_FLP_FREQ_AVAILABLE \
75 "10 20 40 75 150 300" 75 "10 20 40 75 150 300"
76#define BMA180_SCALE_AVAILABLE \ 76#define BMA180_SCALE_AVAILABLE \
77 "0.000130 0.000190 0.000250 0.000380 0.000500 0.000990 0.001980" 77 "0.001275 0.001863 0.002452 0.003727 0.004903 0.009709 0.019417"
78 78
79struct bma180_data { 79struct bma180_data {
80 struct i2c_client *client; 80 struct i2c_client *client;
@@ -94,7 +94,7 @@ enum bma180_axis {
94}; 94};
95 95
96static int bw_table[] = { 10, 20, 40, 75, 150, 300 }; /* Hz */ 96static int bw_table[] = { 10, 20, 40, 75, 150, 300 }; /* Hz */
97static int scale_table[] = { 130, 190, 250, 380, 500, 990, 1980 }; 97static int scale_table[] = { 1275, 1863, 2452, 3727, 4903, 9709, 19417 };
98 98
99static int bma180_get_acc_reg(struct bma180_data *data, enum bma180_axis axis) 99static int bma180_get_acc_reg(struct bma180_data *data, enum bma180_axis axis)
100{ 100{
@@ -376,6 +376,8 @@ static int bma180_write_raw(struct iio_dev *indio_dev,
376 mutex_unlock(&data->mutex); 376 mutex_unlock(&data->mutex);
377 return ret; 377 return ret;
378 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY: 378 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:
379 if (val2)
380 return -EINVAL;
379 mutex_lock(&data->mutex); 381 mutex_lock(&data->mutex);
380 ret = bma180_set_bw(data, val); 382 ret = bma180_set_bw(data, val);
381 mutex_unlock(&data->mutex); 383 mutex_unlock(&data->mutex);
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 36b1ae92e239..9f1a14009901 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -966,7 +966,7 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev,
966 966
967 /* Now we have the two masks, work from least sig and build up sizes */ 967 /* Now we have the two masks, work from least sig and build up sizes */
968 for_each_set_bit(out_ind, 968 for_each_set_bit(out_ind,
969 indio_dev->active_scan_mask, 969 buffer->scan_mask,
970 indio_dev->masklength) { 970 indio_dev->masklength) {
971 in_ind = find_next_bit(indio_dev->active_scan_mask, 971 in_ind = find_next_bit(indio_dev->active_scan_mask,
972 indio_dev->masklength, 972 indio_dev->masklength,