1. 16 3月, 2013 1 次提交
  2. 07 2月, 2013 1 次提交
  3. 02 2月, 2013 2 次提交
  4. 10 11月, 2012 1 次提交
  5. 20 10月, 2012 1 次提交
  6. 19 10月, 2012 1 次提交
  7. 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
  8. 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
  9. 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
  10. 28 8月, 2012 1 次提交
  11. 13 7月, 2012 1 次提交
  12. 09 7月, 2012 1 次提交
  13. 30 6月, 2012 1 次提交
  14. 05 6月, 2012 1 次提交
  15. 26 4月, 2012 2 次提交
  16. 11 4月, 2012 1 次提交
  17. 25 2月, 2012 1 次提交
    • J
      staging:iio:core add in kernel interface mapping and getting IIO channels. · e27d75d7
      Jonathan Cameron 提交于
      Lifted from proposal for in kernel interface built on the out of staging
      branch.
      
      Two elements here:
      * Map as defined in "inkern.h"
      * Matching code to actually get the iio_dev and channel
      that we want from the global list of IIO devices.
      V4: Everything now built if iio is built (rather than being optional)
          Removal race condition prevented by using info pointer as a check
          of removal under a lock.
      V3: Drop the option of registering / getting channels using dev pointer.
      Stick to name only as suggested by Mark Brown (this has caused user
      confusion in the regulator framework.)
      V2: As per Greg KH suggestion, move over to registration by passing
      the tables into the provider drivers (how regulator does it).
      This does not prevent us using the original more flexible approach
      if at a later date there is a usecase that demands it.
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e27d75d7