platform/kernel/linux-starfive.git
4 years agodt-bindings:iio:adc:cosmic,10001-adc yaml conversion
Jonathan Cameron [Wed, 9 Sep 2020 17:59:39 +0000 (18:59 +0100)]
dt-bindings:iio:adc:cosmic,10001-adc yaml conversion

I don't really know much about this one, hence the binding is
a simple conversion of what was in the txt file.

Note that I have taken on maintenance of this binding as I don't
have a recent address for Phani Movva.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200909175946.395313-14-jic23@kernel.org
4 years agodt-bindings:iio:adc:nuvoton,npcm750-adc yaml conversion
Jonathan Cameron [Wed, 9 Sep 2020 17:59:34 +0000 (18:59 +0100)]
dt-bindings:iio:adc:nuvoton,npcm750-adc yaml conversion

Renamed the file to reflect the only compatible.
Added #io-channel-cells to make it easier to support consumers of the
ADC channels this device provides.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Tomer Maimon <tmaimon77@gmail.com>
Link: https://lore.kernel.org/r/20200909175946.395313-9-jic23@kernel.org
4 years agodt-bindings:iio:adc:nuvoton,nau7802 yaml conversion
Jonathan Cameron [Wed, 9 Sep 2020 17:59:33 +0000 (18:59 +0100)]
dt-bindings:iio:adc:nuvoton,nau7802 yaml conversion

A simple conversion from txt file to yaml.  I added the #io-channel-cells
property as optional to allow the channels of this ADCs to be used
to provide services to other drivers, for example if an analog
accelerometer is connected.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20200909175946.395313-8-jic23@kernel.org
4 years agodt-bindings:iio:adc:sprd,sc2720-adc yaml conversion.
Jonathan Cameron [Wed, 9 Sep 2020 17:59:32 +0000 (18:59 +0100)]
dt-bindings:iio:adc:sprd,sc2720-adc yaml conversion.

I changed the name to reflect a specific part in line with normal
naming conventions. If there is a particularly strong reason to
keep the wild cards let me know.

Otherwise this was a fairly simple conversion as part of converting
all the IIO bindings to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Orson Zhai <orsonzhai@gmail.com>
Cc: Baolin Wang <baolin.wang7@gmail.com>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Link: https://lore.kernel.org/r/20200909175946.395313-7-jic23@kernel.org
4 years agodt-bindings:iio:adc:marvell,berlin2-adc yaml conversion
Jonathan Cameron [Wed, 9 Sep 2020 17:59:31 +0000 (18:59 +0100)]
dt-bindings:iio:adc:marvell,berlin2-adc yaml conversion

Part of a general move of IIO bindings over to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Antoine Tenart <antoine.tenart@free-electrons.com>
Link: https://lore.kernel.org/r/20200909175946.395313-6-jic23@kernel.org
4 years agodt-bindings:iio:adc: aspeed,ast2400 yaml conversion
Jonathan Cameron [Wed, 9 Sep 2020 17:59:30 +0000 (18:59 +0100)]
dt-bindings:iio:adc: aspeed,ast2400 yaml conversion

Simple txt to yaml conversion. Part of a general move to convert
all the IIO bindings over to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Joel Stanley <joel@jms.id.au>
Cc: Rick Altherr <raltherr@google.com>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Andrew Jeffery <andrew@aj.id.au>
Link: https://lore.kernel.org/r/20200909175946.395313-5-jic23@kernel.org
4 years agodt-bindings:iio:adc:st,stmpe-adc yaml conversion
Jonathan Cameron [Wed, 9 Sep 2020 17:59:29 +0000 (18:59 +0100)]
dt-bindings:iio:adc:st,stmpe-adc yaml conversion

Conversion from freeform text to yaml.
One oddity in this binding is that, for historical reasons it requires
the node name to be stmpe_adc.  I've put that in the decription field
but I'm not sure if there is a better way to specify this?

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Stefan Agner <stefan@agner.ch>
Link: https://lore.kernel.org/r/20200909175946.395313-4-jic23@kernel.org
4 years agodt-bindings:iio:adc:ti,twl4030-madc yaml conversion
Jonathan Cameron [Wed, 9 Sep 2020 17:59:28 +0000 (18:59 +0100)]
dt-bindings:iio:adc:ti,twl4030-madc yaml conversion

Conversion from txt to yaml as part of a general move of IIO bindings
to the new format.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Sebastian Reichel <sre@kernel.org>
Link: https://lore.kernel.org/r/20200909175946.395313-3-jic23@kernel.org
4 years agodt-bindings:iio:adc:fsl,vf610-adc conversion to yaml.
Jonathan Cameron [Wed, 9 Sep 2020 17:59:27 +0000 (18:59 +0100)]
dt-bindings:iio:adc:fsl,vf610-adc conversion to yaml.

A simple conversion of this freescale ADC binding from txt to yaml.
For maintainer I went with Fugang Duan as the original author of the
binding. Would be great to have confirmation of this.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20200909175946.395313-2-jic23@kernel.org
4 years agoiio: imu: st_lsm6dsx: Scaling factor type set to IIO_VAL_INT_PLUS_NANO
Mario Tesi [Thu, 17 Sep 2020 16:47:16 +0000 (18:47 +0200)]
iio: imu: st_lsm6dsx: Scaling factor type set to IIO_VAL_INT_PLUS_NANO

