platform/kernel/linux-rpi.git
3 years agoiio: accel: kxcjk-1013: Add support for KX023-1025
Stephan Gerhold [Tue, 11 May 2021 14:24:02 +0000 (16:24 +0200)]
iio: accel: kxcjk-1013: Add support for KX023-1025

The KX023-1025 accelerometer [1] seems to be some mixture of
KXCJK and KXTF9. It has the motion interrupt functionality from KXCJK
but also the tap detection from KXTF9, and a lot more functionality.

The configuration register map seems fairly different at first,
but actually all register bits used by the kxcjk-1013 driver are
available at the same bit positions on KX023-1025. It's just quite
misleading because:

  1. The registers have entirely different names and are at different
     addresses, but the bits are mostly named the same (and mean the same).
  2. There are many more registers and bits used that are reserved on KXCJK
     to enable additional functionality.

Ignoring all additionally available functionality for now, the KX023
works just fine after setting up the struct with the correct register
addresses. The only difference that needs to be handled additionally
is that the KX023 supports two configurable interrupt lines (INT1/2).

For now only INT1 is supported so we route all interrupts used by
the driver there.

[1]: https://kionixfs.azureedge.net/en/datasheet/KX023-1025%20Specifications%20Rev%2012.0.pdf

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: kxcjk-1013: Refactor configuration registers into struct
Stephan Gerhold [Tue, 11 May 2021 14:24:01 +0000 (16:24 +0200)]
iio: accel: kxcjk-1013: Refactor configuration registers into struct

Most Kionix accelerometers seem to use fairly consistent register bits,
but the register addresses are not necessarily the same. This is already
partially the case for the KXTF9 (added in commit 1540d0106bcb
("iio: accel: kxcjk1013: add support for KXTF9")), which has some
registers at different addresses.

However, it's even much worse for the KX023-1025. All register bits
used by the kxcjk-1013 driver seem to be fully compatible with KX023,
but it has most registers at totally different addresses.

In preparation to add support for KX023-1025, move the fixed register
addresses into a struct so we can change them for KX023 more easily.

Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: kionix,kxcjk1013: Document kionix,kx023-1025
Stephan Gerhold [Tue, 11 May 2021 14:24:00 +0000 (16:24 +0200)]
dt-bindings: iio: kionix,kxcjk1013: Document kionix,kx023-1025

The KX023-1025 accelerometer uses similar register bits as kxcjk1023,
so it can make use of the same driver. Document the new kionix,kx023-1025
compatible that is also supported by the kxcjk-1013 driver now.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: Add missing MODULE_DEVICE_TABLE
Chunyan Zhang [Wed, 12 May 2021 09:38:44 +0000 (17:38 +0800)]
iio: adc: Add missing MODULE_DEVICE_TABLE

MODULE_DEVICE_TABLE is used to extract the device information out of the
driver and builds a table when being compiled. If using this macro,
kernel can find the driver if available when the device is plugged in,
and then loads that driver and initializes the device.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: afe: current-sense-shunt: add io-channel-cells
Krzysztof Kozlowski [Thu, 6 May 2021 15:06:37 +0000 (11:06 -0400)]
dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells

The current-sense-shunt is an IIO provider thus can be referenced by IIO
consumers (via "io-channels" property in consumer device node).
Such provider is required to describe number of cells used in phandle
lookup with "io-channel-cells" property.  This also fixes dtbs_check
warnings like:

  arch/arm/boot/dts/s5pv210-fascinate4g.dt.yaml: current-sense-shunt:
    '#io-channel-cells' does not match any of the regexes: 'pinctrl-[0-9]+'

Fixes: ce66e52b6c16 ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: ep93xx: Remove redundant error printing in ep93xx_adc_probe()
Zhen Lei [Tue, 11 May 2021 11:39:12 +0000 (19:39 +0800)]
iio: ep93xx: Remove redundant error printing in ep93xx_adc_probe()

When devm_ioremap_resource() fails, a clear enough error message will be
printed by its subfunction __devm_ioremap_resource(). The error
information contains the device name, failure cause, and possibly resource
information.

Therefore, remove the error printing here to simplify code and reduce the
binary size.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: fxls8962af: fix errata bug E3 - I2C burst reads
Sean Nyekjaer [Thu, 6 May 2021 07:09:40 +0000 (09:09 +0200)]
iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads

When flushing the hw fifo there is a bug in the I2C that prevents burst
reads of more than one sample pair.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: fxls8962af: add hw buffered sampling
Sean Nyekjaer [Thu, 6 May 2021 07:09:39 +0000 (09:09 +0200)]
iio: accel: fxls8962af: add hw buffered sampling

When buffered sampling is enabled, the accelerometer will dump data into
the internal fifo and interrupt at watermark. Then the driver flushes
all data to the iio buffer.
As the accelerometer doesn't have internal timestamps, they are
approximated between the current and last interrupt.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: fxls8962af: add interrupt support
Sean Nyekjaer [Thu, 6 May 2021 07:09:38 +0000 (09:09 +0200)]
iio: accel: fxls8962af: add interrupt support

Preparation commit for the next that adds hw buffered sampling.
Adds the interrupt function and reads the devicetree for which
interrupt pin that is used.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: fxls8962af: add set/get of samplerate
Sean Nyekjaer [Thu, 6 May 2021 07:09:37 +0000 (09:09 +0200)]
iio: accel: fxls8962af: add set/get of samplerate

This adds support for setting de accelerometers output data rate.
Primarily used for hardware buffered reads.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: accel: fxls8962af: add bindings
Sean Nyekjaer [Thu, 6 May 2021 07:09:36 +0000 (09:09 +0200)]
dt-bindings: iio: accel: fxls8962af: add bindings

Add devicetree binding for the NXP FXLS8962AF/FXLS8964AF
accelerometer sensor.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers
Sean Nyekjaer [Thu, 6 May 2021 07:09:35 +0000 (09:09 +0200)]
iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers

Add basic support for NXP FXLS8962AF/FXLS8964AF Automotive
accelerometers.
It will allow setting up scale/gain and reading x,y,z
axis.

Datasheet: https://www.nxp.com/docs/en/data-sheet/FXLS8962AF.pdf
Datasheet: https://www.nxp.com/docs/en/data-sheet/FXLS8964AF.pdf
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: imu: st_lsm6dsx: correct ODR in header
Sean Nyekjaer [Fri, 7 May 2021 10:31:49 +0000 (12:31 +0200)]
iio: imu: st_lsm6dsx: correct ODR in header

Fix wrongly stated 13 Hz ODR for accelerometers, the correct ODR is 12.5 Hz

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: bme680_i2c: Remove acpi_device_id table
Guenter Roeck [Thu, 6 May 2021 03:43:32 +0000 (20:43 -0700)]
iio: bme680_i2c: Remove acpi_device_id table

