1. 10 7月, 2012 2 次提交
    • L
      iio: Introduce iio_validate_scan_mask_onehot · 81636632
      Lars-Peter Clausen 提交于
      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: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      81636632
    • L
      iio: Add callback to check whether a scan mask is valid · 939546d1
      Lars-Peter Clausen 提交于
      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: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      939546d1
  2. 19 6月, 2012 1 次提交
  3. 16 6月, 2012 1 次提交
  4. 15 5月, 2012 1 次提交
  5. 26 4月, 2012 2 次提交
  6. 25 4月, 2012 6 次提交
  7. 25 2月, 2012 1 次提交
  8. 23 12月, 2011 7 次提交
  9. 09 12月, 2011 8 次提交
  10. 30 11月, 2011 1 次提交
  11. 27 11月, 2011 2 次提交
    • J
      staging:iio: header reorganization · af5046af
      Jonathan Cameron 提交于
      Issue brought up by Lars-Peter Clausen. This is a varient of what
      he suggested.
      
      io/iio.h for driver stuff (has to include types.h)
      	Sub files for the bits drivers may or may not use
      	iio/sysfs.h
      	iio/buffer.h (contents of current buffer_generic.h)
      	(obviously anything offering events will need events.h as well)
      iio/types.h for the enums that matter to both
      	iio_chan_type, iio_modifier
      iio/events.h for the event code stuff
      	IIO_EVENT_CODE and friends.  + everything in chrdev.h  So this
      	is the stuff that userspace cares about.
      	Also include iio_event_type, iio_event_direction
      
      Thus iio drivers include iio.h + as required
      events.h
      sysfs.h
      buffer.h
      
      in kernel users (once that interface is merged) will need inkern.h
      which will pull in types.h
      
      Userspace will need just events.h (which pulls in types.h) to get
      everything they need to know about.  Buffer userspace access doesn't
      currently need any core defines. All information about the data
      format is passed through sysfs.
      Signed-off-by: NJonathan Cameron <jic23@cam.ac.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      af5046af
    • J
      staging:iio: core. Allow for event chrdev obtaining ioctl if no buffer present. · 96e00f11
      Jonathan Cameron 提交于
      Logic bug meant the chrdev would fail to open if there was no buffer support
      in a driver or in the core. This meant the ioctl to get the event chrdev
      would fail and hence events were not available.
      
      V2: change error to -EINVAL to mark as unsuitable for reading rather than
      not there.  Both are true depending on how you look at it.
      Signed-off-by: NJonathan Cameron <jic23@cam.ac.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      96e00f11
  12. 01 11月, 2011 1 次提交
  13. 11 10月, 2011 1 次提交
  14. 05 10月, 2011 1 次提交
  15. 27 9月, 2011 4 次提交
  16. 07 9月, 2011 1 次提交