diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 13:50:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 13:50:03 -0400 |
commit | ef994fda44d6b55ffef7bfdf06f645ff2ab1ab1a (patch) | |
tree | 564a62822ebb1f6f7e1f86b0eefc34bc769dff7d /drivers/iio/imu | |
parent | 25eeb667599b192ea850a062d69383ee864c06ab (diff) | |
parent | 51b53dc991ae7eebc5d45b06d576da6486fbf823 (diff) |
Merge tag 'iio-for-3.10a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
First set of IIO new drivers and cleanup for the 3.10 cycle.
New stuff
1) Add OF support for specifying mappings between iio devices and their
in kernel consumers.
2) Driver for AD7923 (extra functionality and support for ad7904, ad7914 and
ad7924 added later in series)
3) Driver for Exynos adc (dt suppor for phy added later in series).
4) Make iio_push_event save IRQ context - necessary if it is to be used
within an interrupt handler. Users of this functionality to follow.
5) For iio use the device tree node name to provide the hwmon name attribute
if available.
Removal and moves out of staging
1) Drop the adt7410 driver from IIO now that there is a hmwon driver with
equivalent support. This device is very much targeted at hardware
monitoring so hwmon is a more appropriate host for the driver.
2) Move iio_hwmon driver to drivers/hwmon.
Cleanups
1) Minor cleanup in ST common library.
2) Large set of patches to break the info_mask element which previously used
odd and even bits to specify if a channel attribute was either shared across
similar channels or specific to only one. Now we have two bitmaps, one for
those parameters that are specific to this channel and one for those shared
by all channels with the same type as this one. This has no effect on the
userspace abi. It simplifies the core code and provides more space for new
channel parameters. It has been on the todo list for a long time!
Conflicts:
drivers/iio/dac/ad5064.c
Diffstat (limited to 'drivers/iio/imu')
-rw-r--r-- | drivers/iio/imu/adis16400_core.c | 49 | ||||
-rw-r--r-- | drivers/iio/imu/adis16480.c | 32 | ||||
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 10 | ||||
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 5 |
4 files changed, 48 insertions, 48 deletions
diff --git a/drivers/iio/imu/adis16400_core.c b/drivers/iio/imu/adis16400_core.c index b7f215eab5de..f60591f0b925 100644 --- a/drivers/iio/imu/adis16400_core.c +++ b/drivers/iio/imu/adis16400_core.c | |||
@@ -484,8 +484,8 @@ static int adis16400_read_raw(struct iio_dev *indio_dev, | |||
484 | .indexed = 1, \ | 484 | .indexed = 1, \ |
485 | .channel = 0, \ | 485 | .channel = 0, \ |
486 | .extend_name = name, \ | 486 | .extend_name = name, \ |
487 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 487 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
488 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ | 488 | BIT(IIO_CHAN_INFO_SCALE), \ |
489 | .address = (addr), \ | 489 | .address = (addr), \ |
490 | .scan_index = (si), \ | 490 | .scan_index = (si), \ |
491 | .scan_type = { \ | 491 | .scan_type = { \ |
@@ -507,10 +507,10 @@ static int adis16400_read_raw(struct iio_dev *indio_dev, | |||
507 | .type = IIO_ANGL_VEL, \ | 507 | .type = IIO_ANGL_VEL, \ |
508 | .modified = 1, \ | 508 | .modified = 1, \ |
509 | .channel2 = IIO_MOD_ ## mod, \ | 509 | .channel2 = IIO_MOD_ ## mod, \ |
510 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 510 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
511 | IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT | \ | 511 | BIT(IIO_CHAN_INFO_CALIBBIAS), \ |
512 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ | 512 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ |
513 | IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SHARED_BIT, \ | 513 | BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \ |
514 | .address = addr, \ | 514 | .address = addr, \ |
515 | .scan_index = ADIS16400_SCAN_GYRO_ ## mod, \ | 515 | .scan_index = ADIS16400_SCAN_GYRO_ ## mod, \ |
516 | .scan_type = { \ | 516 | .scan_type = { \ |
@@ -526,10 +526,10 @@ static int adis16400_read_raw(struct iio_dev *indio_dev, | |||
526 | .type = IIO_ACCEL, \ | 526 | .type = IIO_ACCEL, \ |
527 | .modified = 1, \ | 527 | .modified = 1, \ |
528 | .channel2 = IIO_MOD_ ## mod, \ | 528 | .channel2 = IIO_MOD_ ## mod, \ |
529 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 529 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
530 | IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT | \ | 530 | BIT(IIO_CHAN_INFO_CALIBBIAS), \ |
531 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ | 531 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ |
532 | IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SHARED_BIT, \ | 532 | BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \ |
533 | .address = (addr), \ | 533 | .address = (addr), \ |
534 | .scan_index = ADIS16400_SCAN_ACC_ ## mod, \ | 534 | .scan_index = ADIS16400_SCAN_ACC_ ## mod, \ |
535 | .scan_type = { \ | 535 | .scan_type = { \ |
@@ -545,9 +545,9 @@ static int adis16400_read_raw(struct iio_dev *indio_dev, | |||
545 | .type = IIO_MAGN, \ | 545 | .type = IIO_MAGN, \ |
546 | .modified = 1, \ | 546 | .modified = 1, \ |
547 | .channel2 = IIO_MOD_ ## mod, \ | 547 | .channel2 = IIO_MOD_ ## mod, \ |
548 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 548 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ |
549 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ | 549 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ |
550 | IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SHARED_BIT, \ | 550 | BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \ |
551 | .address = (addr), \ | 551 | .address = (addr), \ |
552 | .scan_index = ADIS16400_SCAN_MAGN_ ## mod, \ | 552 | .scan_index = ADIS16400_SCAN_MAGN_ ## mod, \ |
553 | .scan_type = { \ | 553 | .scan_type = { \ |
@@ -568,10 +568,11 @@ static int adis16400_read_raw(struct iio_dev *indio_dev, | |||
568 | .indexed = 1, \ | 568 | .indexed = 1, \ |
569 | .channel = 0, \ | 569 | .channel = 0, \ |
570 | .extend_name = ADIS16400_MOD_TEMP_NAME_ ## mod, \ | 570 | .extend_name = ADIS16400_MOD_TEMP_NAME_ ## mod, \ |
571 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 571 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
572 | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT | \ | 572 | BIT(IIO_CHAN_INFO_OFFSET) | \ |
573 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \ | 573 | BIT(IIO_CHAN_INFO_SCALE), \ |
574 | IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SHARED_BIT, \ | 574 | .info_mask_shared_by_type = \ |
575 | BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \ | ||
575 | .address = (addr), \ | 576 | .address = (addr), \ |
576 | .scan_index = ADIS16350_SCAN_TEMP_ ## mod, \ | 577 | .scan_index = ADIS16350_SCAN_TEMP_ ## mod, \ |
577 | .scan_type = { \ | 578 | .scan_type = { \ |
@@ -587,9 +588,9 @@ static int adis16400_read_raw(struct iio_dev *indio_dev, | |||
587 | .type = IIO_TEMP, \ | 588 | .type = IIO_TEMP, \ |
588 | .indexed = 1, \ | 589 | .indexed = 1, \ |
589 | .channel = 0, \ | 590 | .channel = 0, \ |
590 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 591 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
591 | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT | \ | 592 | BIT(IIO_CHAN_INFO_OFFSET) | \ |
592 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ | 593 | BIT(IIO_CHAN_INFO_SCALE), \ |
593 | .address = (addr), \ | 594 | .address = (addr), \ |
594 | .scan_index = ADIS16350_SCAN_TEMP_X, \ | 595 | .scan_index = ADIS16350_SCAN_TEMP_X, \ |
595 | .scan_type = { \ | 596 | .scan_type = { \ |
@@ -605,8 +606,8 @@ static int adis16400_read_raw(struct iio_dev *indio_dev, | |||
605 | .type = IIO_INCLI, \ | 606 | .type = IIO_INCLI, \ |
606 | .modified = 1, \ | 607 | .modified = 1, \ |
607 | .channel2 = IIO_MOD_ ## mod, \ | 608 | .channel2 = IIO_MOD_ ## mod, \ |
608 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 609 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ |
609 | IIO_CHAN_INFO_SCALE_SHARED_BIT, \ | 610 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ |
610 | .address = (addr), \ | 611 | .address = (addr), \ |
611 | .scan_index = ADIS16300_SCAN_INCLI_ ## mod, \ | 612 | .scan_index = ADIS16300_SCAN_INCLI_ ## mod, \ |
612 | .scan_type = { \ | 613 | .scan_type = { \ |
@@ -646,8 +647,8 @@ static const struct iio_chan_spec adis16448_channels[] = { | |||
646 | ADIS16400_MAGN_CHAN(Z, ADIS16400_ZMAGN_OUT, 16), | 647 | ADIS16400_MAGN_CHAN(Z, ADIS16400_ZMAGN_OUT, 16), |
647 | { | 648 | { |
648 | .type = IIO_PRESSURE, | 649 | .type = IIO_PRESSURE, |
649 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | 650 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), |
650 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | 651 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), |
651 | .address = ADIS16448_BARO_OUT, | 652 | .address = ADIS16448_BARO_OUT, |
652 | .scan_index = ADIS16400_SCAN_BARO, | 653 | .scan_index = ADIS16400_SCAN_BARO, |
653 | .scan_type = IIO_ST('s', 16, 16, 0), | 654 | .scan_type = IIO_ST('s', 16, 16, 0), |
diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index 8c26a5f7cd5d..b7db38376295 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c | |||
@@ -591,15 +591,15 @@ static int adis16480_write_raw(struct iio_dev *indio_dev, | |||
591 | } | 591 | } |
592 | } | 592 | } |
593 | 593 | ||
594 | #define ADIS16480_MOD_CHANNEL(_type, _mod, _address, _si, _info, _bits) \ | 594 | #define ADIS16480_MOD_CHANNEL(_type, _mod, _address, _si, _info_sep, _bits) \ |
595 | { \ | 595 | { \ |
596 | .type = (_type), \ | 596 | .type = (_type), \ |
597 | .modified = 1, \ | 597 | .modified = 1, \ |
598 | .channel2 = (_mod), \ | 598 | .channel2 = (_mod), \ |
599 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 599 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
600 | IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT | \ | 600 | BIT(IIO_CHAN_INFO_CALIBBIAS) | \ |
601 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ | 601 | _info_sep, \ |
602 | _info, \ | 602 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ |
603 | .address = (_address), \ | 603 | .address = (_address), \ |
604 | .scan_index = (_si), \ | 604 | .scan_index = (_si), \ |
605 | .scan_type = { \ | 605 | .scan_type = { \ |
@@ -613,21 +613,21 @@ static int adis16480_write_raw(struct iio_dev *indio_dev, | |||
613 | #define ADIS16480_GYRO_CHANNEL(_mod) \ | 613 | #define ADIS16480_GYRO_CHANNEL(_mod) \ |
614 | ADIS16480_MOD_CHANNEL(IIO_ANGL_VEL, IIO_MOD_ ## _mod, \ | 614 | ADIS16480_MOD_CHANNEL(IIO_ANGL_VEL, IIO_MOD_ ## _mod, \ |
615 | ADIS16480_REG_ ## _mod ## _GYRO_OUT, ADIS16480_SCAN_GYRO_ ## _mod, \ | 615 | ADIS16480_REG_ ## _mod ## _GYRO_OUT, ADIS16480_SCAN_GYRO_ ## _mod, \ |
616 | IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SEPARATE_BIT | \ | 616 | BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY) | \ |
617 | IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT, \ | 617 | BIT(IIO_CHAN_INFO_CALIBSCALE), \ |
618 | 32) | 618 | 32) |
619 | 619 | ||
620 | #define ADIS16480_ACCEL_CHANNEL(_mod) \ | 620 | #define ADIS16480_ACCEL_CHANNEL(_mod) \ |
621 | ADIS16480_MOD_CHANNEL(IIO_ACCEL, IIO_MOD_ ## _mod, \ | 621 | ADIS16480_MOD_CHANNEL(IIO_ACCEL, IIO_MOD_ ## _mod, \ |
622 | ADIS16480_REG_ ## _mod ## _ACCEL_OUT, ADIS16480_SCAN_ACCEL_ ## _mod, \ | 622 | ADIS16480_REG_ ## _mod ## _ACCEL_OUT, ADIS16480_SCAN_ACCEL_ ## _mod, \ |
623 | IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SEPARATE_BIT | \ | 623 | BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY) | \ |
624 | IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT, \ | 624 | BIT(IIO_CHAN_INFO_CALIBSCALE), \ |
625 | 32) | 625 | 32) |
626 | 626 | ||
627 | #define ADIS16480_MAGN_CHANNEL(_mod) \ | 627 | #define ADIS16480_MAGN_CHANNEL(_mod) \ |
628 | ADIS16480_MOD_CHANNEL(IIO_MAGN, IIO_MOD_ ## _mod, \ | 628 | ADIS16480_MOD_CHANNEL(IIO_MAGN, IIO_MOD_ ## _mod, \ |
629 | ADIS16480_REG_ ## _mod ## _MAGN_OUT, ADIS16480_SCAN_MAGN_ ## _mod, \ | 629 | ADIS16480_REG_ ## _mod ## _MAGN_OUT, ADIS16480_SCAN_MAGN_ ## _mod, \ |
630 | IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SEPARATE_BIT, \ | 630 | BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \ |
631 | 16) | 631 | 16) |
632 | 632 | ||
633 | #define ADIS16480_PRESSURE_CHANNEL() \ | 633 | #define ADIS16480_PRESSURE_CHANNEL() \ |
@@ -635,9 +635,9 @@ static int adis16480_write_raw(struct iio_dev *indio_dev, | |||
635 | .type = IIO_PRESSURE, \ | 635 | .type = IIO_PRESSURE, \ |
636 | .indexed = 1, \ | 636 | .indexed = 1, \ |
637 | .channel = 0, \ | 637 | .channel = 0, \ |
638 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 638 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
639 | IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT | \ | 639 | BIT(IIO_CHAN_INFO_CALIBBIAS) | \ |
640 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ | 640 | BIT(IIO_CHAN_INFO_SCALE), \ |
641 | .address = ADIS16480_REG_BAROM_OUT, \ | 641 | .address = ADIS16480_REG_BAROM_OUT, \ |
642 | .scan_index = ADIS16480_SCAN_BARO, \ | 642 | .scan_index = ADIS16480_SCAN_BARO, \ |
643 | .scan_type = { \ | 643 | .scan_type = { \ |
@@ -652,9 +652,9 @@ static int adis16480_write_raw(struct iio_dev *indio_dev, | |||
652 | .type = IIO_TEMP, \ | 652 | .type = IIO_TEMP, \ |
653 | .indexed = 1, \ | 653 | .indexed = 1, \ |
654 | .channel = 0, \ | 654 | .channel = 0, \ |
655 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 655 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
656 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \ | 656 | BIT(IIO_CHAN_INFO_SCALE) | \ |
657 | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \ | 657 | BIT(IIO_CHAN_INFO_OFFSET), \ |
658 | .address = ADIS16480_REG_TEMP_OUT, \ | 658 | .address = ADIS16480_REG_TEMP_OUT, \ |
659 | .scan_index = ADIS16480_SCAN_TEMP, \ | 659 | .scan_index = ADIS16480_SCAN_TEMP, \ |
660 | .scan_type = { \ | 660 | .scan_type = { \ |
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 37ca05b47e4b..fe4c61e219f3 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | |||
@@ -544,8 +544,8 @@ static int inv_mpu6050_validate_trigger(struct iio_dev *indio_dev, | |||
544 | .type = _type, \ | 544 | .type = _type, \ |
545 | .modified = 1, \ | 545 | .modified = 1, \ |
546 | .channel2 = _channel2, \ | 546 | .channel2 = _channel2, \ |
547 | .info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT \ | 547 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ |
548 | | IIO_CHAN_INFO_RAW_SEPARATE_BIT, \ | 548 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ |
549 | .scan_index = _index, \ | 549 | .scan_index = _index, \ |
550 | .scan_type = { \ | 550 | .scan_type = { \ |
551 | .sign = 's', \ | 551 | .sign = 's', \ |
@@ -564,9 +564,9 @@ static const struct iio_chan_spec inv_mpu_channels[] = { | |||
564 | */ | 564 | */ |
565 | { | 565 | { |
566 | .type = IIO_TEMP, | 566 | .type = IIO_TEMP, |
567 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | 567 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
568 | | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT | 568 | | BIT(IIO_CHAN_INFO_OFFSET) |
569 | | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, | 569 | | BIT(IIO_CHAN_INFO_SCALE), |
570 | .scan_index = -1, | 570 | .scan_index = -1, |
571 | }, | 571 | }, |
572 | INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_X, INV_MPU6050_SCAN_GYRO_X), | 572 | INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_X, INV_MPU6050_SCAN_GYRO_X), |
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c index 331781ffbb15..7da0832f187b 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | |||
@@ -105,9 +105,8 @@ irqreturn_t inv_mpu6050_irq_handler(int irq, void *p) | |||
105 | s64 timestamp; | 105 | s64 timestamp; |
106 | 106 | ||
107 | timestamp = iio_get_time_ns(); | 107 | timestamp = iio_get_time_ns(); |
108 | spin_lock(&st->time_stamp_lock); | 108 | kfifo_in_spinlocked(&st->timestamps, ×tamp, 1, |
109 | kfifo_in(&st->timestamps, ×tamp, 1); | 109 | &st->time_stamp_lock); |
110 | spin_unlock(&st->time_stamp_lock); | ||
111 | 110 | ||
112 | return IRQ_WAKE_THREAD; | 111 | return IRQ_WAKE_THREAD; |
113 | } | 112 | } |