Scaling factor values for Acc lead to an unacceptable rounding of the
full scale (FS) calculated by some SensorHAL on Android devices. For examples
setting FS to 4g the in_accel_x_scale, in_accel_y_scale and in_accel_z_scale
are 0.001196 on 6 decimal digits and the FS is
0.001196 × ((2^15) − 1) ~= 39.1893 m/s^2.

Android CTS R10 SensorParameterRangeTest test expects a value greater than
39.20 m/s^2 so this test fails (ACCELEROMETER_MAX_RANGE = 4 * 9.80).

Using 9 decimal digits the new scale factor is 0.001196411 and the FS now
is 0.001196411 × ((2^15)−1) ~= 39.2028 m/s^2.

This patch extends to IIO_VAL_INT_PLUS_NANO type the scaling factor to all
IMU devices where SensorParameterRangeTest CTS test fails.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/1600361236-2285-1-git-send-email-martepisa@gmail.com
4 years agoiio: adis. Drop adis_burst struct
Nuno Sá [Thu, 17 Sep 2020 15:52:23 +0000 (17:52 +0200)]
iio: adis. Drop adis_burst struct

As there are no users anymore of this structure, it can be safely
removed.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20200917155223.218500-5-nuno.sa@analog.com
4 years agoiio: adis16475: Drop adis_burst usage
Nuno Sá [Thu, 17 Sep 2020 15:52:22 +0000 (17:52 +0200)]
iio: adis16475: Drop adis_burst usage

Burst mode variables are now part of the `adis_data` struct. The driver
also has now to explicitly define the length of the burst buffer.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20200917155223.218500-4-nuno.sa@analog.com
4 years agoiio: adis16400: Drop adis_burst usage
Nuno Sá [Thu, 17 Sep 2020 15:52:21 +0000 (17:52 +0200)]
iio: adis16400: Drop adis_burst usage

Burst mode variables are now part of the `adis_data` struct. The driver
also has now to explicitly define the length of the burst buffer.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20200917155223.218500-3-nuno.sa@analog.com
4 years agoiio: adis: Move burst mode into adis_data
Nuno Sá [Thu, 17 Sep 2020 15:52:20 +0000 (17:52 +0200)]
iio: adis: Move burst mode into adis_data

Add burst mode variables in the per device specific data structure. As
some drivers support multiple devices with different burst sizes it
makes sense this data to be in `adis_data`. While moving the variables,
there are two main differences:

1. The `en`variable is dropped. If a device supports burst mode, it will
just use it as it will has better performance for almost all real use
cases.
2. Replace `extra_len` by `burst_len`. Users should now explicitly
define the length of the burst buffer as it is typically constant. This
also allows to remove the following line from the library:

```
/* All but the timestamp channel */
burst_length = (indio_dev->num_channels - 1) * sizeof(u16);
```

The library should not assume that a timestamp channel is defined.
Moreover, most parts also include some diagnostic data, crc, etc.. in
the burst buffer that needed to be included in an `extra_len` variable
which is not that nice. On top of this, some devices already start to
have some 32bit size channels ...

This patch is also a move to completely drop the `struct adis_burst`
from the library.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20200917155223.218500-2-nuno.sa@analog.com
4 years agoiio:accel:bma180: Fix use of true when should be iio_shared_by enum
Jonathan Cameron [Sun, 13 Sep 2020 12:12:27 +0000 (13:12 +0100)]
iio:accel:bma180: Fix use of true when should be iio_shared_by enum

Given a value of 1 corresponds to IIO_SHARE_BY_TYPE I have replaced
it with that.  Should cause no functional change.

Fixes: fdadbce0da42 ("iio: add Bosch BMA180 acceleration sensor driver")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Jonathan Bakker <xc-racer2@live.ca>
Link: https://lore.kernel.org/r/20200913121227.764626-1-jic23@kernel.org
4 years agoiio:magn:hmc5843: Fix passing true where iio_shared_by enum required.
Jonathan Cameron [Sun, 13 Sep 2020 11:25:46 +0000 (12:25 +0100)]
iio:magn:hmc5843: Fix passing true where iio_shared_by enum required.

So it's obvious that the code is wrong in passing true, but I'm assuming
that will actually evaluate to 1 and hence IIO_SHARED_BY_TYPE.
The documentation however has this attribute as IIO_SHARED_BY_ALL.
My current assumption is the documentation is wrong.
If anyone knows otherwise please shout out!

Fixes: 7247645f6865 ("iio: hmc5843: Move hmc5843 out of staging")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Tested-by: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/r/20200913112546.715624-1-jic23@kernel.org
4 years agoiio: Add __printf() attributes to various allocation functions
Jonathan Cameron [Sun, 13 Sep 2020 13:21:14 +0000 (14:21 +0100)]
iio: Add __printf() attributes to various allocation functions

A partial set of these was added to IIO a long time back.
This fills in some gaps in coverage highlighted by building
with W=1

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200913132115.800131-3-jic23@kernel.org
4 years agoiio:core: Tidy up kernel-doc.
Jonathan Cameron [Sun, 13 Sep 2020 13:21:15 +0000 (14:21 +0100)]
iio:core: Tidy up kernel-doc.

