platform/kernel/linux-rpi.git
3 years agodt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:35 +0000 (18:48 +0000)]
dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.

Simple binding format conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Song Qiang <songqiang1304521@gmail.com>
Link: https://lore.kernel.org/r/20201031184854.745828-28-jic23@kernel.org
3 years agodt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:34 +0000 (18:48 +0000)]
dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion

Mostly a straight conversion, but the txt file had an oddity.
It documented a gpios property for what appeared to be in interrupt line.
There are mainline dts that have this as interrupts, so I've converted
it to that.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Neil Brown <neilb@suse.de>
Link: https://lore.kernel.org/r/20201031184854.745828-27-jic23@kernel.org
3 years agodt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:33 +0000 (18:48 +0000)]
dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion.

This describes the bindings for both stand along magnetometers and ones
which form part of a multi chip package.
Given original author hasn't been active remotely recently I've
put myself as maintainer for this one.  I would of course like to
hand this over to someone more appropriate so shout out if this is you!

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-26-jic23@kernel.org
3 years agodt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:32 +0000 (18:48 +0000)]
dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion

Simple conversion.  I have pruned descriptions that did not add much useful
detail.  Note that the mount-matrix description will form part of a generic
IIO binding.  No need to repeat that in every driver that uses it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-25-jic23@kernel.org
3 years agodt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:31 +0000 (18:48 +0000)]
dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion

Dropped a few bits of help text in here that didn't seem to add anything
that wasn't fairly obvious.  Otherwise simple format conversion

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Anson Huang <Anson.Huang@nxp.com>
Link: https://lore.kernel.org/r/20201031184854.745828-24-jic23@kernel.org
3 years agodt-bindings:iio:light:st,vl6180: txt to yaml format conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:30 +0000 (18:48 +0000)]
dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.

I'm not sure anyone would use this part primarily as an ALS,
given the time of flight laser also present, but I'll stick with the
original decision on where to put the binding.

Added interrupts property as the device has a GPIO interrupt even
if the driver is not currently using it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Manivannan Sadhasivam <manivannanece23@gmail.com>
Cc: Manivannan Sadhasivam <manivannanece23@gmail.com>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Link: https://lore.kernel.org/r/20201031184854.745828-23-jic23@kernel.org
3 years agodt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:29 +0000 (18:48 +0000)]
dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion

Only significant change in here was dropping the statement that the
i2c address should be 60.  The datasheet suggests there are variants
available with several different addresses.

Parthiban's email address is bouncing, so I've listed myself as
maintainer for this one until someone else steps up.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-22-jic23@kernel.org
3 years agodt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor
Jonathan Cameron [Sat, 31 Oct 2020 18:48:28 +0000 (18:48 +0000)]
dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor

For the example, node name is uv-sensor because the standard option
of light-sensor seemed a little too generic for this.

This one could have just been moved to trivial-devices.yaml but for now
I have kept it as a separate doc.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Link: https://lore.kernel.org/r/20201031184854.745828-21-jic23@kernel.org
3 years agodt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:27 +0000 (18:48 +0000)]
dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.

I don't have an up to date address for Adriana Reus so I've put myself
as the binding maintainer for this one.  I'm happy to hand over to Adriana
or anyone else who wants take it on!

This has a lot of optional tuning parameters. The docs are modified to try
and put the default values in the description of each one rather than a
forwards reference to the example.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-20-jic23@kernel.org
3 years agodt-bindings:iio:light:ti,opt3001: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:26 +0000 (18:48 +0000)]
dt-bindings:iio:light:ti,opt3001: txt to yaml conversion

Straight forward format conversion of this simple binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Andreas Dannenberg <dannenberg@ti.com>
Link: https://lore.kernel.org/r/20201031184854.745828-19-jic23@kernel.org
3 years agodt-bindings:iio:light:maxim,max44009: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:25 +0000 (18:48 +0000)]
dt-bindings:iio:light:maxim,max44009: txt to yaml conversion.

Straight forward format conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Robert Eshleman <bobbyeshleman@gmail.com>
Link: https://lore.kernel.org/r/20201031184854.745828-18-jic23@kernel.org
3 years agodt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:24 +0000 (18:48 +0000)]
dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.

Simple conversion.
Jacek's email bounced, by Kyungmin's still seems good so just dropped
Jacek from maintainer list.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Link: https://lore.kernel.org/r/20201031184854.745828-17-jic23@kernel.org
3 years agodt-bindings:iio:light:capella,cm36651: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:23 +0000 (18:48 +0000)]
dt-bindings:iio:light:capella,cm36651: txt to yaml conversion.

Straight forward conversion with no changes beyond the node
name in the example

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Beomho Seo <beomho.seo@samsung.com>
Link: https://lore.kernel.org/r/20201031184854.745828-16-jic23@kernel.org
3 years agodt-bindings:iio:light:avago,apds9960: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:22 +0000 (18:48 +0000)]
dt-bindings:iio:light:avago,apds9960: txt to yaml conversion

Very simple binding that we could move into trivial-devices.yaml
with a small loss of documentation.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201031184854.745828-15-jic23@kernel.org
3 years agodt-bindings:iio:light:avago,apds9300: txt to yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:21 +0000 (18:48 +0000)]
dt-bindings:iio:light:avago,apds9300: txt to yaml conversion.

This could have gone in trivial-devices.yaml, but there was a datasheet
link so I've given it a minimal file of it's own.
Very simple binding and so a very simple conversion.

