Commit graph

998447 commits

Author SHA1 Message Date
Fabio M. De Francesco
cd2c304266 staging: rtl8723bs: hal: Add spaces around operator in HalBtc8723b1Ant.h
Added spaces around operators in file HalBtc8723b1Ant.h. Issue detected
by checkpatch.pl. Spaces are preferred to improve readibility.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210406164001.13646-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07 10:18:28 +02:00
Fabio M. De Francesco
2dc7daaa33 staging: rtl8723bs: hal: Add spaces around operators in HalBtc8723b2Ant.c
Added spaces around operators in file HalBtc8723b2Ant.c. Issue detected
by checkpatch.pl. Spaces are preferred to improve readibility.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210406170011.20753-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07 10:18:28 +02:00
Fabio M. De Francesco
f26f85858d staging: rtl8723bs: hal: Add spaces around operators in hal_btcoex.c
Added spaces around operators. Issue detected by checkpatch.pl.
Spaces around operators are preferred to improve readibility.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210406181428.15097-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07 10:18:28 +02:00
Beatriz Martins de Carvalho
2466b0b27c staging: rtl8723bs: core: reorganize characters so the lines are under 100 ch
Cleans up warnings of "line over 100 characters" but avoiding
more than 90 characters in file rtw_ap.c

Signed-off-by: Beatriz Martins de Carvalho <martinsdecarvalhobeatriz@gmail.com>
Link: https://lore.kernel.org/r/20210406155815.90271-1-martinsdecarvalhobeatriz@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07 10:17:06 +02:00
Fabio M. De Francesco
7948c501d6 staging: rtl8723bs: hal: Add spaces around operators
Added spaces around operators in file HalBtc8723b1Ant.c. Issue detected
by checkpatch.pl. Spaces are preferred to improve readibility.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210406154635.23191-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07 10:16:54 +02:00
Greg Kroah-Hartman
6470a8206a 2nd set of IIO features, cleanups etc for 5.13
Trying again as a wrong fixes tag managed to beat the checking script
 I was running.
 
 A few of these are fixes for major rework earlier in cycle.
 Bulk of patches are the ad7150 pre graduation cleanup, some link
 fixes in maintainers and set using the new IRQF_NO_AUTOEN flag.
 
 Note includes a merge of a tag from tip to get the IRQF_NO_AUTOEN
 support (one patch only from Barry Song)
 
 Staging graduation
 * adi,ad7150 CDC
   - A lot of precursor patches cleaning it up first.
   - Includes core support for timeout event ABI where after a time
     a adaptive threshold jumps to fix slow tracking problems.
 
 Cleanups and minor / late breaking fixes
 * core
   - Use sysfs_emit() and sysfs_emit_at() as appropriate
   - Fix a bug introduced in this cycle for iio_read_channel_processed_scale()
   - Fix handling of getfd ioctl as IIO_IOCTL_UNHANDLED is a valid ioctl number
   - Tidy up some pointless type conversion in string formatting and odd
     indentation.
 * dac
   - Use sysfs_emit() for powerdown attribute show() functions.
 * docs
   - Fix dead links due to txt to yaml binding conversions.
 * treewide
   - Use IRQF_NO_AUTOEN
 * various
   - Typo fixes in comments.
 * triggers/hr-timer-trigger
   - Fix an overflow handing issue.
 * ad,ad7923
   - Device managed functions in probe()
 * ad,ad9467
   - Fix kconfig dependency issue
 * adi,adis16201
   - Fix a wrong axis assignment that stops the driver loading.
 * invensense,mpu6050
   - Allow use as a standalone trigger (no channels enabled)
   - Drop unnecessary manual assignment of indio_dev->modes
   - Make device function in a basic way if no interrupt wired.
   - Sanity check scale writes.
 * semtech,sx9310
   - Fix access to a variable length array in DT binding.
   - Sanity check input before writing debounce register.
 * st,stm32-dfsdm
   - Drop __func__ from dev_dbg() and pr_debug().
 * yamaha,yas530
   - Include asm/unaligned.h instead of be_byteshift.h
   - Fix an issue with return value on an error path.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAmBtYfIRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FogXCQ//T6eQjWzgM3y3mR2Op0koyTYHBBQSq+/a
 SfgfcKmDJbAqebg/f4RfyU6Q+5l2aRZOsznRDPXHQUtIvocmp8D+LKMLJQpdDcKC
 P0kbge0UXW2zP+l/+cd1qy14+aka+l2lsMV1pdCsJXbBrOpW3rhRkJiK0BRchXLm
 5XyFXcrnBcuH/unLBYTvsUZ4QLHMav1FWN6CMsjmZzOgPU3SzJCPz4qpd1ZugULU
 BvRs8GCQYhA23FVlStr7OTo1N0NHHDt0M8oCwEO2fdg+MXBVOarAtHxZuVq+dfPv
 7EXlE8J/v2g6kXLiMT2dvXIKSOhpUgZI+gaVfX+drZyayfrTi+ik+EVdr/yGHEkv
 1lFab0/svaAeZGjlOuB9qNUoee45Qkpf6ef/jY5DT88Gy5/C5fYCVmPx0f7GP8iy
 N3qCOtA70peAd1W7B9FBZzUaaB3rhNkCqzvTHkZiLOmkz2hG5zXfY7PAdyn0jf72
 9n7PAuiEfV6vH9ZrtLjL4ReodpNzTFqgNsoMf90ff+LDqlZNgtNY/UHc4a8T+k1T
 9F6dMECrEmnL9qYMmn7wF2oFvOkMoFcb7avugl5zeZFjV3gE/udAdwOeHGXCtATV
 LX0ro8HejHOd6WxW7cKDG47TuNyBMvai7TNyGMkZNQWwVHbNdqQFsOi+aYI9Sm92
 JkQSzbogpMA=
 =7i4R
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-5.13b-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