One comment isn't kernel-doc at all, but starts with /** and another
is simply missing a parameter that was introduced recently.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200913132115.800131-4-jic23@kernel.org
4 years agoiio: dac: ad5592r: localize locks only where needed in ad5592r_read_raw()
Alexandru Ardelean [Mon, 6 Jul 2020 11:02:59 +0000 (14:02 +0300)]
iio: dac: ad5592r: localize locks only where needed in ad5592r_read_raw()

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 <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200706110259.23947-3-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: dac: ad5592r: un-indent code-block for scale read
Alexandru Ardelean [Mon, 6 Jul 2020 11:02:58 +0000 (14:02 +0300)]
iio: dac: ad5592r: un-indent code-block for scale read

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 <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200706110259.23947-2-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio:dac:ad5592r: Fix use of true for IIO_SHARED_BY_TYPE
Jonathan Cameron [Wed, 22 Jul 2020 14:25:15 +0000 (15:25 +0100)]
iio:dac:ad5592r: Fix use of true for IIO_SHARED_BY_TYPE

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 <Jonathan.Cameron@huawei.com>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200722142515.897378-1-jic23@kernel.org
4 years agoiio: chemical: sgp30: Add description for sgp_read_cmd()'s 'duration_us'
Lee Jones [Thu, 16 Jul 2020 13:59:03 +0000 (14:59 +0100)]
iio: chemical: sgp30: Add description for sgp_read_cmd()'s 'duration_us'

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

 drivers/iio/chemical/sgp30.c:236: warning: Function parameter or member 'duration_us' not described in 'sgp_read_cmd'

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: Andreas Brauchli <a.brauchli@elementarea.net>
Cc: Pascal Sachs <pascal.sachs@sensirion.com>
Link: https://lore.kernel.org/r/20200716135928.1456727-6-lee.jones@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: gyro: adis16080: Fix formatting issue
Lee Jones [Thu, 16 Jul 2020 13:59:10 +0000 (14:59 +0100)]
iio: gyro: adis16080: Fix formatting issue

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

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

 drivers/iio/gyro/adis16080.c:49: warning: Function parameter or member 'lock' not described in 'adis16080_state'

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Barry Song <21cnbao@gmail.com>
Link: https://lore.kernel.org/r/20200716135928.1456727-13-lee.jones@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: dummy: iio_dummy_evgen: Demote file header and supply description for 'irq_sim_d...
Lee Jones [Thu, 16 Jul 2020 13:59:13 +0000 (14:59 +0100)]
iio: dummy: iio_dummy_evgen: Demote file header and supply description for 'irq_sim_domain'

File headers are not good candidates for kerneldoc.

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

 drivers/iio/dummy/iio_dummy_evgen.c:30: warning: Cannot understand  * @regs: irq regs we are faking
 on line 30 - I thought it was a doc line
 drivers/iio/dummy/iio_dummy_evgen.c:42: warning: Function parameter or member 'irq_sim_domain' not described in 'iio_dummy_eventgen'

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20200716135928.1456727-16-lee.jones@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: ad7949: Fix misspelling issue
Lee Jones [Thu, 16 Jul 2020 13:59:15 +0000 (14:59 +0100)]
iio: adc: ad7949: Fix misspelling issue

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

 drivers/iio/adc/ad7949.c:58: warning: Function parameter or member 'indio_dev' not described in 'ad7949_adc_chip'

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Charles-Antoine Couret <charles-antoine.couret@essensium.com>
Link: https://lore.kernel.org/r/20200716135928.1456727-18-lee.jones@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: dac: ad5064: Fix a few kerneldoc misdemeanours
Lee Jones [Thu, 16 Jul 2020 13:59:17 +0000 (14:59 +0100)]
iio: dac: ad5064: Fix a few kerneldoc misdemeanours

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 <lee.jones@linaro.org>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200716135928.1456727-20-lee.jones@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: dac: ad7303: Complete 'struct ad7303_state' doc
Lee Jones [Thu, 16 Jul 2020 13:59:28 +0000 (14:59 +0100)]
iio: dac: ad7303: Complete 'struct ad7303_state' doc

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 <lee.jones@linaro.org>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200716135928.1456727-31-lee.jones@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: fsl-imx25-gcq: Replace indio_dev->mlock with own device lock
Sergiu Cuciurean [Wed, 16 Sep 2020 09:29:28 +0000 (12:29 +0300)]
iio: adc: fsl-imx25-gcq: Replace indio_dev->mlock with own device lock

As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock, to protect against any other accesses during the
reading of sample. Reading a sample requires multiple consecutive regmap
operations and a completion callback, so this requires that no other
read occurs until it completes.

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 <sergiu.cuciurean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200916092928.78026-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: proximity: vl53l0x: Add IRQ support
Ivan Drobyshevskyi [Wed, 16 Sep 2020 07:44:58 +0000 (10:44 +0300)]
iio: proximity: vl53l0x: Add IRQ support

VL53L0X can be configured to use interrupt pin (GPIO1)
to notify host about readiness of new measurement.

If interrupt pin is not specified, driver still uses polling.

Signed-off-by: Ivan Drobyshevskyi <drobyshevskyi@gmail.com>
Link: https://lore.kernel.org/r/20200916074458.873359-2-drobyshevskyi@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: proximity: vl53l0x: Add IRQ support
Ivan Drobyshevskyi [Wed, 16 Sep 2020 07:44:57 +0000 (10:44 +0300)]
dt-bindings: iio: proximity: vl53l0x: Add IRQ support

Since IRQ support was added to the driver, update bindings accordingly.

Signed-off-by: Ivan Drobyshevskyi <drobyshevskyi@gmail.com>
Link: https://lore.kernel.org/r/20200916074458.873359-1-drobyshevskyi@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio:health:max30102: Drop of_match_ptr and use generic fw accessors
Jonathan Cameron [Thu, 10 Sep 2020 17:32:42 +0000 (18:32 +0100)]
iio:health:max30102: Drop of_match_ptr and use generic fw accessors

