13 Jan, 2019

1 commit

  • The magnetometer's power supplies could be controllable on some platforms,
    such as i.MX6Q-SABRESD board, the mag3110's power supplies are controlled
    by a GPIO fixed regulator, need to make sure the regulators are enabled
    before any communication with mag3110, this patch adds vdd/vddio regulator
    operation support.

    Signed-off-by: Anson Huang
    Signed-off-by: Jonathan Cameron

    Anson Huang
     

13 Dec, 2018

1 commit

  • …/iio into staging-next

    Jonathan writes:

    Second set of IIO new device support, features and cleanups for the 4.21 cycle.

    Staging graduation
    * ad2s90
    - Driver for this resolver to digital chip.

    New drivers and device support.
    * ad5686
    - Add support for ad5310r DAC and associated fix in value read back.
    * exynos-adc
    - Support for S5PV210 which is slightly different from other parts.
    * mcp41010
    - Driver supporting MCP41010, MCP41050, MCP41100, MCP42010, MCP42050 and
    MCP42100 microchip potentiometers.

    New ACPI ids.
    * ak8975
    - AKM9911 ACPI HID.
    * kxcjk-1013
    - KXJ2109 ACPI HID.
    - KIOX010A ACPI HID.

    New features
    * ad5933
    - Explicit DT binding.
    * ad2s90
    - Explicit DT binding including dropping spi setup that is done via dt
    in favour of verifying the settings form DT.
    * adt7316
    - Explicit DT binding and support for gpio, irq_flags etc.
    * stm32-adc
    - Runtime power management.

    Minor fixes and cleanups
    * core
    - Protect against missing info structure.
    * ad2s90
    - SPDX
    - Add documentation fo the mutex.
    * ad7280a
    - Check allocation failure.
    - Fix an accidental replacement of an error return.
    * adt7316
    - Switch some variables to be local and rename for consistency with other
    drivers.
    - Revert a false handling of 0 as an error introduced earlier this cycle.
    * bmi160
    - Use devm functions throughout probe() to avoid need for remove().
    * hid-sensor-hub
    - White space cleanup.
    * hts221
    - MAINTAINERS entry.
    * lis302
    - Use generic name in the DT binding doc.
    * Messon-saradc
    - Check for allocation error.
    - Fix some presented clock names that break clk debugfs.
    * qcom-spmi-adc
    - A fix for initialization of the prescale property. Came late in the
    cycle, so merge window is probably the best route for this.
    * st_lsm6dsx
    - Allow for variable read length to support wider range of slave devices.

    * tag 'iio-for-4.21b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (37 commits)
    iio: adc: qcom-spmi-adc5: Initialize prescale properly
    dt-bindings: iio: adc: exynos-adc: Add S5PV210 variant
    iio: adc: Allow selection of Exynos ADC on S5PV210
    iio: adc: exynos-adc: Add S5PV210 variant
    iio: bmi160: use all devm functions in probe
    iio: dac: ad5686: fix bit shift read register
    iio:dac:ad5686: Add AD5310R support
    Revert "Staging: iio: adt7316: Add an extra check for 'ret' equals to 0"
    dt-bindings: iio: accel: use a generic node name for lis302
    iio: core: check 'info' value before registering the device
    staging: iio: adc: ad7280a: fix overwrite of the returned value
    staging: iio: adc: ad7280a: check for devm_kasprint() failure
    iio: humidity: hts221: add entry in MAINTAINERS file
    iio: magnetometer: ak8975: Add the "AKM9911" ACPI HID
    staging:iio:ad2s90: Move out of staging
    staging:iio:ad2s90: Add comment to device state mutex
    staging:iio:ad2s90: Replace license text w/ SPDX identifier
    dt-bindings:iio:resolver: Add docs for ad2s90
    staging:iio:ad2s90: Add max frequency check at probe
    staging:iio:ad2s90: Remove spi setup that should be done via dt
    ...

    Greg Kroah-Hartman
     

03 Dec, 2018

1 commit


02 Dec, 2018

1 commit


17 Nov, 2018

1 commit

  • PNI RM3100 is a high resolution, large signal immunity magnetometer,
    composed of 3 single sensors and a processing chip with a MagI2C
    interface.

    Following functions are available:
    - Single-shot measurement from
    /sys/bus/iio/devices/iio:deviceX/in_magn_{axis}_raw
    - Triggerd buffer measurement.
    - DRDY pin for data ready trigger.
    - Both i2c and spi interface are supported.
    - Both interrupt and polling measurement is supported, depends on if
    the 'interrupts' in DT is declared.

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

    Song Qiang
     