Oleksandr's email address is bouncing so I've put myself as fallback
maintainer until someone else steps forward.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-14-jic23@kernel.org
3 years agodt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:20 +0000 (18:48 +0000)]
dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion

Straight forward conversion, but there are a few generic properties
in here like wakeup-source which should probably have schema in a
more generic location.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-13-jic23@kernel.org
3 years agodt-bindings:iio:imu:adi,adis16480: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:19 +0000 (18:48 +0000)]
dt-bindings:iio:imu:adi,adis16480: txt to yaml conversion

Alexandru is currently listed as maintainer on basis of last person
to touch the binding.

Whilst the driver only uses one interrupt, the hardware can route events
to one and dataready signal to the other so we should allow for either
1 or 2 interrupts.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201031184854.745828-12-jic23@kernel.org
3 years agodt-bindings:iio:health:maxim,max30102: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:18 +0000 (18:48 +0000)]
dt-bindings:iio:health:maxim,max30102: txt to yaml conversion

Straight forward binding.  Title was a bit of a challenge to keep short
as this binding covers sensors for two entirely different purposes.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Cc: Matt Ranostay <mranostay@gmail.com>
Link: https://lore.kernel.org/r/20201031184854.745828-11-jic23@kernel.org
3 years agodt-bindings:iio:health:maxim,max30100: txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:17 +0000 (18:48 +0000)]
dt-bindings:iio:health:maxim,max30100: txt to yaml conversion

Straight forward conversion. As with other bindings I've dropped
any standrd description, but kept the unusual bits, in thisscase
the maxim,led-current-microamp and it's description.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201031184854.745828-10-jic23@kernel.org
3 years agodt-bindings:iio:samsung,sensorhub-rinato: yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:14 +0000 (18:48 +0000)]
dt-bindings:iio:samsung,sensorhub-rinato: yaml conversion

Renamed to be more specific as I would be surprised if this is the only
sensorhub Samsung have ever shipped.
Fixed missing reg property in the example

Karol's email address from original patch is bouncing, so I've
put myself as maintainer until someone else steps up.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-7-jic23@kernel.org
3 years agodt-bindings:iio:impedance-analyzer:adi,ad5933 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:13 +0000 (18:48 +0000)]
dt-bindings:iio:impedance-analyzer:adi,ad5933 yaml conversion.

The example in this one had a completely wrong compatible so I've
fixed that. Otherwise, a fairly simple conversion.

Note the driver itself is still in staging.  Looking back at the
last discussion around this, I think we were just waiting for some
test results on some refactors.  As such the binding should be stable
even if the driver might need a little more love and attention.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Cc: Gabriel Capella <gabriel@capella.pro>
Cc: Alexandru Ardelean <Alexandru.Ardelean@analog.com>
Link: https://lore.kernel.org/r/20201031184854.745828-6-jic23@kernel.org
3 years agodt-bindings:iio:potentiometer:microchip,mcp41010 txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:12 +0000 (18:48 +0000)]
dt-bindings:iio:potentiometer:microchip,mcp41010 txt to yaml conversion

A simple binding that I almost just move to trivial devices.
The small amount of additional documentation and relatively large number
of compatible entries convinced me to suggest we keep this one separately
documented.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Chris Coffey <cmc@babblebit.net>
Link: https://lore.kernel.org/r/20201031184854.745828-5-jic23@kernel.org
3 years agodt-bindings:iio:potentiometer:adi,ad5272 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:10 +0000 (18:48 +0000)]
dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion

Simple direct conversion from txt to yaml as part of a general aim of
converting all IIO bindings to this machine readable format.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Phil Reid <preid@electromag.com.au>
Cc: Phil Reid <preid@electromag.com.au>
Link: https://lore.kernel.org/r/20201031184854.745828-3-jic23@kernel.org
3 years agodt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 18:48:11 +0000 (18:48 +0000)]
dt-bindings:iio:potentiometer:microchip,mcp4131 txt to yaml conversion

This binding is very simple, but I think the very large number of
compatible values make it unsuitable for moving to trivial-devices.yaml.
Main change in the conversion was reordering the compatible list to
numerical order.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Slawomir Stepien <sst@poczta.fm>
Link: https://lore.kernel.org/r/20201031184854.745828-4-jic23@kernel.org
3 years agodt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml.
Jonathan Cameron [Sat, 31 Oct 2020 18:48:09 +0000 (18:48 +0000)]
dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml.

Simple binding with a good description of why the spi-max-frequency is,
in practice not as high as the datasheet implies.  I've set the
maximum as per the value established in the description.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Matheus Tavares <matheus.bernardino@usp.br>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201031184854.745828-2-jic23@kernel.org
3 years agoiio: core: return -EINVAL when no ioctl handler has been run
Alexandru Ardelean [Tue, 17 Nov 2020 09:51:54 +0000 (11:51 +0200)]
iio: core: return -EINVAL when no ioctl handler has been run

It seems that when this was tested the happy case was more tested. A few of
the userspace apps rely on this returning negative error codes in case an
ioctl() is not available.

When running multiple ioctl() handlers or when calling an ioctl() that
doesn't exist, IIO_IOCTL_UNHANDLED is returned. In that case -EINVAL should
be returned.

Fixes: 8dedcc3eee3a ("iio: core: centralize ioctl() calls to the main chardev")
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201117095154.7189-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: core: organize buffer file-ops in the order defined in the struct
Alexandru Ardelean [Tue, 17 Nov 2020 10:37:53 +0000 (12:37 +0200)]
iio: core: organize buffer file-ops in the order defined in the struct