This enables use of the driver with ACPI PRP0001 and also removes
an antipattern that I am trying to clear out of IIO to avoid
it being copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-39-jic23@kernel.org
4 years agoiio:humidity:si7020: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:41 +0000 (18:32 +0100)]
iio:humidity:si7020: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: David Barksdale <dbarksdale@uplogix.com>
Link: https://lore.kernel.org/r/20200910173242.621168-38-jic23@kernel.org
4 years agoiio:humidity:htu21: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:40 +0000 (18:32 +0100)]
iio:humidity:htu21: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Ludovic Tancerel <ludovic.tancerel@maplehightech.com>
Link: https://lore.kernel.org/r/20200910173242.621168-37-jic23@kernel.org
4 years agoiio:magn:ak8974: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:39 +0000 (18:32 +0100)]
iio:magn:ak8974: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20200910173242.621168-36-jic23@kernel.org
4 years agoiio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:38 +0000 (18:32 +0100)]
iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections.

Both would result in only a small size saving.  For simplicity it
is best to remove them.  I also wish to remove both these antipatterns
from IIO.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tested-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Link: https://lore.kernel.org/r/20200910173242.621168-35-jic23@kernel.org
4 years agoiio:proximity:pulsedlight: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:37 +0000 (18:32 +0100)]
iio:proximity:pulsedlight: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-34-jic23@kernel.org
4 years agoiio:proximity:as3935: Drop of_match_ptr and use generic fw accessors
Jonathan Cameron [Thu, 10 Sep 2020 17:32:36 +0000 (18:32 +0100)]
iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors

This change allows the driver to be used with ACPI PRP0001 and removes
an antipattern that I want to avoid being copied into new IIO drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-33-jic23@kernel.org
4 years agoiio:proximity:as3935: Use local struct device pointer to simplify code.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:35 +0000 (18:32 +0100)]
iio:proximity:as3935: Use local struct device pointer to simplify code.

This makes the existing code easier to read and will make the following
patch a little simpler.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-32-jic23@kernel.org
4 years agoiio:humidity:hdc100x: Drop of_match_ptr protection.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:34 +0000 (18:32 +0100)]
iio:humidity:hdc100x: Drop of_match_ptr protection.

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-31-jic23@kernel.org
4 years agoiio:chemical:vz89x: Drop of_match_ptr protection and use generic fw accessors
Jonathan Cameron [Thu, 10 Sep 2020 17:32:33 +0000 (18:32 +0100)]
iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw accessors

This change allow the driver to be used with ACPI PRP0001 and removes
an antipattern that I want to avoid being copied into new IIO drivers.

The handling of match_data uses a different approach as
device_get_match_data() doesn't distinguish between no match, and
a match but with NULL data.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-30-jic23@kernel.org
4 years agoiio:chemical:vz89x: Introduce local struct device pointer.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:32 +0000 (18:32 +0100)]
iio:chemical:vz89x: Introduce local struct device pointer.

Avoids lots of repetition of &client->dev and will make the next
patch tidier.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-29-jic23@kernel.org
4 years agoiio:chemical:sgp30: Drop of_match_ptr and use generic fw accessors
Jonathan Cameron [Thu, 10 Sep 2020 17:32:31 +0000 (18:32 +0100)]
iio:chemical:sgp30: Drop of_match_ptr and use generic fw accessors

This change allow the driver to be used with ACPI PRP0001 and removes
an antipattern that I want to avoid being copied into new IIO drivers.

The handling of match_data uses a different approach as
device_get_match_data doesn't distinguish between no match, and
a match but with NULL data.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Andreas Brauchli <andreas.brauchli@sensirion.com>
Link: https://lore.kernel.org/r/20200910173242.621168-28-jic23@kernel.org
4 years agoiio:chemical:sgp30: Use local variable dev to simplify code
Jonathan Cameron [Thu, 10 Sep 2020 17:32:30 +0000 (18:32 +0100)]
iio:chemical:sgp30: Use local variable dev to simplify code

This cleans up the code at bit, but is primarily here as a precusor
to the next patch. I've only done this for the two functions
which use the dev pointer repeatedly.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Andreas Brauchli <andreas.brauchli@sensirion.com>
Link: https://lore.kernel.org/r/20200910173242.621168-27-jic23@kernel.org
4 years agoiio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw accessors
Jonathan Cameron [Thu, 10 Sep 2020 17:32:29 +0000 (18:32 +0100)]
iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw accessors

of_match_ptr() prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver and use generic fw accessors to check
if there is a fw_node and get the id.