16 Nov, 2018

1 commit

  • Before this commit sensor_hub_input_attr_get_raw_value() failed to take
    the signedness of 16 and 8 bit values into account, returning e.g.
    65436 instead of -100 for the z-axis reading of an accelerometer.

    This commit adds a new is_signed parameter to the function and makes all
    callers pass the appropriate value for this.

    While at it, this commit also fixes up some neighboring lines where
    statements were needlessly split over 2 lines to improve readability.

    Signed-off-by: Hans de Goede
    Acked-by: Srinivas Pandruvada
    Acked-by: Benjamin Tissoires
    Cc:
    Signed-off-by: Jonathan Cameron

    Hans de Goede
     

11 Nov, 2018

3 commits


03 Nov, 2018

1 commit

  • Currently, we enable the device before we enable the device trigger. At
    high frequencies, this can cause interrupts that don't yet have a poll
    function associated with them and are thus treated as spurious. At high
    frequencies with level interrupts, this can even cause an interrupt storm
    of repeated spurious interrupts (~100,000 on my Beagleboard with the
    LSM9DS1 magnetometer). If these repeat too much, the interrupt will get
    disabled and the device will stop functioning.

    To prevent these problems, enable the device prior to enabling the device
    trigger, and disable the divec prior to disabling the trigger. This means
    there's no window of time during which the device creates interrupts but we
    have no trigger to answer them.

    Fixes: 90efe055629 ("iio: st_sensors: harden interrupt handling")
    Signed-off-by: Martin Kelly
    Tested-by: Denis Ciocca
    Cc:
    Signed-off-by: Jonathan Cameron

    Martin Kelly
     

21 Oct, 2018

1 commit


22 Sep, 2018

1 commit


12 May, 2018

1 commit

  • Adds the ability to run the Mag3110 in continuous mode to speed up the
    sampling rate.
    Depending on the sampling rate requested the device can be put in or out
    of continuous mode automatically.
    Shifting out of continuous mode requires a potential 1 / ODR wait which
    is also implemented.
    Modified the sleep method when data is not ready to allow for
    sampling > 50sps to work.

    Signed-off-by: Richard Tresidder
    Signed-off-by: Jonathan Cameron

    Richard Tresidder
     

03 Mar, 2018

1 commit

  • The function magn_3d_read_raw has a switch statement handling multiple
    cases per channel. The first case statement uses the magic number 0,
    which means IIO_CHAN_INFO_RAW. Additionally, the iio_chan_spec for
    magn_3d_channels is configured to be IIO_CHAN_INFO_RAW. Therefore, this
    patch replaces the magic number 0 for the appropriate IIO_CHAN_INFO_RAW.

    Signed-off-by: Rodrigo Siqueira
    Signed-off-by: Jonathan Cameron

    Rodrigo Siqueira
     

02 Dec, 2017

1 commit


14 Nov, 2017

