1. 22 Jul, 2017 1 commit
    • Rob Herring's avatar
      iio: Convert to using %pOF instead of full_name · 3921db46
      Rob Herring authored
      Now that we have a custom printf format specifier, convert users of
      full_name to use %pOF instead. This is preparation to remove storing
      of the full path string for each node.
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: Hartmut Knaack <knaack.h@gmx.de>
      Cc: Lars-Peter Clausen <lars@metafoo.de>
      Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
      Cc: Carlo Caione <carlo@caione.org>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: linux-iio@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-amlogic@lists.infradead.org
      Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      3921db46
  2. 15 Jul, 2017 1 commit
  3. 03 Jun, 2017 1 commit
  4. 26 Apr, 2017 1 commit
  5. 14 Jan, 2017 1 commit
    • Linus Walleij's avatar
      iio: inkern: pass through raw values if no scaling · adc8ec5f
      Linus Walleij authored
      When a consumer calls iio_read_channel_processed() the IIO core
      tries to apply scaling to the value, but if the channel only
      supports reading raw values, we should return that raw value
      to the cosumer instead of an error.
      
      This is what userspace is expected to do with sensors only
      providing raw values so the kernel should do the same, so as to
      avoid adding scaling boilerplate to drivers for hardware that
      actually return processed values from raw reads.
      
      A sensor not providing a scale, but providing a _raw attribute
      could be valid if for example the scale is the default of 1,
      but an offset needs to be applied to convert to the _processed
      form.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      adc8ec5f
  6. 13 Nov, 2016 1 commit
  7. 27 Sep, 2016 1 commit
  8. 19 Apr, 2016 2 commits
    • Laxman Dewangan's avatar
      iio: core: Add devm_ APIs for iio_channel_{get,release}_all · efc2c013
      Laxman Dewangan authored
      Some of kernel driver uses the IIO framework to get the sensor
      value via ADC or IIO HW driver. The client driver get iio channel
      by iio_channel_get_all() and release it by calling
      iio_channel_release_all().
      
      Add resource managed version (devm_*) of these APIs so that if client
      calls the devm_iio_channel_get_all() then it need not to release it
      explicitly, it can be done by managed device framework when driver
      get un-binded.
      
      This reduces the code in error path and also need of .remove callback in
      some cases.
      Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      efc2c013
    • Laxman Dewangan's avatar
      iio: core: Add devm_ APIs for iio_channel_{get,release} · 8bf872d8
      Laxman Dewangan authored
      Some of kernel driver uses the IIO framework to get the sensor
      value via ADC or IIO HW driver. The client driver get iio channel
      by iio_channel_get() and release it by calling iio_channel_release().
      
      Add resource managed version (devm_*) of these APIs so that if client
      calls the devm_iio_channel_get() then it need not to release it explicitly,
      it can be done by managed device framework when driver get un-binded.
      
      This reduces the code in error path and also need of .remove callback in
      some cases.
      Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      8bf872d8
  9. 16 Apr, 2016 1 commit
  10. 30 Jan, 2016 1 commit
  11. 12 Dec, 2015 1 commit
  12. 05 Jan, 2015 1 commit
  13. 01 Jan, 2015 1 commit
  14. 12 Dec, 2014 1 commit
  15. 25 Oct, 2014 1 commit
  16. 25 Aug, 2014 1 commit
  17. 21 Jun, 2014 1 commit
  18. 29 Apr, 2014 1 commit
    • Srinivas Pandruvada's avatar
      IIO: core: Introduce read_raw_multi · 9fbfb4b3
      Srinivas Pandruvada authored
      This callback is introduced to overcome some limitations of existing
      read_raw callback. The functionality of both existing read_raw and
      read_raw_multi is similar, both are used to request values from the
      device. The current read_raw callback allows only two return values.
      The new read_raw_multi allows returning multiple values. Instead of
      passing just address of val and val2, it passes length and pointer
      to values. Depending on the type and length of passed buffer, iio
      client drivers can return multiple values.
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      9fbfb4b3
  19. 16 Mar, 2014 1 commit
  20. 03 Jul, 2013 1 commit
  21. 04 Jun, 2013 2 commits
  22. 16 Mar, 2013 1 commit
  23. 06 Feb, 2013 1 commit
  24. 02 Feb, 2013 2 commits
  25. 10 Nov, 2012 1 commit
  26. 19 Oct, 2012 2 commits
  27. 22 Sep, 2012 2 commits
    • Kim, Milo's avatar
      iio: inkern: clean up error return code · 3183bac1
      Kim, Milo authored
       When the IIO consumer tries to get specific IIO channel,
       few error cases can be happened.
       (a) Memory allocation failure
       (b) No matched ADC channel error
       (c) Invalid input arguments
       This patch enables cleaning up error handling in case of (a) and (b).
      
       In error handling code,
       (a): the reference count of the IIO device should be decreased.
       (b): the allocated memory should be freed with restoring the reference count.
       Therefore iio_deivce_put() is called in both cases.
       This can be handled in the last error statement.
      
       Additionally, integer variable is used for stating each error case explicitly.
       Then, the error returns as ERR_PTR() with this value.
      Signed-off-by: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      3183bac1
    • Kim, Milo's avatar
      iio: inkern: put the IIO device when it fails to allocate memory · 801c4b5c
      Kim, Milo authored
       The reference count of the IIO device is increased if the IIO map has
       matched consumer name.
       After then, it tries to allocate the iio_channel which is used by the consumer.
       If it fails to allocate memory, the reference count should be decreased.
      
       This patch enables restoring the reference count of the IIO device.
      Signed-off-by: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      801c4b5c
  28. 17 Sep, 2012 2 commits
    • Lars-Peter Clausen's avatar
      iio:inkern: Add function to read the processed value · 48e44ce0
      Lars-Peter Clausen authored
      Add a function to read a processed value from a channel. The function will first
      attempt to read the IIO_CHAN_INFO_PROCESSED attribute. If that fails it will
      read the IIO_CHAN_INFO_RAW attribute and convert the result from a raw value to
      a processed value.
      
      The patch also introduces a function to convert raw value to a processed value
      and exports it, in case a user needs or wants to do the conversion by itself.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      48e44ce0
    • Kim, Milo's avatar
      iio: inkern: add error case in iio_channel_get() · b2b79ffa
      Kim, Milo authored
       The datasheet name is defined in the IIO driver.
       On the other hand, the adc_channel_label is configured in
       the platform side.
       If the datasheet name is not matched with any adc_channel_label,
       the iio_channel_get() should be returned as error for preventing
       invalid channel data access.
      
       This can be handled either way.
       (a) checking null data when using it : in the xxx_read_raw()
       or
       (b) error returns when the channel is requested : this patch
      
       The IIO consumer can't use the channel with invalid channel spec.
       Therefore case (b) is more reasonable.
      Signed-off-by: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      b2b79ffa
  29. 15 Sep, 2012 1 commit
    • Kim, Milo's avatar
      iio: inkern: allocate zeroed memory · 2cc412b5
      Kim, Milo authored
       Use kzalloc() rather than kmalloc() for initializing the iio_channel structure.
       This patch enables the iio_dev and iio_chan_spec are set to NULL.
       This may prevent the page fault problem because the pointer of iio_chan_spec
       is initialized as NULL.
      
       The iio_chan_spec is updated only in case that the IIO map has
       specific channel label.
       When the map has no ADC channel label, then the value of iio_chan_spec
       remains as invalid pointer.
       To prevent this problem, the pointer should be initialized as NULL.
      Signed-off-by: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      2cc412b5
  30. 27 Aug, 2012 1 commit
  31. 12 Jul, 2012 1 commit
  32. 08 Jul, 2012 1 commit
  33. 30 Jun, 2012 1 commit
  34. 05 Jun, 2012 1 commit