The change is mostly cosmetic. This organizes the order of assignment of
the members of 'iio_buffer_fileops' to be similar to the one as defined in
the 'struct file_operations' type.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201117103753.8450-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: adis16209: remove unneeded spi_set_drvdata()
Alexandru Ardelean [Thu, 19 Nov 2020 14:18:06 +0000 (16:18 +0200)]
iio: accel: adis16209: remove unneeded spi_set_drvdata()

There is no matching spi_get_drvdata() in the driver. This looks like a
left-over from before the driver was converted to device-managed functions.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201119141806.84827-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: adis16201: remove unneeded spi_set_drvdata()
Alexandru Ardelean [Thu, 19 Nov 2020 14:17:29 +0000 (16:17 +0200)]
iio: accel: adis16201: remove unneeded spi_set_drvdata()

There is no matching spi_get_drvdata() in the driver. This looks like a
left-over from before the driver was converted to device-managed functions.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201119141729.84185-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: ad7292: remove unneeded spi_set_drvdata()
Alexandru Ardelean [Thu, 19 Nov 2020 14:27:20 +0000 (16:27 +0200)]
iio: adc: ad7292: remove unneeded spi_set_drvdata()

This seems to have been copied from a driver that calls spi_set_drvdata()
but doesn't call spi_get_drvdata().
Setting a private object on the SPI device's object isn't necessary if it
won't be accessed.
This change removes the spi_set_drvdata() call.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Tested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20201119142720.86326-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: cpcap: Fix fall-through warnings for Clang
Gustavo A. R. Silva [Fri, 20 Nov 2020 18:36:26 +0000 (12:36 -0600)]
iio: adc: cpcap: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a break statement instead of letting the code fall
through to the next case.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://github.com/KSPP/linux/issues/115
Link: https://lore.kernel.org/r/b3c1c3f9c76f2f0e832f956587f227e44af57d3d.1605896060.git.gustavoars@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: buffer: remove iio_buffer_set_attrs() helper
Alexandru Ardelean [Tue, 29 Sep 2020 12:59:49 +0000 (15:59 +0300)]
iio: buffer: remove iio_buffer_set_attrs() helper

The iio_buffer_set_attrs() is no longer used in the drivers, so it can be
removed now.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-10-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: hid-sensors: use iio_triggered_buffer_setup_ext()
Alexandru Ardelean [Tue, 29 Sep 2020 12:59:48 +0000 (15:59 +0300)]
iio: hid-sensors: use iio_triggered_buffer_setup_ext()

This change switches to the new iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-9-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: cros_ec: use devm_iio_triggered_buffer_setup_ext()
Alexandru Ardelean [Tue, 29 Sep 2020 12:59:47 +0000 (15:59 +0300)]
iio: cros_ec: use devm_iio_triggered_buffer_setup_ext()

This change switches to the new devm_iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-8-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91-sama5d2_adc: use devm_iio_triggered_buffer_setup_ext()
Alexandru Ardelean [Tue, 29 Sep 2020 12:59:46 +0000 (15:59 +0300)]
iio: adc: at91-sama5d2_adc: use devm_iio_triggered_buffer_setup_ext()

This change switches to the new devm_iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-7-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: bmc150: use iio_triggered_buffer_setup_ext()
Alexandru Ardelean [Tue, 29 Sep 2020 12:59:45 +0000 (15:59 +0300)]
iio: accel: bmc150: use iio_triggered_buffer_setup_ext()

This change switches to the new iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-6-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: adxl372: use devm_iio_triggered_buffer_setup_ext()
Alexandru Ardelean [Tue, 29 Sep 2020 12:59:44 +0000 (15:59 +0300)]
iio: accel: adxl372: use devm_iio_triggered_buffer_setup_ext()

This change switches to the new devm_iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-5-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: triggered-buffer: add {devm_}iio_triggered_buffer_setup_ext variants
Alexandru Ardelean [Tue, 29 Sep 2020 12:59:43 +0000 (15:59 +0300)]
iio: triggered-buffer: add {devm_}iio_triggered_buffer_setup_ext variants

This change adds a parameter to the {devm_}iio_triggered_buffer_setup()
functions to assign the extra sysfs buffer attributes that are typically
assigned via iio_buffer_set_attrs().

The functions also get renamed to iio_triggered_buffer_setup_ext() &
devm_iio_triggered_buffer_setup_ext().
For backwards compatibility the old {devm_}iio_triggered_buffer_setup()
functions are now macros wrap the new (renamed) functions with NULL for the
buffer attrs.

The aim is to remove iio_buffer_set_attrs(), so in the
iio_triggered_buffer_setup_ext() function the attributes are assigned
directly to 'buffer->attrs'.

When adding multiple IIO buffers per IIO device, it can be pretty
cumbersome to first allocate a set of buffers, then to dig them out of IIO
to assign extra attributes (with iio_buffer_set_attrs()).

Naturally, the best way would be to provide them at allocation time, which
is what this change does.

At this moment, buffers allocated with {devm_}iio_triggered_buffer_setup()
are the only ones in mainline IIO to call iio_buffer_set_attrs().

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-4-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91-sama5d2_adc: merge buffer & trigger init into a function
Alexandru Ardelean [Tue, 29 Sep 2020 12:59:42 +0000 (15:59 +0300)]
iio: adc: at91-sama5d2_adc: merge buffer & trigger init into a function

