aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/accel/bma180.c8
-rw-r--r--drivers/iio/accel/mma8452.c8
-rw-r--r--drivers/iio/industrialio-buffer.c2
-rw-r--r--drivers/iio/industrialio-event.c3
4 files changed, 16 insertions, 5 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/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index 9231f8a65e79..3c12d4966376 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -111,8 +111,14 @@ static const int mma8452_samp_freq[8][2] = {
111 {6, 250000}, {1, 560000} 111 {6, 250000}, {1, 560000}
112}; 112};
113 113
114/*
115 * Hardware has fullscale of -2G, -4G, -8G corresponding to raw value -2048
116 * The userspace interface uses m/s^2 and we declare micro units
117 * So scale factor is given by:
118 * g * N * 1000000 / 2048 for N = 2, 4, 8 and g=9.80665
119 */
114static const int mma8452_scales[3][2] = { 120static const int mma8452_scales[3][2] = {
115 {0, 977}, {0, 1953}, {0, 3906} 121 {0, 9577}, {0, 19154}, {0, 38307}
116}; 122};
117 123
118static ssize_t mma8452_show_samp_freq_avail(struct device *dev, 124static ssize_t mma8452_show_samp_freq_avail(struct device *dev,
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 2952ee038477..0472ee268271 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -963,7 +963,7 @@ static int iio_buffer_update_demux(struct iio_dev *indio_dev,
963 963
964 /* Now we have the two masks, work from least sig and build up sizes */ 964 /* Now we have the two masks, work from least sig and build up sizes */
965 for_each_set_bit(out_ind, 965 for_each_set_bit(out_ind,
966 indio_dev->active_scan_mask, 966 buffer->scan_mask,
967 indio_dev->masklength) { 967 indio_dev->masklength) {
968 in_ind = find_next_bit(indio_dev->active_scan_mask, 968 in_ind = find_next_bit(indio_dev->active_scan_mask,
969 indio_dev->masklength, 969 indio_dev->masklength,
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c
index 35a5b0311dae..0c1e37e3120a 100644
--- a/drivers/iio/industrialio-event.c
+++ b/drivers/iio/industrialio-event.c
@@ -346,6 +346,9 @@ static int iio_device_add_event(struct iio_dev *indio_dev,
346 &indio_dev->event_interface->dev_attr_list); 346 &indio_dev->event_interface->dev_attr_list);
347 kfree(postfix); 347 kfree(postfix);
348 348
349 if ((ret == -EBUSY) && (shared_by != IIO_SEPARATE))
350 continue;
351
349 if (ret) 352 if (ret)
350 return ret; 353 return ret;
351 354