12 Jul, 2019

1 commit

  • Pull staging and IIO driver updates from Greg KH:
    "Here is the big Staging and IIO driver update for 5.3-rc1.

    Lots of new IIO drivers are in here, along with loads of tiny staging
    driver cleanups and fixes. Overall we almost break even with the same
    lines added as removed.

    Full details are in the shortlog, they are too large to list here.

    All of these changes have been in linux-next for a while with no
    reported issues"

    * tag 'staging-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (608 commits)
    staging: kpc2000: simplify comparison to NULL in fileops.c
    staging: kpc2000: simplify comparison to NULL in dma.c
    staging: kpc2000: simplify comparison to NULL in kpc2000_spi.c
    staging: rtl8723bs: hal: remove redundant assignment to packetType
    staging: rtl8723bs: Change return type of hal_btcoex_IsBtDisabled()
    staging: rtl8723bs: Remove rtw_btcoex_DisplayBtCoexInfo()
    staging: rtl8723bs: Remove function rtw_btcoex_GetDBG()
    staging: rtl8723bs: Remove function rtw_btcoex_SetDBG()
    staging: rtl8723bs: Remove rtw_btcoex_IsBTCoexCtrlAMPDUSize()
    staging: rtl8723bs: Remove rtw_btcoex_BtInfoNotify()
    staging: rtl8723bs: Remove rtw_btcoex_ScanNotify()
    staging: rtl8723bs: Remove rtw_btcoex_SetSingleAntPath()
    staging: rtl8723bs: Remove rtw_btcoex_SetPGAntNum()
    staging: rtl8192e: remove redundant initialization of rtstatus
    staging: rtl8723bs: Remove rtw_btcoex_GetRaMask()
    staging: rtl8723bs: Remove rtw_btcoex_SetChipType()
    staging: rtl8723bs: Remove rtw_btcoex_ConnectNotify()
    staging: rtl8723bs: Remove rtw_btcoex_SetBTCoexist()
    staging: rtl8723bs: Remove rtw_btcoex_IsBtDisabled()
    staging: rtl8723bs: Remove rtw_btcoex_IsBtControlLps()
    ...

    Linus Torvalds
     

03 Jul, 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
     

22 Jun, 2019

2 commits


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
     

18 Jun, 2019