With CONFIG_ACPI=n and -Werror, 0-day reports:

drivers/iio/chemical/bme680_i2c.c:46:36: error:
'bme680_acpi_match' defined but not used

Apparently BME0680 is not a valid ACPI ID. Remove the ID.

Note the driver will still work with ACPI bindings that use the PRP0001
mechanism as that uses the of_device_id table instead.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: bme680_spi: Remove acpi_device_id table
Guenter Roeck [Thu, 6 May 2021 13:31:45 +0000 (06:31 -0700)]
iio: bme680_spi: Remove acpi_device_id table

BME0680 is not an official ACPI ID, so let's remove it before someone
starts using it.

Note that ACPI can still be used with this driver via the PRP0001 method
which will use the of_device_id table to match.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:accel:stk8312: Remove acpi_device_id table
Guenter Roeck [Thu, 6 May 2021 03:56:59 +0000 (20:56 -0700)]
iio:accel:stk8312: Remove acpi_device_id table

With CONFIG_ACPI=n, W=1 and -Werror, 0-day reports:

drivers/iio/accel/stk8312.c:644:36: error:
'stk8312_acpi_id' defined but not used

Apparently STK8312 is not a valid ACPI ID. Remove the ID table
as this is the only entry.  If ACPI support is desired an explicit
of_device_id table should be added (rather than relying on the fallback
to the existing ID table).

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: am2315: Remove acpi_device_id table
Guenter Roeck [Tue, 4 May 2021 15:37:46 +0000 (08:37 -0700)]
iio: am2315: Remove acpi_device_id table

With CONFIG_ACPI=n and -Werror, 0-day reports:

drivers/iio/humidity/am2315.c:259:36: error:
'am2315_acpi_id' defined but not used

According to Andy Shevchenko, the ACPI ID used in this driver is fake
and does not really exist. Remove it and with it ACPI support from
the driver.

Note that, if an explicit of_device_id table is added to the driver
it could support the PRP0001 based ACPI approach.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:dac:ad5755: txt to yaml format conversion.
Jonathan Cameron [Sat, 24 Apr 2021 17:30:15 +0000 (18:30 +0100)]
dt-bindings:iio:dac:ad5755: txt to yaml format conversion.

Straight forward conversion.  Only fiddly bit is the XOR of
spi-cpol and spi-cpha.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Link: https://lore.kernel.org/r/20201031184854.745828-40-jic23@kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210424173015.534941-1-jic23@kernel.org
3 years agodt-bindings: iio: st,st-sensors: Add LSM9DS0 compatible string
Andy Shevchenko [Wed, 14 Apr 2021 19:54:54 +0000 (22:54 +0300)]
dt-bindings: iio: st,st-sensors: Add LSM9DS0 compatible string

Enumerate LSM9DS0 (accelerometer and magnetometer parts) via
'st,lsm9ds0-imu' compatible string.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210414195454.84183-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: st_sensors: Add lsm9ds0 IMU support
Andy Shevchenko [Wed, 14 Apr 2021 19:54:53 +0000 (22:54 +0300)]
iio: st_sensors: Add lsm9ds0 IMU support

We can utilize separate drivers for accelerometer and magnetometer,
so here is the glue driver to enable LSM9DS0 IMU support.

The idea was suggested by Crestez Dan Leonard in [1]. The proposed change
was sent as RFC due to race condition concerns, which are indeed possible.

In order to amend the initial change, I went further by providing a specific
multi-instantiate probe driver that reuses existing accelerometer and
magnetometer.

[1]: https://lore.kernel.org/patchwork/patch/670353/

Suggested-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Cc: mr.lahorde@laposte.net
Cc: Matija Podravec <matija_podravec@fastmail.fm>
Cc: Sergey Borishchenko <borischenko.sergey@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210414195454.84183-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: st_sensors: Make accel, gyro, magn and pressure probe shared
Andy Shevchenko [Wed, 14 Apr 2021 19:54:52 +0000 (22:54 +0300)]
iio: st_sensors: Make accel, gyro, magn and pressure probe shared

Some IMUs may utilize existing library code for STMicro accelerometer,
gyroscope, magnetometer and pressure. Let's share them via st_sensors.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210414195454.84183-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: st_sensors: Call st_sensors_power_enable() from bus drivers
Andy Shevchenko [Wed, 14 Apr 2021 19:54:51 +0000 (22:54 +0300)]
iio: st_sensors: Call st_sensors_power_enable() from bus drivers

In case we would initialize two IIO devices from one physical device,
we shouldn't have a clash on regulators. That's why move
st_sensors_power_enable() call from core to bus drivers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210414195454.84183-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: magnetometer: st_magn: Provide default platform data
Andy Shevchenko [Wed, 14 Apr 2021 19:54:50 +0000 (22:54 +0300)]
iio: magnetometer: st_magn: Provide default platform data

Provide default platform data for magnetometer in case it supports DRDY.

One case is LSM9DS0 IMU, on which it is the case. Since accelerometer
is using INT1, default magnetometer to INT2.

While at it, update description of the drdy_int_pin field.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210414195454.84183-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: gyro: st_gyro: Move platform data from header to C file
Andy Shevchenko [Wed, 14 Apr 2021 19:54:49 +0000 (22:54 +0300)]
iio: gyro: st_gyro: Move platform data from header to C file

Platform data is solely used by one file. Don't share it with others.

While at it, drop unneeded anymore __maybe_unused and fix kernel doc
to avoid warning:

  st_gyro_core.c:366: error: Cannot parse struct or union!

by converting to a simple comment. It is described at the declaration.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210414195454.84183-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: st_accel: Move platform data from header to C file
Andy Shevchenko [Wed, 14 Apr 2021 19:54:48 +0000 (22:54 +0300)]
iio: accel: st_accel: Move platform data from header to C file

Platform data is solely used by one file. Don't share it with others.

While at it, drop unneeded anymore __maybe_unused and fix kernel doc
to avoid warning:

  st_accel_core.c:1079: error: Cannot parse struct or union!

by converting to a simple comment. It is described at the declaration.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210414195454.84183-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: core: move @clock_id from struct iio_dev to struct iio_dev_opaque
Jonathan Cameron [Mon, 26 Apr 2021 17:49:11 +0000 (18:49 +0100)]
iio: core: move @clock_id from struct iio_dev to struct iio_dev_opaque

There is already an acessor function used to access it, making this
move straight forward.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426174911.397061-10-jic23@kernel.org
3 years agoiio: core: move @flags from struct iio_dev to struct iio_dev_opaque
Jonathan Cameron [Mon, 26 Apr 2021 17:49:10 +0000 (18:49 +0100)]
iio: core: move @flags from struct iio_dev to struct iio_dev_opaque