2nd set of IIO features, cleanups etc for 5.13

Trying again as a wrong fixes tag managed to beat the checking script
I was running.

A few of these are fixes for major rework earlier in cycle.
Bulk of patches are the ad7150 pre graduation cleanup, some link
fixes in maintainers and set using the new IRQF_NO_AUTOEN flag.

Note includes a merge of a tag from tip to get the IRQF_NO_AUTOEN
support (one patch only from Barry Song)

Staging graduation
* adi,ad7150 CDC
  - A lot of precursor patches cleaning it up first.
  - Includes core support for timeout event ABI where after a time
    a adaptive threshold jumps to fix slow tracking problems.

Cleanups and minor / late breaking fixes
* core
  - Use sysfs_emit() and sysfs_emit_at() as appropriate
  - Fix a bug introduced in this cycle for iio_read_channel_processed_scale()
  - Fix handling of getfd ioctl as IIO_IOCTL_UNHANDLED is a valid ioctl number
  - Tidy up some pointless type conversion in string formatting and odd
    indentation.
* dac
  - Use sysfs_emit() for powerdown attribute show() functions.
* docs
  - Fix dead links due to txt to yaml binding conversions.
* treewide
  - Use IRQF_NO_AUTOEN
* various
  - Typo fixes in comments.
* triggers/hr-timer-trigger
  - Fix an overflow handing issue.
* ad,ad7923
  - Device managed functions in probe()
* ad,ad9467
  - Fix kconfig dependency issue
* adi,adis16201
  - Fix a wrong axis assignment that stops the driver loading.
* invensense,mpu6050
  - Allow use as a standalone trigger (no channels enabled)
  - Drop unnecessary manual assignment of indio_dev->modes
  - Make device function in a basic way if no interrupt wired.
  - Sanity check scale writes.
* semtech,sx9310
  - Fix access to a variable length array in DT binding.
  - Sanity check input before writing debounce register.