This change is mostly cosmetic, but it's also a pre-cursor to the
the change for 'iio_buffer_set_attrs()', where the helper gets updated to
better support multiple IIO buffers for 1 IIO device.

The only functional change is that the error message for the trigger alloc
failure is bound to the parent device vs the IIO device object.

Also, the new at91_adc_buffer_and_trigger_init() function was moved after
the definition of the 'at91_adc_fifo_attributes'.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-3-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: buffer: dmaengine: unwrap the use of iio_buffer_set_attrs()
Alexandru Ardelean [Tue, 29 Sep 2020 12:59:41 +0000 (15:59 +0300)]
iio: buffer: dmaengine: unwrap the use of iio_buffer_set_attrs()

The iio_buffer_set_attrs() helper will be removed in this series. So, just
assign the attributes of the DMAEngine buffer logic directly.

This is IIO buffer core context, so there is direct access to the
buffer->attrs object.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-2-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:accel:domintech,dmard06: Move to trivial-devices.yaml
Jonathan Cameron [Sat, 31 Oct 2020 18:29:22 +0000 (18:29 +0000)]
dt-bindings:iio:accel:domintech,dmard06: Move to trivial-devices.yaml

No need to maintain a separate document for such a simple binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031182922.743153-8-jic23@kernel.org
3 years agodt-bindings:iio:magnetometer:memsic,mmc35240: move to trivial-devices.yaml
Jonathan Cameron [Sat, 31 Oct 2020 18:29:21 +0000 (18:29 +0000)]
dt-bindings:iio:magnetometer:memsic,mmc35240: move to trivial-devices.yaml

Extremely simple binding so no need to maintain a separate file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Jandy Gou <qingsong.gou@ck-telecom.com>
Link: https://lore.kernel.org/r/20201031182922.743153-7-jic23@kernel.org
3 years agodt-bindings:iio:light:renesas,isl29501: Move to trivial devices.
Jonathan Cameron [Sat, 31 Oct 2020 18:29:20 +0000 (18:29 +0000)]
dt-bindings:iio:light:renesas,isl29501: Move to trivial devices.

This binding is so simple there is no obvious advantage in maintaining
a separate binding doc file for it. As such, move it to trivial-devices.yaml

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Simon Horman <horms+renesas@verge.net.au>
Link: https://lore.kernel.org/r/20201031182922.743153-6-jic23@kernel.org
3 years agodt-bindings:iio:potentiometer:maxim,max5481 move to trivial devices
Jonathan Cameron [Sat, 31 Oct 2020 18:29:19 +0000 (18:29 +0000)]
dt-bindings:iio:potentiometer:maxim,max5481 move to trivial devices

Simple SPI binding that doesn't need a separate file.
During conversion I looked up the individual part number descriptions
in the datasheet so that we could give slightly more detail in
trivial-device.yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Slawomir Stepien <sst@poczta.fm>
Reviewed-by: Rob Herring <robh@kernel.org>
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/20201031182922.743153-5-jic23@kernel.org
3 years agodt-bindings:iio:potentiometer:maxim,ds1803 move to trivial devices.
Jonathan Cameron [Sat, 31 Oct 2020 18:29:18 +0000 (18:29 +0000)]
dt-bindings:iio:potentiometer:maxim,ds1803 move to trivial devices.

Simple binding where there is no obvious benefit in maintaining a
separate file.  Hence document in trivial-devices.yaml and drop
the txt file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Slawomir Stepien <sst@poczta.fm>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Slawomir Stepien <sst@poczta.fm>
Link: https://lore.kernel.org/r/20201031182922.743153-4-jic23@kernel.org
3 years agodt-bindings:iio:chemical:bosch,bme680: Move to trivial devices
Jonathan Cameron [Sat, 31 Oct 2020 18:29:17 +0000 (18:29 +0000)]
dt-bindings:iio:chemical:bosch,bme680: Move to trivial devices

Very simple binding so no need to maintain a separate file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
Cc: Himanshu Jha <himanshujha199640@gmail.com>
Link: https://lore.kernel.org/r/20201031182922.743153-3-jic23@kernel.org
3 years agodt-bindings:iio:chemical:sensirion,sgp30: Move to trivial-bindings.yaml
Jonathan Cameron [Sat, 31 Oct 2020 18:29:16 +0000 (18:29 +0000)]
dt-bindings:iio:chemical:sensirion,sgp30: Move to trivial-bindings.yaml

The binding for this device and the sgpc3 is very simple so lets
not maintain a seperate document for this one.  Of course we can
always add a document again if the binding becomes more complex in
future.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Andreas Brauchli <andreas.brauchli@sensirion.com>
Link: https://lore.kernel.org/r/20201031182922.743153-2-jic23@kernel.org
3 years agodt-bindings:iio:temperature:ti,tmp07 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:10 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:ti,tmp07 yaml conversion

