22 Aug, 2020

1 commit


25 Mar, 2020

1 commit


11 Nov, 2019

1 commit

  • iio tools fail to build correctly with make parallelization:

    $ make -s -j24
    fixdep: error opening depfile: ./.iio_utils.o.d: No such file or directory
    make[1]: *** [/home/labbott/linux_upstream/tools/build/Makefile.build:96: iio_utils.o] Error 2
    make: *** [Makefile:43: iio_event_monitor-in.o] Error 2
    make: *** Waiting for unfinished jobs....

    This is because iio_utils.o is used across multiple targets.
    Fix this by making iio_utils.o a proper dependency.

    Signed-off-by: Laura Abbott
    Signed-off-by: Jonathan Cameron

    Laura Abbott
     

19 Aug, 2019

1 commit


01 Jul, 2019

1 commit

  • …iio into staging-next

    Jonathan writes:

    Second set of IIO device support, features, cleanups and minor fixes for 5.3.

    A few bits for the counters subsystem mixed in here as well.
    There are some late breaking fixes as well, which aren't so urgent
    they can't wait for the merge window.

    New Device Support
    * adf4371
    - New driver + bindings.
    - Support the adf4372 PLL. Mostly ID and bindings.
    * ad8366 (note includes rework of driver needed to allow support for these).
    - Support the ADL5240 variable gain amplifier (VGA).
    - Support the ADA4961 digital gain amplifier (DGA).
    * dps310
    - New driver, in several parts from different authors for this temp
    and pressure sensor.
    - Includes errata workaround for a temperature reading issue.
    * stk3310
    - Support the stk3335, mostly ID.

    Features and cleanups
    * core
    - drop error handling on debugfs registration.
    - harden by making sure we don't overrun iio_chan_info_postfix.
    * docs
    - convert remaining docs to rst. At somepoint we'll fit these few
    into the main IIO docs.
    - improve sampling_frequency_available docs but explaining the
    range form.
    * ad_sigma_delta
    - Drop a pointless goto.
    * ad2s1210
    - Drop pointless platform data null check seeing as we don't actually
    use platform data anymore.
    * ad7124
    - Relax limitation on channel numbers to allow pseudo different channels.
    - Support control of whether the input is buffered via DT.
    - Use dynamic allocation for channel configuration to make it easier
    to support new devices.
    - YAML binding conversion.
    * ad7150
    - Comment tidy up.
    - Consistent and simple if (ret) handling of i2c errors.
    - FIELD_GET and GENMASK.
    - Ternary rather than !!(condition) for readability.
    - Use macros to avoid repetition of channel definitions.
    * ad7606
    - Add software channel config (rather that pin controlled)
    - Refactor to simplify addition of new part in future.
    * ad7746
    - of_deivce_id table.
    * ad7780
    - MAINTAINERS entry
    - YAML DT bindings.
    * ad8366
    - Stop using core mlock in favour of well scoped local lock.
    - SPDX + copyright date update.
    * ad9834
    - of_device_id table
    * adf4371
    - Add support for output stage muting before lock on has occured.
    * adis library
    - MAINTAINERS entry to reflect that this now Alexandru's problem ;)
    * adis162xx:
    - Fix a slightly incorrect set of comments and print statements on
    minimum supported voltage.
    * adis16203
    - of_device_id table.
    * adis16240
    - Add of_device_id table (in two parts as first patch only used it for
    MODULE_DEVICE_TABLE.)
    * adt7316-spi
    - of_device_id table
    * adxl372
    - YAML DT binding conversion.
    - Cleanup use of buffer callback functions (precursor to core rework).
    * bh1710
    - Simplify getting the i2c adapter from the client.
    * dht11
    - Mote to newer GPIO consumer interface.
    * kxcjk-1013.c
    - Add binding for sensor in display of some ultrabooks after userspace
    tools updated for it not be a problem to report two similar sensors.
    * imx7d
    - drop unused variables.
    - white space
    - define instead of variable for clock frequency that is fixed.
    - drop pointless error message.
    * messon_saradc
    - SPDX
    * sps30
    - MAINTAINERS entry
    - YAML binding conversion.
    * st_accel
    - Tidy up ordering in various buffer related callbacks. This is
    part of a long running effort to simplify the core code.
    * stm32-dfsdm:
    - Manage the resolution cleanly in triggerd modes.
    - Add fast mode support which allows more flexible filter choices.
    - Add a comment on the reason for a 16 bit record when technically
    not 'required'.
    * st_lsm6dsx
    - Embed device name in the sensor_settings struct as i3c doesn't
    have a convenient name field to use for this.
    * xilinx-adc
    - Relax constraints on supported platforms to reflect that this
    can used with FPGAs on PCIe cards and hence many architectures.
    * counters/ftm-quaddec
    - Fix some formatting io MODULE_AUTHOR
    - MAINTAINERS entry

    Fixes
    * tools
    - fix incorrect handling of 32 bit channels.
    * sca3000
    - Potential endian bug that is unlikely to bite anyone (be64 host
    seems unlikely for this old part).
    * stm32-adc
    - Add vdda-supply. On some boards it needs to be turned on to supply
    the ADC. DT bindings included.
    * stm32-dfsdm
    - Fix output resolution to work with filter orders other than 3.
    - Fix output datatype as it's signed and previously claimed not to be.

    * tag 'iio-for-5.3b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (68 commits)
    iio: iio-utils: Fix possible incorrect mask calculation
    iio: frequency: adf4371: Add support for output stage mute
    dt-bindings: iio: frequency: Add ADF4372 PLL documentation
    iio: frequency: adf4371: Add support for ADF4372 PLL
    dt-bindings: iio: adc: Add buffered input property
    Convert AD7124 bindings documentation to YAML format.
    iio: adc: ad7124: Shift to dynamic allocation for channel configuration
    iio: adc: ad7124: Add buffered input support
    iio: adc: ad7124: Remove input number limitation
    MAINTAINERS: add ADIS IMU driver library entry
    iio: adis162xx: fix low-power docs & reports
    counter/ftm-quaddec: Add missing '>' in MODULE_AUTHOR
    iio: core: no need to check return value of debugfs_create functions
    docs: iio: convert to ReST
    iio: adc: stm32-adc: add missing vdda-supply
    dt-bindings: iio: adc: stm32: add missing vdda supply
    iio: adc: stm32-dfsdm: add comment for 16 bits record
    iio: adc: stm32-dfsdm: add fast mode support
    iio: adc: stm32-dfsdm: manage data resolution in trigger mode
    iio: adc: stm32-dfsdm: fix data type
    ...

    Greg Kroah-Hartman
     