* st,stm32-dfsdm
  - Drop __func__ from dev_dbg() and pr_debug().
* yamaha,yas530
  - Include asm/unaligned.h instead of be_byteshift.h
  - Fix an issue with return value on an error path.

* tag 'iio-for-5.13b-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (76 commits)
  iio: inv_mpu6050: Fully validate gyro and accel scale writes
  iio: sx9310: Fix write_.._debounce()
  iio: sx9310: Fix access to variable DT array
  iio: adc: Kconfig: make AD9467 depend on ADI_AXI_ADC symbol
  iio: magnetometer: yas530: Include right header
  iio: magnetometer: yas530: Fix return value on error path
  iio:cdc:ad7150: Fix use of uninitialized ret
  iio: hrtimer-trigger: Fix potential integer overflow in iio_hrtimer_store_sampling_frequency
  iio:adc: Fix trivial typo
  iio:adc:ad7476: Fix remove handling
  iio:adc:ad_sigma_delta: Use IRQF_NO_AUTOEN rather than request and disable
  iio:imu:adis: Use IRQF_NO_AUTOEN instead of irq request then disable
  iio:chemical:scd30: Use IRQF_NO_AUTOEN to avoid irq request then disable
  iio:adc:sun4i-gpadc: Use new IRQF_NO_AUTOEN flag instead of request then disable
  iio:adc:nau7802: Use IRQF_NO_AUTOEN instead of request then disable
  iio:adc:exynos-adc: Use new IRQF_NO_AUTOEN flag rather than separate irq_disable()
  iio:adc:ad7766: Use new IRQF_NO_AUTOEN to reduce boilerplate
  iio: buffer: use sysfs_attr_init() on allocated attrs
  iio: trigger: Fix strange (ladder-type) indentation
  iio: trigger: Replace explicit casting and wrong specifier with proper one
  ...
2021-04-07 10:08:28 +02:00
Lars-Peter Clausen
e09fe91353 iio: inv_mpu6050: Fully validate gyro and accel scale writes
When setting the gyro or accelerometer scale the inv_mpu6050 driver ignores
the integer part of the value. As a result e.g. all of 0.13309, 1.13309,
12345.13309, ... are accepted as a valid gyro scale and 0.13309 is the
scale that gets set in all those cases.

Make sure to check that the integer part of the scale value is 0 and reject
it otherwise.

Fixes: 09a642b785 ("Invensense MPU6050 Device Driver.")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Link: https://lore.kernel.org/r/20210405114441.24167-1-lars@metafoo.de
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:40 +01:00
Gwendal Grignou
fc948409cc iio: sx9310: Fix write_.._debounce()
Check input to be sure it matches Semtech sx9310 specification and
can fit into debounce register.
Compare argument writen to thresh_.._period with read from same
sysfs attribute:

Before:                   Afer:
write   |  read           write   |  read
-1      |     8           -1 fails: -EINVAL
0       |     8           0       |     0
1       |     0           1       |     0
2..15   |  2^log2(N)      2..15   |  2^log2(N)
16      |     0           >= 16 fails: -EINVAL

Fixes: 1b6872015f ("iio: sx9310: Support setting debounce values")
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Cc: stable@vger.kernel.org
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210331182222.219533-1-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:40 +01:00
Gwendal Grignou
6f0078ae70 iio: sx9310: Fix access to variable DT array
With the current code, we want to read 4 entries from DT array
"semtech,combined-sensors". If there are less, we silently fail as
of_property_read_u32_array() returns -EOVERFLOW.

First count the number of entries and if between 1 and 4, collect the
content of the array.

Fixes: 5b19ca2c78 ("iio: sx9310: Set various settings from DT")
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210326184603.251683-2-gwendal@chromium.org
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:40 +01:00
Alexandru Ardelean
194eafc9c1 iio: adc: Kconfig: make AD9467 depend on ADI_AXI_ADC symbol
Because a dependency on HAS_IOMEM and OF was added for the ADI AXI ADC
driver, this makes the AD9467 driver have some build/dependency issues
when OF is disabled (typically on ACPI archs like x86).