No reason any driver should ever need access to this field, so hide it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426174911.397061-9-jic23@kernel.org
3 years agoiio: core: move @chrdev from struct iio_dev to struct iio_dev_opaque
Jonathan Cameron [Mon, 26 Apr 2021 17:49:09 +0000 (18:49 +0100)]
iio: core: move @chrdev from struct iio_dev to struct iio_dev_opaque

No reason for this to be exposed to the drivers, so lets move it to the
opaque structure.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426174911.397061-8-jic23@kernel.org
3 years agoiio: core: move @info_exist_lock to struct iio_dev_opaque
Jonathan Cameron [Mon, 26 Apr 2021 17:49:08 +0000 (18:49 +0100)]
iio: core: move @info_exist_lock to struct iio_dev_opaque

This lock is only of interest to the IIO core, so make it only
visible there.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426174911.397061-7-jic23@kernel.org
3 years agoiio: core: move @scan_index_timestamp to struct iio_dev_opaque
Jonathan Cameron [Mon, 26 Apr 2021 17:49:07 +0000 (18:49 +0100)]
iio: core: move @scan_index_timestamp to struct iio_dev_opaque

No reason for this cached value to be exposed to drivers so move it
to the opaque structure.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426174911.397061-6-jic23@kernel.org
3 years agoiio: core: move @trig_readonly from struct iio_dev to struct iio_dev_opaque
Jonathan Cameron [Mon, 26 Apr 2021 17:49:06 +0000 (18:49 +0100)]
iio: core: move @trig_readonly from struct iio_dev to struct iio_dev_opaque

This is only set via the iio_trig_set_immutable() call and later used
by the IIO core so there is no benefit in drivers being able to access
it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426174911.397061-5-jic23@kernel.org
3 years agoiio: core: move @driver_module from struct iio_dev to struct iio_dev_opaque
Jonathan Cameron [Mon, 26 Apr 2021 17:49:05 +0000 (18:49 +0100)]
iio: core: move @driver_module from struct iio_dev to struct iio_dev_opaque

Continuing move to hide internal elements from drivers, move this structure
element over.  It's only accessed from iio core files so this one was
straight forward and no accessor functions are needed.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426174911.397061-4-jic23@kernel.org
3 years agoiio: avoid shadowing of variable name in to_iio_dev_opaque()
Jonathan Cameron [Mon, 26 Apr 2021 17:49:04 +0000 (18:49 +0100)]
iio: avoid shadowing of variable name in to_iio_dev_opaque()

indio_dev was both the macro input parameter and the field name
in this macro.  That causes trouble if the instance of
struct iio_dev passed in is not called indio_dev.

Whilst a fix of sorts, no need to backport as it seems we never
hit this previously due to some very consistent naming in IIO.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426174911.397061-3-jic23@kernel.org
3 years agoiio: core: move @id from struct iio_dev to struct iio_dev_opaque
Jonathan Cameron [Mon, 26 Apr 2021 17:49:03 +0000 (18:49 +0100)]
iio: core: move @id from struct iio_dev to struct iio_dev_opaque

Continuing from Alexandru Ardelean's introduction of the split between
driver modifiable fields and those that should only be set by the core.

This could have been done in two steps to make the actual move after
introducing iio_device_id() but there seemed limited point to that
given how mechanical the majority of the patch is.

Includes fixup from Alex for missing mxs-lradc-adc conversion.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426174911.397061-2-jic23@kernel.org
3 years agoiio: common: scmi_sensors: Drop duplicate setting of iio_dev.dev.parent
Jonathan Cameron [Mon, 26 Apr 2021 17:02:51 +0000 (18:02 +0100)]
iio: common: scmi_sensors: Drop duplicate setting of iio_dev.dev.parent

This is already set to the same value in devm_iio_device_alloc()

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jyoti Bhayana <jbhayana@google.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426170251.351957-9-jic23@kernel.org
3 years agoiio: position: hid-sensor-custom-intel-hinge: Drop duplicate parent setting.
Jonathan Cameron [Mon, 26 Apr 2021 17:02:50 +0000 (18:02 +0100)]
iio: position: hid-sensor-custom-intel-hinge: Drop duplicate parent setting.

iio_dev.dev.parent is already set to the same value in
devm_iio_device_alloc()

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Ye Xiang <xiang.ye@intel.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426170251.351957-8-jic23@kernel.org
3 years agoiio: humidity: hdc2010: Drop duplicate setting of iio_dev.dev.parent
Jonathan Cameron [Mon, 26 Apr 2021 17:02:49 +0000 (18:02 +0100)]
iio: humidity: hdc2010: Drop duplicate setting of iio_dev.dev.parent

Already set to same value in devm_iio_device_alloc()

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Eugene Zaikonnikov <ez@norphonic.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426170251.351957-7-jic23@kernel.org
3 years agoiio: adc: ti-ads131e08: Drop duplicate setting of iio_dev.dev.parent
Jonathan Cameron [Mon, 26 Apr 2021 17:02:48 +0000 (18:02 +0100)]
iio: adc: ti-ads131e08: Drop duplicate setting of iio_dev.dev.parent

Already set to same value in devm_iio_device_alloc()

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Tomislav Denis <tomislav.denis@avl.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426170251.351957-6-jic23@kernel.org
3 years agoiio: adc: mt6360: Drop duplicate setting of iio_dev.dev.parent
Jonathan Cameron [Mon, 26 Apr 2021 17:02:47 +0000 (18:02 +0100)]
iio: adc: mt6360: Drop duplicate setting of iio_dev.dev.parent

Already set to the same value in devm_iio_device_alloc()

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Gene Chen <gene_chen@richtek.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426170251.351957-5-jic23@kernel.org
3 years agoiio: adc: mp2629: Drop duplicate setting iio_dev.dev.parent
Jonathan Cameron [Mon, 26 Apr 2021 17:02:46 +0000 (18:02 +0100)]
iio: adc: mp2629: Drop duplicate setting iio_dev.dev.parent

This is already set to the same value in devm_iio_device_alloc()

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Saravanan Sekar <sravanhome@gmail.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426170251.351957-4-jic23@kernel.org
3 years agoiio: dac: ad5766: Drop duplicate setting of iio_dev.dev.parent and of_node
Jonathan Cameron [Mon, 26 Apr 2021 17:02:45 +0000 (18:02 +0100)]
iio: dac: ad5766: Drop duplicate setting of iio_dev.dev.parent and of_node

This is set to the same value in devm_iio_device_alloc() so no need to do
it again.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Cristian Pop <cristian.pop@analog.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426170251.351957-3-jic23@kernel.org
3 years agoiio: accel: bmi088: Drop manual assignment of iio_dev.dev.parent
Jonathan Cameron [Mon, 26 Apr 2021 17:02:44 +0000 (18:02 +0100)]
iio: accel: bmi088: Drop manual assignment of iio_dev.dev.parent