28 Jun, 2019

1 commit

  • On some machines, iio-sensor-proxy was returning all 0's for IIO sensor
    values. It turns out that the bits_used for this sensor is 32, which makes
    the mask calculation:

    *mask = (1 << 32) - 1;

    If the compiler interprets the 1 literals as 32-bit ints, it generates
    undefined behavior depending on compiler version and optimization level.
    On my system, it optimizes out the shift, so the mask value becomes

    *mask = (1) - 1;

    With a mask value of 0, iio-sensor-proxy will always return 0 for every axis.

    Avoid incorrect 0 values caused by compiler optimization.

    See original fix by Brett Dutro in
    iio-sensor-proxy:
    https://github.com/hadess/iio-sensor-proxy/commit/9615ceac7c134d838660e209726cd86aa2064fd3

    Signed-off-by: Bastien Nocera
    Signed-off-by: Jonathan Cameron

    Bastien Nocera
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

11 Feb, 2019

1 commit


13 Jan, 2019

1 commit

  • Currently, num_loops is unsigned, but it's set by strtoll, which returns a
    (signed) long long int. This could lead to overflow, and it also makes the
    check "num_loops < 0" always be false, since num_loops is unsigned.
    Setting num_loops to -1 to loop forever is almost working because num_loops
    is getting set to a very high number, but it's technically still incorrect.

    Fix this issue by making num_loops signed. This also fixes an error found
    by Smatch.

    Signed-off-by: Martin Kelly
    Reported-by: Dan Carpenter
    Fixes: 55dda0abcf9d ("tools: iio: iio_generic_buffer: allow continuous looping")
    Cc:
    Signed-off-by: Jonathan Cameron

    Martin Kelly
     