This is because the selection of the AD9467 enforces the ADI_AXI_ADC symbol
which is blocked by the OF (and potentially HAS_IOMEM) being disabled.

To fix this, we make the AD9467 driver depend on the ADI_AXI_ADC symbol.
The AD9467 driver cannot operate on it's own. It requires the ADI AXI ADC
driver to stream data (or some similar IIO interface).

So, the fix here is to make the AD9467 symbol depend on the ADI_AXI_ADC
symbol. At some point this could become it's own subgroup of high-speed
ADCs.

Fixes: be24c65e9f ("iio: adc: adi-axi-adc: add proper Kconfig dependencies")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20210324182746.9337-1-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:40 +01:00
Linus Walleij
bb354aeb36 iio: magnetometer: yas530: Include right header
To get access to the big endian byte order parsing helpers
drivers need to include <asm/unaligned.h> and nothing else.

Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210215153032.47962-1-linus.walleij@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:40 +01:00
Linus Walleij
e64837bf9e iio: magnetometer: yas530: Fix return value on error path
There was a missed return variable assignment in the
default errorpath of the switch statement in yas5xx_probe().
Fix it.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210215153023.47899-1-linus.walleij@linaro.org
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:40 +01:00
Jonathan Cameron
032aec339c iio:cdc:ad7150: Fix use of uninitialized ret
This doesn't appear to generate a warning on all versions of GCC, but
0-day reported it and the report looks valid.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:39 +01:00
Gustavo A. R. Silva
c10f8109f7 iio: hrtimer-trigger: Fix potential integer overflow in iio_hrtimer_store_sampling_frequency
Add suffix ULL to constant 1000 in order to avoid a potential integer
overflow and give the compiler complete information about the proper
arithmetic to use. Notice that this constant is being used in a context
that expects an expression of type unsigned long long, but it's
currently evaluated using 32-bit arithmetic.

Addresses-Coverity-ID: 1503062 ("Unintentional integer overflow")
Fixes: dafcf4ed83 ("iio: hrtimer: Allow sub Hz granularity")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20210329205817.GA188755@embeddedor
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:39 +01:00
Jonathan Cameron
4d84487d96 iio:adc: Fix trivial typo
"an" should be "and".

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20210401150810.227168-1-jic23@kernel.org
2021-04-07 08:36:39 +01:00
Jonathan Cameron
6baee4bd63 iio:adc:ad7476: Fix remove handling
This driver was in an odd half way state between devm based cleanup
and manual cleanup (most of which was missing).
I would guess something went wrong with a rebase or similar.
Anyhow, this basically finishes the job as a precursor to improving
the regulator handling.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Fixes: 4bb2b8f94a ("iio: adc: ad7476: implement devm_add_action_or_reset")
Cc: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210401171759.318140-2-jic23@kernel.org
2021-04-07 08:36:39 +01:00
Jonathan Cameron
eaa17fa7d8 iio:adc:ad_sigma_delta: Use IRQF_NO_AUTOEN rather than request and disable
These devices are not able to mask the signal used as a data ready
interrupt.  As such they previously requested the irq then immediately
disabled it.  Now we can avoid the potential of a spurious interrupt
by avoiding the irq being auto enabled in the first place.

I'm not sure how this code could have been called with the irq already
disabled, so I believe the conditional would always have been true and
have removed it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Alexandru Ardelean <ardeleanalex@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210402184544.488862-8-jic23@kernel.org
2021-04-07 08:36:39 +01:00
Jonathan Cameron
30f6a542b7 iio:imu:adis: Use IRQF_NO_AUTOEN instead of irq request then disable
This is a bit involved as the adis library code already has some
sanity checking of the flags of the requested irq that we need
to ensure is happy to pass through the IRQF_NO_AUTOEN flag untouched.