The core already set this to the same value in devm_iio_device_alloc()

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210426170251.351957-2-jic23@kernel.org
3 years agoiio: adc: add ADC driver for the TI TSC2046 controller
Oleksij Rempel [Wed, 28 Apr 2021 07:32:08 +0000 (09:32 +0200)]
iio: adc: add ADC driver for the TI TSC2046 controller

Basically the TI TSC2046 touchscreen controller is 8 channel ADC optimized for
the touchscreen use case. By implementing it as an IIO ADC device, we can
make use of resistive-adc-touch and iio-hwmon drivers.

Polled readings are currently not implemented to keep this patch small, so
iio-hwmon will not work out of the box for now.

So far, this driver was tested with a custom version of resistive-adc-touch driver,
since it needs to be extended to make use of Z1 and Z2 channels. The X/Y
are working without additional changes.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210428073208.19570-4-o.rempel@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:adc: add documentation for TI TSC2046 controller
Oleksij Rempel [Wed, 28 Apr 2021 07:32:07 +0000 (09:32 +0200)]
dt-bindings:iio:adc: add documentation for TI TSC2046 controller

Add a binding documentation for the TI TSC2046 touchscreen controllers
ADC functionality.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210428073208.19570-3-o.rempel@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:adc: add generic settling-time-us and oversampling-ratio channel...
Oleksij Rempel [Wed, 28 Apr 2021 07:32:06 +0000 (09:32 +0200)]
dt-bindings:iio:adc: add generic settling-time-us and oversampling-ratio channel properties

Settling time and over sampling is a typical challenge for different IIO ADC
devices. So, introduce channel specific settling-time-us and oversampling-ratio
properties to cover this use case.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210428073208.19570-2-o.rempel@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: Documentation: move incompatible ABI to obsolete
Mauro Carvalho Chehab [Tue, 27 Apr 2021 14:03:00 +0000 (16:03 +0200)]
iio: Documentation: move incompatible ABI to obsolete

Commit 63cd35f34d2e ("iio: Documentation: update definitions for bufferY and scan_elements")
updated iio documentation in order to point to the newly
per-buffer API, as it is now possible to support multi buffers.

While the previous ABI will be kept forever, the best is
for applications to use the 5.11+ ABI. So, move the
legacy one ABI/obsolete.

This fixes an issue with scripts/get_abi.pl, that doesn't
accept two different Kernel version support for the same
API set.

Fixes: 63cd35f34d2e ("iio: Documentation: update definitions for bufferY and scan_elements")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/a2c802049adee6a5710a58082cfdc1132c5e4c11.1619532170.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: stm32-adc: Fix docs wrongly marked as kernel-doc
Jonathan Cameron [Wed, 28 Apr 2021 19:26:12 +0000 (20:26 +0100)]
iio: adc: stm32-adc: Fix docs wrongly marked as kernel-doc

W=1 highlights these two cases that are obviously not in kernel-doc
format.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
3 years agodt-bindings: iio: chemical: sps30: update binding with serial example
Tomasz Duszynski [Mon, 3 May 2021 06:00:14 +0000 (08:00 +0200)]
dt-bindings: iio: chemical: sps30: update binding with serial example

sps30 has gained support for serial communication so add example to the
binding file. While at it remove reg property from list of required
properties because it's no-op in case of serial communication.

Signed-off-by: Tomasz Duszynski <tomasz.duszynski@octakon.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sps30: add support for serial interface
Tomasz Duszynski [Mon, 3 May 2021 06:00:13 +0000 (08:00 +0200)]
iio: sps30: add support for serial interface

Sensor has support for both i2c and serial communication interfaces.
Both offer very similar set of features. Minor differences don't impact
overall functionality like doing measurements, etc.

Support for i2c have already been added, this patch adds support
for the latter ie. serial interface.

Signed-off-by: Tomasz Duszynski <tomasz.duszynski@octakon.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sps30: separate core and interface specific code
Tomasz Duszynski [Mon, 3 May 2021 06:00:12 +0000 (08:00 +0200)]
iio: sps30: separate core and interface specific code

Move code responsible for handling i2c communication to a separate file.
Rationale for this change is preparation for adding support for serial
communication.

Signed-off-by: Tomasz Duszynski <tomasz.duszynski@octakon.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:ABI docs: Move specific description of out_altvoltageX_frequency to main docs.
Jonathan Cameron [Sun, 17 Jan 2021 15:38:16 +0000 (15:38 +0000)]
iio:ABI docs: Move specific description of out_altvoltageX_frequency to main docs.

The adf4371 has channels that are very closely coupled, so additional
documentation is needed to express these constraints.
Unfortunately having the same sysfs filename in multiple documentation
does not work well when generating automated documentation.
To avoid this issue, we add a new device specific description to the
main docs and remove the one in the device specific file.

Fixes
$ scripts/get_abi.pl validate
Warning: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_frequency is defined 2 times:  ./Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371:0  ./Documentation/ABI/testing/sysfs-bus-iio:599

Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reported-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20210117153816.696693-8-jic23@kernel.org
3 years agoiio:ABI docs: Fix issue around repeated definition of out_currentY_raw
Jonathan Cameron [Sun, 17 Jan 2021 15:38:13 +0000 (15:38 +0000)]
iio:ABI docs: Fix issue around repeated definition of out_currentY_raw

This one is challenging as both the places this appears in specific drivers
are making 'unusual' uses of what looks like a simple output current
channel.
As a side note, this was particular bit of ABI occurs in other drivers
where the use is much more straight forward e.g. dac/ad5421

This patch attempts to make a best effort of adding it to the main docs but
retaining enough information. Both of these drivers probably need
specific documents being written to describe their unusual interfaces, but
those should be in the main documentation, not under Documentation/ABI.
That is a non trivial job so left for another time.

Fixes
$ scripts/get_abi.pl validate
Warning: /sys/bus/iio/devices/iio:deviceX/out_currentY_raw is defined 2 times:  ./Documentation/ABI/testing/sysfs-bus-iio-light-lm3533-als:43  ./Documentation/ABI/testing/sysfs-bus-iio-health-afe440x:38

Reported-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20210117153816.696693-5-jic23@kernel.org
3 years agoiio:ABI docs: Drop device specific docs for _powerdown for the adf4371
Jonathan Cameron [Sun, 17 Jan 2021 15:38:12 +0000 (15:38 +0000)]
iio:ABI docs: Drop device specific docs for _powerdown for the adf4371

The interface is standard and the extra info provided on exactly what is
being powered down is not of interest to most users.  Hence this doesn't
need it's own documentation and can rely on the docs in sysfs-bus-iio

Fixes
$ scripts/get_abi.pl validate
Warning: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_powerdown is defined 2 times:  ./Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371:36  ./Documentation/ABI/testing/sysfs-bus-iio:588

Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reported-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20210117153816.696693-4-jic23@kernel.org
3 years agoiio:ABI docs: Fix up duplicate *_calibbias_* documentation for icm42600
Jonathan Cameron [Sun, 17 Jan 2021 15:38:10 +0000 (15:38 +0000)]
iio:ABI docs: Fix up duplicate *_calibbias_* documentation for icm42600

