1. 29 3月, 2015 2 次提交
    • O
      iio: add support for hardware fifo · f4f4673b
      Octavian Purdila 提交于
      Some devices have hardware buffers that can store a number of samples
      for later consumption. Hardware usually provides interrupts to notify
      the processor when the FIFO is full or when it has reached a certain
      watermark level. This helps with reducing the number of interrupts to
      the host processor and thus it helps decreasing the power consumption.
      
      This patch enables usage of hardware FIFOs for IIO devices in
      conjunction with software device buffers. When the hardware FIFO is
      enabled the samples are stored in the hardware FIFO. The samples are
      later flushed to the device software buffer when the number of entries
      in the hardware FIFO reaches the hardware watermark or when a flush
      operation is triggered by the user when doing a non-blocking read
      on an empty software device buffer.
      
      In order to implement hardware FIFO support the device drivers must
      implement the following new operations: setting and getting the
      hardware FIFO watermark level, flushing the hardware FIFO to the
      software device buffer. The device must also expose information about
      the hardware FIFO such it's minimum and maximum watermark and if
      necessary a list of supported watermark values. Finally, the device
      driver must activate the hardware FIFO when the device buffer is
      enabled, if the current device settings allows it.
      
      The software device buffer watermark is passed by the IIO core to the
      device driver as a hint for the hardware FIFO watermark. The device
      driver can adjust this value to allow for hardware limitations (such
      as capping it to the maximum hardware watermark or adjust it to a
      value that is supported by the hardware). It can also disable the
      hardware watermark (and implicitly the hardware FIFO) it this value is
      below the minimum hardware watermark.
      
      Since a driver may support hardware FIFO only when not in triggered
      buffer mode (due to different semantics of hardware FIFO sampling and
      triggered sampling) this patch changes the IIO core code to allow
      falling back to non-triggered buffered mode if no trigger is enabled.
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Reviewed-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      f4f4673b
    • J
      iio: add watermark logic to iio read and poll · 37d34556
      Josselin Costanzi 提交于
      Currently the IIO buffer blocking read only wait until at least one
      data element is available.
      This patch makes the reader sleep until enough data is collected before
      returning to userspace. This should limit the read() calls count when
      trying to get data in batches.
      
      Co-author: Yannick Bedhomme <yannick.bedhomme@mobile-devices.fr>
      Signed-off-by: NJosselin Costanzi <josselin.costanzi@mobile-devices.fr>
      [rebased and remove buffer timeout]
      Signed-off-by: NOctavian Purdila <octavian.purdila@intel.com>
      Reviewed-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      37d34556
  2. 28 3月, 2015 7 次提交
  3. 25 3月, 2015 2 次提交
    • G
      staging: fbtft: Do not use binary constants · 153fe946
      Geert Uytterhoeven 提交于
      Gcc < 4.3 doesn't understand binary constants (0b*):
      
      drivers/staging/fbtft/fbtft-sysfs.c:156:19: error: invalid suffix "b111" on integer constant
      drivers/staging/fbtft/fb_hx8340bn.c:159:3: error: invalid suffix "b1111" on integer constant
      drivers/staging/fbtft/fb_hx8340bn.c:159:11: error: invalid suffix "b1111" on integer constant
      drivers/staging/fbtft/fb_hx8340bn.c:159:19: error: invalid suffix "b11111" on integer constant
      drivers/staging/fbtft/fb_hx8340bn.c:159:28: error: invalid suffix "b1111" on integer constant
      drivers/staging/fbtft/fb_hx8340bn.c:159:36: error: invalid suffix "b1111" on integer constant
      drivers/staging/fbtft/fb_hx8340bn.c:159:44: error: invalid suffix "b1111" on integer constant
      drivers/staging/fbtft/fb_hx8340bn.c:159:52: error: invalid suffix "b11111" on integer constant
      drivers/staging/fbtft/fb_hx8340bn.c:160:3: error: invalid suffix "b111" on integer constant
      ...
      
      Hence use hexadecimal constants (0x*) instead.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      153fe946
    • G
      Merge tag 'iio-for-4.1a' of... · dc5f2c5f
      Greg Kroah-Hartman 提交于
      Merge tag 'iio-for-4.1a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
      
      Jonathan writes:
      
      First set of new drivers, cleanups and functionality for IIO in the 4.1 cycle.
      
      New drivers
      * CM3323 color sensor.
      * MS5611 pressure and temperature sensor.
      
      New functionality
      * mup6050 - create mux clients for devices described via ACPI. The reasoning
           and approach taken in this patch are complex.  Basically there is no
           otherway of finding out what is there than by some esoteric look ups in
           the ACPI data.
      * cm3232 - PM support
      * itg3200 - suspend/resume support
      * mcp320x - add more ADCs to the kconfig to reflect what the driver supports
           (this patch and the bindings got left behind when the support was added
            a while back).
      
      Docs / utils
      * ti-adc128s052 - DT bindings.
      * mcp3422 - DT bindings.
      * mcp320x - DT bindings
      * ABI docs for event threshold scale attributes, in_magn_offset, proximity
        scan_element and thresh falling/rising values for accelerometers.  All
        elements long in use that have slipped by being explicitly documented.
      * Tidy up the tools previously in drivers/staging/iio/Documentation and move
        them out to /tools/iio. Yet another move that should have happened long ago.
        This time Roberta Dobrescu did the leg work.  Thanks!
      
      Core Cleanups
      * Export userspace IIO headers.  We should have done the appropriate header
        splitting a long time ago. Thanks to Daniel for sorting this out.
      
      * Refactor the registring of attributes for buffers to move all non-custom
        ones to a vector allowing easier additions to the current set in the future.
      
      Driver Cleanups
      * gpiod related cleanups.  Make use of the additional parameter to specify
        	initial direciton to avoid extra code.
      * bmc150 - Various refactorings to reduce code repitition and prepare for
                 hardware buffer support.  Some of these cleanups are good even
      	   without the new functionality.
      * kmx61 - direct use of index to an array avoiding a structure element which
                was always the index to an element in an array of that structure.
      * vf610 - avoid incorrect type for return from wait_for_completion_timeout.
      * gp2ap020a00f - use put_unaligned_le32 for slight code simplification.
      * ade7754 - improve error handling including suppressing some build warnings.
      * ade7759 - improve error handling including suppressing some build warnings.
      * hmc5843 - Long line and indentation fixes. Also some constifying of various
            constant data.
      * ade7854 - 80+ character line splitting.
      * ad2s1210 - fix wrong printf format string.
      * mxs-lradc - fix wrong printf format string.
      * ade7954-i2c - code alignment fixes and other trivial but worthwhile bits.
      * periodic rtc trigger - make the frequency type an unsigned int as it
        is always treated as such.
      * jsa1212 - constify struct regmap_config as it is constant.
      * ad7793 - typo in the MODULE_DESCRIPTION
      * mma9551 - check gpiod_to_irq errors.  Note that this doesn't actually cause
          any trouble but is worth tidying up as obviously incorrect.
      * mlx90614 - refactor the register symbols to make it clear which reads are to
          RAM not PROM.
      dc5f2c5f
  4. 24 3月, 2015 29 次提交