Using this flag avoids us autoenabling the irq in the adis16460 and
adis16475 drivers which cover parts that don't have any means of
masking the interrupt on the device end.

Note, compile tested only!

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Alexandru Ardelean <ardeleanalex@gmail.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Barry Song <song.bao.hua@hisilicon.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210402184544.488862-7-jic23@kernel.org
2021-04-07 08:36:39 +01:00
Jonathan Cameron
dbb8f20d83 iio:chemical:scd30: Use IRQF_NO_AUTOEN to avoid irq request then disable
This new flag cleanly avoids the need for a dance where we request the
interrupt only to immediately disabling it by ensuring it is not
auto-enabled in the first place.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Tomasz Duszynski <tomasz.duszynski@octakon.com>
Reviewed-by: Barry Song <song.bao.hua@hisilicon.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210402184544.488862-6-jic23@kernel.org
2021-04-07 08:36:39 +01:00
Jonathan Cameron
ff2293ea9c iio:adc:sun4i-gpadc: Use new IRQF_NO_AUTOEN flag instead of request then disable
This new flag ensures a requested irq is not autoenabled, thus removing
the need for the disable_irq() that follows and closing off any chance
of spurious interrupts.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Barry Song <song.bao.hua@hisilicon.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210402184544.488862-5-jic23@kernel.org
2021-04-07 08:36:39 +01:00
Jonathan Cameron
aef3ef1659 iio:adc:nau7802: Use IRQF_NO_AUTOEN instead of request then disable
Whilst a race during interrupt enabling is probably not a problem,
it is better to not enable the interrupt at all.  The new
IRQF_NO_AUTOEN flag allows us to do that.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Barry Song <song.bao.hua@hisilicon.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210402184544.488862-4-jic23@kernel.org
2021-04-07 08:36:39 +01:00
Jonathan Cameron
42004ceb34 iio:adc:exynos-adc: Use new IRQF_NO_AUTOEN flag rather than separate irq_disable()
Disabling an irq before the driver has actually atempted to request it
may work, but is definitely not as clean as just requesting it as
normal but with the auto enable disabled.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Barry Song <song.bao.hua@hisilicon.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210402184544.488862-3-jic23@kernel.org
2021-04-07 08:36:39 +01:00
Jonathan Cameron
0be49bdedc iio:adc:ad7766: Use new IRQF_NO_AUTOEN to reduce boilerplate
As iio_poll_trigger() is safe against spurious interrupts when the
trigger is not enabled, this is not a fix despite looking like
a race.  It is nice to simplify the code however so the interrupt
is never enabled in the first place.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Barry Song <song.bao.hua@hisilicon.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210402184544.488862-2-jic23@kernel.org
2021-04-07 08:36:39 +01:00
Jonathan Cameron
aefaee4ec8 Merge tag 'irq-no-autoen-2021-03-25' into togreg
Tag for the input subsystem to pick up

Picked up for IIO to allow similar changes.
2021-04-07 08:36:39 +01:00
Alexandru Ardelean
ca3e7d524c iio: buffer: use sysfs_attr_init() on allocated attrs
When dynamically allocating sysfs attributes, it's a good idea to call
sysfs_attr_init() on them to initialize lock_class_keys.
This change does that.

The lock_class_keys are set when the CONFIG_DEBUG_LOCK_ALLOC symbol is
enabled. Which is [likely] one reason why I did not see this during
development.

I also am not able to see this even with CONFIG_DEBUG_LOCK_ALLOC enabled,
so this may [likely] be reproduce-able on some system configurations.

This was reported via:
  https://lore.kernel.org/linux-iio/CA+U=DsrsvGgXEF30-vXuXS_k=-mjSjiBwEEzwKb1hJVn1P98OA@mail.gmail.com/T/#u

