1. 12 Jul, 2012 1 commit
    • Peter Meerwald's avatar
      iio: add adjd_s311 I2C digital color sensor driver · bbdb822c
      Peter Meerwald authored
      sensor has 4 channels (10-bit each, R/G/B and clear), sensitivity
      and gain is controlled in the driver by ext_info integration_time
      and CHAN_INFO_HARDWAREGAIN
      
      driver supports triggered buffer and IIO_CHAN_INFO_RAW to get the
      sensor data
      
      v5: address comments by Jonathan Cameron
      * use macro for channel declaration
      * get timestamp right before measurement
      * cleanups
      
      v4: address comments by Lars-Peter Clausen
      * make sure trigger handler is exited with iio_trigger_notify_done()
        and IRQ_HANDLED
      * kfree()/kalloc() -> krealloc()
      
      v3:
      * fix warnings
      
      v2: address comments by Lars-Peter Clausen
      * buffer allocation now in update_scan_mode instead of in trigger
        handler
      * simplify trigger code (assume active_scan_mask is not empty, use
        for_each_set_bit, use iio_push_to_buffer)
      * reorder entry in Makefile and Kconfig
      * fix remove
      Signed-off-by: default avatarPeter Meerwald <pmeerw@pmeerw.net>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      bbdb822c
  2. 10 Jul, 2012 2 commits
  3. 09 Jul, 2012 5 commits
    • Lars-Peter Clausen's avatar
      staging:iio:ade7758: Use iio_validate_scan_mask_onehot · ee0312a0
      Lars-Peter Clausen authored
      Only one of the channels of the ade7758 may be sampled at a time. Use the new
      validate_scan_mask callback and the iio_validate_scan_mask_onehot function to
      implement this restriction. Previously this was implemented using
      available_scan_masks, but this requires a individual scan mask for each channel.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      ee0312a0
    • Lars-Peter Clausen's avatar
      staging:iio:ad7793: Use iio_validate_scan_mask_onehot · 8c2c6ba6
      Lars-Peter Clausen authored
      Only one of the channels of the ad7793 may be sampled at a time. Use the new
      validate_scan_mask callback and the iio_validate_scan_mask_onehot function to
      implement this restriction. Previously this was implemented using
      available_scan_masks, but this requires a individual scan mask for each channel.
      
      Also the previous code was adding the scan index of the timestamp channel to
      each available scan mask, this is not required though since the timestamp
      channel is not restricted by the available scan masks and can be enabled or
      disabled independently. So the new code does not have to take care of this.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      8c2c6ba6
    • Lars-Peter Clausen's avatar
      staging:iio:ad7192: Use iio_validate_scan_mask_onehot · f6aea554
      Lars-Peter Clausen authored
      Only one of the channels of the ad7192 may be sampled at a time. Use the new
      validate_scan_mask callback and the iio_validate_scan_mask_onehot function to
      implement this restriction. Previously this was implemented using
      available_scan_masks, but this requires a individual scan mask for each channel.
      
      Also the previous code was adding the scan index of the timestamp channel to
      each available scan mask, this is not required though since the timestamp
      channel is not restricted by the available scan masks and can be enabled or
      disabled independently. So the new code does not have to take care of this.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      f6aea554
    • Lars-Peter Clausen's avatar
      iio: Introduce iio_validate_scan_mask_onehot · 81636632
      Lars-Peter Clausen authored
      Add a helper function for validating a scan mask for devices where exactly one
      channel must be selected during sampling. This is a common case among devices
      which have scan mask restrictions so it makes sense to provide this function in
      the core.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      81636632
    • Lars-Peter Clausen's avatar
      iio: Add callback to check whether a scan mask is valid · 939546d1
      Lars-Peter Clausen authored
      This is useful for cases where the number of valid scan masks grows
      exponentially, but it is rather easy to check whether a mask is valid or not
      programmatically.
      
      An example of such a case is a device with multiple ADCs where each ADC has a
      upstream MUX, which allows to select from a number of physical channels.
      
        +-------+   +-------+
        |       |   |       | --- Channel 1
        | ADC 1 |---| MUX 1 | ---   ...
        |       |   |       | --- Channel M
        +-------+   +-------+
      
           .            .            .
           .            .            .
           .            .            .
      
        +-------+   +-------+
        |       |   |       | --- Channel M * N + 1
        | ADC N |---| MUX N | ---       ...
        |       |   |       | --- Channel M * N + M
        +-------+   +-------+
      
      The number of necessary scan masks for this case is (M+1)**N - 1, on the other
      hand it is easy to check whether subsets for each ADC of the scanmask have only
      one bit set.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      939546d1
  4. 08 Jul, 2012 5 commits
  5. 07 Jul, 2012 3 commits
  6. 06 Jul, 2012 24 commits