12 Feb, 2019

5 commits


17 Dec, 2018

1 commit

  • [ Upstream commit 0145b50566e7de5637e80ecba96c7f0e6fff1aad ]

    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
    Signed-off-by: Sasha Levin

    Hans de Goede
     

06 Dec, 2018

1 commit

  • commit fe5192ac81ad0d4dfe1395d11f393f0513c15f7f upstream.

    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
    Signed-off-by: Greg Kroah-Hartman

    Martin Kelly
     

14 Nov, 2018

4 commits

  • commit aea835f2dc8a682942b859179c49ad1841a6c8b9 upstream.

    When channels are registered, the hardware channel number is not the
    actual iio channel number.
    This is because the driver is probed with a certain number of accessible
    channels. Some pins are routed and some not, depending on the description of
    the board in the DT.
    Because of that, channels 0,1,2,3 can correspond to hardware channels
    2,3,4,5 for example.
    In the buffered triggered case, we need to do the translation accordingly.
    Fixed the channel number to stop reading the wrong channel.

    Fixes: 0e589d5fb ("ARM: AT91: IIO: Add AT91 ADC driver.")
    Cc: Maxime Ripard
    Signed-off-by: Eugen Hristev
    Acked-by: Ludovic Desroches
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Eugen Hristev
     
  • commit bc1b45326223e7e890053cf6266357adfa61942d upstream.

    When doing simple conversions, the driver did not acknowledge the DRDY irq.
    If this irq status is not acked, it will be left pending, and as soon as a
    trigger is enabled, the irq handler will be called, it doesn't know why
    this status has occurred because no channel is pending, and then it will go
    int a irq loop and board will hang.
    To avoid this situation, read the LCDR after a raw conversion is done.

    Fixes: 0e589d5fb ("ARM: AT91: IIO: Add AT91 ADC driver.")
    Cc: Maxime Ripard
    Signed-off-by: Eugen Hristev
    Acked-by: Ludovic Desroches
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Eugen Hristev
     
  • commit d3fa21c73c391975488818b085b894c2980ea052 upstream.

    Leaving for_each_child_of_node loop we should release child device node,
    if it is not stored for future use.

    Found by Linux Driver Verification project (linuxtesting.org).

    JC: I'm not sending this as a quick fix as it's been wrong for years,
    but good to pick up for stable after the merge window.

    Signed-off-by: Alexey Khoroshilov
    Fixes: 6df2e98c3ea56 ("iio: adc: Add imx25-gcq ADC driver")
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Alexey Khoroshilov
     
  • commit 8911a43bc198877fad9f4b0246a866b26bb547ab upstream.

    The correct way to handle errors returned by regualtor_get() and friends is
    to propagate the error since that means that an regulator was specified,
    but something went wrong when requesting it.

    For handling optional regulators, e.g. when the device has an internal
    vref, regulator_get_optional() should be used to avoid getting the dummy
    regulator that the regulator core otherwise provides.

    Signed-off-by: Lars-Peter Clausen
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     

10 Oct, 2018

1 commit

  • [ Upstream commit 65099ea85e885c3ea1272eca8774b771419d8ce8 ]

    This reverts commit 535fba29b3e1afef4ba201b3c69a6992583ec0bd.

    Seems the submitter (er me, hang head in shame) didn't look at the datasheet
    enough to see that the registers are quite different.

    This needs to be reverted because a) would never work b) to open it be added
    to a Maxim RTDs (Resistance Temperature Detectors) under development by author

    Signed-off-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Matt Ranostay
     

04 Oct, 2018

