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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJTwtkmAAoJEFSFNJnE9BaIr6wQAKpb7trsHY8FrGXyW92FM6eM
 HhrPv8hge5Kkyfp/XKRF90HXbOWgtVmu7whTiXWEtiLTinBttITvRc8dhut1Fr+R
 1X2+gnWe0E9yAN2eUH6pJ16CPSfpRZtF7jdeE5jTY1AEGEaZ8M1W+TH4Z8Jrx335
 uBNGUAAtR7m+Z/KLS65ErArDExLiQuWmSRAqAadgsSUvaoMcDVkg2yqJQ21aazoU
 E27fNqEbFw7aBYcTlM56/QL5/T7XbCYjvhS1oApfNJp0VCoXkLGiQUuYaDEnYp/u
 dSG3wPyPUK3hDL5CDkO+RHd7Md4k42l37UG1YHT08HzVDAnx1gbNc1a2Zi4o2acg
 GBpJBc7Iuxcd3B+J3gW0SUEuEBeKIaQp4zDAC4f0CzMkuAjeNylAd27uTnuU0kSV
 r/pbNUBGWB90HAbw42PGSKq5qWig3TYbX4HHEQi4VRnIiX8qmMhq8cPjsEfjIdw5
 NeF7/QaA59qxPBM68ScbODe5wpNScMJKCym2U+RXic9tPrx+WEdoJNnf02fIzOgG
 7P/CeFpMH28Z1WL5xgHxpYJz35QGadhcz8r9lzSnGO2vpfVZNAx56RIUfvfR+284
 BP5O4TN3khyt0lPTlDZugxxkFsjfjybeJ0GT4rlIx5LEoaI2IVnUxGF/oCXod0Ms
 fIWcjKgEE8fTdWjLbBCj
 =3lEs
 -----END PGP SIGNATURE-----

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.
This commit is contained in:
Greg Kroah-Hartman 2014-07-13 15:47:26 -07:00
Родитель 1795cd9b3a 71702e6e52
Коммит 9359003385
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -111,8 +111,14 @@ static const int mma8452_samp_freq[8][2] = {
{6, 250000}, {1, 560000}
};
/*
* Hardware has fullscale of -2G, -4G, -8G corresponding to raw value -2048
* The userspace interface uses m/s^2 and we declare micro units
* So scale factor is given by:
* g * N * 1000000 / 2048 for N = 2, 4, 8 and g=9.80665
*/
static const int mma8452_scales[3][2] = {
{0, 977}, {0, 1953}, {0, 3906}
{0, 9577}, {0, 19154}, {0, 38307}
};
static ssize_t mma8452_show_samp_freq_avail(struct device *dev,

Просмотреть файл

@ -345,6 +345,9 @@ static int iio_device_add_event(struct iio_dev *indio_dev,
&indio_dev->event_interface->dev_attr_list);
kfree(postfix);
if ((ret == -EBUSY) && (shared_by != IIO_SEPARATE))
continue;
if (ret)
return ret;