Skip to content

Commit

Permalink
iio:accel:bma180: Use modifier instead of index in channel specification
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Meerwald authored and Jonathan Cameron committed Feb 8, 2014
1 parent c76782d commit 5585215
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/iio/accel/bma180.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
.indexed = 1, \
.channel = (_index), \
.modified = 1, \
.channel2 = IIO_MOD_##_axis, \
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
.scan_index = (_index), \
.scan_index = AXIS_##_axis, \
.scan_type = { \
.sign = 's', \
.realbits = 14, \
Expand All @@ -465,10 +465,10 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {
}

static const struct iio_chan_spec bma180_channels[] = {
BMA180_CHANNEL(AXIS_X),
BMA180_CHANNEL(AXIS_Y),
BMA180_CHANNEL(AXIS_Z),
IIO_CHAN_SOFT_TIMESTAMP(4),
BMA180_CHANNEL(X),
BMA180_CHANNEL(Y),
BMA180_CHANNEL(Z),
IIO_CHAN_SOFT_TIMESTAMP(3),
};

static irqreturn_t bma180_trigger_handler(int irq, void *p)
Expand Down

0 comments on commit 5585215

Please sign in to comment.