1. 13 11月, 2016 4 次提交
    • P
      iio: inkern: add helpers to query available values from channels · 00c5f80c
      Peter Rosin 提交于
      Specifically a helper for reading the available maximum raw value of a
      channel and a helper for forwarding read_avail requests for raw values
      from one iio driver to an iio channel that is consumed.
      
      These rather specific helpers are in turn built with generic helpers
      making it easy to build more helpers for available values as needed.
      Signed-off-by: NPeter Rosin <peda@axentia.se>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      00c5f80c
    • J
      iio:core: add a callback to allow drivers to provide _available attributes · 51239600
      Jonathan Cameron 提交于
      A large number of attributes can only take a limited range of values.
      Currently in IIO this is handled by directly registering additional
      *_available attributes thus providing this information to userspace.
      
      It is desirable to provide this information via the core for much the same
      reason this was done for the actual channel information attributes in the
      first place.  If it isn't there, then it can only really be accessed from
      userspace.  Other in kernel IIO consumers have no access to what valid
      parameters are.
      
      Two forms are currently supported:
      * list of values in one particular IIO_VAL_* format.
      	e.g. 1.300000 1.500000 1.730000
      * range specification with a step size:
      	e.g. [1.000000 0.500000 2.500000]
      	equivalent to 1.000000 1.5000000 2.000000 2.500000
      
      An addition set of masks are used to allow different sharing rules for the
      *_available attributes generated.
      
      This allows for example:
      
      in_accel_x_offset
      in_accel_y_offset
      in_accel_offset_available.
      
      We could have gone with having a specification for each and every
      info_mask element but that would have meant changing the existing userspace
      ABI.  This approach does not.
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      [forward ported, added some docs and fixed buffer overflows /peda]
      Acked-by: NDaniel Baluta <daniel.baluta@intel.com>
      Signed-off-by: NPeter Rosin <peda@axentia.se>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      51239600
    • B
      staging: iio: tsl2583: fix issue with changes to calibscale and int_time not being set on the chip · 2167769a
      Brian Masney 提交于
      When updating the in_illuminance_calibscale and
      in_illuminance_integration_time sysfs attributes, these values were not
      actually written to the chip. The chip would continue to use the old
      parameters. Extracted out tsl2583_set_als_gain() and
      tsl2583_set_als_time() functions that are now called when these sysfs
      attributes are updated. The chip initialization also calls these these
      new functions.
      Signed-off-by: NBrian Masney <masneyb@onstation.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      2167769a
    • B
      staging: iio: tsl2583: split out functionality of taos_chip_on() · c908fb76
      Brian Masney 提交于
      taos_chip_on() reads an eight member array called taos_config
      that contains the desired state of the chip's registers. Only four
      of the registers actually need to be written to. The four that do
      not need to be written to are for the {low,high} byte of the lower
      interrupt threshold and the {low,high} byte of the upper interrupt
      threshold. Interrupts are currently not supported by this driver
      so there is no need to write to these registers.
      
      This patch removes the taos_config array and separates out the
      i2c calls that write to the CONTROL, TIMING, INTERRUPT and ANALOG
      registers. This is part of a larger refactor that was split up to
      make the code review easier.
      Signed-off-by: NBrian Masney <masneyb@onstation.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      c908fb76
  2. 12 11月, 2016 6 次提交
  3. 09 11月, 2016 4 次提交
  4. 07 11月, 2016 26 次提交