This device has the unusual characteristic that the calibbias values
have well defined units (more commonly they are tweaks to a DAC)
Unfortunately the previous approach of having more specific documentation
in sysfs-bus-iio-icm42600 results in warnings during the documentation
build and random ordering in the resulting documentation.

To avoid this, add a note to the main documentation on this special
characteristic for the icm42600.   The _available for calibbias was
missing from the main sysfs-bus-iio docs so also add that, allowing
us to drop the icm42600 specific file.

Fixes
$ scripts/get_abi.pl validate warning:
Warning: /sys/bus/iio/devices/iio:deviceX/in_accel_x_calibbias is defined 2 times:  ./Documentation/ABI/testing/sysfs-bus-iio-icm42600:0  ./Documentation/ABI/testing/sysfs-bus-iio:394
Warning: /sys/bus/iio/devices/iio:deviceX/in_accel_y_calibbias is defined 2 times:  ./Documentation/ABI/testing/sysfs-bus-iio-icm42600:1  ./Documentation/ABI/testing/sysfs-bus-iio:395
Warning: /sys/bus/iio/devices/iio:deviceX/in_accel_z_calibbias is defined 2 times:  ./Documentation/ABI/testing/sysfs-bus-iio-icm42600:2  ./Documentation/ABI/testing/sysfs-bus-iio:396
Warning: /sys/bus/iio/devices/iio:deviceX/in_anglvel_x_calibbias is defined 2 times:  ./Documentation/ABI/testing/sysfs-bus-iio-icm42600:3  ./Documentation/ABI/testing/sysfs-bus-iio:397
Warning: /sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibbias is defined 2 times:  ./Documentation/ABI/testing/sysfs-bus-iio-icm42600:4  ./Documentation/ABI/testing/sysfs-bus-iio:398
Warning: /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibbias is defined 2 times:  ./Documentation/ABI/testing/sysfs-bus-iio-icm42600:5  ./Documentation/ABI/testing/sysfs-bus-iio:399

Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Reported-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20210117153816.696693-2-jic23@kernel.org
3 years agoiio: adis16400: do not directly change spi 'max_speed_hz'
Nuno Sa [Tue, 27 Apr 2021 08:54:54 +0000 (10:54 +0200)]
iio: adis16400: do not directly change spi 'max_speed_hz'

With commit 3ba10e37371d ("iio: adis: add burst_max_speed_hz variable"), we
just need to define 'burst_max_speed_hz' and the adis core will take
care of setting up the spi transfers for burst mode. Hence, we fix
a potential race with the spi core where we could be left witn an
invalid 'max_speed_hz'.

Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Fixes: 5eda3550a3cc1 ("staging:iio:adis16400: Preallocate transfer message")
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210427085454.30616-7-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adis16475: do not directly change spi 'max_speed_hz'
Nuno Sa [Tue, 27 Apr 2021 08:54:53 +0000 (10:54 +0200)]
iio: adis16475: do not directly change spi 'max_speed_hz'

With commit 3ba10e37371d ("iio: adis: add burst_max_speed_hz variable"), we
just need to define 'burst_max_speed_hz' and the adis core will take
care of setting up the spi transfers for burst mode. Hence, we fix
a potential race with the spi core where we could be left with an
invalid 'max_speed_hz'.

Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Fixes: fff7352bf7a3c ("iio: imu: Add support for adis16475")
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210427085454.30616-6-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adis: add burst_max_speed_hz variable
Nuno Sa [Tue, 27 Apr 2021 08:54:52 +0000 (10:54 +0200)]
iio: adis: add burst_max_speed_hz variable

Typically, in burst mode, the device cannot operate at it's full spi
speed. Hence, the spi transfers for burst mode have to take this into
account. With this change we avoid a potential race with the spi core as
drivers were 'hacking' the device 'max_speed_hz' directly in the
trigger handler.

Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210427085454.30616-5-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adis_buffer: don't push data to buffers on failure
Nuno Sa [Tue, 27 Apr 2021 08:54:51 +0000 (10:54 +0200)]
iio: adis_buffer: don't push data to buffers on failure

There's no point in pushing data to IIO buffers in case 'spi_sync()'
fails.

Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210427085454.30616-4-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adis_buffer: update device page after changing it
Nuno Sa [Tue, 27 Apr 2021 08:54:50 +0000 (10:54 +0200)]
iio: adis_buffer: update device page after changing it

It makes more sense to update the device page as soon as we we
successfully changed it. Moreover, a follow up patch will handle
'spi_sync' error path which would leave 'current_page' in a inconsistent
state.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210427085454.30616-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adis16475: do not return ints in irq handlers
Nuno Sa [Tue, 27 Apr 2021 08:54:49 +0000 (10:54 +0200)]
iio: adis16475: do not return ints in irq handlers

On an IRQ handler we should not return normal error codes as 'irqreturn_t'
is expected.

This is done by jumping to the 'check_burst32' label where we return
'IRQ_HANDLED'. Note that it is fine to do the burst32 check in this
error path. If we have proper settings to apply burst32, we might just
do the setup now so that the next sample already uses it.

Fixes: fff7352bf7a3c ("iio: imu: Add support for adis16475")
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210427085454.30616-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: Add driver for Murata SCA3300 accelerometer
Tomas Melin [Mon, 26 Apr 2021 08:10:41 +0000 (11:10 +0300)]
iio: accel: Add driver for Murata SCA3300 accelerometer

Add initial support for Murata SCA3300 3-axis industrial
accelerometer with digital SPI interface. This device also
provides a temperature measurement.

Datasheet: https://www.murata.com/en-global/products/sensor/accel/sca3300
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210426081041.59807-3-tomas.melin@vaisala.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: accel: Add SCA3300 documentation
Tomas Melin [Mon, 26 Apr 2021 08:10:40 +0000 (11:10 +0300)]
dt-bindings: iio: accel: Add SCA3300 documentation

initial DT bindings for Murata SCA3300 Accelerometer.

Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210426081041.59807-2-tomas.melin@vaisala.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:adc:adi,ad7476: Add missing binding document
Jonathan Cameron [Sun, 25 Apr 2021 16:31:54 +0000 (17:31 +0100)]
dt-bindings:iio:adc:adi,ad7476: Add missing binding document

This binding covers class of simple SPI ADCs which only provide
data output - they don't have MOSI pin.

The only real variation between them is over how many supplies they
use and which one is used for the reference.

Michael listed as maintainer for this one as it is his driver and
falls under the catch all MAINTAINERS entry for ADI devices.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210425163154.73209-3-jic23@kernel.org
3 years agoiio:adc:ad7476: Handle the different regulators used by various parts.
Jonathan Cameron [Sun, 25 Apr 2021 16:31:53 +0000 (17:31 +0100)]
iio:adc:ad7476: Handle the different regulators used by various parts.