3 commits

  • [ Upstream commit 2873c3f0e2bd12a7612e905c920c058855f4072a ]

    The reset flags operation is selected by bit 2 in the "Reset and Load
    Signals Decoders" register, not bit 1.

    Fixes: 28e5d3bb0325 ("iio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8")
    Signed-off-by: William Breathitt Gray
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    William Breathitt Gray
     
  • [ Upstream commit 9048f1f18a70a01eaa3c8e7166fdb2538929d780 ]

    Currently the address field in iio_chan_spec is filled with an accel
    data register address for the corresponding axis.

    In preparation for adding calibration offset support, this sets the
    address field to the index of accel data registers instead of the actual
    register address.

    This change makes it easier to access both accel registers and
    calibration offset registers with fewer lines of code as these are
    located in X-axis, Y-axis, Z-axis order.

    Cc: Eva Rachel Retuya
    Cc: Andy Shevchenko
    Cc: Jonathan Cameron
    Signed-off-by: Akinobu Mita
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Akinobu Mita
     
  • [ Upstream commit 7d6cd21d82bacab2d1786fe5e989e4815b75d9a3 ]

    When the buffer is enabled for ina2xx driver, a dedicated kthread is
    invoked to capture mesurement data. When the buffer is disabled, the
    kthread is stopped.

    However if the kthread gets register access errors, it immediately exits
    and when the malfunctional buffer is disabled, the stale task_struct
    pointer is accessed as there is no kthread to be stopped.

    A similar issue in the usbip driver is prevented by kthread_get_run and
    kthread_stop_put helpers by increasing usage count of the task_struct.
    This change applies the same solution.

    Cc: Stefan Brüns
    Cc: Jonathan Cameron
    Signed-off-by: Akinobu Mita
    Fixes: c43a102e67db ("iio: ina2xx: add support for TI INA2xx Power Monitors")
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Akinobu Mita
     

10 Sep, 2018

3 commits

  • commit 9a5094ca29ea9b1da301b31fd377c0c0c4c23034 upstream.

    A sysfs write callback function needs to either return the number of
    consumed characters or an error.

    The ad952x_store() function currently returns 0 if the input value was "0",
    this will signal that no characters have been consumed and the function
    will be called repeatedly in a loop indefinitely. Fix this by returning
    number of supplied characters to indicate that the whole input string has
    been consumed.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Alexandru Ardelean
    Fixes: cd1678f96329 ("iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator")
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     
  • commit 5a4e33c1c53ae7d4425f7d94e60e4458a37b349e upstream.

    Fix the displayed phase for the ad9523 driver. Currently the most
    significant decimal place is dropped and all other digits are shifted one
    to the left. This is due to a multiplication by 10, which is not necessary,
    so remove it.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Alexandru Ardelean
    Fixes: cd1678f9632 ("iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator")
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     
  • commit c5b974bee9d2ceae4c441ae5a01e498c2674e100 upstream.

    The IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY case is missing a
    return and will fall through to the default case and errorenously
    return -EINVAL.

    Fix this by adding in missing *return ret*.

    Fixes: 626f971b5b07 ("staging:iio:accel:sca3000 Add write support to the low pass filter control")
    Reported-by: Jonathan Cameron
    Signed-off-by: Gustavo A. R. Silva
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     

24 Aug, 2018

1 commit

  • [ Upstream commit 13399ff25f179811ce9c1df1523eb39f9e4a4772 ]

    According to IIO ABI relative humidity reading should be
    returned in milli percent.

    This patch addresses that by applying proper scaling and
    returning integer instead of fractional format type specifier.

    Note that the fixes tag is before the driver was heavily refactored
    to introduce spi support, so the patch won't apply that far back.

    Signed-off-by: Tomasz Duszynski
    Fixes: 14beaa8f5ab1 ("iio: pressure: bmp280: add humidity support")
    Acked-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Tomasz Duszynski
     

03 Jul, 2018

2 commits

  • commit 4a5b45383ca371e123ba103d34d4b3b87616245c upstream.

    Use 'devm_iio_kfifo_allocate()' instead of 'iio_kfifo_allocate()' in order
    to simplify code and avoid a memory leak in an error path in
    'sca3000_probe()'. A call to 'sca3000_unconfigure_ring()' was missing.

    Sent via the next merge window as unimportant bug and there are
    other patches dependent on it.

    Signed-off-by: Christophe JAILLET
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Christophe JAILLET
     
  • commit 7eb6b35d93c356f1afebbfb808bc296d6351e708 upstream.

    In the current state, these attributes are broken, because they are
    registered already, and the kernel throws a warning.
    The first registration happens via the `IIO_CHAN_INFO_SAMP_FREQ` flag from
    the `ad_sigma_delta` driver.

    In this commit these attrs are removed, and in the following the
    IIO_CHAN_INFO_SAMP_FREQ behavior will be implemented, which replaces these
    hooks.

    This is done to make things a bit easier to review as there is a bit of
    overlap in the patch if it's done all at once.

    Fixes: a13e831fcaa7 ("staging: iio: ad7192: implement IIO_CHAN_INFO_SAMP_FREQ")

    Signed-off-by: Alexandru Ardelean
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Alexandru Ardelean
     

05 Jun, 2018

