projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5405c9b
)
iio: stk8312: Use scan_type when processing raw data
author
Gwendal Grignou
<gwendal@chromium.org>
Thu, 4 Nov 2021 08:24:05 +0000
(
01:24
-0700)
committer
Jonathan Cameron
<Jonathan.Cameron@huawei.com>
Wed, 17 Nov 2021 17:51:41 +0000
(17:51 +0000)
Use channel definition as root of trust and replace constant
when reading elements directly using the raw sysfs attributes.
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Link:
https://lore.kernel.org/r/20211104082413.3681212-6-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/stk8312.c
patch
|
blob
|
history
diff --git
a/drivers/iio/accel/stk8312.c
b/drivers/iio/accel/stk8312.c
index
43c621d
..
de0cdf8
100644
(file)
--- a/
drivers/iio/accel/stk8312.c
+++ b/
drivers/iio/accel/stk8312.c
@@
-355,7
+355,7
@@
static int stk8312_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&data->lock);
return ret;
}
- *val = sign_extend32(ret,
7
);
+ *val = sign_extend32(ret,
chan->scan_type.realbits - 1
);
ret = stk8312_set_mode(data,
data->mode & (~STK8312_MODE_ACTIVE));
mutex_unlock(&data->lock);