Fixes: 15097c7a1a ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210402174226.630346-1-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:38 +01:00
Andy Shevchenko
af3bac44b1 iio: trigger: Fix strange (ladder-type) indentation
In some cases indentation looks a bit weird with starting from = sign
and being in a ladder-type style. Unify it across the module.

While at it, add blank line after definition block where it needed,

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210402174911.44408-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:38 +01:00
Andy Shevchenko
ebb9493c07 iio: trigger: Replace explicit casting and wrong specifier with proper one
By unknown reason device name is set with an index casted from int
to unsigned long while at the same time with "%ld" specifier. Both parts
seems wrong to me, thus replace replace explicit casting and wrong specifier
with proper one, i.e. "%d".

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210402174911.44408-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:38 +01:00
Mugilraj Dhavachelvan
bb142d4433 iio: adc: stm32-dfsdm: drop __func__ while using Dynamic debug
Dropped __func__ while using dev_dbg() and pr_debug()
If the function name is desired, it can be configured using
dynamic debug.

Signed-off-by: Mugilraj Dhavachelvan <dmugil2000@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210401154343.41527-1-dmugil2000@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:38 +01:00
Jonathan Cameron
7604c2f9ea iio:adc: Drop false comment about lack of timestamp control
The timestamp control has been a function implemented in the core of
IIO for a long time, so this comment is incorrect and has clearly been
cut and paste into all these drivers.

The remainder of the comment added nothing and was confusing so dropped
that as well.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210401145410.226917-1-jic23@kernel.org
2021-04-07 08:36:38 +01:00
Mauro Carvalho Chehab
8cc110478c dt-bindings:iio:dac: update microchip,mcp4725.yaml reference
Changeset 6ced946a4b ("dt-bindings:iio:dac:microchip,mcp4725 yaml conversion")
renamed: Documentation/devicetree/bindings/iio/dac/mcp4725.txt
to: Documentation/devicetree/bindings/iio/dac/microchip,mcp4725.yaml.

Update its cross-reference accordingly.