4 commits

  • commit 76974ef9d1bf397b7bb97892a3b3bc516a1fc2c2 upstream.

    We need to select the buffer code, otherwise we get build errors
    with undefined functions on the trigger and buffer,
    if we select just IIO and then AT91_SAMA5D2_ADC from menuconfig

    This adds a Kconfig 'select' statement like other ADC
    drivers have it already.

    Fixes: 5e1a1da0f8c9 ("iio: adc: at91-sama5d2_adc: add hw trigger and buffer support")
    Signed-off-by: Eugen Hristev
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Eugen Hristev
     
  • commit 3d13de4b027d5f6276c0f9d3a264f518747d83f2 upstream.

    Currently, the following causes a kernel OOPS in memcpy:

    echo 1073741825 > buffer/length
    echo 1 > buffer/enable

    Note that using 1073741824 instead of 1073741825 causes "write error:
    Cannot allocate memory" but no OOPS.

    This is because 1073741824 == 2^30 and 1073741825 == 2^30+1. Since kfifo
    rounds up to the nearest power of 2, it will actually call kmalloc with
    roundup_pow_of_two(length) * bytes_per_datum.

    Using length == 1073741825 and bytes_per_datum == 2, we get:

    kmalloc(roundup_pow_of_two(1073741825) * 2
    or kmalloc(2147483648 * 2)
    or kmalloc(4294967296)
    or kmalloc(UINT_MAX + 1)

    so this overflows to 0, causing kmalloc to return ZERO_SIZE_PTR and
    subsequent memcpy to fail once the device is enabled.

    Fix this by checking for overflow prior to allocating a kfifo. With this
    check added, the above code returns -EINVAL when enabling the buffer,
    rather than causing an OOPS.

    Signed-off-by: Martin Kelly
    cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Martin Kelly
     
  • commit c043ec1ca5baae63726aae32abbe003192bc6eec upstream.

    Currently, we use int for buffer length and bytes_per_datum. However,
    kfifo uses unsigned int for length and size_t for element size. We need
    to make sure these matches or we will have bugs related to overflow (in
    the range between INT_MAX and UINT_MAX for length, for example).

    In addition, set_bytes_per_datum uses size_t while bytes_per_datum is an
    int, which would cause bugs for large values of bytes_per_datum.

    Change buffer length to use unsigned int and bytes_per_datum to use
    size_t.

    Signed-off-by: Martin Kelly
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Martin Kelly
     
  • commit 490fba90a90eb7b741f57fefd2bcf2c1e11eb471 upstream.

    This commit is a follow-up to changes made to ad_sigma_delta.h
    in staging: iio: ad7192: implement IIO_CHAN_INFO_SAMP_FREQ
    which broke ad7793 as it was not altered to match those changes.

    This driver predates the availability of IIO_CHAN_INFO_SAMP_FREQ
    attribute wherein usage has some advantages like it can be accessed by
    in-kernel consumers as well as reduces the code size.

    Therefore, use IIO_CHAN_INFO_SAMP_FREQ to implement the
    sampling_frequency attribute instead of using IIO_DEV_ATTR_SAMP_FREQ()
    macro.

    Move code from the functions associated with IIO_DEV_ATTR_SAMP_FREQ()
    into respective read and write hooks with the mask set to
    IIO_CHAN_INFO_SAMP_FREQ.

    Fixes: a13e831fcaa7 ("staging: iio: ad7192: implement IIO_CHAN_INFO_SAMP_FREQ")

    Signed-off-by: Michael Nosthoff
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Michael Nosthoff
     

29 Mar, 2018

4 commits

  • commit 7b9ebe428266fb7e0a6d769bb3ff3fcb6044b15e upstream.

    Apply le16_to_cpu() to data read from the sensor in order to take into
    account architecture endianness

    Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver)
    Signed-off-by: Lorenzo Bianconi
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Lorenzo Bianconi
     
  • commit 3c3e4b3a708a9d6451052e348981f37d2b3e92b0 upstream.

    The meson_sar_adc_lock() function is not supposed to hold the
    "indio_dev->mlock" on the error path.

    Fixes: 3adbf3427330 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs")
    Signed-off-by: Dan Carpenter
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit 8b438686a001db64c21782d04ef68111e53c45d9 upstream.

    Commit 7383d44b added a pointer pdata which get set to the default
    platform_data when non was defined in the device. But it did not
    pass this pointer to the st_sensors_init_sensor call but still
    used the maybe uninitialized platform_data from dev.

    This breaks initialization when no platform_data is given and
    the optional st,drdy-int-pin devicetree option is not set.

    This commit fixes this.

    Cc: stable@vger.kernel.org
    Fixes: 7383d44b ("iio: st_pressure: st_accel: Initialise sensor platform data properly")
    Signed-off-by: Michael Nosthoff
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Michael Nosthoff
     
  • commit b91e146c38b003c899710ede6d05fc824675e386 upstream.

    CCS811 has different I2C register maps in boot and application mode. When
    CCS811 is in boot mode, register APP_START (0xF4) is used to transit the
    firmware state from boot to application mode. However, APP_START is not a
    valid register location when CCS811 is in application mode (refer to
    "CCS811 Bootloader Register Map" and "CCS811 Application Register Map" in
    CCS811 datasheet). The driver should not attempt to perform a write to
    APP_START while CCS811 is in application mode, as this is not a valid or
    documented register location.

    When prob function is being called, the driver assumes the CCS811 sensor
    is in boot mode, and attempts to perform a write to APP_START. Although
    CCS811 powers-up in boot mode, it may have already been transited to
    application mode by previous instances, e.g. unload and reload device
    driver by the system, or explicitly by user. Depending on the system
    design, CCS811 sensor may be permanently connected to system power source
    rather than power controlled by GPIO, hence it is possible that the sensor
    is never power reset, thus the firmware could be in either boot or
    application mode at any given time when driver prob function is being
    called.

    This patch checks the STATUS register before attempting to send a write to
    APP_START. Only if the firmware is not in application mode and has valid
    firmware application loaded, then it will continue to start transiting the
    firmware boot to application mode.

    Signed-off-by: Richard Lai
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Richard Lai
     