It might be neater to use pointers rather than indexes for
the device_data but that is another issue and should be handled
separately.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-26-jic23@kernel.org
4 years agoiio:chemical:ams-iaq-core: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:28 +0000 (18:32 +0100)]
iio:chemical:ams-iaq-core: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-25-jic23@kernel.org
4 years agoiio:resolver:ad2s1200: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:27 +0000 (18:32 +0100)]
iio:resolver:ad2s1200: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200910173242.621168-24-jic23@kernel.org
4 years agoiio:temperature:tmp007: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:26 +0000 (18:32 +0100)]
iio:temperature:tmp007: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Manivannan Sadhasivam <manivannanece23@gmail.com>
Link: https://lore.kernel.org/r/20200910173242.621168-23-jic23@kernel.org
4 years agoiio:temperature:tsys01: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:25 +0000 (18:32 +0100)]
iio:temperature:tsys01: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Ludovic Tancerel <ludovic.tancerel@maplehightech.com>
Link: https://lore.kernel.org/r/20200910173242.621168-22-jic23@kernel.org
4 years agoiio:pressure:zpa2326: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:24 +0000 (18:32 +0100)]
iio:pressure:zpa2326: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Gregor Boirie <gregor.boirie@parrot.com>
Link: https://lore.kernel.org/r/20200910173242.621168-21-jic23@kernel.org
4 years agoiio:pressure:ms5637: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:23 +0000 (18:32 +0100)]
iio:pressure:ms5637: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Ludovic Tancerel <ludovic.tancerel@maplehightech.com>
Link: https://lore.kernel.org/r/20200910173242.621168-20-jic23@kernel.org
4 years agoiio:pressure:ms5611: Drop of_match_ptr and CONFIG_OF protections
Jonathan Cameron [Thu, 10 Sep 2020 17:32:22 +0000 (18:32 +0100)]
iio:pressure:ms5611: Drop of_match_ptr and CONFIG_OF protections

These prevents 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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Tomasz Duszynski <tduszyns@gmail.com>
Link: https://lore.kernel.org/r/20200910173242.621168-19-jic23@kernel.org
4 years agoiio:pressure:icp10100: Drop of_match_ptr and CONFIG_OF protections
Jonathan Cameron [Thu, 10 Sep 2020 17:32:21 +0000 (18:32 +0100)]
iio:pressure:icp10100: Drop of_match_ptr and CONFIG_OF protections

These prevents 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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Link: https://lore.kernel.org/r/20200910173242.621168-18-jic23@kernel.org
4 years agoiio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw accessors
Jonathan Cameron [Thu, 10 Sep 2020 17:32:20 +0000 (18:32 +0100)]
iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw accessors

This change allows use of this driver with ACPI via PRP0001 and removes
an example of an anti pattern I'm trying to remove from IIO.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20200910173242.621168-17-jic23@kernel.org
4 years agoiio:dac:ti-dac5571: Drop of_match_ptr and CONFIG_OF protections
Jonathan Cameron [Thu, 10 Sep 2020 17:32:19 +0000 (18:32 +0100)]
iio:dac:ti-dac5571: Drop of_match_ptr and CONFIG_OF protections

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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Link: https://lore.kernel.org/r/20200910173242.621168-16-jic23@kernel.org
4 years agoiio:dac:ti-dac082s085: Drop of_match_ptr and CONFIG_OF protections
Jonathan Cameron [Thu, 10 Sep 2020 17:32:18 +0000 (18:32 +0100)]
iio:dac:ti-dac082s085: Drop of_match_ptr and CONFIG_OF protections

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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/20200910173242.621168-15-jic23@kernel.org
4 years agoiio:dac:mcp4725: drop of_match_ptr and use generic fw properties
Jonathan Cameron [Thu, 10 Sep 2020 17:32:17 +0000 (18:32 +0100)]
iio:dac:mcp4725: drop of_match_ptr and use generic fw properties

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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Link: https://lore.kernel.org/r/20200910173242.621168-14-jic23@kernel.org
4 years agoiio:dac:ad7303: Drop of_match_ptr protection
Jonathan Cameron [Thu, 10 Sep 2020 17:32:16 +0000 (18:32 +0100)]
iio:dac:ad7303: Drop of_match_ptr protection

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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20200910173242.621168-13-jic23@kernel.org
4 years agoiio:dac:ad5593r: Drop of_match_ptr and ACPI_PTR protections.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:15 +0000 (18:32 +0100)]
iio:dac:ad5593r: Drop of_match_ptr and ACPI_PTR protections.

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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20200910173242.621168-12-jic23@kernel.org
4 years agoiio:dac:ad5592r: Drop of_match_ptr and ACPI_PTR protections.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:14 +0000 (18:32 +0100)]
iio:dac:ad5592r: Drop of_match_ptr and ACPI_PTR protections.

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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20200910173242.621168-11-jic23@kernel.org
4 years agoiio:dac:ad5446: Drop of_match_ptr and CONFIG_OF protections
Jonathan Cameron [Thu, 10 Sep 2020 17:32:13 +0000 (18:32 +0100)]
iio:dac:ad5446: Drop of_match_ptr and CONFIG_OF protections

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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20200910173242.621168-10-jic23@kernel.org
4 years agoiio:potentiometer:mcp4531: Drop of_match_ptr and CONFIG_OF protections.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:12 +0000 (18:32 +0100)]
iio:potentiometer:mcp4531: Drop of_match_ptr and CONFIG_OF protections.

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.

Also switch to device_get_match_data() from of_ variant and adjust
headers to reflect the change.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200910173242.621168-9-jic23@kernel.org
4 years agoiio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw interfaces.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:11 +0000 (18:32 +0100)]
iio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw interfaces.

This change allows the use of the driver with ACPI via PRP0001
and remove an example of an anti pattern I'm trying to remove from IIO.
Also adjust includes to reflect this change.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Slawomir Stepien <sst@poczta.fm>
Link: https://lore.kernel.org/r/20200910173242.621168-8-jic23@kernel.org
4 years agoiio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF protections.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:10 +0000 (18:32 +0100)]
iio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF protections.

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.
Also use device_get_match_data() rather than devicetree only version.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200910173242.621168-7-jic23@kernel.org
4 years agoiio:potentiometer:max5481: Drop invalid ACPI binding.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:09 +0000 (18:32 +0100)]
iio:potentiometer:max5481: Drop invalid ACPI binding.

