diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-13 18:47:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-13 18:47:26 -0400 |
commit | 9359003385a2faffa502d201771d45624037a4cd (patch) | |
tree | efcb2266e8af794f9336733a188c97bb75510779 /drivers | |
parent | 1795cd9b3a91d4b5473c97f491d63892442212ab (diff) | |
parent | 71702e6e52c8312f4c6797a9787d0f8b5656156f (diff) |
Merge tag 'iio-fixes-for-3.16d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes:
4th set of fixes for IIO in the 3.16 cycle
* Fix incorrect handling of the iio_event_spec mask_shared_by_type
bitmap. The point of this was to allow multiple channels to specify
elements that lead to the same sysfs attribute. A but in the handling
meant that this failed. The handling is modified to be similar to that
used for the main IIO info_mask_shared_by_type which works correclty.
* The acceleration scale factors reported by the mma8452 driver gave
accelerations in g, wherease the IIO ABI is in m/s^2. The fix simply
corrects the reported scale factors.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/accel/mma8452.c | 8 | ||||
-rw-r--r-- | drivers/iio/industrialio-event.c | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index 17aeea170566..2a5fa9a436e5 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 | */ | ||
114 | static const int mma8452_scales[3][2] = { | 120 | static const int mma8452_scales[3][2] = { |
115 | {0, 977}, {0, 1953}, {0, 3906} | 121 | {0, 9577}, {0, 19154}, {0, 38307} |
116 | }; | 122 | }; |
117 | 123 | ||
118 | static ssize_t mma8452_show_samp_freq_avail(struct device *dev, | 124 | static ssize_t mma8452_show_samp_freq_avail(struct device *dev, |
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c index 258a973a1fb8..bfbf4d419f41 100644 --- a/drivers/iio/industrialio-event.c +++ b/drivers/iio/industrialio-event.c | |||
@@ -345,6 +345,9 @@ static int iio_device_add_event(struct iio_dev *indio_dev, | |||
345 | &indio_dev->event_interface->dev_attr_list); | 345 | &indio_dev->event_interface->dev_attr_list); |
346 | kfree(postfix); | 346 | kfree(postfix); |
347 | 347 | ||
348 | if ((ret == -EBUSY) && (shared_by != IIO_SEPARATE)) | ||
349 | continue; | ||
350 | |||
348 | if (ret) | 351 | if (ret) |
349 | return ret; | 352 | return ret; |
350 | 353 | ||