22 Sep, 2020

13 commits

  • …it/jic23/iio into staging-next

    Jonathan writes:

    Second set of features and cleanups for IIO in 5.10

    We have a couple of changes that apply to large sets of drivers, so
    I have grouped those to keep this short.

    There are a few late breaking fixes in here that can wait for the
    merge window.

    dt yaml conversions
    -------------------

    * adi,ad7768-1
    * adi,ad7949
    * aspeed,ast2400
    * cosmic,10001-adc
    * dlg,da9150-gpadc
    * fsl,imx25-gcq
    * fsl,imx7d-adc
    * fsl,vf610
    * holt,hi8435
    * marvell,berlin2-adc
    * motorola,cpcap-adc
    * nuvoton,nau7802
    * nuvoton,npcm750-adc
    * nxp,lpc1850-adc
    * nxp,lpc3220
    * sprd,sc2720-adc
    * st,stmpe-adc
    * ti,adc12138
    * ti,ads1015
    * ti,ads7950
    * ti,twl4030-madc

    Features
    --------

    * adxrs290
    - Add triggered buffer support and expose data ready signal as a possible
    trigger. Includes updating bindings.
    - Add debugfs hooks for register access.
    * mlx90632
    - Add a clear user interface to override the measured ambient temperature.
    * vl53l0x
    - Add IRQ support including dt bindings.

    Cleanups and minor fixes
    ------------------------
    (groups)
    Replace mlock with local lock:
    * adf4350
    * exynos-adc
    * fls-imx25-gcq
    * stm32-dac

    devm use to simplify probe error handling and remove functions.
    * adis16201
    * adis16203
    * adis16209
    * adis16240
    * adis16136
    * adis16260
    * adis16400
    * adis16460
    * adis16480
    * adis library - drop unused adis_setup_buffer_and_trigger()

    of_match_ptr removal and incorrect ACPI binding removal
    of_match_ptr() rarely makes sense in an IIO driver as space saving
    is trivial and it breaks ACPI PRP0001 based instantiation.
    Mostly this series is about removing examples that get copied into new
    drivers.
    * ad2s1200
    * ad5272
    * ad5446
    * ad5592r
    * ad5593r
    * ad5703
    * ak8974
    * ak8975
    * ams-iaq-core
    * as3935
    * atlas-sensor
    * ds1803
    * hdc100x
    * htu21
    * icp10100
    * lmp91000
    * pulsedlight
    * max30102
    * max5432
    * max5481
    * mcp4018
    * mcp4131
    * mcp4531
    * mcp4725
    * ms5611
    * ms5637
    * si7020
    * sgp30
    * ti-dac082s085
    * ti-dac5571
    * tmp007
    * tsys01
    * vz89x
    * zpa2326

    kernel-doc fixes
    * iio-core
    * ad7303
    * ad7947
    * adis16080
    * adis16400
    * iio_dummy_evgen
    * sgp30

    Fixes for buffer alignment when passed to iio_push_to_buffers_with_timestamp()
    This is a long running effort. There are a few more drivers to come.
    * inv_mpu6050
    * itg3200
    * si1145
    * st_lsm6dsx
    * ti-adc0832
    * ti-adc12138

    (not driver focused)
    * MAINTAINERS
    - Consolidate Analog Device IIO entries whilst removing Beniamin Bia.
    - Remove Hartmut Knaack as a listed IIO maintainer as he hasn't been
    active for a long time and people are getting intermitted bounces.
    * Add __printf() markings to a few functions that were missing them.
    * drop some rotted documentation from staging.
    * rework buffer sysfs file creation (precursor to multiple buffer support)

    (individual drivers)
    * ad5592r
    - Fix use of true for IIO_SHARED_BY_TYPE
    - Tidy up locking and indentation.
    * ad9467
    - Improve error message on chip-id missmatch.
    - Use more appropriate error value if chip-id not recognised.
    * adis-library
    - Simplify burst mode handling.
    * adxrs290
    - Make sure to switch device to standby mode during remove.
    * as73211
    - Increase measurement timeout as seems some devices are slower.
    * bma180
    - Fix use of true fo IIO_SHARED_BY_TYPE
    * exynos_adc
    - Update binding to require second interrut with touch screen.
    - Update binding to not require syscon on S5Pv210
    * hmc5843
    - Fix use of true for IIO_SHARED_BY_TYPE
    * inv_mpu6050
    - Use regmap_noinc_read() for fifo reading.
    * palmas_gpadc
    - Use module_platform_driver() to remove boilerplate.
    * meson-saradc
    - style consistency fixes
    * rockchip_saradc
    - Allow compile testing with !ARM.
    * st_lsm6dsx
    - Changing scaling factor to use IIO_VAL_INT_PLUS_NANO to improve precision.
    - Fix an issue with unchecked return value.
    * stm32-adc
    - Fix a missing return introduced in dev_err_probe() patch earlier in
    cycle.
    * sx9310
    - Prefer async mode for probe as paticularly slow startup.
    * vcnl4000
    - Add missing interrupt property to dt binding.

    * tag 'iio-for-5.10b-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (126 commits)
    dt-bindings: iio: vishay,vcnl4000: add interrupts property
    iio:imu:inv_mpu6050: Use regmap_noinc_read for fifo reads.
    iio:imu:inv_mpu6050 Fix dma and ts alignment and data leak issues.
    iio:adc:ti-adc12138 Fix alignment issue with timestamp
    iio:adc:ti-adc0832 Fix alignment issue with timestamp
    iio:imu:st_lsm6dsx Fix alignment and data leak issues
    iio:light:si1145: Fix timestamp alignment and prevent data leak.
    iio:gyro:itg3200: Fix timestamp alignment and prevent data leak.
    iio:imu:st_lsm6dsx: check st_lsm6dsx_shub_read_output return
    iio: adc: exynos_adc: Replace indio_dev->mlock with own device lock
    dt-bindings:iio:adc:holt,hi8435 yaml conversion
    dt-bindings:iio:adc:adi,ad7768-1 yaml conversion
    dt-bindings:iio:adc:adi,ad7949 yaml conversion
    dt-bindings:iio:adc:dlg,da9150-gpadc yaml conversion
    dt-bindings:iio:adc:motorola,cpcap-adc yaml conversion
    dt-bindings:iio:adc:nxp,lpc3220-adc yaml conversion
    dt-bindings:iio:adc:nxp,lpc1850-adc yaml conversion
    dt-bindings:iio:adc:fsl,imx25-gcq yaml conversion
    dt-bindings:iio:adc:fsl,imx7d-adc yaml conversion
    dt-bindings:iio:adc:ti,ads1015 yaml conversion
    ...

    Greg Kroah-Hartman
     
  • Since there was a recently discovered issue with these locks, it probably
    makes sense to cleanup the code a bit, to prevent it from being used as an
    example/reference.

    This change moves the lock only where it is explicitly needed to protect
    resources from potential concurrent accesses.

    It also reworks the switch statements to do direct returns vs caching the
    return value on a variable.

    Signed-off-by: Alexandru Ardelean
    Link: https://lore.kernel.org/r/20200706110259.23947-3-alexandru.ardelean@analog.com
    Signed-off-by: Jonathan Cameron

    Alexandru Ardelean
     
  • The next rework may require an unindentation of a code block in
    ad5592r_read_raw(), which would make review a bit more difficult.

    This change unindents the code block for reading the scale of the
    non-temperature channels.

    Signed-off-by: Alexandru Ardelean
    Link: https://lore.kernel.org/r/20200706110259.23947-2-alexandru.ardelean@analog.com
    Signed-off-by: Jonathan Cameron

    Alexandru Ardelean
     
  • struct iio_chan_spec_ext_info shared element is of type
    enum iio_shared_by, not boolean. It's like the enum value
    will for IIO_SHARED_BY_TYPE == 1 == true, hence no actual
    problem has been observed.

    CC [M] drivers/iio/dac/ad5592r-base.o
    491 | .shared = true,
    |

    Fixes: 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
    Signed-off-by: Jonathan Cameron
    Acked-by: Alexandru Ardelean
    Link: https://lore.kernel.org/r/20200722142515.897378-1-jic23@kernel.org

    Jonathan Cameron
     
  • Misspelling, missing description.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5064.c:71: warning: bad line: internal vref.
    drivers/iio/dac/ad5064.c:83: warning: Function parameter or member 'channels' not described in 'ad5064_chip_info'
    drivers/iio/dac/ad5064.c:125: warning: Function parameter or member 'lock' not described in 'ad5064_state'

    Signed-off-by: Lee Jones
    Cc: Michael Hennerich
    Cc: Liam Girdwood
    Cc: Mark Brown
    Link: https://lore.kernel.org/r/20200716135928.1456727-20-lee.jones@linaro.org
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad7303.c:49: warning: Function parameter or member 'vdd_reg' not described in 'ad7303_state'
    drivers/iio/dac/ad7303.c:49: warning: Function parameter or member 'vref_reg' not described in 'ad7303_state'
    drivers/iio/dac/ad7303.c:49: warning: Function parameter or member 'lock' not described in 'ad7303_state'

    Signed-off-by: Lee Jones
    Cc: Michael Hennerich
    Cc: Liam Girdwood
    Cc: Mark Brown
    Link: https://lore.kernel.org/r/20200716135928.1456727-31-lee.jones@linaro.org
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • These prevent the use of this driver with ACPI via PRP0001 and are
    an example of an anti pattern I'm trying to remove from IIO.
    Hence drop them from this driver.

    Signed-off-by: Jonathan Cameron
    Reviewed-by: Andy Shevchenko
    Cc: Sean Nyekjaer
    Link: https://lore.kernel.org/r/20200910173242.621168-16-jic23@kernel.org

    Jonathan Cameron
     
  • These prevent the use of this driver with ACPI via PRP0001 and are
    an example of an anti pattern I'm trying to remove from IIO.
    Hence drop them from this driver.

    Signed-off-by: Jonathan Cameron
    Reviewed-by: Andy Shevchenko
    Cc: Lukas Wunner
    Link: https://lore.kernel.org/r/20200910173242.621168-15-jic23@kernel.org

    Jonathan Cameron
     
  • This enables use of ACPI PRP0001 and removes an antipattern I am
    trying to stop people copying in IIO.

    This particular case is more complex than most because it allowed
    probing via sysfs with out a fwnode but would presumably always
    have then failed. Now the code will assume that properties are
    the defaults if not specified or the firmware node is not present.
    This relaxation of the constraints should not break any existing
    cases and may enable some new ones.

    Signed-off-by: Jonathan Cameron
    Reviewed-by: Andy Shevchenko
    Cc: Peter Meerwald
    Link: https://lore.kernel.org/r/20200910173242.621168-14-jic23@kernel.org

    Jonathan Cameron
     
  • This prevents use of this driver with ACPI via PRP0001 and are
    an example of an anti pattern I'm trying to remove from IIO.

    Also add mod_devicetable.h include given struct of_device_id is
    declared there.

    Signed-off-by: Jonathan Cameron
    Reviewed-by: Andy Shevchenko
    Cc: Michael Hennerich
    Cc: Lars-Peter Clausen
    Link: https://lore.kernel.org/r/20200910173242.621168-13-jic23@kernel.org

    Jonathan Cameron
     
  • These result in a very small reduction in driver size, but at the
    cost of more complex build and slightly harder to read code.
    In the case of of_match_ptr it also prevents use of PRP0001
    ACPI based identification. In this particular case we have
    a valid ACPI/PNP ID that I am assuming was issued by Analog
    Devices. That should be used in preference to PRP0001 but doesn't
    mean we should prevent that route.

    Signed-off-by: Jonathan Cameron
    Reviewed-by: Andy Shevchenko
    Cc: Michael Hennerich
    Cc: Lars-Peter Clausen
    Link: https://lore.kernel.org/r/20200910173242.621168-12-jic23@kernel.org

    Jonathan Cameron
     
  • These result in a very small reduction in driver size, but at the
    cost of more complex build and slightly harder to read code.
    In the case of of_match_ptr it also prevents use of PRP0001
    ACPI based identification. In this particular case we have
    a valid ACPI/PNP ID that I am assuming was issued by Analog
    Devices. That should be used in preference to PRP0001 but doesn't
    mean we should prevent that route.

    Signed-off-by: Jonathan Cameron
    Reviewed-by: Andy Shevchenko
    Cc: Michael Hennerich
    Cc: Lars-Peter Clausen
    Link: https://lore.kernel.org/r/20200910173242.621168-11-jic23@kernel.org

    Jonathan Cameron
     
  • These prevent use of this driver with ACPI via PRP0001 and are
    an example of an anti pattern I'm trying to remove from IIO.
    Hence drop them from this driver.

    Signed-off-by: Jonathan Cameron
    Reviewed-by: Andy Shevchenko
    Cc: Michael Hennerich
    Link: https://lore.kernel.org/r/20200910173242.621168-10-jic23@kernel.org

    Jonathan Cameron
     

