Skip to content

Commit 5585215

Browse files
pmeerwjic23
authored andcommitted
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 <[email protected]> Cc: Kravchenko Oleksandr <[email protected]> Cc: [email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent c76782d commit 5585215

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/iio/accel/bma180.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -447,14 +447,14 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {
447447
{ },
448448
};
449449

450-
#define BMA180_CHANNEL(_index) { \
450+
#define BMA180_CHANNEL(_axis) { \
451451
.type = IIO_ACCEL, \
452-
.indexed = 1, \
453-
.channel = (_index), \
452+
.modified = 1, \
453+
.channel2 = IIO_MOD_##_axis, \
454454
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
455455
BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \
456456
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
457-
.scan_index = (_index), \
457+
.scan_index = AXIS_##_axis, \
458458
.scan_type = { \
459459
.sign = 's', \
460460
.realbits = 14, \
@@ -465,10 +465,10 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {
465465
}
466466

467467
static const struct iio_chan_spec bma180_channels[] = {
468-
BMA180_CHANNEL(AXIS_X),
469-
BMA180_CHANNEL(AXIS_Y),
470-
BMA180_CHANNEL(AXIS_Z),
471-
IIO_CHAN_SOFT_TIMESTAMP(4),
468+
BMA180_CHANNEL(X),
469+
BMA180_CHANNEL(Y),
470+
BMA180_CHANNEL(Z),
471+
IIO_CHAN_SOFT_TIMESTAMP(3),
472472
};
473473

474474
static irqreturn_t bma180_trigger_handler(int irq, void *p)

0 commit comments

Comments
 (0)