1. 27 Aug, 2015 2 commits
    • Vladimir Barinov's avatar
      iio: Support triggered events · 735ad074
      Vladimir Barinov authored
      Support triggered events.
      
      This is useful for chips that don't have their own interrupt sources.
      It allows to use generic/standalone iio triggers for those drivers.
      Signed-off-by: default avatarVladimir Barinov <vladimir.barinov@cogentembedded.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      735ad074
    • Crt Mori's avatar
      iio: mlx90614: Implement filter configuration · 764589b6
      Crt Mori authored
      Implemented Low pass 3db frequency filter which configures
      FIR and IIR values within the configuration register of EEPROM.
      For more standardized interface we have fixed the FIR value
      to 1024, while changes in IIR value are directly connected to
      filter responses. The new datasheet version will provide a
      simplified table (also in reStructured text format below) with
      this change, to provide quick overview of possible settings.
      
      Below sensor timings (bandwidth) are calculated for 3db frequency
      low pass filter.
      
      +--------------------+-----------------+
      | Filter setting (%) | Band width (Hz) |
      |  (rounded to 1.0)  |                 |
      +====================+=================+
      |         13         |      0.15       |
      +--------------------+-----------------+
      |         17         |      0.20       |
      +--------------------+-----------------+
      |         25         |      0.31       |
      +--------------------+-----------------+
      |         50         |      0.77       |
      +--------------------+-----------------+
      |         57         |      0.86       |
      +--------------------+-----------------+
      |         67         |      1.10       |
      +--------------------+-----------------+
      |         80         |      1.53       |
      +--------------------+-----------------+
      |        100         |      7.23       |
      +--------------------+-----------------+
      
      The diff is made towards togreg branch. Added myself to MAINTAINERS and
      authors as per discussion with Jonathan.
      Signed-off-by: default avatarCrt Mori <cmo@melexis.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      764589b6
  2. 24 Aug, 2015 1 commit
  3. 22 Aug, 2015 8 commits
  4. 16 Aug, 2015 15 commits
  5. 15 Aug, 2015 1 commit
  6. 12 Aug, 2015 13 commits
    • Hartmut Knaack's avatar
      iio:adc:cc10001_adc: resort entry in Kconfig and Makefile · 47d5e30a
      Hartmut Knaack authored
      Move the entry for the CC 10001 ADC driver in Kconfig and Makefile up to
      maintain alphabetic order.
      Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      47d5e30a
    • Hartmut Knaack's avatar
      iio:magnetometer:bmc150_magn: sort entry alphabetically · 2427d22d
      Hartmut Knaack authored
      Sort the entry for bmc105_magn in Kconfig and Makefile to its correct
      position. Also add the minor module information for completeness.
      
      Fixes: c91746a2 ("iio: magn: Add support for BMC150 magnetometer")
      Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      2427d22d
    • Hartmut Knaack's avatar
      iio:light:stk3310: adjust indentation · 5b958f11
      Hartmut Knaack authored
      Adjust some indentation issues as spotted by checkpatch.pl --strict
      Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
      Reviewed-by: default avatarTiberiu Breana <tiberiu.a.breana@intel.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      5b958f11
    • Hartmut Knaack's avatar
      iio:light:stk3310: use correct names and type for state · 952c3aa3
      Hartmut Knaack authored
      Indicate the bit number of predefined states, make use of these names and
      change the state type in _resume to u8 to avoid type casting.
      Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
      Reviewed-by: default avatarTiberiu Breana <tiberiu.a.breana@intel.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      952c3aa3
    • Hartmut Knaack's avatar
      iio:light:stk3310: add more error handling · 7c7a9eea
      Hartmut Knaack authored
      Check for the following error cases:
        * lower boundary for val in _write_event
        * return value of regmap_(field_)read
        * possible values for chan->type
        * return value of stk3310_gpio_probe
      
      Also add an error path in _probe to put the sensor back into stand-by mode
      in case of serious errors.
      Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      7c7a9eea
    • Hartmut Knaack's avatar
      iio:adc:berlin2-adc: coding style cleanup · b465fc54
      Hartmut Knaack authored
      Some adjustment of indentation to make checkpatch.pl happy in strict mode.
      Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
      Acked-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      b465fc54
    • Hartmut Knaack's avatar
      iio:adc:berlin2-adc: enable interrupts with mutex locked · 3ac06522
      Hartmut Knaack authored
      Move the call to enable channel interrupts into its _read() function to
      have it protected by a mutex. This ensures that only one channel is
      sampled at a time.
      Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      3ac06522
    • Hartmut Knaack's avatar
      iio:adc:berlin2-adc: use GENMASK and BIT for masks · 4b308e8c
      Hartmut Knaack authored
      Make use of GENMASK for consecutive bitmasks and BIT for single bitmasks.
      Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
      Acked-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      4b308e8c
    • Greg Kroah-Hartman's avatar
      Merge tag 'iio-for-4.3b-2' of... · 1c46ae0a
      Greg Kroah-Hartman authored
      Merge tag 'iio-for-4.3b-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
      
      Jonathan writes:
      
      Second set of new device support, features and cleanup for the 4.3 cycle.
      Take 2 also includes a fix set that was too late for the 4.2 cycle.
      
      As we had a lot of tools and docs work in this set, I have broken those
      out into their own categories in this description.
      
      Fixes from the pull request '4th set of IIO fixes for the 4.2 cycle'.
      * Poll functions for both event chardev and the buffer one were returning
        negative error codes (via a positive value).
      * A recent change to lsiio adding some error handling that was wrong and
        stopped the tool working.
      * bmg160 was missing some dependencies in Kconfig
      * berlin2-adc had a misshandled register (wrote a value rather than a bitmap)
      
      New device support
      * TI opt3001 light sensor
      * TXC PA12 ALS and proximity sensor.
      * mcp3301 ADC support (in mcp320x driver)
      * ST lsm303agr accelerometer and magnetometer drivers (plus some st-sensors
        common support to allow different WHOAMI register addresses, devices with
        fixed scale and allow interrupt equiped magnetometers).
      * ADIS16305, ADIS16367, ADIS16445IMUs (in the adis16400 driver)
      * ADIS16266 gyro (in the adis16260 driver)
      * ADIS16137 gyro (in the adis16136 driver)
      
      New functionality
      * mmc35240 DT bindings.
      * Inverse unit conversion macros to aid handing of values written to sysfs
        attributes.
      
      Core cleanup
      * Forward declaration of struct iio_trigger to avoid a compile warning.
      
      Driver cleanup / fixes
      * mxs-lradc
        - Clarify which parts are supported.
        - Fix spelling erorrs.
        - Missing/extra includes
        - reorder includes
        - add datasheet name listings for all usable channels (to allow them
          to be bound by name from consumer drivers)
      * acpi-als - add some function prefixes as per general iio style.
      * bmc150_magn - replace a magic value with the existing define.
      * vf610 - determine possible sample frequencies taking into account the
        electrical characteristics (defining a minimum sample time)
      * dht11
        - whitespace
        - additional docs
        - avoid mulitple assignments in one line
        - Use the new funciton ktime_get_resolution_ns to cleanup a nasty trick
          previously used for timing.
      * Fix all drivers that consider 0 a valid IRQ for historical reasons.
      * Export I2C module alias info where previously missing (to allow autoprobing)
      * Export OF module alias info where previously missing.
      * mmc35240 - switch some variables into arrays to improve readability.
      * mlx90614 - define some magic numbers for readability.
      * bmc150_magn
        - expand area locked by a mutex to cover all the use of the
          data->buffer.
        - use descriptive naming for a mask instead of a magic value.
      * berin2-adc
        - pass up an error code rather that a generic error
        - constify the iio_chan_spec
        - some other little tidy ups.
      * stk8312
        - fix a dependency on triggered buffers in kconfig
        - add a check for invalid attribute values
        - improve error handling by returning error codes where possible and
          return immediately where relevant
        - rework macro defs to use GENMASK etc
        - change some variable types to reduce unnecessary casting
        - clean up code style
        - drop a local buffer copy for bulk reads and use the one in data->buffer
           instead.
      * adis16400 - the adis16448 gyroscope scale was wrong.
      * adis16480 - some more wrong scales for various parts.
      * adis16300 - has an undocumented product id and serial number registers so
        use them.
      * iio_simple_dummy - fix some wrong code indentation.
      * bmc150-accel - use the chip ID to detect the chip present rather than
        verifying the expected part was there.  This was in response to a wrong
        ACPI entry on the WinBook TW100.
      * mma8452
        - fix _get_hp_filter_index
        - drop a double include
        - pass up an error code rather than rewriting it
        - range check input values to attribute writes
        - register defs tidy up using GENMASK and reordering them to be easier to
          follow.
        - various coding style cleanups
        - put the Kconfig entry in the write place (alphabetically).
      
      Tools related
      * Tools cleanup - drop an explicity NULL comparison, some unnecessary braces,
        use the ARRAY_SIZE macro, send error messages to stderr instead of dropping
        them in the middle of normal output.
      * Fix tools to allow that scale and offset attributes are optional.
      * More tools fixes including allowing true 32bit data (previously an overflow
        prevented more than 31bits)
      * Drop a stray header guard that ended up in a c file.
      * Make calc_digits static as it isn't exported or in the header.
      * Set ci_array pointer to NULL after free as a protection against non safe
        usage of the tools core code.  Also convert a double pointer to a single
        one as the extra level of indirection was unnecessary.
      
      Docs
      * DocBook introduction by Daniel Baluta.  Glad we are beginning to
        draw together some more introductory docs to suplement the various
        tools / examples.
      * Drop bytes_per_datum sysfs attribute docs as it no longer exists.
      * A whole load of missing / fixing of kernel-doc for the core of IIO.
      * Document the trigger name sysfs attribute in the ABI docs.
      * Minor typos in the ABI docs related to power down modes.
      1c46ae0a
    • Cristina Opriceana's avatar
      iio: event: Remove negative error code from iio_event_poll · 41d903c0
      Cristina Opriceana authored
      Negative return values are not supported by iio_event_poll since
      its return type is unsigned int.
      
      Fixes: f18e7a06 ("iio: Return -ENODEV for file operations if the device has been unregistered")
      Signed-off-by: default avatarCristina Opriceana <cristina.opriceana@gmail.com>
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      41d903c0
    • Cristina Opriceana's avatar
      iio: industrialio-buffer: Fix iio_buffer_poll return value · 1bdc0293
      Cristina Opriceana authored
      Change return value to 0 if no device is bound since
      unsigned int cannot support negative error codes.
      
      Fixes: f18e7a06 ("iio: Return -ENODEV for file operations if the
      device has been unregistered")
      Signed-off-by: default avatarCristina Opriceana <cristina.opriceana@gmail.com>
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      1bdc0293
    • Linus Walleij's avatar
      iio: lsiio: fix error code handling error · af255cd5
      Linus Walleij authored
      commit acf50b35
      "tools:iio:lsiio: add error handling"
      introduced error handling of errors returned from
      read_sysfs_string(), but with a simple if (retval),
      missing the fact that these functions return a positive
      value if the read was successful.
      
      As a result lsiio regresses and does not show any
      devices on my filesystem. Fix this by checking for
      only negative error codes.
      
      Cc: Hartmut Knaack <knaack.h@gmx.de>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Acked-by: default avatarHartmut Knaack <knaack.h@gmx.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      af255cd5
    • Markus Pargmann's avatar
      iio: bmg160: IIO_BUFFER and IIO_TRIGGERED_BUFFER are required · 06d2f6ca
      Markus Pargmann authored
      This patch adds selects for IIO_BUFFER and IIO_TRIGGERED_BUFFER. Without
      IIO_BUFFER, the driver does not compile.
      Signed-off-by: default avatarMarkus Pargmann <mpa@pengutronix.de>
      Reviewed-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      06d2f6ca