17 Sep, 2020

2 commits

  • As part of the general cleanup of indio_dev->mlock, this change replaces
    it with a local lock on the device's state from potential concurrent write
    accesses from userspace. The write operation requires an SPI write, then
    toggling of a GPIO, so the lock aims to protect the sanity of the entire
    sequence of operation.

    This is part of a bigger cleanup.
    Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/

    Signed-off-by: Sergiu Cuciurean
    Signed-off-by: Alexandru Ardelean
    Link: https://lore.kernel.org/r/20200916092535.76527-1-alexandru.ardelean@analog.com
    Signed-off-by: Jonathan Cameron

    Sergiu Cuciurean
     
  • As part of the general cleanup of indio_dev->mlock, this change replaces
    it with a local lock. The lock protects against potential races when
    reading the CR reg and then updating, so that the state of pm_runtime
    is consistent between the two operations.

    This is part of a bigger cleanup.
    Link: https://lore.kernel.org/linux-iio/CA+U=Dsoo6YABe5ODLp+eFNPGFDjk5ZeQEceGkqjxXcVEhLWubw@mail.gmail.com/

    Signed-off-by: Sergiu Cuciurean
    Signed-off-by: Alexandru Ardelean
    Reviewed-by: Fabrice Gasnier
    Link: https://lore.kernel.org/r/20200916092349.75647-1-alexandru.ardelean@analog.com
    Signed-off-by: Jonathan Cameron

    Sergiu Cuciurean
     