Simple conversion from txt to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-30-jic23@kernel.org
3 years agodt-bindings:iio:temperature:maxim_thermocouple.txt to maxim,max31855k.yaml
Jonathan Cameron [Sat, 31 Oct 2020 13:41:09 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:maxim_thermocouple.txt to maxim,max31855k.yaml

Given we already have another maxim thermocouple driver that isn't
covered by this binding it seems a better idea to chose to name it
after a specific part.

I added an additional example for the maxim,max6755 to illustrate
the need for spi-cpha for that part.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201031134110.724233-29-jic23@kernel.org
3 years agodt-bindings:iio:temperature:maxim,max31856 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:41:08 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:maxim,max31856 yaml conversion.

Simple txt to yaml conversion of this binding.
Paresh Chaudhary's email is bouncing so for now I've listed
myself as maintainer.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-28-jic23@kernel.org
3 years agodt-bindings:iio:temperature:meas,tsys01 move to trivial-devices.yaml
Jonathan Cameron [Sat, 31 Oct 2020 13:41:07 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:meas,tsys01 move to trivial-devices.yaml

The existing binding description brings little value and the similar
meas,* parts are in trivial-devices.yaml so move this one there
to join them.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20201031134110.724233-27-jic23@kernel.org
3 years agodt-bindings:iio:temperature:melexis,mlx90632 conversion to yaml
Jonathan Cameron [Sat, 31 Oct 2020 13:41:06 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:melexis,mlx90632 conversion to yaml

Technically this could have gone in trivial-devices.yaml, but I have
kept it as a separate binding due to the detailed additional description
from the text file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Crt Mori <cmo@melexis.com>
Cc: Crt Mori <cmo@melexis.com>
Link: https://lore.kernel.org/r/20201031134110.724233-26-jic23@kernel.org
3 years agodt-bindings:iio:temperature:melexis,mlx90614 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:05 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:melexis,mlx90614 yaml conversion

Simple conversion from txt to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Crt Mori <cmo@melexis.com>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Link: https://lore.kernel.org/r/20201031134110.724233-25-jic23@kernel.org
3 years agodt-bindings:iio:dac:adi,ad5758 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:04 +0000 (13:41 +0000)]
dt-bindings:iio:dac:adi,ad5758 yaml conversion

I have put Michael as maintainer on this one. Happy to change it to
someone else though.

One issue in here, is I cannot have an example with a negative
limit on the range.  There are very few such yaml bindings in existence
but the thermal-zones.yaml has the same problem.  If there is
any means of fixing this let me know.  For now I'm sticking to
positive range values in the example.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Link: https://lore.kernel.org/r/20201031134110.724233-24-jic23@kernel.org
3 years agodt-bindings:iio:dac:nxp,lpc1850-dac yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:41:03 +0000 (13:41 +0000)]
dt-bindings:iio:dac:nxp,lpc1850-dac yaml conversion.

Very similar binding to that for the ADC on the same device.
Conversion from txt to yaml format.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://lore.kernel.org/r/20201031134110.724233-23-jic23@kernel.org
3 years agodt-bindings:iio:dac:maxim,max5821 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:02 +0000 (13:41 +0000)]
dt-bindings:iio:dac:maxim,max5821 yaml conversion

Simple txt to yaml conversion for this binding description.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Philippe Reynes <tremyfr@yahoo.fr>
Link: https://lore.kernel.org/r/20201031134110.724233-22-jic23@kernel.org
3 years agodt-bindings:iio:dac:microchip,mcp4725 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:01 +0000 (13:41 +0000)]
dt-bindings:iio:dac:microchip,mcp4725 yaml conversion

I'm not sure vdd-supply absolutely has to be provided if vref-supply
is, but as the previous binding docs stated it was required it seems
reasonable to leave it as such.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Tomas Novotny <tomas@novotny.cz>
Link: https://lore.kernel.org/r/20201031134110.724233-21-jic23@kernel.org
3 years agodt-bindings:iio:dac:fsl,vf610-dac yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:00 +0000 (13:41 +0000)]
dt-bindings:iio:dac:fsl,vf610-dac yaml conversion

Simple binding to convert.  Example expanded a little to include
an example bus.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Sanchayan Maity <maitysanchayan@gmail.com>
Link: https://lore.kernel.org/r/20201031134110.724233-20-jic23@kernel.org
3 years agodt-bindings:iio:dac:maxim,ds4424 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:59 +0000 (13:40 +0000)]
dt-bindings:iio:dac:maxim,ds4424 yaml conversion

Simple conversion of this straight forward binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Ismail H. Kose <ihkose@gmail.com>
Link: https://lore.kernel.org/r/20201031134110.724233-19-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:dac:adi,ad7303 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:58 +0000 (13:40 +0000)]
dt-bindings:iio:dac:adi,ad7303 yaml conversion

Converted to maintain the requirement for Vdd-supply as per original file.
It is possible we could relax this requirement to make it at least one
of Vdd-supply and REF-supply.  We need to establish the scaling of the
output channel and if REF-supply is provided that is used instead of
Vdd-supply, hence I cannot see why a dummy regulator cannot be used for
Vdd-supply if this happens.

For now, let us keep it simple.

Drop adi,use-external-reference from binding example as no such binding
exists.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201031134110.724233-18-jic23@kernel.org
3 years agodt-bindings:iio:dac:ti,dac7612 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:56 +0000 (13:40 +0000)]
dt-bindings:iio:dac:ti,dac7612 yaml conversion

Simple conversion from txt to yaml.  No significant adjustments.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Link: https://lore.kernel.org/r/20201031134110.724233-16-jic23@kernel.org
3 years agodt-bindings:iio:dac:ti,dac7512 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:55 +0000 (13:40 +0000)]
dt-bindings:iio:dac:ti,dac7512 yaml conversion

This one is a bit interesting because the binding was moved from
misc a while back, but the linux support for this device is
provided via the ad5446 DAC driver which doesn't currently
have a binding.

For now, lets just convert this file over, but we may want to
think about consolidating this with proper documentation of
the bindings for the other parts supported by the ad5446 driver.

