aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2014-10-01 16:37:00 -0400
committerJonathan Cameron <jic23@kernel.org>2014-02-08 06:31:50 -0500
commit5585215b6daabf898b4d40f33d1b8c1d41e85018 (patch)
treeea2bbb80a5847400272691b94902a1770c17def0
parentc76782d151dab7ecfdcdf9a01561c2d61d9b490f (diff)
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: Peter Meerwald <pmeerw@pmeerw.net> Cc: Kravchenko Oleksandr <x0199363@ti.com> Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/accel/bma180.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
index 3bec9220df04..bfec313492b3 100644
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c
@@ -447,14 +447,14 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {
447 { }, 447 { },
448}; 448};
449 449
450#define BMA180_CHANNEL(_index) { \ 450#define BMA180_CHANNEL(_axis) { \
451 .type = IIO_ACCEL, \ 451 .type = IIO_ACCEL, \
452 .indexed = 1, \ 452 .modified = 1, \
453 .channel = (_index), \ 453 .channel2 = IIO_MOD_##_axis, \
454 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ 454 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
455 BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \ 455 BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \
456 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ 456 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
457 .scan_index = (_index), \ 457 .scan_index = AXIS_##_axis, \
458 .scan_type = { \ 458 .scan_type = { \
459 .sign = 's', \ 459 .sign = 's', \
460 .realbits = 14, \ 460 .realbits = 14, \
@@ -465,10 +465,10 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {
465} 465}
466 466
467static const struct iio_chan_spec bma180_channels[] = { 467static const struct iio_chan_spec bma180_channels[] = {
468 BMA180_CHANNEL(AXIS_X), 468 BMA180_CHANNEL(X),
469 BMA180_CHANNEL(AXIS_Y), 469 BMA180_CHANNEL(Y),
470 BMA180_CHANNEL(AXIS_Z), 470 BMA180_CHANNEL(Z),
471 IIO_CHAN_SOFT_TIMESTAMP(4), 471 IIO_CHAN_SOFT_TIMESTAMP(3),
472}; 472};
473 473
474static irqreturn_t bma180_trigger_handler(int irq, void *p) 474static irqreturn_t bma180_trigger_handler(int irq, void *p)