19 Mar, 2018

2 commits


28 Feb, 2018

4 commits

  • commit f027e0b3a774e10302207e91d304bbf99e3a8b36 upstream.

    The adis_probe_trigger() creates a new IIO trigger and requests an
    interrupt associated with the trigger. The interrupt uses the generic
    iio_trigger_generic_data_rdy_poll() function as its interrupt handler.

    Currently the driver initializes some fields of the trigger structure after
    the interrupt has been requested. But an interrupt can fire as soon as it
    has been requested. This opens up a race condition.

    iio_trigger_generic_data_rdy_poll() will access the trigger data structure
    and dereference the ops field. If the ops field is not yet initialized this
    will result in a NULL pointer deref.

    It is not expected that the device generates an interrupt at this point, so
    typically this issue did not surface unless e.g. due to a hardware
    misconfiguration (wrong interrupt number, wrong polarity, etc.).

    But some newer devices from the ADIS family start to generate periodic
    interrupts in their power-on reset configuration and unfortunately the
    interrupt can not be masked in the device. This makes the race condition
    much more visible and the following crash has been observed occasionally
    when booting a system using the ADIS16460.

    Unable to handle kernel NULL pointer dereference at virtual address 00000008
    pgd = c0004000
    [00000008] *pgd=00000000
    Internal error: Oops: 5 [#1] PREEMPT SMP ARM
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.0-04126-gf9739f0-dirty #257
    Hardware name: Xilinx Zynq Platform
    task: ef04f640 task.stack: ef050000
    PC is at iio_trigger_notify_done+0x30/0x68
    LR is at iio_trigger_generic_data_rdy_poll+0x18/0x20
    pc : [] lr : [] psr: 60000193
    sp : ef051bb8 ip : 00000000 fp : ef106400
    r10: c081d80a r9 : ef3bfa00 r8 : 00000087
    r7 : ef051bec r6 : 00000000 r5 : ef3bfa00 r4 : ee92ab00
    r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : ee97e400
    Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
    Control: 18c5387d Table: 0000404a DAC: 00000051
    Process swapper/0 (pid: 1, stack limit = 0xef050210)
    [] (iio_trigger_notify_done) from [] (__handle_irq_event_percpu+0x88/0x118)
    [] (__handle_irq_event_percpu) from [] (handle_irq_event_percpu+0x1c/0x58)
    [] (handle_irq_event_percpu) from [] (handle_irq_event+0x38/0x5c)
    [] (handle_irq_event) from [] (handle_level_irq+0xa4/0x130)
    [] (handle_level_irq) from [] (generic_handle_irq+0x24/0x34)
    [] (generic_handle_irq) from [] (zynq_gpio_irqhandler+0xb8/0x13c)
    [] (zynq_gpio_irqhandler) from [] (generic_handle_irq+0x24/0x34)
    [] (generic_handle_irq) from [] (__handle_domain_irq+0x5c/0xb4)
    [] (__handle_domain_irq) from [] (gic_handle_irq+0x48/0x8c)
    [] (gic_handle_irq) from [] (__irq_svc+0x6c/0xa8)

    To fix this make sure that the trigger is fully initialized before
    requesting the interrupt.

    Fixes: ccd2b52f4ac6 ("staging:iio: Add common ADIS library")
    Reported-by: Robin Getz
    Signed-off-by: Lars-Peter Clausen
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     
  • commit 4cd140bda6494543f1c1b0ccceceaa44b676eef6 upstream.

    If no iio buffer has been set up and poll is called return 0.
    Without this check there will be a null pointer dereference when
    calling poll on a iio driver without an iio buffer.

    Cc: stable@vger.kernel.org
    Signed-off-by: Stefan Windfeldt-Prytz
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Stefan Windfeldt-Prytz
     
  • commit 511051d509ec54642dd6d30fdf2caa33c23619cc upstream.

    Functions for triggered buffer support are needed by this module.
    If they are not defined accidentally by another driver, there's an error
    thrown out while linking.

    Add a select of IIO_BUFFER and IIO_TRIGGERED_BUFFER in the Kconfig file.

    Signed-off-by: Andreas Klinger
    Fixes: a83195937151 ("iio: srf08: add triggered buffer support")
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Andreas Klinger
     
  • commit a3b5655ebdb501a98a45c0d3265dca9f2fe0218a upstream.

    Error handling in stm32h7_adc_enable routine doesn't unwind enable
    sequence correctly. ADEN can only be cleared by hardware (e.g. by
    writing one to ADDIS).
    It's also better to clear ADRDY just after it's been set by hardware.

    Fixes: 95e339b6e85d ("iio: adc: stm32: add support for STM32H7")

    Signed-off-by: Fabrice Gasnier
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Fabrice Gasnier
     

25 Feb, 2018

2 commits

  • [ Upstream commit c175cb7cd953782bbf4e8bdf088ad61440d6dde5 ]

    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
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • [ Upstream commit e53111ad5deaef98d8c18a9933ef1f5624c5979d ]

    The commit 0f0796509c07

    ("iio: remove gpio interrupt probing from drivers that use a single interrupt")

    removed custom IRQ assignment for the drivers which are enumerated via
    ACPI or OF. Unfortunately, some ACPI tables have IRQ line defined as
    GpioIo() resource and thus automatic IRQ allocation will fail.

    Partially revert the commit 0f0796509c07 to restore original behaviour.

    Signed-off-by: Andy Shevchenko
    Acked-by: Mika Westerberg
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     

08 Feb, 2018

1 commit

  • commit 9a0ebbc93547d88f422905c34dcceebe928f3e9e upstream.

    The module license checker complains about these two so just fix
    it up. They are both GPLv2, both written by me or using code
    I extracted while refactoring from the GPLv2 drivers.

    Cc: Randy Dunlap
    Reported-by: Randy Dunlap
    Signed-off-by: Linus Walleij
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Linus Walleij
     

04 Feb, 2018

2 commits

  • commit 8f114acd4e1a9cfa05b70bcc4219bc88197b5c9b upstream.

    in_concentration_raw should report, according to sysfs-bus-iio documentation,
    a "Raw (unscaled no offset etc.) percentage reading of a substance."

    Modify scale to convert from ppm/ppb to percentage:
    1 ppm = 0.0001%
    1 ppb = 0.0000001%

    There is no offset needed to convert the ppm/ppb to percentage,
    so remove offset from IIO_CONCENTRATION (IIO_MOD_CO2) channel.

    Cc'd stable to reduce chance of userspace breakage in the long
    run as we fix this wrong bit of ABI usage.

    Signed-off-by: Narcisa Ana Maria Vasile
    Reviewed-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Narcisa Ana Maria Vasile
     
  • commit 04e491ca9df60ffe8637d00d68e5ab8bc73b30d5 upstream.

    By default, watermark is set to '1'. Watermark is used to fine tune
    cyclic dma buffer period. In case watermark is left untouched (e.g. 1)
    and several channels are being scanned, buffer period is wrongly set
    (e.g. to 1 sample). As a consequence, data is never pushed to upper layer.
    Fix buffer period size, by taking scan channels number into account.

    Fixes: 2763ea0585c9 ("iio: adc: stm32: add optional dma support")

    Signed-off-by: Fabrice Gasnier
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Fabrice Gasnier