14 Sep, 2020

1 commit


04 Sep, 2020

4 commits

  • Common pattern of handling deferred probe can be simplified with
    dev_err_probe(). Less code and also it prints the error value.

    Signed-off-by: Krzysztof Kozlowski
    Reviewed-by: Andy Shevchenko
    Acked-by: Peter Rosin
    Link: https://lore.kernel.org/r/20200829064726.26268-12-krzk@kernel.org
    Signed-off-by: Jonathan Cameron

    Krzysztof Kozlowski
     
  • Common pattern of handling deferred probe can be simplified with
    dev_err_probe(). Less code and also it prints the error value.

    Signed-off-by: Krzysztof Kozlowski
    Reviewed-by: Andy Shevchenko
    Link: https://lore.kernel.org/r/20200829064726.26268-8-krzk@kernel.org
    Signed-off-by: Jonathan Cameron

    Krzysztof Kozlowski
     
  • These are never modified and can be made const to allow the compiler to
    put it in read-only memory.

    Before:
    text data bss dec hex filename
    6642 12608 64 19314 4b72 drivers/iio/dac/ad5686.o

    After:
    text data bss dec hex filename
    16946 2304 64 19314 4b72 drivers/iio/dac/ad5686.o

    Signed-off-by: Rikard Falkeborn
    Acked-by: Alexandru Ardelean
    Signed-off-by: Jonathan Cameron

    Rikard Falkeborn
     
  • The driver currently only allows channel 0 to be powered down but the
    multi-channel variants of the hardware allow each channel to be powered
    down separately and with separate power down modes. Add support for
    this.

    Signed-off-by: Vincent Whitchurch
    Acked-by: Sean Nyekjaer
    Signed-off-by: Jonathan Cameron

    Vincent Whitchurch
     