16 Dec, 2018

2 commits

  • Add ethanol and H2 gas modifiers:
    * IIO_MOD_ETHANOL
    * IIO_MOD_H2

    Signed-off-by: Andreas Brauchli
    Acked-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron

    Andreas Brauchli
     
  • Measuring particulate matter in ug / m3 (micro-grams per cubic meter)
    is de facto standard. Existing air quality sensors usually follow
    this convention and are capable of returning measurements using
    this unit.

    IIO currently does not offer suitable channel type for this
    type of measurements hence this patch adds this.

    In addition, extra modifiers are introduced used for distinguishing
    between fine pm1, pm2p5 and coarse pm4, pm10 particle measurements, i.e
    IIO_MOD_PM1, IIO_MOD_PM25 and IIO_MOD_PM4, IIO_MOD_PM10.

    pmX consists of particles with aerodynamic diameter less or equal to
    X micrometers.

    Signed-off-by: Tomasz Duszynski
    Acked-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron

    Tomasz Duszynski
     

21 Oct, 2018

1 commit


24 Jul, 2018

1 commit


21 Jul, 2018

1 commit

  • Add new channel type support for phase.

    This channel may be used by Time-of-flight sensors to express the
    phase difference between emitted and received signals. Those sensor
    will then use the phase shift of return signals to approximate the
    distance to objects.

    Signed-off-by: Mathieu Othacehe
    Signed-off-by: Jonathan Cameron

    Mathieu Othacehe
     

10 Jun, 2018

1 commit

  • Add new channel type for relative position on a pad.

    These type of analog sensor offers the position of a pen
    on a touchpad, and is represented as a voltage, which can be
    converted to a position on X and Y axis on the pad.
    The channel will hand the relative position on the pad in both directions.

    The channel can then be consumed by a touchscreen driver or
    read as-is for a raw indication of the touchpen on a touchpad.

    Signed-off-by: Eugen Hristev
    Signed-off-by: Jonathan Cameron

    Eugen Hristev
     

20 May, 2018

2 commits

  • Sometimes it's useful to stream samples forever, such as when
    stress-testing a driver overnight to check for memory leaks or other
    issues. When the program receives a signal, it will gracefully cleanup,
    so it is still safe to terminate at any time.

    Add support for specifying a negative -c option, meaning that we should
    loop forever. To do so, we need to use a long long (instead of just
    long) for num_loops so that current code specifying num_loops greater
    than UNSIGNED_LONG_MAX doesn't break.

    Signed-off-by: Martin Kelly
    Signed-off-by: Jonathan Cameron

    Martin Kelly
     
  • Several types are mismatched and causing implicit conversions. Fix them
    up so the types match.

    Signed-off-by: Martin Kelly
    Signed-off-by: Jonathan Cameron

    Martin Kelly
     

22 Feb, 2018