Given that an ACPI binding must start with 3 or 4 capitals,
this cannot represent a valid binding.

It seems unlikely anything out there is using it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Maury Anderson <maury.anderson@rockwellcollins.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Cc: Slawomir Stepien <sst@poczta.fm>
Link: https://lore.kernel.org/r/20200910173242.621168-6-jic23@kernel.org
4 years agoiio:potentiometer:max5481: Drop of_match_ptr and CONFIG_OF protections.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:08 +0000 (18:32 +0100)]
iio:potentiometer:max5481: Drop of_match_ptr and CONFIG_OF protections.

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.
Whilst this driver has an ACPI binding, it is not of a form
that is valid under ACPI so will be dropped shortly.

Also switch to device_get_match_data() and switch headers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Maury Anderson <maury.anderson@rockwellcollins.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Cc: Slawomir Stepien <sst@poczta.fm>
Link: https://lore.kernel.org/r/20200910173242.621168-5-jic23@kernel.org
4 years agoiio:potentiometer:max5432: Drop of_match_ptr and use generic fw accessors
Jonathan Cameron [Thu, 10 Sep 2020 17:32:07 +0000 (18:32 +0100)]
iio:potentiometer:max5432: Drop of_match_ptr and use generic fw accessors

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.
Drop them to remove this restriction.

Also switch headers to reflect this change.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20200910173242.621168-4-jic23@kernel.org
4 years agoiio:potentiometer:ds1803: Drop of_match_ptr and CONFIG_OF protections
Jonathan Cameron [Thu, 10 Sep 2020 17:32:06 +0000 (18:32 +0100)]
iio:potentiometer:ds1803: Drop of_match_ptr and CONFIG_OF protections

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.
Drop them to remove this restriction.

Also switch of.h for mod_devicetable.h include given use of
struct of_device_id which is defined in that header.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Slawomir Stepien <sst@poczta.fm>
Link: https://lore.kernel.org/r/20200910173242.621168-3-jic23@kernel.org
4 years agoiio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections.
Jonathan Cameron [Thu, 10 Sep 2020 17:32:05 +0000 (18:32 +0100)]
iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections.

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.
Drop them to remove this restriction.

Also added mod_devicetable.h include given use of struct of_device_id
which is defined in that header.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Phil Reid <preid@eletromag.com.au>
Link: https://lore.kernel.org/r/20200910173242.621168-2-jic23@kernel.org
4 years agoiio:imu:adis16400: Sort out missing kernel doc.
Jonathan Cameron [Sun, 13 Sep 2020 13:21:13 +0000 (14:21 +0100)]
iio:imu:adis16400: Sort out missing kernel doc.

I'd like to be enable W=1 for all IIO builds as it catches real issues as well
as more minor documentation issues such as this (also good to fix though!)

drivers/iio/imu/adis16400.c:183: warning: Function parameter or member 'avail_scan_mask' not described in 'adis16400_state'

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200913132115.800131-2-jic23@kernel.org
4 years agoiio: buffer: split buffer sysfs creation to take buffer as primary arg
Alexandru Ardelean [Thu, 17 Sep 2020 12:59:51 +0000 (15:59 +0300)]
iio: buffer: split buffer sysfs creation to take buffer as primary arg

Currently the iio_buffer_{alloc,free}_sysfs_and_mask() take 'indio_dev' as
primary argument. This change splits the main logic into a private function
that takes an IIO buffer as primary argument.

That way, the functions can be extended to configure the sysfs for multiple
buffers.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200917125951.861-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: meson-saradc: Make the of_device_id array style consistent
Martin Blumenstingl [Tue, 15 Sep 2020 19:26:21 +0000 (21:26 +0200)]
iio: adc: meson-saradc: Make the of_device_id array style consistent

Use only one line for the closing bracket of the last entry and the
opening bracket for the next one to keep the style across the whole
array consistent. Also add a "sentinel" comment to the last entry and
remove the comma to ensure that there won't be any entry after it.
No functional changes.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20200915192621.13202-1-martin.blumenstingl@googlemail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: ad9467: return ENODEV vs EINVAL in ad9467_setup()
Alexandru Ardelean [Wed, 16 Sep 2020 08:22:21 +0000 (11:22 +0300)]
iio: adc: ad9467: return ENODEV vs EINVAL in ad9467_setup()

The proper error code should be ENODEV (vs EINVAL) in case the chip ID
isn't recognized.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200916082221.72851-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: ad9467: refine mismatch vs unknown chip-id messages
Alexandru Ardelean [Wed, 16 Sep 2020 08:31:28 +0000 (11:31 +0300)]
iio: adc: ad9467: refine mismatch vs unknown chip-id messages

We should probably print what the expected chip-ID is. We already have
that information available, based on the device specified via
device-tree.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200916083128.73729-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging:iio:documentation: Drop most generic docs
Jonathan Cameron [Sat, 5 Sep 2020 17:47:21 +0000 (18:47 +0100)]
staging:iio:documentation: Drop most generic docs

These docs are both suffering from being out of date, and from being
superceeded by the documentation in Documentation/driver-api/iio

Note the inkern.txt drop is left for now as this is an area not
well covered by the more recent documentation outside staging.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20200905174721.216452-5-jic23@kernel.org
4 years agostaging:iio:light: drop stale ABI docs
Jonathan Cameron [Sat, 5 Sep 2020 17:47:20 +0000 (18:47 +0100)]
staging:iio:light: drop stale ABI docs