Not all of the parts supported by this driver use single supply.
Hence we add chip_info fields to say what additional supplies exist
and in the case of vref, ensure that is used for the reference voltage
rather than vcc.

One corner case is the ad7091r which has an internal reference that
can be over-driven by an external reference connected on the vref pin.
To handle that force_ext_vref is introduced and set if an optional
vref regulator is present.

Tested using really simple QEMU model and some fixed regulators.

The devm_add_action_or_reset() callback is changed to take the
regulator as it's parameter so we can use one callback for all the
different regulators without having to store pointers to them in
the iio_priv() structure.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210425163154.73209-2-jic23@kernel.org
3 years agodt-bindings:iio:dac:ti,dac082s085 yaml conversion
Jonathan Cameron [Thu, 1 Apr 2021 14:09:56 +0000 (15:09 +0100)]
dt-bindings:iio:dac:ti,dac082s085 yaml conversion

Fairly simple conversion with the exception of the XOR between
spi-cpha and spi-cpol.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/20201031134110.724233-17-jic23@kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210401140956.224084-3-jic23@kernel.org
3 years agoiio:accel:stk8312: Add lowercase i2c device id
Jonathan Cameron [Thu, 1 Apr 2021 14:42:26 +0000 (15:42 +0100)]
iio:accel:stk8312: Add lowercase i2c device id

These are never upper case.  Chances are that all users of this driver
were using the ACPI binding but just in case keep the uppercase version
but mark it deprecated.

Whilst here tidy up some spacing.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20210401144226.225928-1-jic23@kernel.org
3 years agodt-bindings:iio:adc:adi,ad7298 document bindings
Jonathan Cameron [Thu, 1 Apr 2021 17:41:12 +0000 (18:41 +0100)]
dt-bindings:iio:adc:adi,ad7298 document bindings

The device has a tsens-busy pin, but it's both fiddly and currently
ignored by the Linux driver.  Given it's not clear whether the binding
should be an interrupt, or a GPIO I have left that out for now.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210401174112.320497-7-jic23@kernel.org
3 years agodt-bindings:trivial-devices: Add sensortek,stk8312 and sensortek,s8ba50
Jonathan Cameron [Thu, 1 Apr 2021 17:41:11 +0000 (18:41 +0100)]
dt-bindings:trivial-devices: Add sensortek,stk8312 and sensortek,s8ba50

Two simple devices. The stk8ba50 datasheet could be found via
google, but I only have the driver for the 8312.

Given they both seem to be 3 axis devices with a single interrupt
line, add them to trivial-devices.yaml

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210401174112.320497-6-jic23@kernel.org
3 years agodt-bindings:trivial-devices: Add memsic,mxc4005/mxc6255/mxc6655 entries
Jonathan Cameron [Thu, 1 Apr 2021 17:41:10 +0000 (18:41 +0100)]
dt-bindings:trivial-devices: Add memsic,mxc4005/mxc6255/mxc6655 entries

Simple devices with I2C interface and single interrupt line so
entries in trivial devices are sufficient.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210401174112.320497-5-jic23@kernel.org
3 years agodt-bindings:iio:accel:fsl,mma7455 binding doc
Jonathan Cameron [Thu, 1 Apr 2021 17:41:09 +0000 (18:41 +0100)]
dt-bindings:iio:accel:fsl,mma7455 binding doc

Binding documentation for this driver was missing.
Note that the binding and some in tree dts files specifiy interrupts
etc but the driver is fairly simple and does not yet make use of them.

Listed both Joachim and myself as maintainers for this binding on basis
it's Joachim's driver but I don't want to volunteer Joachim too
strongly to look after this doc.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Joachim Eastwood <manabian@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210401174112.320497-4-jic23@kernel.org
3 years agodt-bindings:iio:accel:bosch,bma220 device tree binding documentation
Jonathan Cameron [Thu, 1 Apr 2021 17:41:08 +0000 (18:41 +0100)]
dt-bindings:iio:accel:bosch,bma220 device tree binding documentation

Linux driver currently relies on the driver.name to match to the
compatible, but that doesn't mean it isn't a good idea to document it.

Only real complexity is the 3 separate power supplies.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210401174112.320497-3-jic23@kernel.org
3 years agodt-bindings:iio:accel:adis16201 and adis16209 bindings
Jonathan Cameron [Thu, 1 Apr 2021 17:41:07 +0000 (18:41 +0100)]
dt-bindings:iio:accel:adis16201 and adis16209 bindings

These two devices have different internal characteristics, but their
external connectivity and as a result device tree descriptions are
identical.

Note that neither driver in Linux currently has an of_match_table
but instead rely on matching via name alone.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210401174112.320497-2-jic23@kernel.org
3 years agoiio: inkern: simplify some devm functions
Yicong Yang [Thu, 8 Apr 2021 11:38:16 +0000 (19:38 +0800)]
iio: inkern: simplify some devm functions

Use devm_add_action_or_reset() instead of devres_alloc() and
devres_add(), which works the same. This will simplify the
code. There is no functional changes.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1617881896-3164-8-git-send-email-yangyicong@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: trigger: simplify __devm_iio_trigger_register
Yicong Yang [Thu, 8 Apr 2021 11:38:15 +0000 (19:38 +0800)]
iio: trigger: simplify __devm_iio_trigger_register

Use devm_add_action_or_reset() instead of devres_alloc() and
devres_add(), which works the same. This will simplify the
code. There is no functional changes.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1617881896-3164-7-git-send-email-yangyicong@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: core: simplify some devm functions
Yicong Yang [Thu, 8 Apr 2021 11:38:14 +0000 (19:38 +0800)]
iio: core: simplify some devm functions

Use devm_add_action_or_reset() instead of devres_alloc() and
devres_add(), which works the same. This will simplify the
code. There is no functional changes.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1617881896-3164-6-git-send-email-yangyicong@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: triggered-buffer: simplify devm_iio_triggered_buffer_setup_ext()
Yicong Yang [Thu, 8 Apr 2021 11:38:13 +0000 (19:38 +0800)]
iio: triggered-buffer: simplify devm_iio_triggered_buffer_setup_ext()

Use devm_add_action_or_reset() instead of devres_alloc() and
devres_add(), which works the same. This will simplify the
code. There is no functional changes.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1617881896-3164-5-git-send-email-yangyicong@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: hw_consumer: simplify devm_iio_hw_consumer_alloc()
Yicong Yang [Thu, 8 Apr 2021 11:38:12 +0000 (19:38 +0800)]
iio: hw_consumer: simplify devm_iio_hw_consumer_alloc()

