提交 5585215b 编写于 作者: P Peter Meerwald 提交者: Jonathan Cameron

iio:accel:bma180: Use modifier instead of index in channel specification

This driver was not complying with the ABI and the purpose of this patch
is to bring it inline so that userspace will correctly identify the channels.

Should use channel modifiers (X/Y/Z), not channel indices
timestamp channel has scan index 3, not 4
Signed-off-by: NPeter Meerwald <pmeerw@pmeerw.net>
Cc: Kravchenko Oleksandr <x0199363@ti.com>
Cc: Stable@vger.kernel.org
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 c76782d1
...@@ -447,14 +447,14 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = { ...@@ -447,14 +447,14 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {
{ }, { },
}; };
#define BMA180_CHANNEL(_index) { \ #define BMA180_CHANNEL(_axis) { \
.type = IIO_ACCEL, \ .type = IIO_ACCEL, \
.indexed = 1, \ .modified = 1, \
.channel = (_index), \ .channel2 = IIO_MOD_##_axis, \
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \ BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
.scan_index = (_index), \ .scan_index = AXIS_##_axis, \
.scan_type = { \ .scan_type = { \
.sign = 's', \ .sign = 's', \
.realbits = 14, \ .realbits = 14, \
...@@ -465,10 +465,10 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = { ...@@ -465,10 +465,10 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {
} }
static const struct iio_chan_spec bma180_channels[] = { static const struct iio_chan_spec bma180_channels[] = {
BMA180_CHANNEL(AXIS_X), BMA180_CHANNEL(X),
BMA180_CHANNEL(AXIS_Y), BMA180_CHANNEL(Y),
BMA180_CHANNEL(AXIS_Z), BMA180_CHANNEL(Z),
IIO_CHAN_SOFT_TIMESTAMP(4), IIO_CHAN_SOFT_TIMESTAMP(3),
}; };
static irqreturn_t bma180_trigger_handler(int irq, void *p) static irqreturn_t bma180_trigger_handler(int irq, void *p)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册