1 commit

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

    Lots and lots of little changes, almost all minor code cleanups as the
    Outreachy application process happened during this development cycle.
    Also happened was a lot of IIO driver activity, and the typec USB code
    moving out of staging to drivers/usb (same commits are in the USB tree
    on a persistent branch to not cause merge issues.)

    Overall, it's a wash, I think we added a few hundred more lines than
    removed, but really only a few thousand were modified at all.

    All of these have been in linux-next for a while. There might be a
    merge issue with Al's vfs tree in the pi433 driver (take his changes,
    they are always better), and the media tree with some of the odd
    atomisp cleanups (take the media tree's version)"

    * tag 'staging-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (507 commits)
    staging: lustre: add SPDX identifiers to all lustre files
    staging: greybus: Remove redundant license text
    staging: greybus: add SPDX identifiers to all greybus driver files
    staging: ccree: simplify ioread/iowrite
    staging: ccree: simplify registers access
    staging: ccree: simplify error handling logic
    staging: ccree: remove dead code
    staging: ccree: handle limiting of DMA masks
    staging: ccree: copy IV to DMAable memory
    staging: fbtft: remove redundant initialization of buf
    staging: sm750fb: Fix parameter mistake in poke32
    staging: wilc1000: Fix bssid buffer offset in Txq
    staging: fbtft: fb_ssd1331: fix mirrored display
    staging: android: Fix checkpatch.pl error
    staging: greybus: loopback: convert loopback to use generic async operations
    staging: greybus: operation: add private data with get/set accessors
    staging: greybus: loopback: Fix iteration count on async path
    staging: greybus: loopback: Hold per-connection mutex across operations
    staging: greybus/loopback: use ktime_get() for time intervals
    staging: fsl-dpaa2/eth: Extra headroom in RX buffers
    ...

    Linus Torvalds
     

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
     

11 Oct, 2017

1 commit


10 Oct, 2017

2 commits

  • Separate data-ready configuration parameters for INT1 and INT2 pins in
    st_sensor_data_ready_irq data structure. That change will be use to
    properly support LIS2DW12 accel sensor.

    Signed-off-by: Lorenzo Bianconi
    Reviewed-by: Linus Walleij
    Signed-off-by: Jonathan Cameron

    Lorenzo Bianconi
     
  • Introduce register mask for data-ready status register since
    pressure sensors (e.g. LPS22HB) export just two channels
    (BIT(0) and BIT(1)) and BIT(2) is marked reserved while in
    st_sensors_new_samples_available() value read from status register
    is masked using 0x7.
    Moreover do not mask status register using active_scan_mask since
    now status value is properly masked and if the result is not zero the
    interrupt has to be consumed by the driver. This fix an issue on LPS25H
    and LPS331AP where channel definition is swapped respect to status
    register.
    Furthermore that change allows to properly support new devices
    (e.g LIS2DW12) that report just ZYXDA (data-ready) field in status register
    to figure out if the interrupt has been generated by the device.

    Fixes: 97865fe41322 (iio: st_sensors: verify interrupt event to status)
    Signed-off-by: Lorenzo Bianconi
    Reviewed-by: Linus Walleij
    Signed-off-by: Jonathan Cameron

    Lorenzo Bianconi
     

09 Oct, 2017

1 commit


25 Sep, 2017

2 commits

  • …/iio into staging-next

    Jonathan writes:

    Round one of new device support, features and cleanup for IIO in the 4.15 cycle.

    Note there is a misc driver drop in here given we have support
    in IIO and the feeling is no one will care.

    A large part of this series is a boiler plate removal series avoiding
    the need to explicitly provide THIS_MODULE in various locations.
    It's very dull but touches all drivers.

    New device support
    * ad5446
    - add ids to support compatible parts DAC081S101, DAC101S101,
    DAC121S101.
    - add the dac7512 id and drop the misc driver as feeling is no
    one is using it (was introduced for a board that is long obsolete)
    * mt6577
    - add bindings for mt2712 which is fully compatible with other
    supported parts.
    * st_pressure
    - add support for LPS33HW and LPS35HW with bindings (ids mostly).

    New features
    * ccs811
    - Add support for the data ready trigger.
    * mma8452
    - remove artifical restriction on supporting multiple event types
    at the same time.
    * tcs3472
    - support out of threshold events

    Core and tree wide cleanup
    * Use macro magic to remove the need to provide THIS_MODULE as part of
    struct iio_info or struct iio_trigger_ops. This is similar to
    work done in a number of other subsystems (e.g. i2c, spi).

    All drivers are fixed and then the fields in these structures are
    removed.

    This will cause build failures for out of tree drivers and any
    new drivers that cross with this work going into the kernel.

    Note mostly done with a coccinelle patch, included in the series
    on the mailing list but not merged as the fields no longer exist
    in the structures so the any hold outs will cause a build failure.

    Cleanups
    * ads1015
    - avoid writing config register when it doesn't change.
    - add 10% to conversion wait time as it seems it is sometimes
    a little small.
    * ade7753
    - replace use of core mlock with a local lock. This is part of a
    long term effort to make the use of mlock opaque and single
    purpose.
    * ade7759
    - expand the use of buf_lock to cover previous mlock cases. This
    is a slightly nicer solution to the same issue as in ade7753.
    * cros_ec
    - drop an unused variable
    * inv_mpu6050
    - add a missing break in a switch for consistency - not actual
    bug,
    - make some local arrays static to save on object code size.
    * max5481
    - drop manual setting of the spi module owner as handled by the
    spi core.
    * max5487
    - drop manual setting of the spi module owner as handled by the
    spi core.
    * max9611
    - drop explicit setting of the i2c module owner as handled by
    the i2c core.
    * mcp320x
    - speed up reads on single channel devices,
    - drop unused of_device_id data elements,
    - document the struct mcp320x,
    - improve binding docs to reflect restrictions on spi setup and
    to make it explicit that the reference regulator is needed.
    * mma8452
    - symbolic to octal permissions,
    - unsigned to unsigned int.
    * st_lsm6dsx
    - avoid setting odr values multiple times,
    - drop config of LIR as it is only ever set to the existing
    defaults,
    - drop rounding configuration as it only ever matches the defaults.
    * ti-ads8688
    - drop manual setting of the spi module owner as handled by the
    spi core.
    * tsl2x7x
    - constify the i2c_device_id,
    - cleanup limit checks to avoid static checker warnings (and generally
    have nicer code).

    Greg Kroah-Hartman
     
  • …/jic23/iio into staging-linus

    Jonathan writes:

    First round of IIO fixes for the 4.14 cycle

    Note this includes fixes from recent merge window. As such the tree
    is based on top of a prior staging/staging-next tree.

    * iio core
    - return and error for a failed read_reg debugfs call rather than
    eating the error.
    * ad7192
    - Use the dedicated reset function in the ad_sigma_delta library
    instead of an spi transfer with the data on the stack which
    could cause problems with DMA.
    * ad7793
    - Implement a dedicate reset function in the ad_sigma_delta library
    and use it to correctly reset this part.
    * bme280
    - ctrl_reg write must occur after any register writes
    for updates to take effect.
    * mcp320x
    - negative voltage readout was broken.
    - Fix an oops on module unload due to spi_set_drvdata not being called
    in probe.
    * st_magn
    - Fix the data ready line configuration for the lis3mdl. It is not
    configurable so the st_magn core was assuming it didn't exist
    and so wasn't consuming interrupts resulting in an unhandled
    interrupt.
    * stm32-adc
    - off by one error on max channels checking.
    * stm32-timer
    - preset should not be buffered - reorganising register writes avoids
    this.
    - fix a corner case in which write preset goes wrong when a timer is
    used first as a trigger then as a counter with preset. Odd case but
    you never know.
    * ti-ads1015
    - Fix setting of comparator polarity by fixing bitfield definition.
    * twl4030
    - Error path handling fix to cleanup in event of regulator
    registration failure.
    - Disable the vusb3v1 regulator correctly in error handling
    - Don't paper over a regulator enable failure.

    Greg Kroah-Hartman
     

04 Sep, 2017

1 commit

  • Data-ready line in LIS3MDL is routed to drdy pin and it is not possible
    to select a different INT pin. st_sensors_set_dataready_irq() assumes
    that if drdy int address is not exported in register map, irq trigger
    is not supported by the sensor and hw_irq_trigger is always false.
    Based on this configuration st_sensors_irq_thread does not consume
    generated interrupt causing an unhandled irq.
    Fix this taking into account status register address in
    st_sensors_set_dataready_irq()

    Fixes: 90efe0556292 (iio: st_sensors: harden interrupt handling)
    Signed-off-by: Lorenzo Bianconi
    Cc:
    Signed-off-by: Jonathan Cameron

    Lorenzo Bianconi
     

28 Aug, 2017

1 commit


23 Aug, 2017

1 commit


20 Aug, 2017

6 commits


17 Aug, 2017

1 commit


02 Jul, 2017

2 commits


01 Jul, 2017

2 commits

  • Move st_sensors_of_i2c_probe() in st_sensors_core and rename it in
    st_sensors_of_name_probe(). That change is necessary to add device-tree
    support in spi code otherwise the rest of the autodetection will fail
    since spi->modalias (and indio_dev->name) will be set using compatible
    string value that differs from standard sensor name

    Signed-off-by: Lorenzo Bianconi
    Signed-off-by: Jonathan Cameron

    Lorenzo Bianconi
     
  • Enable multiread by default for LIS3MDL since using I2C interface
    the subaddr Msb is used to automatically increase the slave address
    during multiple data read/write. In the same way, using SPI interface,
    bit 1 in register address is used to enable auto-increment of the slave
    address in multiple read/write.

    Fixes: 872e79add756 (iio:magn: Add STMicroelectronics magn driver)
    Signed-off-by: Lorenzo Bianconi
    Signed-off-by: Jonathan Cameron

    Lorenzo Bianconi
     

11 Jun, 2017

1 commit


27 Mar, 2017

1 commit


19 Mar, 2017

1 commit

  • The driver doesn't have a struct of_device_id table but supported devices
    are registered via Device Trees. This is working on the assumption that a
    I2C device registered via OF will always match a legacy I2C device ID and
    that the MODALIAS reported will always be of the form i2c:.

    But this could change in the future so the correct approach is to have an
    OF device ID table if the devices are registered via OF.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Jonathan Cameron

    Javier Martinez Canillas