There are no remaining light drivers in staging/iio.
The content of this file are either included in the non staging
ABI docs, or don't seem to be used in any current driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20200905174721.216452-4-jic23@kernel.org
4 years agostaging:iio:light: Move tsl2x7x ABI docs to correct location.
Jonathan Cameron [Sat, 5 Sep 2020 17:47:19 +0000 (18:47 +0100)]
staging:iio:light: Move tsl2x7x ABI docs to correct location.

These seem to be up to date but never moved out of staging when the driver
did. Hence let us move them out now.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Brian Masney <masneyb@onstation.org>
Cc: Brian Masney <masneyb@onstation.org>
Link: https://lore.kernel.org/r/20200905174721.216452-3-jic23@kernel.org
4 years agostaging:iio:dac:max517 remove documentation
Jonathan Cameron [Sat, 5 Sep 2020 17:47:18 +0000 (18:47 +0100)]
staging:iio:dac:max517 remove documentation

Whilst there is some useful info in here, it can be easily
obtained from datasheets. Some of the info should perhaps
be incorporated into a device tree bindings doc.
As this didn't move out of staging with the driver, I'm suggesting
we just drop it.  We don't generally carry per driver documentation
with the exception of non standard ABI which is not the case here.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Roland Stigge <stigge@antcom.de>
Link: https://lore.kernel.org/r/20200905174721.216452-2-jic23@kernel.org
4 years agoiio: adc: palmas_gpadc: use module_platform_driver to simplify the code
Liu Shixin [Mon, 14 Sep 2020 06:54:01 +0000 (14:54 +0800)]
iio: adc: palmas_gpadc: use module_platform_driver to simplify the code

module_platform_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Link: https://lore.kernel.org/r/20200914065401.3726354-1-liushixin2@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adis: Drop non Managed device functions
Nuno Sá [Tue, 15 Sep 2020 12:02:58 +0000 (14:02 +0200)]
iio: adis: Drop non Managed device functions

Drop `adis_setup_buffer_and_trigger()`. All users were updated to use
the devm version of this function. This avoids having almost the same
code repeated.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20200915120258.161587-11-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: iio: adis16240: Use Managed device functions
Nuno Sá [Tue, 15 Sep 2020 12:02:57 +0000 (14:02 +0200)]
staging: iio: adis16240: Use Managed device functions

Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.

Since we are here, drop the `.remove` callback by further using devm
functions.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20200915120258.161587-10-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agostaging: iio: adis16203: Use Managed device functions
Nuno Sá [Tue, 15 Sep 2020 12:02:56 +0000 (14:02 +0200)]
staging: iio: adis16203: Use Managed device functions

Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.

Since we are here, drop the `.remove` callback by further using devm
functions.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20200915120258.161587-9-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adis16480: Use Managed device functions
Nuno Sá [Tue, 15 Sep 2020 12:02:55 +0000 (14:02 +0200)]
iio: adis16480: Use Managed device functions

Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.

Since we are here, drop the `.remove` callback by further using devm
functions.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20200915120258.161587-8-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adis16460: Use Managed device functions
Nuno Sá [Tue, 15 Sep 2020 12:02:54 +0000 (14:02 +0200)]
iio: adis16460: Use Managed device functions

Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.

Since we are here, drop the `.remove` callback by further using devm
functions.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20200915120258.161587-7-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adis16400: Use Managed device functions
Nuno Sá [Tue, 15 Sep 2020 12:02:53 +0000 (14:02 +0200)]
iio: adis16400: Use Managed device functions

Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.

Since we are here, drop the `.remove` callback by further using devm
functions.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20200915120258.161587-6-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adis16260: Use Managed device functions
Nuno Sá [Tue, 15 Sep 2020 12:02:52 +0000 (14:02 +0200)]
iio: adis16260: Use Managed device functions

Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.

Since we are here, drop the `.remove` callback by further using devm
functions.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20200915120258.161587-5-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adis16136: Use Managed device functions
Nuno Sá [Tue, 15 Sep 2020 12:02:51 +0000 (14:02 +0200)]
iio: adis16136: Use Managed device functions

Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.

Since we are here, drop the `.remove` callback by further using devm
functions.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20200915120258.161587-4-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adis16209: Use Managed device functions
Nuno Sá [Tue, 15 Sep 2020 12:02:50 +0000 (14:02 +0200)]
iio: adis16209: Use Managed device functions

Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.

Since we are here, drop the `.remove` callback by further using devm
functions.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20200915120258.161587-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adis16201: Use Managed device functions
Nuno Sá [Tue, 15 Sep 2020 12:02:49 +0000 (14:02 +0200)]
iio: adis16201: Use Managed device functions

Use the adis managed device functions to setup the buffer and the trigger.
The ultimate goal will be to completely drop the non devm version from
the lib.

Since we are here, drop the `.remove` callback by further using devm
functions.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20200915120258.161587-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: adc: exynos-adc: do not require syscon on S5Pv210
Krzysztof Kozlowski [Thu, 10 Sep 2020 16:19:33 +0000 (18:19 +0200)]
dt-bindings: iio: adc: exynos-adc: do not require syscon on S5Pv210