As Daniel Mack does not seem to have been active since 2015,
I've put myself as maintainer of this binding for now.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-15-jic23@kernel.org
3 years agodt-bindings:iio:dac:ti,dac7311 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:54 +0000 (13:40 +0000)]
dt-bindings:iio:dac:ti,dac7311 yaml conversion

Very simple conversion of this binding from txt to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Charles-Antoine Couret <charles-antoine.couret@essensium.com>
Link: https://lore.kernel.org/r/20201031134110.724233-14-jic23@kernel.org
3 years agodt-bindings:iio:dac:ti,dac5571 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:40:53 +0000 (13:40 +0000)]
dt-bindings:iio:dac:ti,dac5571 yaml conversion.

A few tweaks in this conversion.
* The example didn't have the I2C address of 4C in the node name so
  fixed that.
* The reference voltage in the txt file is an optional binding, but
  the driver is making use of it to provide the scaling of the output
  channels.  As such I have made it required going forwards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Sean Nyekjaer <sean@geanix.com>
Link: https://lore.kernel.org/r/20201031134110.724233-13-jic23@kernel.org
3 years agodt-bindings:iio:proximity:ams,as3935 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:52 +0000 (13:40 +0000)]
dt-bindings:iio:proximity:ams,as3935 yaml conversion

A straight forward conversion of this binding. I have added
a maximum SPI frequency from the datasheet.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201031134110.724233-12-jic23@kernel.org
3 years agodt-bindings:iio:proximity:st,vl53l0x yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:51 +0000 (13:40 +0000)]
dt-bindings:iio:proximity:st,vl53l0x yaml conversion

Straight forward conversion from txt to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Song Qiang <songqiang1304521@gmail.com>
Link: https://lore.kernel.org/r/20201031134110.724233-11-jic23@kernel.org
3 years agodt-bindings:iio:proximity:semtech,sx9500 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:40:50 +0000 (13:40 +0000)]
dt-bindings:iio:proximity:semtech,sx9500 yaml conversion.

Simple conversion.  There hasn't been much activity around this driver
for a long time and I don't think I have any up to date contact details
for the original authors.  As such, I've listed myself as the binding
maintainer.  More than happy to hand it off to someone more relevant though!

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-10-jic23@kernel.org
3 years agodt-bindings:iio:pressure:hoperf,hp03 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:49 +0000 (13:40 +0000)]
dt-bindings:iio:pressure:hoperf,hp03 yaml conversion

One quirk in the txt file was that the xclr gpio was specified as
xclr-gpio rather than xclr-gpios. I've fixed that in the
yaml version.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20201031134110.724233-9-jic23@kernel.org
3 years agodt-bindings:iio:pressure:meas,ms5611 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:40:48 +0000 (13:40 +0000)]
dt-bindings:iio:pressure:meas,ms5611 yaml conversion.

One addition here was to put in a 20MHz maximum for the SPI bus
as specified in the datasheets of both support parts.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Tomasz Duszynski <tduszyns@gmail.com>
Link: https://lore.kernel.org/r/20201031134110.724233-8-jic23@kernel.org
3 years agodt-bindings:iio:pressure:murata,zpa2326 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:47 +0000 (13:40 +0000)]
dt-bindings:iio:pressure:murata,zpa2326 yaml conversion

Simple conversion with a few minor tweaks:
* I added 1MHz max for spi-max-frequency
* I have give myself as the maintainer.  This driver was written by
  Gregor Boirie but I don't have an up to date email address for Gregor.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-7-jic23@kernel.org
3 years agodt-bindings:iio:pressure:ms5637 Drop separate doc + add to trivial-devices
Jonathan Cameron [Sat, 31 Oct 2020 13:40:46 +0000 (13:40 +0000)]
dt-bindings:iio:pressure:ms5637 Drop separate doc + add to trivial-devices

Very simple binding for this i2c device with no properties beyond
reg and compatible.  Hence doesn't need it's own document.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-6-jic23@kernel.org
3 years agodt-bindings:iio:humidity:dht11 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:45 +0000 (13:40 +0000)]
dt-bindings:iio:humidity:dht11 yaml conversion

The conversion is straight forward, but leaves an open question.
The compatible for this device has never had a vendor.

Harald Geyer has identified as probably being made by aosong,
but we have no current match to any of their more specific part
numbers.  As such, this is noted in the file but the
compatible doesn't include the vendor prefix.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-By: Harald Geyer <harald@ccbib.org>
Link: https://lore.kernel.org/r/20201031134110.724233-5-jic23@kernel.org
3 years agodt-bindings:iio:humidity:st,hts221 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:40:44 +0000 (13:40 +0000)]
dt-bindings:iio:humidity:st,hts221 yaml conversion.

Straight forward conversion of this temperature and pressure sensor binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-4-jic23@kernel.org
3 years agodt-bindings:iio:humidity:htu21 Drop separate doc + add to trivial-devices
Jonathan Cameron [Sat, 31 Oct 2020 13:40:43 +0000 (13:40 +0000)]
dt-bindings:iio:humidity:htu21 Drop separate doc + add to trivial-devices

Very simple binding for this i2c device with no properties beyond
reg and compatible.  Hence doesn't need it's own document.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-3-jic23@kernel.org
3 years agodt-bindings:iio:humidity:hdc100x Drop separate doc + add to trivial-devices
Jonathan Cameron [Sat, 31 Oct 2020 13:40:42 +0000 (13:40 +0000)]
dt-bindings:iio:humidity:hdc100x Drop separate doc + add to trivial-devices