27 Aug, 2020

1 commit


24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

22 Jul, 2020

1 commit

  • There are 2 exit paths where the lock isn't held, but try to unlock the
    mutex when exiting. In these places we should just return from the
    function.

    A neater approach would be to cleanup the ad5592r_read_raw(), but that
    would make this patch more difficult to backport to stable versions.

    Fixes 56ca9db862bf3: ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
    Reported-by: Charles Stanhope
    Signed-off-by: Alexandru Ardelean
    Cc:
    Signed-off-by: Jonathan Cameron

    Alexandru Ardelean
     

20 Jul, 2020

13 commits

  • Kerneldoc expects attributes/parameters to be in '@*.: ' format.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5504.c:58: warning: Function parameter or member 'pwr_down_mask' not described in 'ad5504_state'
    drivers/iio/dac/ad5504.c:58: warning: Function parameter or member 'pwr_down_mode' not described in 'ad5504_state'
    drivers/iio/dac/ad5504.c:64: warning: cannot understand function prototype: 'enum ad5504_supported_device_ids '

    Cc: Michael Hennerich
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Kerneldoc expects attributes/parameters to be in '@*.: ' format.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ltc2632.c:50: warning: Function parameter or member 'powerdown_cache_mask' not described in 'ltc2632_state'
    drivers/iio/dac/ltc2632.c:50: warning: Function parameter or member 'vref_mv' not described in 'ltc2632_state'
    drivers/iio/dac/ltc2632.c:50: warning: Function parameter or member 'vref_reg' not described in 'ltc2632_state'

    Cc: Liam Girdwood
    Cc: Mark Brown
    Cc: "Uwe Kleine-König"
    Cc: Silvan Murer
    Cc: Maxime Roussin-Belanger
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • ... and remove seemingly pointless comment.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5791.c:97: warning: Function parameter or member 'ctrl' not described in 'ad5791_state'
    drivers/iio/dac/ad5791.c:97: warning: Function parameter or member 'pwr_down_mode' not described in 'ad5791_state'
    drivers/iio/dac/ad5791.c:97: warning: Function parameter or member 'pwr_down' not described in 'ad5791_state'
    drivers/iio/dac/ad5791.c:97: warning: Function parameter or member 'data' not described in 'ad5791_state'
    drivers/iio/dac/ad5791.c:103: warning: cannot understand function prototype: 'enum ad5791_supported_device_ids '

    Cc: Michael Hennerich
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Attribute descriptions must match the name exactly.

    Kerneldoc expects attributes/parameters to be in '@*.: ' format.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5764.c:42: warning: Function parameter or member 'channels' not described in 'ad5764_chip_info'
    drivers/iio/dac/ad5764.c:67: warning: Function parameter or member 'lock' not described in 'ad5764_state'

    Cc: Michael Hennerich
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Kerneldoc expects attributes/parameters to be in '@*.: ' format.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5761.c:80: warning: Function parameter or member 'lock' not described in 'ad5761_state'

    Cc: Michael Hennerich
    Cc: Liam Girdwood
    Cc: Mark Brown
    Cc: Ricardo Ribalda
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Kerneldoc headers need to come directly before the function/struct
    that they are documenting. Also fix some missing descriptions and
    misspellings.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5758.c:111: warning: Function parameter or member 'reg' not described in 'ad5758_range'
    drivers/iio/dac/ad5758.c:111: warning: Function parameter or member 'min' not described in 'ad5758_range'
    drivers/iio/dac/ad5758.c:111: warning: Function parameter or member 'max' not described in 'ad5758_range'
    drivers/iio/dac/ad5758.c:122: warning: Function parameter or member 'gpio_reset' not described in 'ad5758_state'
    drivers/iio/dac/ad5758.c:122: warning: Function parameter or member 'd32' not described in 'ad5758_state'
    drivers/iio/dac/ad5758.c:137: warning: cannot understand function prototype: 'enum ad5758_output_range '

    Cc: Michael Hennerich
    Cc: Stefan Popa
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Kerneldoc expects attributes/parameters to be in '@*.: ' format.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5755.c:105: warning: Function parameter or member 'lock' not described in 'ad5755_state'

    Cc: Michael Hennerich
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Kerneldoc expects attributes/parameters to be in '@*.: ' format.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5449.c:75: warning: Function parameter or member 'lock' not described in 'ad5449'

    Cc: Michael Hennerich
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5446.c:48: warning: Function parameter or member 'dev' not described in 'ad5446_state'
    drivers/iio/dac/ad5446.c:48: warning: Function parameter or member 'cached_val' not described in 'ad5446_state'
    drivers/iio/dac/ad5446.c:48: warning: Function parameter or member 'pwr_down_mode' not described in 'ad5446_state'
    drivers/iio/dac/ad5446.c:48: warning: Function parameter or member 'pwr_down' not described in 'ad5446_state'
    drivers/iio/dac/ad5446.c:48: warning: Function parameter or member 'lock' not described in 'ad5446_state'
    drivers/iio/dac/ad5446.c:323: warning: cannot understand function prototype: 'enum ad5446_supported_spi_device_ids '
    drivers/iio/dac/ad5446.c:545: warning: cannot understand function prototype: 'enum ad5446_supported_i2c_device_ids '

    Cc: Michael Hennerich
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5064.c:790:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
    790 | static const char * const ad5064_vref_name(struct ad5064_state *st,
    | ^~~~~

    Cc: Michael Hennerich
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Kerneldoc expects attributes/parameters to be in '@*.: ' format.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5421.c:82: warning: Function parameter or member 'lock' not described in 'ad5421_state'

    Cc: Michael Hennerich
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Kerneldoc expects attributes/parameters to be in '@*.: ' format.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5380.c:64: warning: Function parameter or member 'lock' not described in 'ad5380_state'

    Cc: Michael Hennerich
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     
  • Kerneldoc expects attributes/parameters to be in '@*.: ' format.

    Fixes the following W=1 kernel build warning(s):

    drivers/iio/dac/ad5360.c:89: warning: Function parameter or member 'lock' not described in 'ad5360_state'

    Cc: Michael Hennerich
    Signed-off-by: Lee Jones
    Signed-off-by: Jonathan Cameron

    Lee Jones
     

17 Jul, 2020

1 commit

  • …jic23/iio into staging-next

    Jonathan writes:

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

    Some new devices, but particularly good this time is the core rework coming
    from Alexandru. Some of this has been in Analog's tree a long time, but other
    parts are motivated by closing down common mistakes in new drivers.

    Changes since first try at this pull request:
    * Add missed patch to actually remove iio_priv_to_dev and as a result
    also drop a few ingenic patches that need to be updated to take this
    into account.
    * Fix an ordering issue int he pollfunc attach in the core rework.

    New device support
    * qcom pmic7 adc
    - New driver using common qcom-vadc library. Some associated cleanups and
    refactors.
    * invensense icm42600
    - New driver supporting icm42600, icm42602, icm42605 and icm42622 via i2c
    or spi. These are all 6 axis IMUs with gyro and accelerometers.
    Driver supports buffered modes using the hardware fifo and interpolation
    for accurate timestamps.
    * sensirion scd30
    - New driver for this carbon dioxide sensor including i2c and serial
    interfaces + bindings.

    Features
    * ak8975
    - Add reset gpio support.
    * bma400
    - Support SPI.
    * bmc150
    - Document and add support for bmc156b and bmm150b, tidy up _magn endings.
    * bmi160
    - Regulator and mount matrix support.
    * mxc4005
    - Add ID for mxc6655
    * rockchip-saradc
    - Triggered buffer support.

    DT bindings
    * qcom spmi-vadc converted to yaml + pmic7 bindings
    * ak8975 tidy up and convert to yaml + add reset-gpio binding
    * ingenic-adc -convert to yaml.

    Core rework all carried through by Alexandru Ardelean.
    * Assign parent device in the core rather than every driver. A few devices
    need to provide specific non standard parents, so there is support for
    overriding.
    * Start to take parts of struct iio_dev opaque to the drivers.
    This will be a long term job, but should reduce the number of drivers
    we get that use parts that are currently only 'internal' by documentation.
    * Move attach and detach of pollfunc to the core. Every triggered buffer
    using driver had to do the same thing, so lets do it in the core. The
    hard part here was getting all the drivers into canonical form so there
    would be no functional changes in this final patch. That's taken quite
    a lot of work over last couple of cycles!

    Cleanups and minor fixes.
    * docs
    - Improve IIO_CONCENTRATION channel type description in ABI docs.
    - Drop doubled word cases.
    - Http to Https conversion.
    * core
    - Make iio_device_get_drvdata take a const struct iio_dev * avoiding some
    nasty casts.
    * ADCs
    - Drop lots of users of of_match_ptr macro, includes of mod_devicetable.h
    and CONFIG_OF protections. These prevent use of ACPI PRP0001 with these
    drivers and get coppied into lots of new drivers.
    * ad5380
    - Constify iio_chan_spec_ext_info
    * ad5592r
    - Constify iio_chan_spec_ext_info
    - Avoid use of iio_priv_to_dev (precursor to taking parts of iio_dev opaque)
    * ad8366
    - Make gpio optional as doesn't matter if its there or not.
    * adis16480
    - Use irq types instead of the flags.
    * atlas-ezo-sensor
    - Minimize scope of ret variable.
    * at91-adc
    - Add COMPILE_TEST dependency to driver to improve build coverage.
    - Avoid use of iio_priv_to_dev (precursor to taking parts of iio_dev opaque)
    * at91-sama5d2
    - Avoid use of iio_priv_to_dev (precursor to taking parts of iio_dev opaque)
    - Drop Ludovic as a co-maintaienr.
    * cros_ec
    - Reapply the range after resume.
    - Add a read only frequency entry for legacy version.
    - Typo fixes
    * hts221
    - Avoid use of iio_priv_to_dev (precursor to taking parts of iio_dev opaque)
    * inv_mpu
    - Drop double check on ACPI companion device.
    * iqs621
    - Avoid use of iio_priv_to_dev (precursor to taking parts of iio_dev opaque)
    * iqs624
    - Avoid use of iio_priv_to_dev (precursor to taking parts of iio_dev opaque)
    * max11100
    - Constify iio_chan_spec
    * mmc35240
    - Constify reg_default
    * rockchip-saradc
    - Move to managed allocators for everything in probe.
    - Use more distinctive prefix for channel macros.
    * stk3310
    - Constify regmap_config.
    * stm32-adc
    - Avoid use of iio_priv_to_dev (precursor to taking parts of iio_dev opaque)
    * stm32-dfsdm-adc
    - Avoid use of iio_priv_to_dev (precursor to taking parts of iio_dev opaque)
    * ti-am335x
    - Use managed allocations where straight forward in probe function.
    * tsl2563
    - Avoid use of iio_priv_to_dev (precursor to taking parts of iio_dev opaque)

    * tag 'iio-for-5.9a-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (107 commits)
    iio: buffer: fix attach/detach pollfunc order
    iio: core: remove iio_priv_to_dev() helper
    Replace HTTP links with HTTPS ones: drivers/iio
    Replace HTTP links with HTTPS ones: Documentation/devicetree/bindings/iio
    dt-bindings: iio/adc: Convert ingenic-adc docs to YAML.
    iio: cros_ec_accel_legacy: Add Read Only frequency entries
    MAINTAINERS: adc: at91-sama5d2_adc: remove myself as co-maintainer
    iio: adc: ti_am335x_adc: alloc kfifo & IRQ via devm_ functions
    iio: adc: ti_am335x_adc: alloc channels via devm_kcalloc()
    iio:adc:ingenic: drop of_match_ptr protection and include mod_devicetable.h
    iio:adc:ti-tlc4541: Drop CONFIG_OF and of_match_ptr protections.
    iio:adc:ti-adc161s626: Drop of_match_ptr protection.
    iio:adc:ti-adc084s021: drop of_match_ptr protection
    iio:adc:ti-adc0832: drop CONFIG_OF and of_match_ptr protections
    iio:adc:ti-adc081c: Drop of_match_ptr and change to mod_devicetable.h
    iio:adc:sd_adc_modulator: Drop of_match_ptr and tweak includes
    iio:adc:mcp3422: remove CONFIG_OF and of_match_ptr protections
    iio:adc:mcp320x: Drop CONFIG_OF and of_match_ptr protections
    iio:adc:max1118: Drop CONFIG_OF / of_match_ptr protections
    iio:adc:max11100: Drop of_match_ptr protection / add mod_devicetable.h include
    ...

    Greg Kroah-Hartman
     

13 Jul, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Signed-off-by: Alexander A. Klimov
    Signed-off-by: Jonathan Cameron

    Alexander A. Klimov
     

14 Jun, 2020

2 commits

  • If a driver does not assign an of_node to a IIO device to IIO core will
    automatically assign the of_node of the parent device. This automatic
    assignment is done in the iio_device_register() function.

    There is a fair amount of drivers that currently manually assign the
    of_node of the IIO device. All but 4 of them can make use of the automatic
    assignment though.

    The exceptions are:
    * mxs-lradc-adc: Which uses the of_node of the parent of the parent.
    * stm32-dfsdm-adc, stm32-adc and stm32-dac: Which reference the of_node
    assigned to the IIO device before iio_device_register() is called.

    All other drivers are updated to use automatic assignment. This reduces
    the amount of boilerplate code involved in setting up the IIO device.

    The patch has mostly been auto-generated with the following semantic patch

    //
    @exists@
    expression indio_dev;
    expression parent;
    @@
    indio_dev = \(devm_iio_device_alloc\|iio_device_alloc\)(&parent, ...)
    ...
    -indio_dev->dev.of_node = parent.of_node;

    @exists@
    expression indio_dev;
    expression parent;
    @@
    indio_dev = \(devm_iio_device_alloc\|iio_device_alloc\)(parent, ...)
    ...
    -indio_dev->dev.of_node = parent->of_node;
    //

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

    Lars-Peter Clausen
     
  • These were found by doing some shell magic:
    ------------
    for file in $(git grep -w devm_iio_device_alloc | cut -d: -f1 | sort | uniq) ; do
    if grep 'parent =' $file | grep -v trig | grep -vq devm_; then
    echo "$file -> $(grep "parent =" $file)"
    fi
    done
    -----------

    The output is bearable [after the semantic patch is applied].
    There is a mix of trigger assignments with some iio device parent
    assignments that are removed via this patch.

    JC: A few more added via inspection of all parent =
    statements in drivers/iio. Some of these may just have crossed with this
    series, others were less obvious to scripting due to some cross
    file / module boundary calls.

    Signed-off-by: Alexandru Ardelean
    Signed-off-by: Jonathan Cameron

    Alexandru Ardelean