Use devm_add_action_or_reset() instead of devres_alloc() and
devres_add(), which works the same. This will simplify the
code. There is no functional changes.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1617881896-3164-4-git-send-email-yangyicong@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: buffer-dmaengine: simplify __devm_iio_dmaengine_buffer_free()
Yicong Yang [Thu, 8 Apr 2021 11:38:11 +0000 (19:38 +0800)]
iio: buffer-dmaengine: simplify __devm_iio_dmaengine_buffer_free()

Use devm_add_action_or_reset() instead of devres_alloc() and
devres_add(), which works the same. This will simplify the
code. There is no functional changes.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1617881896-3164-3-git-send-email-yangyicong@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: adi-axi-adc: simplify devm_adi_axi_adc_conv_register()
Yicong Yang [Thu, 8 Apr 2021 11:38:10 +0000 (19:38 +0800)]
iio: adc: adi-axi-adc: simplify devm_adi_axi_adc_conv_register()

Use devm_add_action_or_reset() instead of devres_alloc() and
devres_add(), which works the same. This will simplify the
code. There is no functional changes.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1617881896-3164-2-git-send-email-yangyicong@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: light: Added AMS tsl2591 device tree binding
Joe Sandom [Wed, 21 Apr 2021 22:13:30 +0000 (23:13 +0100)]
dt-bindings: iio: light: Added AMS tsl2591 device tree binding

Device tree binding for AMS/TAOS tsl2591 ambient light sensor.

This driver supports configuration via device tree and sysfs.
Supported channels for raw infrared light intensity,
raw combined light intensity and illuminance in lux.
The driver additionally supports iio events on lower and
upper thresholds.

This is a very-high sensitivity light-to-digital converter that
transforms light intensity into a digital signal.

Signed-off-by: Joe Sandom <joe.g.sandom@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210421221330.17007-2-joe.g.sandom@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: Added AMS tsl2591 driver implementation
Joe Sandom [Wed, 21 Apr 2021 22:13:29 +0000 (23:13 +0100)]
iio: light: Added AMS tsl2591 driver implementation

Driver implementation for AMS/TAOS tsl2591 ambient light sensor.

This driver supports configuration via device tree and sysfs.
Supported channels for raw infrared light intensity,
raw combined light intensity and illuminance in lux.
The driver additionally supports iio events on lower and
upper thresholds.

This is a very-high sensitivity light-to-digital converter that
transforms light intensity into a digital signal.

Datasheet: https://ams.com/tsl25911#tab/documents
Signed-off-by: Joe Sandom <joe.g.sandom@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210421221330.17007-1-joe.g.sandom@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adis_buffer: check return value on page change
Nuno Sa [Thu, 22 Apr 2021 10:19:06 +0000 (12:19 +0200)]
iio: adis_buffer: check return value on page change

On the trigger handler, we might need to change the device page. Hence,
we should check the return value from 'spi_write()' and act accordingly.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20210422101911.135630-5-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adis16400: do not return ints in irq handlers
Nuno Sa [Thu, 22 Apr 2021 10:19:04 +0000 (12:19 +0200)]
iio: adis16400: do not return ints in irq handlers

On an IRQ handler we should not return normal error codes as 'irqreturn_t'
is expected.

Not necessary to apply to stable as the original check cannot fail and
as such the bug cannot actually occur.

Fixes: 5eda3550a3cc1 ("staging:iio:adis16400: Preallocate transfer message")
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210422101911.135630-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adis_buffer: do not return ints in irq handlers
Nuno Sa [Thu, 22 Apr 2021 10:19:03 +0000 (12:19 +0200)]
iio: adis_buffer: do not return ints in irq handlers

On an IRQ handler we should not return normal error codes as 'irqreturn_t'
is expected.

Not necessarily stable material as the old check cannot fail, so it's a bug
we can not hit.

Fixes: ccd2b52f4ac69 ("staging:iio: Add common ADIS library")
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210422101911.135630-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: ad7298: Enable on Intel Galileo Gen 1
Andy Shevchenko [Mon, 12 Apr 2021 13:18:35 +0000 (16:18 +0300)]
iio: adc: ad7298: Enable on Intel Galileo Gen 1

Enable ADC on Intel Galileo Gen 1 board.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210412131835.70212-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: st-sensors: Update ST Sensor bindings
Linus Walleij [Mon, 12 Apr 2021 12:23:31 +0000 (14:23 +0200)]
iio: st-sensors: Update ST Sensor bindings

This adjusts the ST Sensor bindings with the more fine-grained
syntax checks that were proposed late in the last kernel cycle
and colliding with parallel work.

Cc: devicetree@vger.kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210412122331.1631643-1-linus.walleij@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: trigger: stm32-timer: Convert sysfs sprintf/snprintf family to sysfs_emit
Tian Tao [Mon, 12 Apr 2021 08:39:11 +0000 (16:39 +0800)]
iio: trigger: stm32-timer: Convert sysfs sprintf/snprintf family to sysfs_emit

Fix the following coccicheck warning:
drivers/iio/trigger/stm32-timer-trigger.c:299:8-16: WARNING:
use scnprintf or sprintf

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: https://lore.kernel.org/r/1618216751-1678-4-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: Convert sysfs sprintf/snprintf family to sysfs_emit
Tian Tao [Mon, 12 Apr 2021 08:39:10 +0000 (16:39 +0800)]
iio: light: Convert sysfs sprintf/snprintf family to sysfs_emit

Fix the following coccicheck warning:
drivers/iio/light/veml6030.c:131:8-16: WARNING:
use scnprintf or sprintf

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: https://lore.kernel.org/r/1618216751-1678-3-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:chemical:sps30: Convert sysfs sprintf/snprintf family to sysfs_emit
Tian Tao [Mon, 12 Apr 2021 08:39:09 +0000 (16:39 +0800)]
iio:chemical:sps30: Convert sysfs sprintf/snprintf family to sysfs_emit

Fix the following coccicheck warning:
./drivers/iio/chemical/sps30.c:414:8-16: WARNING:
use scnprintf or sprintf

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: https://lore.kernel.org/r/1618216751-1678-2-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: temperature: add driver support for ti tmp117
Puranjay Mohan [Wed, 7 Apr 2021 18:21:47 +0000 (23:51 +0530)]
iio: temperature: add driver support for ti tmp117

TMP117 is a Digital temperature sensor with integrated Non-Volatile memory.
Add support for tmp117 driver in iio subsystem.

Datasheet: https://www.ti.com/lit/gpn/tmp117
Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210407182147.77221-3-puranjay12@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: temperature: Add DT bindings for TMP117
Puranjay Mohan [Wed, 7 Apr 2021 18:21:46 +0000 (23:51 +0530)]
dt-bindings: iio: temperature: Add DT bindings for TMP117

Add devicetree binding document for TMP117, a digital temperature sensor.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210407182147.77221-2-puranjay12@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: exynos: drop unneeded variable assignment
Krzysztof Kozlowski [Sat, 10 Apr 2021 16:47:28 +0000 (18:47 +0200)]
iio: adc: exynos: drop unneeded variable assignment