Fixes: 6ced946a4b ("dt-bindings:iio:dac:microchip,mcp4725 yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/82fb54974e8a22be15e64343260a6de39a18edda.1617279356.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:38 +01:00
Mauro Carvalho Chehab
a909ba1ae9 MAINTAINERS: update ti,dac7612.yaml reference
Changeset 8b74e06b0f ("dt-bindings:iio:dac:ti,dac7612 yaml conversion")
renamed: Documentation/devicetree/bindings/iio/dac/ti,dac7612.txt
to: Documentation/devicetree/bindings/iio/dac/ti,dac7612.yaml.

Update its cross-reference accordingly.

Fixes: 8b74e06b0f ("dt-bindings:iio:dac:ti,dac7612 yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/04039b6991838f0107a42ccb0d9774cb8873a61a.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:38 +01:00
Mauro Carvalho Chehab
01ec483013 MAINTAINERS: update st,vl53l0x.yaml reference
Changeset b4be8bd1c6 ("dt-bindings:iio:proximity:st,vl53l0x yaml conversion")
renamed: Documentation/devicetree/bindings/iio/proximity/vl53l0x.txt
to: Documentation/devicetree/bindings/iio/proximity/st,vl53l0x.yaml.

Update its cross-reference accordingly.

Fixes: b4be8bd1c6 ("dt-bindings:iio:proximity:st,vl53l0x yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/c315ff7435bb4382b9c729a6242d098befb7796d.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:38 +01:00
Mauro Carvalho Chehab
5f8bef56e1 MAINTAINERS: update st,lsm6dsx.yaml reference
Changeset 7a2cf8e913 ("dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion")
renamed: Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
to: Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml.

Update its cross-reference accordingly.

Fixes: 7a2cf8e913 ("dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/e058dc096c39933eb7647a86c57b3489906c89c3.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:38 +01:00
Mauro Carvalho Chehab
1867eff87a MAINTAINERS: update renesas,rcar-gyroadc.yaml reference
Changeset 8c41245872 ("dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt
to: Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml.

Update its cross-reference accordingly.

Fixes: 8c41245872 ("dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/aa999b76bb0b6c3ca4cb0c1a8679c22c91690429.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:38 +01:00
Mauro Carvalho Chehab
f4bec27fad MAINTAINERS: update pni,rm3100.yaml reference
Changeset f383069be3 ("dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
to: Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.yaml.

Update its cross-reference accordingly.

Fixes: f383069be3 ("dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/d9090dc18907b4c534bf12a47e47a96ed1d3b45a.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:37 +01:00
Mauro Carvalho Chehab
63e6b02cf2 MAINTAINERS: update atmel,sama5d2-adc.yaml reference
Changeset 58ff1b5197 ("dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion")
renamed: Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt
to: Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml.

Update its cross-reference accordingly.

Fixes: 58ff1b5197 ("dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/4574e4b7612f5fd683fddbcd7d7307d5e6d02988.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:37 +01:00
Mauro Carvalho Chehab
40ee0e2a7d MAINTAINERS: update voltage-divider.yaml reference
Changeset 6f633bc91a ("dt-bindings:iio:afe:voltage-divider: txt to yaml conversion")
renamed: Documentation/devicetree/bindings/iio/afe/voltage-divider.txt
to: Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml.

Update its cross-reference accordingly.

Fixes: 6f633bc91a ("dt-bindings:iio:afe:voltage-divider: txt to yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/5006767228ea6392a33e280612599ab5749db021.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:37 +01:00
Mauro Carvalho Chehab
72744d4baf MAINTAINERS: update current-sense-shunt.yaml reference
Changeset ce66e52b6c ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/afe/current-sense-shunt.txt
to: Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml.

Update its cross-reference accordingly.

Fixes: ce66e52b6c ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/49371c37a988ffcae9188cbe4735e6eab920b2e0.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:37 +01:00
Mauro Carvalho Chehab
8aa6681f30 MAINTAINERS: update current-sense-amplifier.yaml reference
Changeset fbac26b9ad ("dt-bindings:iio:afe:current-sense-amplifier: txt to yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.txt
to: Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.yaml.

Update its cross-reference accordingly.

Fixes: fbac26b9ad ("dt-bindings:iio:afe:current-sense-amplifier: txt to yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/d0008b06f8ca65108eb1e7734ec6e3e32ec28172.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:37 +01:00
Mauro Carvalho Chehab
0eb56a608e MAINTAINERS: update envelope-detector.yaml reference
Changeset 66a6dcc20e ("dt-bindings:iio:adc:envelope-detector: txt to yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
to: Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml.

Update its cross-reference accordingly.

Fixes: 66a6dcc20e ("dt-bindings:iio:adc:envelope-detector: txt to yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/d4ccc625ccb89730c03204b7aae98fd94ea97fc2.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:37 +01:00
Mauro Carvalho Chehab
959e9b93cf MAINTAINERS: update dpot-dac.yaml reference
Changeset 06d2ff6fe1 ("dt-bindings:iio:dac:dpot-dac: yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/dac/dpot-dac.txt
to: Documentation/devicetree/bindings/iio/dac/dpot-dac.yaml.

Update its cross-reference accordingly.

Fixes: 06d2ff6fe1 ("dt-bindings:iio:dac:dpot-dac: yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/efda999adce3332dc1b5c20a998f3824c1cc1b0f.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:37 +01:00
Mauro Carvalho Chehab
9122a6c32f MAINTAINERS: update st,hts221.yaml reference
Changeset 9a6ac31382 ("dt-bindings:iio:humidity:st,hts221 yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/humidity/hts221.txt
to: Documentation/devicetree/bindings/iio/humidity/st,hts221.yaml.

Update its cross-reference accordingly.

Fixes: 9a6ac31382 ("dt-bindings:iio:humidity:st,hts221 yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/a83cf29bbd27b26eb22e0046c41efebf488e7e4d.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:37 +01:00
Mauro Carvalho Chehab
9ec8f413d7 MAINTAINERS: update adi,ad5758.yaml reference
Changeset 1e6536ee34 ("dt-bindings:iio:dac:adi,ad5758 yaml conversion")
renamed: Documentation/devicetree/bindings/iio/dac/ad5758.txt
to: Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml.

Update its cross-reference accordingly.

Fixes: 1e6536ee34 ("dt-bindings:iio:dac:adi,ad5758 yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/ca35b929c098163cfda9682ce791572629b763e2.1617279355.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-04-07 08:36:37 +01:00
Jonathan Cameron
646d67b5c5 iio:cdc:ad7150: Move driver out of staging.
This capacitance to digital converter (CDC) driver is compliant with
the IIO ABI.  Note, not all features supported (e.g. window event modes)
but the driver should be in a useful functional state.

The cleanup was done against QEMU emulation of the device rather than
actual hardware.   Whilst this was a bit of an experiment, it made it
easy to confirm that the driver remained in a consistent working state
through the various refactors.  If it worked in the first place, it
should still be working after this cleanup.

Given some IIO drivers require expensive hardware setups, (not particularly
true with this one) the use of QEMU may provide a viable way forward
for providing testing during code changes where previously we'd had
to rely on sharp eyes and crossed fingers.

Note, no explicit MAINTAINERS entry as it will be covered by the
generic catch-alls for ADI and IIO drivers which are sufficient.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20210314181511.531414-25-jic23@kernel.org
2021-04-07 08:36:37 +01:00
Jonathan Cameron
d403719eeb dt-bindings:iio:cdc:adi,ad7150 binding doc
Binding covering the ad7150, ad7151 and ad7156 capacitance to digital
convertors.  The only difference between these is how many channels they
have (1 or 2)

Whilst it is clearly necessary to provide power to the part, we don't
need to know the voltage or anything so if it is always on, there should
be no need to have it specified in the binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: devicetree@vger.kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210314181511.531414-24-jic23@kernel.org
2021-04-07 08:36:37 +01:00
Jonathan Cameron
cbdf6ccaec staging:iio:cdc:ad7150: Add copyright notice given substantial changes.
It seems to me that the changes made to get this ready to move out of
staging are substantial enough to warant a copyright notice addition.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20210314181511.531414-23-jic23@kernel.org
2021-04-07 08:36:37 +01:00
Jonathan Cameron
9b2571b02d iio:Documentation:ABI Add missing elements as used by the adi,ad7150
Main additions are around thresh_adaptive.  This has been supported
by the core of IIO for a long time, but no driver that uses it has
previously graduated from staging, hence we are missing Docs.

Otherwise, just new entries in existing lists.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210314181511.531414-22-jic23@kernel.org
2021-04-07 08:36:37 +01:00
Jonathan Cameron
89f2d5b080 staging:iio:cdc:ad7150: Add of_match_table
Rather than using the fallback path in the i2c subsystem and hoping
for no clashes across vendors, lets put in an explicit table for
matching.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Reviewed-by: Barry Song <song.bao.hua@hisilicon>
Link: https://lore.kernel.org/r/20210314181511.531414-21-jic23@kernel.org
2021-04-07 08:36:37 +01:00
Jonathan Cameron
a9f8afe164 staging:iio:cdc:ad7150: Really basic regulator support.
Given DT docs will include regulators, lets just turn them on and
off with driver probe() and remove().

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20210314181511.531414-20-jic23@kernel.org
2021-04-07 08:36:36 +01:00
Jonathan Cameron
18595e71c5 staging:iio:cdc:ad7150: Add scale and offset to info_mask_shared_by_type
The datasheet provides these two values on the assumption they are applied
to unshift raw value.  Hence shift both the offset and scale by 4
to compensate.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20210314181511.531414-19-jic23@kernel.org
2021-04-07 08:36:36 +01:00