1 commit

  • Currently a number of Makefiles break when used with toolchains that
    pass extra flags in CC and other cross-compile related variables (such
    as --sysroot).

    Thus we get this error when we use a toolchain that puts --sysroot in
    the CC var:

    ~/src/linux/tools$ make iio
    [snip]
    iio_event_monitor.c:18:10: fatal error: unistd.h: No such file or directory
    #include
    ^~~~~~~~~~

    This occurs because we clobber several env vars related to
    cross-compiling with lines like this:

    CC = $(CROSS_COMPILE)gcc

    Although this will point to a valid cross-compiler, we lose any extra
    flags that might exist in the CC variable, which can break toolchains
    that rely on them (for example, those that use --sysroot).

    This easily shows up using a Yocto SDK:

    $ . [snip]/sdk/environment-setup-cortexa8hf-neon-poky-linux-gnueabi

    $ echo $CC
    arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard
    -mcpu=cortex-a8
    --sysroot=[snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi

    $ echo $CROSS_COMPILE
    arm-poky-linux-gnueabi-

    $ echo ${CROSS_COMPILE}gcc
    krm-poky-linux-gnueabi-gcc

    Although arm-poky-linux-gnueabi-gcc is a cross-compiler, we've lost the
    --sysroot and other flags that enable us to find the right libraries to
    link against, so we can't find unistd.h and other libraries and headers.
    Normally with the --sysroot flag we would find unistd.h in the sdk
    directory in the sysroot:

    $ find [snip]/sdk/sysroots -path '*/usr/include/unistd.h'
    [snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/include/unistd.h

    The perf Makefile adds CC = $(CROSS_COMPILE)gcc if and only if CC is not
    already set, and it compiles correctly with the above toolchain.

    So, generalize the logic that perf uses in the common Makefile and
    remove the manual CC = $(CROSS_COMPILE)gcc lines from each Makefile.

    Note that this patch does not fix cross-compile for all the tools (some
    have other bugs), but it does fix it for all except usb and acpi, which
    still have other unrelated issues.

    I tested both with and without the patch on native and cross-build and
    there appear to be no regressions.

    Link: http://lkml.kernel.org/r/20180107214028.23771-1-martin@martingkelly.com
    Signed-off-by: Martin Kelly
    Acked-by: Mark Brown
    Cc: Tejun Heo
    Cc: Li Zefan
    Cc: Johannes Weiner
    Cc: Linus Walleij
    Cc: "K. Y. Srinivasan"
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Cc: Jonathan Cameron
    Cc: Pali Rohar
    Cc: Richard Purdie
    Cc: Jacek Anaszewski
    Cc: Pavel Machek
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Arnaldo Carvalho de Melo
    Cc: Robert Moore
    Cc: Lv Zheng
    Cc: "Rafael J. Wysocki"
    Cc: Greg Kroah-Hartman
    Cc: Valentina Manea
    Cc: Shuah Khan
    Cc: Mario Limonciello
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Kelly
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

09 Aug, 2017

2 commits


07 May, 2017

1 commit


27 Apr, 2017

1 commit

  • Use the local uapi headers to keep in sync with "recently" added enum
    values like IIO_UVINDEX.

    Build tested using:
    $ make -C tools/iio
    $ make -C /tools iio
    $ make -C /tools/iio

    This follows a strategy similar to that used by tools/hv, tools/net and
    tools/leds among others.

    Cc: Randy Dunlap
    Cc: Jonathan Cameron
    Signed-off-by: Sekhar Nori
    Signed-off-by: Jonathan Cameron

    Sekhar Nori
     

05 Jan, 2017

1 commit

  • Add new channel types support for gravity sensor.

    Gravity sensor provides an application-level or physical collection that
    identifies a device that measures exclusively the force of Earth's
    gravity along any number of axes.

    More information can be found in:
    http://www.usb.org/developers/hidpage/HUTRR59_-_Usages_for_Wearables.pdf

    Signed-off-by: Song Hongyan
    Signed-off-by: Jonathan Cameron

    Song Hongyan
     

24 Oct, 2016

3 commits


23 Sep, 2016

1 commit

  • When help ('?') option is passed to the command, the help text
    printed but not from '?' switch case of getopt_long() but as a
    invalid argument as below. Fix this by adding '?' to opt_String
    of getopt_long().

    root@am437x-evm:~# ./iio_generic_buffer -?
    ./iio_generic_buffer: invalid option -- '?'
    Usage: generic_buffer [options]...
    Capture, convert and output data from IIO device buffer
    -a Auto-activate all available channels
    ...

    Signed-off-by: Mugunthan V N
    Signed-off-by: Jonathan Cameron

    Mugunthan V N
     

15 Sep, 2016

1 commit

  • …iio into staging-next

    Jonathan writes:

    Second set of iio new device support, features and cleanups for the 4.9 cycle.

    New device support
    * ad8801 dac
    - new driver supporting ad8801 and ad8803 DACs.
    * adc12138
    - new driver supporting TI adc12130/adc12132 and adc12138 ADCs.
    * ltc2485 adc
    - new driver
    * mxc6255
    - add support for the mxc6225 part name and fixup the ID check so it works.
    * vz89x VOC sensor
    - add support for the vz89te part which drops the voc_short channel and adds
    CRCs compared to other supported parts.

    New features
    * core
    - immutable triggers. These effectively grant exclusive control over a
    trigger. The typical usecase is a device representing an analog part
    (perhaps a MUX) that needs to control the sampling of a downstream
    ADC.
    - resource managed trigger registration and triggered_buffer_init.
    - iio_push_event now protected against case of the event interface
    registration not having yet occured. Only matters if an interrupt
    can occur during this window - might happen on shared interrupt lines.
    - helper to let a driver query if the trigger it is using is provided by
    itself (using the convention of both device and trigger having the same
    parent).
    * tools
    - iio-utils. Used channel modifier scaling in preference to generic scaling
    when both exist.
    * at91-adc
    - Add support for touchscreen switches closure time needed by some newer
    parts.
    * stx104
    - support the ADC channels on this ADC/DAC board. As these are the primary
    feature of the board also move the driver to the iio/adc directory.
    * sx9500
    - device tree bindings.

    Cleanups / Fixes
    * ad5755
    - fix an off-by-one on devnr limit check (introduced earlier this cycle)
    * ad7266
    - drop NULL check on devm_regulator_get_optional as it can't return NULL.
    * ak8974
    - avoid an unused functional warning due to rework in PM core code.
    - remove .owner field setting as done by i2c_core.
    * ina2xx
    - clear out a left over debug field from chip global data.
    * hid-sensors
    - avoid an unused functional warning due to rework in PM core code.
    * maxim-thermocouple
    - fix non static symbol warnings.
    * ms5611
    - fetch and enable regulators unconditionally when they aren't optional.
    * sca3000
    - whitespace cleanup.
    * st_sensors
    - fetch and enable regulators unconditionally rather than having them
    supported as optional regulators (missunderstanding on my part amongst
    others a while back)
    - followup to previous patch fixes error checking on the regulators.
    - mark symbols static where possible.
    - use the 'is it my trigger' help function. This prevents the odd case
    of another device triggering from the st-sensors trigger whilst the
    st-sensors trigger is itself not using it but rather using say an hrtimer.
    * ti-ads1015
    - add missing of_node_put.
    * vz89x
    - rework to all support of new devices.
    - prevent reading of a corrupted buffer.
    - fixup a return value of 0/1 in a bool returning function.

    Address updates
    - Vlad Dogaru email address change.

    Greg Kroah-Hartman
     

12 Sep, 2016

1 commit


05 Sep, 2016

1 commit


30 Aug, 2016

1 commit

  • Passing the trigger-less mode option on the command line causes
    iio_generic_buffer to fail searching for an IIO trigger.
    Fix this by skipping trigger initialization if trigger-less mode is
    requested.

    Technically it actually fixes:
    7c7e9dad70 where the bug was introduced but as the window to the patch
    below that changes the context was very small let's mark it with that.

    Signed-off-by: Gregor Boirie
    Fixes: deb4d1fdcb5af ("iio: generic_buffer: Fix --trigger-num option")
    Signed-off-by: Jonathan Cameron

    Gregor Boirie
     

29 Aug, 2016

1 commit

  • Now there are channel modifiers with their own scaling those should be
    used when possible over the generic channel type scaling.

    Examples are of IIO_TEMP channel having a generic scaling value, and
    another having IIO_MOD_TEMP_AMBIENT modifier with another scaling value.

    Previously the first scaling value for a channel type would be applied
    to all channels of like type in iio_generic_buffer

    Signed-off-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron

    Matt Ranostay
     

16 Aug, 2016

2 commits


12 Jun, 2016

1 commit


30 May, 2016

4 commits