1. 04 12月, 2013 1 次提交
  2. 25 11月, 2013 2 次提交
  3. 24 10月, 2013 2 次提交
  4. 12 10月, 2013 5 次提交
  5. 01 10月, 2013 1 次提交
  6. 21 9月, 2013 3 次提交
  7. 16 9月, 2013 2 次提交
  8. 15 9月, 2013 1 次提交
    • P
      iio: Add INT_TIME (integration time) channel info attribute · 899d90bd
      Peter Meerwald 提交于
      Integration time is in seconds; it controls the measurement
      time and influences the gain of a sensor.
      
      There are two typical ways that scaling is implemented in a device:
      1) input amplifier,
      2) reference to the ADC is changed.
      These both result in the accuracy of the ADC varying (by applying its
      sampling over a more relevant range).
      
      Integration time is a way of dealing with noise inherent in the analog
      sensor itself.  In the case of a light sensor, a mixture of photon noise
      and device specific noise.  Photon noise is dealt with by either improving
      the efficiency of the sensor, (more photons actually captured) which is not
      easily varied dynamically, or by integrating the measurement over a longer
      time period.  Note that this can also be thought of as an averaging of a
      number of individual samples and is infact sometimes implemented this way.
      Altering integration time implies that the duration of a measurement changes,
      a fact the device's user may be interested in.
      
      Hence it makes sense to distinguish between integration time and simple
      scale. In some devices both types of control are present and whilst they
      will have similar effects on the amplitude of the reading, their effect
      on the noise of the measurements will differ considerably.
      
      Used by adjd_s311, tsl4531, tcs3472
      The following drivers have similar controls (and could be adapted):
      * tsl2563 (integration time is controlled via CALIBSCALE among other things)
      * tsl2583 (has integration_time device_attr, but driver doesn't use channels yet)
      * tsl2x7x (has integration_time attr)
      Signed-off-by: NPeter Meerwald <pmeerw@pmeerw.net>
      Cc: Jon Brenner <jon.brenner@ams.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      899d90bd
  9. 04 8月, 2013 2 次提交
  10. 18 3月, 2013 2 次提交
  11. 16 3月, 2013 1 次提交
  12. 21 11月, 2012 2 次提交
  13. 10 11月, 2012 1 次提交
  14. 02 11月, 2012 3 次提交
  15. 20 10月, 2012 1 次提交
  16. 15 9月, 2012 1 次提交
    • L
      iio: Introduce a new fractional value type · 7985e7c1
      Lars-Peter Clausen 提交于
      Currently IIO uses a decimal fixed point representations for real type numbers.
      This patch introduces a new representation for rational type numbers. The number
      will be expressed by specifying a numerator and denominator. For converting a
      raw value to a processed value multiply it by the numerator and divide it by the
      denominator.
      
      The reasoning for introducing this new type is that for a lot of devices the
      scale can be represented easily by a fractional number, but it is not possible
      to represent it as fixed point number without rounding.  E.g. for a simple DAC
      the scale is often the reference voltage divided by the number of possible
      values (Usually 2**n_bits - 1). Each driver currently implements the conversion
      of this fraction to a fixed point number on its own.
      
      Also when it comes to the in-kernel interface this allows to directly use the
      fractional factors to convert a raw value to a processed value. This should on
      one hand require less instructions and on the other hand increase the
      precision.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      7985e7c1
  17. 07 9月, 2012 1 次提交
  18. 04 9月, 2012 3 次提交
  19. 11 7月, 2012 1 次提交
  20. 30 6月, 2012 2 次提交
  21. 07 6月, 2012 1 次提交
  22. 05 6月, 2012 2 次提交
    • L
      iio: Add helper functions for enum style channel attributes · 5212cc8a
      Lars-Peter Clausen 提交于
      We often have the case were we do have a enum style channel attribute. These
      attributes have in common that they are a list of string values which usually
      map in a 1-to-1 fashion to integer values.
      
      This patch implements some common helper code for implementing enum style
      channel attributes using extended channel attributes. The helper functions take
      care of converting between the string and integer values, as well providing a
      function for "_available" attributes which list all available enum items.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Acked-by: NJonathan Cameron <jic23@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5212cc8a
    • L
      iio: Fix potential use after free · e407fd65
      Lars-Peter Clausen 提交于
      There is no guarantee that the last reference to the iio device has already been
      dropped when iio_device_free is called. This means that we can up calling
      iio_dev_release after iio_device_free which will lead to a use after free. As
      the general rule the struct containing the device should always be freed in the
      release callback.
      
      This is what this patch does, it moves freeing the iio device struct as well as
      releasing the idr reference to the release callback. To ensure that the device
      is not freed before calling iio_device_free the device_unregister call in
      iio_device_unregister is broken apart. iio_device_unregister will now only call
      device_del to remove the device from the system and iio_device_free will call
      put_device to drop the reference we obtained in iio_devce_alloc.
      
      We also have to take care that calling iio_device_free without having called
      iio_device_register still works (i.e. this can happen if something failed during
      device initialization). For this to work properly two minor changes were
      necessary: channel_attr_list needs to be initialized in iio_device_alloc and we
      have to check whether the chrdev has been registered before releasing it in
      iio_device_release.
      
      This change also brings iio_device_unregister and iio_device_free more in sync
      with iio_device_register and iio_device_alloc which call device_add and
      device_initialize respectively.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Acked-by: NJonathan Cameron <jic23@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e407fd65