Skip to content

Commit b7a6836

Browse files
committed
Merge tag 'staging-3.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull more IIO driver fixes from Greg KH: "Here are two IIO driver fixes for 3.16-rc6 that resolve some reported issues" * tag 'staging-3.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: iio: mma8452: Use correct acceleration units. iio:core: Handle error when mask type is not separate
2 parents caa7c4e + 9359003 commit b7a6836

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

drivers/iio/accel/mma8452.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,14 @@ static const int mma8452_samp_freq[8][2] = {
111111
{6, 250000}, {1, 560000}
112112
};
113113

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+
*/
114120
static const int mma8452_scales[3][2] = {
115-
{0, 977}, {0, 1953}, {0, 3906}
121+
{0, 9577}, {0, 19154}, {0, 38307}
116122
};
117123

118124
static ssize_t mma8452_show_samp_freq_avail(struct device *dev,

drivers/iio/industrialio-event.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ static int iio_device_add_event(struct iio_dev *indio_dev,
345345
&indio_dev->event_interface->dev_attr_list);
346346
kfree(postfix);
347347

348+
if ((ret == -EBUSY) && (shared_by != IIO_SEPARATE))
349+
continue;
350+
348351
if (ret)
349352
return ret;
350353

0 commit comments

Comments
 (0)