1 commit

  • The incorrect limit for the for_each_set_bit loop was noticed whilst fixing
    this other case. Note that as we only have 3 possible entries a the moment
    and the value was set to 4, the bug would not have any effect currently.
    It will bite fairly soon though, so best fix it now.

    See commit ef4b4856593f ("iio:core: Fix bug in length of event info_mask and
    catch unhandled bits set in masks.") for details.

    Signed-off-by: Young Xiao
    Reviewed-by: Alexandru Ardelean
    Signed-off-by: Jonathan Cameron

    Young Xiao
     

22 Apr, 2019

1 commit


05 Apr, 2019

1 commit

  • Currently mount matrix is allowed in Device Tree, though there is
    no technical issue to extend it to support ACPI.

    Convert the function to use device_property_read_string_array() and
    thus allow to read mount matrix from ACPI if available.

    Example of use in _DSD method:

    Name (_DSD, Package ()
    {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package ()
    {
    Package () { "mount-matrix", Package() {
    "1", "0", "0",
    "0", "0.866", "0.5",
    "0", "-0.5", "0.866",
    } },
    }
    })

    At the same time drop the "of" prefix from its name and
    convert current users.

    No functional change intended.

    Signed-off-by: Andy Shevchenko
    Reviewed-by: Linus Walleij
    Signed-off-by: Jonathan Cameron

    Andy Shevchenko
     

31 Mar, 2019

1 commit

  • This fixes a possible circular locking dependency detected warning seen
    with:
    - CONFIG_PROVE_LOCKING=y
    - consumer/provider IIO devices (ex: "voltage-divider" consumer of "adc")

    When using the IIO consumer interface, e.g. iio_channel_get(), the consumer
    device will likely call iio_read_channel_raw() or similar that rely on
    'info_exist_lock' mutex.

    typically:
    ...
    mutex_lock(&chan->indio_dev->info_exist_lock);
    if (chan->indio_dev->info == NULL) {
    ret = -ENODEV;
    goto err_unlock;
    }
    ret = do_some_ops()
    err_unlock:
    mutex_unlock(&chan->indio_dev->info_exist_lock);
    return ret;
    ...

    Same mutex is also hold in iio_device_unregister().

    The following deadlock warning happens when:
    - the consumer device has called an API like iio_read_channel_raw()
    at least once.
    - the consumer driver is unregistered, removed (unbind from sysfs)

    ======================================================
    WARNING: possible circular locking dependency detected
    4.19.24 #577 Not tainted
    ------------------------------------------------------
    sh/372 is trying to acquire lock:
    (kn->count#30){++++}, at: kernfs_remove_by_name_ns+0x3c/0x84

    but task is already holding lock:
    (&dev->info_exist_lock){+.+.}, at: iio_device_unregister+0x18/0x60

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #1 (&dev->info_exist_lock){+.+.}:
    __mutex_lock+0x70/0xa3c
    mutex_lock_nested+0x1c/0x24
    iio_read_channel_raw+0x1c/0x60
    iio_read_channel_info+0xa8/0xb0
    dev_attr_show+0x1c/0x48
    sysfs_kf_seq_show+0x84/0xec
    seq_read+0x154/0x528
    __vfs_read+0x2c/0x15c
    vfs_read+0x8c/0x110
    ksys_read+0x4c/0xac
    ret_fast_syscall+0x0/0x28
    0xbedefb60

    -> #0 (kn->count#30){++++}:
    lock_acquire+0xd8/0x268
    __kernfs_remove+0x288/0x374
    kernfs_remove_by_name_ns+0x3c/0x84
    remove_files+0x34/0x78
    sysfs_remove_group+0x40/0x9c
    sysfs_remove_groups+0x24/0x34
    device_remove_attrs+0x38/0x64
    device_del+0x11c/0x360
    cdev_device_del+0x14/0x2c
    iio_device_unregister+0x24/0x60
    release_nodes+0x1bc/0x200
    device_release_driver_internal+0x1a0/0x230
    unbind_store+0x80/0x130
    kernfs_fop_write+0x100/0x1e4
    __vfs_write+0x2c/0x160
    vfs_write+0xa4/0x17c
    ksys_write+0x4c/0xac
    ret_fast_syscall+0x0/0x28
    0xbe906840

    other info that might help us debug this:

    Possible unsafe locking scenario:

    CPU0 CPU1
    ---- ----
    lock(&dev->info_exist_lock);
    lock(kn->count#30);
    lock(&dev->info_exist_lock);
    lock(kn->count#30);

    *** DEADLOCK ***
    ...

    cdev_device_del() can be called without holding the lock. It should be safe
    as info_exist_lock prevents kernelspace consumers to use the exported
    routines during/after provider removal. cdev_device_del() is for userspace.

    Help to reproduce:
    See example: Documentation/devicetree/bindings/iio/afe/voltage-divider.txt
    sysv {
    compatible = "voltage-divider";
    io-channels = ;
    output-ohms = ;
    full-ohms = ;
    };

    First, go to iio:deviceX for the "voltage-divider", do one read:
    $ cd /sys/bus/iio/devices/iio:deviceX
    $ cat in_voltage0_raw

    Then, unbind the consumer driver. It triggers above deadlock warning.
    $ cd /sys/bus/platform/drivers/iio-rescale/
    $ echo sysv > unbind

    Note I don't actually expect stable will pick this up all the
    way back into IIO being in staging, but if's probably valid that
    far back.

    Signed-off-by: Fabrice Gasnier
    Fixes: ac917a81117c ("staging:iio:core set the iio_dev.info pointer to null on unregister")
    Cc:
    Signed-off-by: Jonathan Cameron

    Fabrice Gasnier
     

16 Dec, 2018

1 commit

  • 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
     

08 Dec, 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
     

24 Jun, 2018

1 commit


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
     

06 Dec, 2017

1 commit


02 Dec, 2017

2 commits

  • Fix build errors in kernel-doc notation. Symbols that end in '_'
    have a special meaning, but adding a '*' makes them OK.

    ../drivers/iio/industrialio-core.c:635: ERROR: Unknown target name: "iio_val".
    ../drivers/iio/industrialio-core.c:642: ERROR: Unknown target name: "iio_val".

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

    Randy Dunlap
     
  • In preparation to enabling -Wimplicit-fallthrough, mark switch cases
    where we are expecting to fall through.

    Addresses-Coverity-ID: 1397962
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Jonathan Cameron

    Gustavo A. R. Silva
     

09 Oct, 2017

1 commit


24 Sep, 2017

1 commit

  • If an IIO device returns an error code for a read access via debugfs, it
    is currently ignored by the IIO core (other than emitting an error
    message). Instead, return this error code to user space, so upper layers
    can detect it correctly.

    Signed-off-by: Matt Fornero
    Signed-off-by: Lars-Peter Clausen
    Cc:
    Signed-off-by: Jonathan Cameron

    Matt Fornero
     

23 Aug, 2017

1 commit


11 Jun, 2017

2 commits

  • Devices, like stm32 timer, could be triggered by hardware events which
    are not buffer or software events. However it could be necessary to
    validate the triggers like it is done for buffer or event triggered modes.
    This patch add a new INDIO_HARDWARE_TRIGGERED operating mode for this
    kind of devices and allow this mode to register trigger consumer.

    Signed-off-by: Benjamin Gaignard
    Signed-off-by: Jonathan Cameron

    Benjamin Gaignard
     
  • Use __sysfs_match_string() helper instead of open coded variant.

    Cc: Jonathan Cameron
    Cc: Lars-Peter Clausen
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Jonathan Cameron

    Andy Shevchenko
     

29 May, 2017

1 commit

  • …/iio into staging-next

    Jonathan writes:

    First set of new device support, features and cleanups for IIO in the 4.13 cycle

    Two entirely new drivers in here plus the usual range of cleanups and features.

    New device support
    * ad5064
    - add ltc2631, ltc2633 and ltc2635 support.
    * bma180
    - trivial support for bma250e (new id)
    * hid-sensor-rotation
    - add relative orientation and geometric orientation support.
    * isl29028
    - add isl29030 support (its effectively the same part from a driver point of
    view)
    * maxim_thermocouple
    - add max31856 id.
    * meson-saradc
    - add meson8b SoC adc support.
    * ti-adc084s021
    - new driver and bindings.
    * ti-adc108s102
    - new driver and bindings.

    Staging graduations
    * isl29028

    Features
    * bma180
    - ACPI enumeration for BMA250E which is used in various x86 tablets.
    * hi8453
    - add raw access rather than only events.
    * hid-sensor-hub
    - Implement batch mode in which we can set a threshold on the amount of time
    between data coming from the fifos. This is the first device to do this
    rather than use a watershed on the number of samples.
    * hts221
    - power management support
    * lsm6dsx
    - add system power management support.
    * rpr0521
    - sampling frequency read / write
    * stm32-trigger
    - add support for TRG02 triggers.
    * tsl2583
    - runtime power management support.

    Cleanups
    * core
    - inkern: fix a double unlock in iio_read_available_channel_raw when raw
    value doesn't appear to be raw (error path).
    - fixup accidental sizeof pointer in iio_device_add_mask_type.
    * docs
    - fix an accidental duplicated line in sysfs-bus-iio-meas-spec.
    * tools
    - use local include/uapi headers to ensure always up to date.
    - increase length of allowed trigger names.
    * ad9834
    - symbolic to octal permissions.
    * ade7753
    - symbolic to octal permissions.
    - fix indentation
    * ade7754
    - symbolic to octal permissions.
    * ade7758
    - symbolic to octal permissions.
    - ade7854
    - symbolic to octal permissions.
    * as3935
    - move out of storm check to given consistent results for raw and processed
    values.
    * bmp280
    - fix bme280 naming in Kconfig help.
    * hi8435
    - avoid garbage on event after enable.
    - add missing in_voltage_sensing_mode_available to list possible enum options.
    - handle the reset gpio with the obvious polarity rather than relying on
    DT to provide it correctly.
    * hid-sensors
    - fix a wrong error path scrubbing of return values.
    * hid-sensors-accel
    - drop static on a local variable
    * hid-sensors-rotation
    - Add missing scale and offset property parsing support.
    * ina2xx
    - Fix a bad use of GENMASK and some typos and whitespace issues.
    * isl29018
    - only declare the ACPI table when ACPI is enabled.
    * isl29028
    - fix proximity sleep times.
    * lsm6dsx
    - replace ifdef CONFIG_PM with __maybe_unused to avoid the complexity of
    dealing with the various PM config variables.
    * meson-saradc
    - mark meson_sar_adc_data static and const.
    * rcar-gyroadc
    - derive the interface clock speed from the fck clock on the basis they are
    the same actual clock.
    - drop the now unused if clock from the bindings.
    * rpr0521
    - disable sensor when marked as such rather than always enabling it.
    - poweroff if probe fails and we can talk to device.
    - make sure device powered off when it doesn't need to be on.
    - use sizeof rather than hardcoded size on value read.
    - whitespace fixup.
    - reorder channel numbers ready for buffered support which didn't quite
    make this pull request.
    * st-accel
    - fix platform data initialization to allow remove and reprobe.
    * st-pressure
    - fix platform data initialization to allow remove and reprobe.
    * tsl2x7x
    - S_IRUGO, S_IWUSR to octal values
    - rename driver for consistency with more recent drivers
    - drop FSF mailing address
    - replace DEVICE_ATTR macros with the shorter DEVICE_ATTR_RW form and
    relevant function renames.
    * zpa2326
    - report an error for consistency with other error paths.

    Greg Kroah-Hartman
     

05 May, 2017

1 commit

  • Pull char/misc driver updates from Greg KH:
    "Here is the big set of new char/misc driver drivers and features for
    4.12-rc1.

    There's lots of new drivers added this time around, new firmware
    drivers from Google, more auxdisplay drivers, extcon drivers, fpga
    drivers, and a bunch of other driver updates. Nothing major, except if
    you happen to have the hardware for these drivers, and then you will
    be happy :)

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'char-misc-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (136 commits)
    firmware: google memconsole: Fix return value check in platform_memconsole_init()
    firmware: Google VPD: Fix return value check in vpd_platform_init()
    goldfish_pipe: fix build warning about using too much stack.
    goldfish_pipe: An implementation of more parallel pipe
    fpga fr br: update supported version numbers
    fpga: region: release FPGA region reference in error path
    fpga altera-hps2fpga: disable/unprepare clock on error in alt_fpga_bridge_probe()
    mei: drop the TODO from samples
    firmware: Google VPD sysfs driver
    firmware: Google VPD: import lib_vpd source files
    misc: lkdtm: Add volatile to intentional NULL pointer reference
    eeprom: idt_89hpesx: Add OF device ID table
    misc: ds1682: Add OF device ID table
    misc: tsl2550: Add OF device ID table
    w1: Remove unneeded use of assert() and remove w1_log.h
    w1: Use kernel common min() implementation
    uio_mf624: Align memory regions to page size and set correct offsets
    uio_mf624: Refactor memory info initialization
    uio: Allow handling of non page-aligned memory regions
    hangcheck-timer: Fix typo in comment
    ...

    Linus Torvalds
     

27 Apr, 2017

1 commit


02 Apr, 2017

1 commit

  • Fix formatting of negative values of type IIO_VAL_FRACTIONAL_LOG2 by
    switching from do_div(), which can't handle negative numbers, to
    div_s64_rem(). Also use shift_right for shifting, which is safe with
    negative values.

    Signed-off-by: Nikolaus Schulz
    Reviewed-by: Lars-Peter Clausen
    Cc: stable@vger.kernel.org
    Signed-off-by: Jonathan Cameron

    Nikolaus Schulz
     

21 Mar, 2017

1 commit

  • Replace the open coded registration of the cdev and dev with the
    new device_add_cdev() helper. The helper replaces a common pattern by
    taking the proper reference against the parent device and adding both
    the cdev and the device.

    In doing so we have to remove a guard statement from cdev_del,
    but this doesn't appear to be required in any way.

    Signed-off-by: Logan Gunthorpe
    Signed-off-by: Greg Kroah-Hartman

    Logan Gunthorpe
     

11 Jan, 2017

1 commit

  • buffer.h supplies everything needed for devices using buffers.
    buffer_impl.h supplies access to the internals as needed to write
    a buffer implementation.

    This was really motivated by the mess that turned up in the
    kernel-doc documentation pulled in by the new sphinx docs.
    It made it clear that our logical separations in headers were
    generally terrible. The buffer case was easy to sort out without
    greatly effecting drivers so here it is.

    Signed-off-by: Jonathan Cameron
    Reviewed-by: Lars-Peter Clausen

    Jonathan Cameron
     

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
     

13 Nov, 2016

1 commit

  • A large number of attributes can only take a limited range of values.
    Currently in IIO this is handled by directly registering additional
    *_available attributes thus providing this information to userspace.

    It is desirable to provide this information via the core for much the same
    reason this was done for the actual channel information attributes in the
    first place. If it isn't there, then it can only really be accessed from
    userspace. Other in kernel IIO consumers have no access to what valid
    parameters are.

    Two forms are currently supported:
    * list of values in one particular IIO_VAL_* format.
    e.g. 1.300000 1.500000 1.730000
    * range specification with a step size:
    e.g. [1.000000 0.500000 2.500000]
    equivalent to 1.000000 1.5000000 2.000000 2.500000

    An addition set of masks are used to allow different sharing rules for the
    *_available attributes generated.

    This allows for example:

    in_accel_x_offset
    in_accel_y_offset
    in_accel_offset_available.

    We could have gone with having a specification for each and every
    info_mask element but that would have meant changing the existing userspace
    ABI. This approach does not.

    Signed-off-by: Jonathan Cameron
    [forward ported, added some docs and fixed buffer overflows /peda]
    Acked-by: Daniel Baluta
    Signed-off-by: Peter Rosin
    Signed-off-by: Jonathan Cameron

    Jonathan Cameron
     

02 Oct, 2016

1 commit

  • Quadrature encoders, such as rotary encoders and linear encoders, are
    devices which are capable of encoding the relative position and
    direction of motion of a shaft. This patch introduces several IIO
    constants for supporting quadrature encoder counter devices.

    IIO_COUNT: Current count (main data provided by the counter device)
    IIO_INDEX: Counter device index value

    Signed-off-by: William Breathitt Gray
    Signed-off-by: Jonathan Cameron

    William Breathitt Gray
     

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
     

06 Sep, 2016

1 commit

  • 7985e7c100 ("iio: Introduce a new fractional value type") introduced a
    new IIO_VAL_FRACTIONAL value type meant to represent rational type numbers
    expressed by a numerator and denominator combination.

    Formating of IIO_VAL_FRACTIONAL values relies upon do_div() usage. This
    fails handling negative values properly since parameters are reevaluated
    as unsigned values.
    Fix this by using div_s64_rem() instead. Computed integer part will carry
    properly signed value. Formatted fractional part will always be positive.

    Fixes: 7985e7c100 ("iio: Introduce a new fractional value type")
    Signed-off-by: Gregor Boirie
    Reviewed-by: Lars-Peter Clausen
    Cc:
    Signed-off-by: Jonathan Cameron

    Gregor Boirie
     

04 Sep, 2016

1 commit


01 Jul, 2016

1 commit

  • Adds a new per-device sysfs attribute "current_timestamp_clock" to allow
    userspace to select a particular POSIX clock for buffered samples and
    events timestamping.

    Following clocks, as listed in clock_gettime(2), are supported:
    CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW,
    CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME and
    CLOCK_TAI.

    Signed-off-by: Gregor Boirie
    Acked-by: Sanchayan Maity
    Signed-off-by: Jonathan Cameron

    Gregor Boirie
     

30 May, 2016

1 commit


24 Apr, 2016

1 commit

  • Expose a rotation matrix to indicate userspace the chip placement with
    respect to the overall hardware system. This is needed to adjust
    coordinates sampled from a sensor chip when its position deviates from the
    main hardware system.

    Final coordinates computation is delegated to userspace since:
    * computation may involve floating point arithmetics ;
    * it allows an application to combine adjustments with arbitrary
    transformations.

    This 3 dimentional space rotation matrix is expressed as 3x3 array of
    strings to support floating point numbers. It may be retrieved from a
    "[_][_]mount_matrix" sysfs attribute file. It is declared into a
    device / driver specific DTS property or platform data.

    Signed-off-by: Gregor Boirie
    Signed-off-by: Jonathan Cameron

    Gregor Boirie
     

03 Apr, 2016

1 commit