Very simple binding for this i2c device with no properties beyond
reg and compatible.  Hence doesn't need it's own document.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201031134110.724233-2-jic23@kernel.org
3 years agoiio: adc: ad7887: convert probe to device-managed functions
Alexandru Ardelean [Fri, 13 Nov 2020 09:16:48 +0000 (11:16 +0200)]
iio: adc: ad7887: convert probe to device-managed functions

This is conversion of the driver to use device-managed functions.
The IIO registration and triggered buffer setup both have device-managed
versions.
The regulator disable needs to be handled via an action_or_reset handler.

With these changes, the remove hook is removed, and the error path is
cleaned up in probe.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201113091648.148589-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: stm32-adc: adapt clock duty cycle for proper operation
Fabrice Gasnier [Fri, 6 Nov 2020 16:57:26 +0000 (17:57 +0100)]
iio: adc: stm32-adc: adapt clock duty cycle for proper operation

For proper operation, STM32 ADC should be used with a clock duty cycle
of 50%, in the range of 49% to 51%. Depending on the clock tree, divider
can be used in case clock duty cycle is out of this range.
In case clk_get_scaled_duty_cycle() returns an error, kindly apply a
divider by default (don't make the probe fail).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Link: https://lore.kernel.org/r/1604681846-31234-1-git-send-email-fabrice.gasnier@st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: core: centralize ioctl() calls to the main chardev
Alexandru Ardelean [Thu, 24 Sep 2020 08:41:55 +0000 (11:41 +0300)]
iio: core: centralize ioctl() calls to the main chardev

The aim of this is to improve a bit the organization of ioctl() calls in
IIO core. Currently the chardev is split across IIO core sub-modules/files.
The main chardev has to be able to handle ioctl() calls, and if we need to
add buffer ioctl() calls, this would complicate things.

The 'industrialio-core.c' file will provide a 'iio_device_ioctl()' which
will iterate over a list of ioctls registered with the IIO device. These
can be event ioctl() or buffer ioctl() calls, or something else.

Each ioctl() handler will have to return a IIO_IOCTL_UNHANDLED code (which
is positive 1), if the ioctl() did not handle the call in any. This
eliminates any potential ambiguities about negative error codes, which
should fail the call altogether.

If any ioctl() returns 0, it was considered that it was serviced
successfully and the loop will exit.

This change also moves the handling of the IIO_GET_EVENT_FD_IOCTL command
inside 'industrialio-event.c', where this is better suited.

This patch is a combination of 2 other patches from an older series:
Patch 1: iio: core: add simple centralized mechanism for ioctl() handlers
Link: https://lore.kernel.org/linux-iio/20200427131100.50845-6-alexandru.ardelean@analog.com/
Patch 2: iio: core: use new common ioctl() mechanism
Link: https://lore.kernel.org/linux-iio/20200427131100.50845-7-alexandru.ardelean@analog.com/
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200924084155.99406-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: mt6360: Add ADC driver for MT6360
Gene Chen [Tue, 20 Oct 2020 08:07:47 +0000 (16:07 +0800)]
iio: adc: mt6360: Add ADC driver for MT6360

Add MT6360 ADC driver including Charger Current, Voltage, and
Temperature.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Link: https://lore.kernel.org/r/1603181267-15610-4-git-send-email-gene.chen.richtek@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoDocumentation: ABI: testing: mt6360: Add ADC sysfs guideline
Gene Chen [Tue, 20 Oct 2020 08:07:46 +0000 (16:07 +0800)]
Documentation: ABI: testing: mt6360: Add ADC sysfs guideline

Add ABI documentation for mt6360 ADC sysfs interfaces.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Link: https://lore.kernel.org/r/1603181267-15610-3-git-send-email-gene.chen.richtek@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: add bindings doc for MT6360 ADC
Gene Chen [Tue, 20 Oct 2020 08:07:45 +0000 (16:07 +0800)]
dt-bindings: iio: adc: add bindings doc for MT6360 ADC

This change adds the binding doc for the MT6360 ADC.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1603181267-15610-2-git-send-email-gene.chen.richtek@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: stm32-adc: dma transfers cleanup
Olivier Moysan [Thu, 5 Nov 2020 14:29:41 +0000 (15:29 +0100)]
iio: adc: stm32-adc: dma transfers cleanup

- Remove processing related to DMA in irq handler as this
data transfer is managed directly in DMA callback.
- Update comment in stm32_adc_set_watermark() function.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Link: https://lore.kernel.org/r/20201105142941.27301-1-olivier.moysan@st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:adc:adc.txt: Add documentation for channel label attribute
Cristian Pop [Mon, 28 Sep 2020 09:09:59 +0000 (12:09 +0300)]
dt-bindings:iio:adc:adc.txt: Add documentation for channel label attribute

Optional attribute for better identification of the channels.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200928090959.88842-5-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:adc:adi,ad7768-1: Add documentation for channel label
Cristian Pop [Mon, 28 Sep 2020 09:09:58 +0000 (12:09 +0300)]
dt-bindings:iio:adc:adi,ad7768-1: Add documentation for channel label

Optional attribute for better identification of the channels.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200928090959.88842-4-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: ad7768-1: Add channel labels.
Cristian Pop [Mon, 28 Sep 2020 09:09:57 +0000 (12:09 +0300)]
iio: adc: ad7768-1: Add channel labels.

For better identification of the channels.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
Link: https://lore.kernel.org/r/20200928090959.88842-3-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:Documentation: Add documentation for label channel attribute
Cristian Pop [Mon, 28 Sep 2020 09:09:56 +0000 (12:09 +0300)]
iio:Documentation: Add documentation for label channel attribute

If a label is defined for this channel add that to the channel specific
attributes. This is useful for userspace to be able to identify an
individual channel.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
Link: https://lore.kernel.org/r/20200928090959.88842-2-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: core: Add optional symbolic label to a device channel
Cristian Pop [Mon, 28 Sep 2020 09:09:55 +0000 (12:09 +0300)]
iio: core: Add optional symbolic label to a device channel

If a label is defined in the device tree for this channel add that
to the channel specific attributes. This is useful for userspace to
be able to identify an individual channel.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
Link: https://lore.kernel.org/r/20200928090959.88842-1-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoMAINTAINERS: Fix 'W:' prefix in Invensense IMU entry
Jonathan Neuschäfer [Sun, 8 Nov 2020 01:37:38 +0000 (02:37 +0100)]
MAINTAINERS: Fix 'W:' prefix in Invensense IMU entry

The colon is missing, which can confuse scripts/parse-maintainers.pl.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Link: https://lore.kernel.org/r/20201108013738.1410528-1-j.neuschaefer@gmx.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: remove unneeded break
Tom Rix [Mon, 19 Oct 2020 17:28:24 +0000 (10:28 -0700)]
iio: remove unneeded break

A break is not needed if it is preceded by a return

Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20201019172824.32166-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:light:tsl2563 use generic fw accessors
Vaishnav M A [Sun, 18 Oct 2020 20:35:52 +0000 (02:05 +0530)]
iio:light:tsl2563 use generic fw accessors

Replace of_property_read_u32() with device_property_read_u32(),
when reading the amstaos,cover-comp-gain.This opens up the
possibility of passing the properties during platform instantiation
of the device by a suitable populated struct property_entry.
Additionally, a minor change in logic is added to remove the
of_node present check.

Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
Link: https://lore.kernel.org/r/20201018203552.GA816421@ubuntu
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: vcnl4035 add i2c_device_id
Vaishnav M A [Sun, 18 Oct 2020 19:53:57 +0000 (01:23 +0530)]
iio: light: vcnl4035 add i2c_device_id

Add i2c_device_id table for the vcnl4035 driver,
enabling device instantiation using i2c_new_client_device()
or from userspace in cases where device-tree based description
is not possible now, like device(s) on a gbphy i2c adapter
created by greybus.

Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
Link: https://lore.kernel.org/r/20201018195357.GA814864@ubuntu
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: proximity: vl53l0x-i2c add i2c_device_id
Vaishnav M A [Sun, 18 Oct 2020 19:51:02 +0000 (01:21 +0530)]
iio: proximity: vl53l0x-i2c add i2c_device_id

Add i2c_device_id table for the vl53l0x-i2c driver,
helps in device instantiation using i2c_new_client_device()
or from userspace in cases where device-tree based description
is not possible now, like device(s) on a gbphy i2c adapter
created by greybus.

Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
Link: https://lore.kernel.org/r/20201018195102.GA814713@ubuntu
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: magnetometer: bmc150: remove unneeded semicolon
Tom Rix [Sat, 31 Oct 2020 13:43:19 +0000 (06:43 -0700)]
iio: magnetometer: bmc150: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20201031134319.2134314-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: pressure: bmp280: remove unneeded semicolon
Tom Rix [Sat, 31 Oct 2020 13:45:06 +0000 (06:45 -0700)]
iio: pressure: bmp280: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20201031134506.2134698-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: fix a kernel-doc markup
Mauro Carvalho Chehab [Fri, 23 Oct 2020 16:33:32 +0000 (18:33 +0200)]
iio: fix a kernel-doc markup

A function has a different name between their prototype
and its kernel-doc markup.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/46622c3bdcffb76e79719f0fe5011c2952960b32.1603469755.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91-sama5d2_adc: remove unneeded semicolon
Tom Rix [Tue, 27 Oct 2020 20:08:53 +0000 (13:08 -0700)]
iio: adc: at91-sama5d2_adc: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20201027200853.1596699-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio/adc: ingenic: remove unneeded semicolon
Tom Rix [Tue, 27 Oct 2020 20:11:28 +0000 (13:11 -0700)]
iio/adc: ingenic: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20201027201128.1597230-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: apds9960: remove unneeded semicolon
Tom Rix [Tue, 27 Oct 2020 20:14:36 +0000 (13:14 -0700)]
iio: light: apds9960: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201027201436.1597726-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: ti,adc084s021 yaml conversion
Jonathan Cameron [Sun, 9 Aug 2020 11:17:47 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,adc084s021 yaml conversion

Simple conversion.

Added the #io-channel-cells optional property to allow for consumer
bindings if appropriate on a given board.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Mårten Lindahl <martenli@axis.com>
Link: https://lore.kernel.org/r/20200809111753.156236-8-jic23@kernel.org
3 years agodt-bindings: fxas21002c: convert bindings to yaml
Rui Miguel Silva [Wed, 14 Oct 2020 10:49:26 +0000 (11:49 +0100)]
dt-bindings: fxas21002c: convert bindings to yaml

Convert fxas21002c gyroscope sensor bindings documentation to
yaml schema, remove the textual bindings document and update MAINTAINERS entry.

Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201014104926.688666-1-rmfrfs@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>