1. 11 1月, 2017 5 次提交
  2. 03 4月, 2016 1 次提交
  3. 25 10月, 2015 2 次提交
  4. 01 6月, 2015 1 次提交
    • L
      iio: Specify supported modes for buffers · 225d59ad
      Lars-Peter Clausen 提交于
      For each buffer type specify the supported device modes for this buffer.
      This allows us for devices which support multiple different operating modes
      to pick the correct operating mode based on the modes supported by the
      attached buffers.
      
      It also prevents that buffers with conflicting modes are attached
      to a device at the same time or that a buffer with a non-supported mode is
      attached to a device (e.g. in-kernel callback buffer to a device only
      supporting hardware mode).
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      225d59ad
  5. 29 3月, 2015 1 次提交
  6. 12 12月, 2014 5 次提交
    • L
      iio: buffer: Drop get_length callback · 37495660
      Lars-Peter Clausen 提交于
      We already do have the length field in the struct iio_buffer which is
      expected to be in sync with the current size of the buffer. And currently
      all implementations of the get_length callback either return this field or a
      constant number.
      
      This patch removes the get_length callback and replaces all occurrences in
      the IIO core with directly accessing the length field of the buffer.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      37495660
    • L
      iio: buffer: Allocate standard attributes in the core · 08e7e0ad
      Lars-Peter Clausen 提交于
      All buffers want at least the length and the enable attribute. Move the
      creation of those attributes to the core instead of having to do this in
      each individual buffer implementation. This allows us to get rid of some
      boiler-plate code.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      08e7e0ad
    • L
      iio: Remove get_bytes_per_datum() from iio_buffer_access_funcs · 616dde2a
      Lars-Peter Clausen 提交于
      There haven't been any users of the get_bytes_per_datum() callback for a
      while. The core assumes that the number of bytes per datum can be calculated
      based on the enabled channels and the storage size of the channel and
      iio_compute_scan_bytes() is used to compute this number. So remove the
      callback.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      616dde2a
    • L
      iio: Move buffer registration to the core · 3e1b6c95
      Lars-Peter Clausen 提交于
      Originally device and buffer registration were kept as separate operations
      in IIO to allow to register two distinct sets of channels for buffered and
      non-buffered operations. This has since already been further restricted and
      the channel set registered for the buffer needs to be a subset of the
      channel set registered for the device. Additionally the possibility to not
      have a raw (or processed) attribute for a channel which was registered for
      the device was added a while ago. This means it is possible to not register
      any device level attributes for a channel even if it is registered for the
      device. Also if a channel's scan_index is set to -1 and the channel is
      registered for the buffer it is ignored.
      
      So in summary it means it is possible to register the same channel array for
      both the device and the buffer yet still end up with distinctive sets of
      channels for both of them. This makes the argument for having to have to
      manually register the channels for both the device and the buffer invalid.
      Considering that the vast majority of all drivers want to register the same
      set of channels for both the buffer and the device it makes sense to move
      the buffer registration into the core to avoid some boiler-plate code in the
      device driver setup path.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      3e1b6c95
    • L
      iio: Unexport iio_scan_mask_set() · 217a5cf0
      Lars-Peter Clausen 提交于
      Individual drivers should not be messing with the scan mask that contains
      the list of enabled channels. This is something that is supposed to be
      managed by the core.
      
      Now that the last few drivers that used it to configure a default scan mask
      have been updated to not do this anymore we can unexport the function.
      
      Note, this patch also requires moving a few functions around so they are all
      declared before the first internal user.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Reviewed-by: NDaniel Baluta <daniel.baluta@intel.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      217a5cf0
  7. 04 12月, 2013 1 次提交
    • L
      iio: Add data_available callback for buffers · 647cc7b9
      Lars-Peter Clausen 提交于
      This patch adds a new data_available() callback to the iio_buffer_access_funcs
      struct. The callback is used to indicate whether data is available in the buffer
      for reading. It is meant to replace the stufftoread flag from the iio_buffer
      struct. The reasoning for this is that the buffer implementation usually can
      determine whether data is available rather easily based on its state, on the
      other hand it can be rather tricky to update the stufftoread flag in a race free
      way.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      647cc7b9
  8. 17 10月, 2013 1 次提交
  9. 12 10月, 2013 1 次提交
    • L
      iio: Add reference counting for buffers · 9e69c935
      Lars-Peter Clausen 提交于
      Since the buffer is accessed by userspace we can not just free the buffers
      memory once we are done with it in kernel space. There might still be open file
      descriptors and userspace still might be accessing the buffer. This patch adds
      support for reference counting to the IIO buffers. When a buffer is created and
      initialized its initial reference count is set to 1. Instead of freeing the
      memory of the buffer the buffer's _free() function will drop that reference
      again. But only after the last reference to the buffer has been dropped the
      buffer the buffer's memory will be freed. The IIO device will take a reference
      to its primary buffer. The patch adds a small helper function for this called
      iio_device_attach_buffer() which will get a reference to the buffer and assign
      the buffer to the IIO device. This function must be used instead of assigning
      the buffer to the device by hand. The reference is only dropped once the IIO
      device is freed and we can be sure that there are no more open file handles. A
      reference to a buffer will also be taken whenever the buffer is active to avoid
      the buffer being freed while data is still being send to it.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      9e69c935
  10. 22 9月, 2013 1 次提交
    • L
      iio: Add iio_push_buffers_with_timestamp() helper · d2c3d072
      Lars-Peter Clausen 提交于
      Drivers using software buffers often store the timestamp in their data buffer
      before calling iio_push_to_buffers() with that data buffer. Storing the
      timestamp in the buffer usually involves some ugly pointer arithmetic. This
      patch adds a new helper function called iio_push_buffers_with_timestamp() which
      is similar to iio_push_to_buffers but takes an additional timestamp parameter.
      The function will help to hide to uglyness in one central place instead of
      exposing it in every driver. If timestamps are enabled for the IIO device
      iio_push_buffers_with_timestamp() will store the timestamp as the last element
      in buffer, before passing the buffer on to iio_push_buffers(). The buffer needs
      large enough to hold the timestamp in this case. If timestamps are disabled
      iio_push_buffers_with_timestamp() will behave just like iio_push_buffers().
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
      Cc: Josh Wu <josh.wu@atmel.com>
      Cc: Denis Ciocca <denis.ciocca@gmail.com>
      Cc: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
      Cc: Ge Gao <ggao@invensense.com>
      Cc: Peter Meerwald <pmeerw@pmeerw.net>
      Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Marek Vasut <marex@denx.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      d2c3d072
  11. 16 9月, 2013 1 次提交
    • L
      iio: iio_push_to_buffers(): Change type of 'data' to const void * · 5d65d920
      Lars-Peter Clausen 提交于
      Change the type of the 'data' parameter for iio_push_to_buffers() from 'u8 *' to
      'const void *'. Drivers typically use the correct type (e.g. __be16 *) for their
      data buffer. When passing the buffer to iio_push_to_buffers() it needs to be
      cast to 'u8 *' for the compiler to not complain (and also having to add __force
      if we want to keep sparse happy as well). Since the buffer implementation should
      not care about the data layout (except the size of one sample) using a void
      pointer is the correct thing to do. Also make it const as the buffer
      implementations are not supposed to modify it.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      5d65d920
  12. 01 2月, 2013 1 次提交
  13. 20 11月, 2012 1 次提交
    • L
      iio: Fix iio_buffer_register stub signature · 50d69b51
      Lars-Peter Clausen 提交于
      Match the iio_buffer_register stub signature up to the real function and make
      the second parameter const. This fixes a the following warnings if
      CONFIG_IIO_BUFFER is disabled:
      
      	drivers/staging/iio/accel/adis16201_core.c: In function ‘adis16201_probe’:
      	drivers/staging/iio/accel/adis16201_core.c:536: warning: passing argument 2 of ‘iio_buffer_register’ discards qualifiers from pointer target type
      	drivers/staging/iio/accel/adis16203_core.c: In function ‘adis16203_probe’:
      	drivers/staging/iio/accel/adis16203_core.c:468: warning: passing argument 2 of ‘iio_buffer_register’ discards qualifiers from pointer target type
      	drivers/staging/iio/accel/adis16204_core.c: In function ‘adis16204_probe’:
      	drivers/staging/iio/accel/adis16204_core.c:527: warning: passing argument 2 of ‘iio_buffer_register’ discards qualifiers from pointer target type
      	drivers/staging/iio/accel/adis16209_core.c: In function ‘adis16209_probe’:
      	drivers/staging/iio/accel/adis16209_core.c:542: warning: passing argument 2 of ‘iio_buffer_register’ discards qualifiers from pointer target type
      	drivers/staging/iio/accel/adis16240_core.c: In function ‘adis16240_probe’:
      	drivers/staging/iio/accel/adis16240_core.c:588: warning: passing argument 2 of ‘iio_buffer_register’ discards qualifiers from pointer target type
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      50d69b51
  14. 10 11月, 2012 1 次提交
  15. 08 9月, 2012 1 次提交
  16. 10 7月, 2012 1 次提交
  17. 07 7月, 2012 1 次提交
  18. 19 6月, 2012 1 次提交
  19. 26 4月, 2012 1 次提交
  20. 25 4月, 2012 1 次提交
  21. 25 2月, 2012 1 次提交
  22. 23 12月, 2011 4 次提交
  23. 13 12月, 2011 1 次提交
  24. 09 12月, 2011 5 次提交