The initialization of 'ret' variable in probe function is shortly after
overwritten.  This initialization is simply not used.

Addresses-Coverity: Unused value
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Link: https://lore.kernel.org/r/20210410164728.8096-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoMerge 5.13-rc2 into staging-next
Greg Kroah-Hartman [Mon, 17 May 2021 07:47:44 +0000 (09:47 +0200)]
Merge 5.13-rc2 into staging-next

We need the staging and iio fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoLinux 5.13-rc2
Linus Torvalds [Sun, 16 May 2021 22:27:44 +0000 (15:27 -0700)]
Linux 5.13-rc2

3 years agoMerge tag 'driver-core-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 16 May 2021 17:13:14 +0000 (10:13 -0700)]
Merge tag 'driver-core-5.13-rc2' of git://git./linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are two driver fixes for driver core changes that happened in
  5.13-rc1.

  The clk driver fix resolves a many-reported issue with booting some
  devices, and the USB typec fix resolves the reported problem of USB
  systems on some embedded boards.

  Both of these have been in linux-next this week with no reported
  issues"

* tag 'driver-core-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  clk: Skip clk provider registration when np is NULL
  usb: typec: tcpm: Don't block probing of consumers of "connector" nodes

3 years agoMerge tag 'staging-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sun, 16 May 2021 17:06:19 +0000 (10:06 -0700)]
Merge tag 'staging-5.13-rc2' of git://git./linux/kernel/git/gregkh/staging

Pull staging and IIO driver fixes from Greg KH:
 "Here are some small IIO driver fixes and one Staging driver fix for
  5.13-rc2.

  Nothing major, just some resolutions for reported problems:

   - gcc-11 bogus warning fix for rtl8723bs

   - iio driver tiny fixes

  All of these have been in linux-next for many days with no reported
  issues"

* tag 'staging-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  iio: tsl2583: Fix division by a zero lux_val
  iio: core: return ENODEV if ioctl is unknown
  iio: core: fix ioctl handlers removal
  iio: gyro: mpu3050: Fix reported temperature value
  iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER
  iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
  iio: light: gp2ap002: Fix rumtime PM imbalance on error
  staging: rtl8723bs: avoid bogus gcc warning

3 years agoMerge tag 'usb-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sun, 16 May 2021 16:55:05 +0000 (09:55 -0700)]
Merge tag 'usb-5.13-rc2' of git://git./linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are some small USB fixes for 5.13-rc2. They consist of a number
  of resolutions for reported issues:

   - typec fixes for found problems

   - xhci fixes and quirk additions

   - dwc3 driver fixes

   - minor fixes found by Coverity

   - cdc-wdm fixes for reported problems

  All of these have been in linux-next for a few days with no reported
  issues"

* tag 'usb-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (28 commits)
  usb: core: hub: fix race condition about TRSMRCY of resume
  usb: typec: tcpm: Fix SINK_DISCOVERY current limit for Rp-default
  xhci: Add reset resume quirk for AMD xhci controller.
  usb: xhci: Increase timeout for HC halt
  xhci: Do not use GFP_KERNEL in (potentially) atomic context
  xhci: Fix giving back cancelled URBs even if halted endpoint can't reset
  xhci-pci: Allow host runtime PM as default for Intel Alder Lake xHCI
  usb: musb: Fix an error message
  usb: typec: tcpm: Fix wrong handling for Not_Supported in VDM AMS
  usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work
  usb: typec: ucsi: Retrieve all the PDOs instead of just the first 4
  usb: fotg210-hcd: Fix an error message
  docs: usb: function: Modify path name
  usb: dwc3: omap: improve extcon initialization
  usb: typec: ucsi: Put fwnode in any case during ->probe()
  usb: typec: tcpm: Fix wrong handling in GET_SINK_CAP
  usb: dwc2: Remove obsolete MODULE_ constants from platform.c
  usb: dwc3: imx8mp: fix error return code in dwc3_imx8mp_probe()
  usb: dwc3: imx8mp: detect dwc3 core node via compatible string
  usb: dwc3: gadget: Return success always for kick transfer in ep queue
  ...

3 years agoMerge tag 'timers-urgent-2021-05-16' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 16 May 2021 16:42:13 +0000 (09:42 -0700)]
Merge tag 'timers-urgent-2021-05-16' of git://git./linux/kernel/git/tip/tip

Pull timer fixes from Thomas Gleixner:
 "Two fixes for timers:

   - Use the ALARM feature check in the alarmtimer core code insted of
     the old method of checking for the set_alarm() callback.

     Drivers can have that callback set but the feature bit cleared. If
     such a RTC device is selected then alarms wont work.

   - Use a proper define to let the preprocessor check whether Hyper-V
     VDSO clocksource should be active.

     The code used a constant in an enum with #ifdef, which evaluates to
     always false and disabled the clocksource for VDSO"

* tag 'timers-urgent-2021-05-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
  alarmtimer: Check RTC features instead of ops

3 years agoMerge tag 'for-linus-5.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 16 May 2021 16:39:04 +0000 (09:39 -0700)]
Merge tag 'for-linus-5.13b-rc2-tag' of git://git./linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:

 - two patches for error path fixes

 - a small series for fixing a regression with swiotlb with Xen on Arm

* tag 'for-linus-5.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen/swiotlb: check if the swiotlb has already been initialized
  arm64: do not set SWIOTLB_NO_FORCE when swiotlb is required
  xen/arm: move xen_swiotlb_detect to arm/swiotlb-xen.h
  xen/unpopulated-alloc: fix error return code in fill_list()
  xen/gntdev: fix gntdev_mmap() error exit path

3 years agoMerge tag 'x86_urgent_for_v5.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 16 May 2021 16:31:06 +0000 (09:31 -0700)]
Merge tag 'x86_urgent_for_v5.13_rc2' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:
 "The three SEV commits are not really urgent material. But we figured
  since getting them in now will avoid a huge amount of conflicts
  between future SEV changes touching tip, the kvm and probably other
  trees, sending them to you now would be best.

  The idea is that the tip, kvm etc branches for 5.14 will all base
  ontop of -rc2 and thus everything will be peachy. What is more, those
  changes are purely mechanical and defines movement so they should be
  fine to go now (famous last words).

  Summary:

   - Enable -Wundef for the compressed kernel build stage

   - Reorganize SEV code to streamline and simplify future development"

* tag 'x86_urgent_for_v5.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/boot/compressed: Enable -Wundef
  x86/msr: Rename MSR_K8_SYSCFG to MSR_AMD64_SYSCFG
  x86/sev: Move GHCB MSR protocol and NAE definitions in a common header
  x86/sev-es: Rename sev-es.{ch} to sev.{ch}