1. 10 1月, 2018 1 次提交
  2. 23 7月, 2017 1 次提交
    • R
      iio: Convert to using %pOF instead of full_name · 3921db46
      Rob Herring 提交于
      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: NRob 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: NJonathan Cameron <Jonathan.Cameron@huawei.com>
      3921db46
  3. 15 7月, 2017 1 次提交
  4. 03 6月, 2017 1 次提交
  5. 26 4月, 2017 1 次提交
  6. 14 1月, 2017 1 次提交
    • L
      iio: inkern: pass through raw values if no scaling · adc8ec5f
      Linus Walleij 提交于
      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: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      adc8ec5f
  7. 13 11月, 2016 1 次提交
  8. 28 9月, 2016 1 次提交
  9. 20 4月, 2016 2 次提交
    • L
      iio: core: Add devm_ APIs for iio_channel_{get,release}_all · efc2c013
      Laxman Dewangan 提交于
      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: NLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      efc2c013
    • L
      iio: core: Add devm_ APIs for iio_channel_{get,release} · 8bf872d8
      Laxman Dewangan 提交于
      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: NLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      8bf872d8
  10. 16 4月, 2016 1 次提交
  11. 30 1月, 2016 1 次提交
  12. 13 12月, 2015 1 次提交
  13. 06 1月, 2015 1 次提交
  14. 01 1月, 2015 1 次提交
  15. 12 12月, 2014 1 次提交
  16. 25 10月, 2014 1 次提交
  17. 25 8月, 2014 1 次提交
  18. 21 6月, 2014 1 次提交
  19. 30 4月, 2014 1 次提交
    • S
      IIO: core: Introduce read_raw_multi · 9fbfb4b3
      Srinivas Pandruvada 提交于
      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: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      9fbfb4b3
  20. 17 3月, 2014 1 次提交
  21. 04 7月, 2013 1 次提交
  22. 05 6月, 2013 2 次提交
  23. 16 3月, 2013 1 次提交
  24. 07 2月, 2013 1 次提交
  25. 02 2月, 2013 2 次提交
  26. 10 11月, 2012 1 次提交
  27. 20 10月, 2012 1 次提交
  28. 19 10月, 2012 1 次提交
  29. 22 9月, 2012 2 次提交
    • K
      iio: inkern: clean up error return code · 3183bac1
      Kim, Milo 提交于
       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: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      3183bac1
    • K
      iio: inkern: put the IIO device when it fails to allocate memory · 801c4b5c
      Kim, Milo 提交于
       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: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      801c4b5c
  30. 18 9月, 2012 2 次提交
    • L
      iio:inkern: Add function to read the processed value · 48e44ce0
      Lars-Peter Clausen 提交于
      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: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      48e44ce0
    • K
      iio: inkern: add error case in iio_channel_get() · b2b79ffa
      Kim, Milo 提交于
       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: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      b2b79ffa
  31. 15 9月, 2012 1 次提交
    • K
      iio: inkern: allocate zeroed memory · 2cc412b5
      Kim, Milo 提交于
       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: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      2cc412b5
  32. 28 8月, 2012 1 次提交
  33. 13 7月, 2012 1 次提交
  34. 09 7月, 2012 1 次提交
  35. 30 6月, 2012 1 次提交