The ADC in S5Pv210 does not have ADC phy registers in separate block for
which syscon would be needed.  Remove this requirement to fix dtbs_check
warnings like:

  arch/arm/boot/dts/s5pv210-fascinate4g.dt.yaml: adc@e1700000: 'samsung,syscon-phandle' is a required property

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huwei.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200910161933.9156-2-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: adc: exynos-adc: require second interrupt with touch screen
Krzysztof Kozlowski [Thu, 10 Sep 2020 16:19:32 +0000 (18:19 +0200)]
dt-bindings: iio: adc: exynos-adc: require second interrupt with touch screen

The ADC in S3C/S5P/Exynos SoCs can be used also for handling touch
screen.  In such case the second interrupt is required.  This second
interrupt can be anyway provided, even without touch screens.  This
fixes dtbs_check warnings like:

  arch/arm/boot/dts/s5pv210-aquila.dt.yaml: adc@e1700000: interrupts: [[23], [24]] is too long

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huwei.com>
Link: https://lore.kernel.org/r/20200910161933.9156-1-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: adc: ti,ads7950 binding conversion
Jonathan Cameron [Sun, 30 Aug 2020 16:11:54 +0000 (17:11 +0100)]
dt-bindings: iio: adc: ti,ads7950 binding conversion

Conversion from txt to yaml.  The binding documents that
as not all boards will make use of the ADC channels via a consumer
driver.  It does no harm however, so we will leave it as required.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: David Lechner <david@lechnology.com>
Cc: David Lechner <david@lechnology.com>
Link: https://lore.kernel.org/r/20200830161154.3201-3-jic23@kernel.org
4 years agodt-bindings: iio: adc: ti,adc12138 yaml conversion.
Jonathan Cameron [Sun, 30 Aug 2020 16:11:53 +0000 (17:11 +0100)]
dt-bindings: iio: adc: ti,adc12138 yaml conversion.

Simple binding conversion from txt to yaml.
Only addition was #io-channel-cells to allow for potential consumers
of the channels on this device.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Link: https://lore.kernel.org/r/20200830161154.3201-2-jic23@kernel.org
4 years agoiio: frequency: adf4350: Replace indio_dev->mlock with own device lock
Sergiu Cuciurean [Wed, 16 Sep 2020 09:27:31 +0000 (12:27 +0300)]
iio: frequency: adf4350: Replace indio_dev->mlock with own device lock

As part of the general cleanup of indio_dev->mlock, this change replaces
it with a local lock.
The lock protect the state of the device from potential concurrent writes.
The device is configured via a sequence of SPI writes, and this lock is
meant to prevent the start of another sequence before another one has
finished.

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 <sergiu.cuciurean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200916092731.77220-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: dac: ti-dac7612: Replace indio_dev->mlock with own device lock
Sergiu Cuciurean [Wed, 16 Sep 2020 09:25:35 +0000 (12:25 +0300)]
iio: dac: ti-dac7612: Replace indio_dev->mlock with own device lock

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 <sergiu.cuciurean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200916092535.76527-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: stm32-dac: Replace indio_dev->mlock with own device lock
Sergiu Cuciurean [Wed, 16 Sep 2020 09:23:49 +0000 (12:23 +0300)]
iio: stm32-dac: Replace indio_dev->mlock with own device lock

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 <sergiu.cuciurean@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Link: https://lore.kernel.org/r/20200916092349.75647-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: gyro: adxrs290: Add debugfs register access support
Nishant Malpani [Thu, 10 Sep 2020 18:04:50 +0000 (23:34 +0530)]
iio: gyro: adxrs290: Add debugfs register access support

Extend support to read/write byte data from/to the device using
debugfs iio interface.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200910180450.29696-4-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agodt-bindings: iio: gyro: adxrs290: Add interrupts support
Nishant Malpani [Thu, 10 Sep 2020 18:04:49 +0000 (23:34 +0530)]
dt-bindings: iio: gyro: adxrs290: Add interrupts support

Include 'interrupts' property and provide a suitable example for using
a GPIO interrupt line.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Link: https://lore.kernel.org/r/20200910180450.29696-3-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: gyro: adxrs290: Add triggered buffer support
Nishant Malpani [Thu, 10 Sep 2020 18:04:48 +0000 (23:34 +0530)]
iio: gyro: adxrs290: Add triggered buffer support

Provide a way for continuous data capture by setting up buffer support. The
data ready signal exposed at the SYNC pin of the ADXRS290 is exploited as
a hardware interrupt which triggers to fill the buffer.

Triggered buffer setup was tested with both hardware trigger (DATA_RDY) and
software triggers (sysfs-trig & hrtimer).

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200910180450.29696-2-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: gyro: adxrs290: use hook for devm resource unwinding
Nishant Malpani [Thu, 10 Sep 2020 12:27:11 +0000 (17:57 +0530)]
iio: gyro: adxrs290: use hook for devm resource unwinding

Make use of devm_add_action_or_reset() hook to switch device into STANDBY
mode during standard resource unwinding. The patch includes a helper
function, in the form of adxrs290_set_mode(), to realise driving the
device into STANDBY mode.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200910122711.16670-1-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
4 years agoiio: adc: stm32: Fix missing return in booster error path
Krzysztof Kozlowski [Thu, 10 Sep 2020 08:52:07 +0000 (10:52 +0200)]
iio: adc: stm32: Fix missing return in booster error path

Conversion of error paths to dev_err_probe() dropped one return
statement.  The driver will continue to probe if getting booster
regulator fails.

Fixes: ce30eeb613cb ("iio: adc: stm32: Simplify with dev_err_probe()")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/1599727927-7776-1-git-send-email-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>