platform/kernel/linux-rpi.git
20 months agomisc: fastrpc: Add mmap request assigning for static PD pool
Abel Vesa [Fri, 25 Nov 2022 07:14:04 +0000 (07:14 +0000)]
misc: fastrpc: Add mmap request assigning for static PD pool

If the mmap request is to add pages and thre are VMIDs associated with
that context, do a call to SCM to reassign that memory. Do not do this
for remote heap allocation, that is done on init create static process
only.

Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221125071405.148786-10-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 months agomisc: fastrpc: Safekeep mmaps on interrupted invoke
Abel Vesa [Fri, 25 Nov 2022 07:14:03 +0000 (07:14 +0000)]
misc: fastrpc: Safekeep mmaps on interrupted invoke

If the userspace daemon is killed in the middle of an invoke (e.g.
audiopd listerner invoke), we need to skip the unmapping on device
release, otherwise the DSP will crash. So lets safekeep all the maps
only if there is in invoke interrupted, by attaching them to the channel
context (which is resident until RPMSG driver is removed), and free them
on RPMSG driver remove.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221125071405.148786-9-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 months agomisc: fastrpc: Add support for audiopd
Abel Vesa [Fri, 25 Nov 2022 07:14:02 +0000 (07:14 +0000)]
misc: fastrpc: Add support for audiopd

In order to be able to start the adsp listener for audiopd using adsprpcd,
we need to add the corresponding ioctl for creating a static process.
On that ioctl call we need to allocate the heap. Allocating the heap needs
to be happening only once and needs to be kept between different device
open calls, so attach it to the channel context to make sure that remains
until the RPMSG driver is removed. Then, if there are any VMIDs associated
with the static ADSP process, do a call to SCM to assign it.
And then, send all the necessary info related to heap to the DSP.

Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221125071405.148786-8-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 months agomisc: fastrpc: Rework fastrpc_req_munmap
Abel Vesa [Fri, 25 Nov 2022 07:14:01 +0000 (07:14 +0000)]
misc: fastrpc: Rework fastrpc_req_munmap

Move the lookup of the munmap request to the fastrpc_req_munmap and pass
on only the buf to the lower level fastrpc_req_munmap_impl. That way
we can use the lower level fastrpc_req_munmap_impl on error path in
fastrpc_req_mmap to free the buf without searching for the munmap
request it belongs to.

Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221125071405.148786-7-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 months agomisc: fastrpc: Use fastrpc_map_put in fastrpc_map_create on fail
Abel Vesa [Fri, 25 Nov 2022 07:14:00 +0000 (07:14 +0000)]
misc: fastrpc: Use fastrpc_map_put in fastrpc_map_create on fail

Move the kref_init right after the allocation so that we can use
fastrpc_map_put on any following error case.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221125071405.148786-6-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 months agomisc: fastrpc: Add fastrpc_remote_heap_alloc
Abel Vesa [Fri, 25 Nov 2022 07:13:59 +0000 (07:13 +0000)]
misc: fastrpc: Add fastrpc_remote_heap_alloc

Split fastrpc_buf_alloc in such a way it allows allocation of remote
heap too and add fastrpc_remote_heap_alloc to do so.

Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221125071405.148786-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 months agomisc: fastrpc: Add reserved mem support
Abel Vesa [Fri, 25 Nov 2022 07:13:58 +0000 (07:13 +0000)]
misc: fastrpc: Add reserved mem support

The reserved mem support is needed for CMA heap support, which will be
used by AUDIOPD.

Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221125071405.148786-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 months agomisc: fastrpc: Rename audio protection domain to root
Abel Vesa [Fri, 25 Nov 2022 07:13:57 +0000 (07:13 +0000)]
misc: fastrpc: Rename audio protection domain to root

The AUDIO_PD will be done via static pd, so the proper name here is
actually ROOT_PD.

Co-developed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221125071405.148786-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 months agodt-bindings: misc: qcom,fastrpc: increase allowed iommus entries
Abel Vesa [Fri, 25 Nov 2022 07:13:56 +0000 (07:13 +0000)]
dt-bindings: misc: qcom,fastrpc: increase allowed iommus entries

The fastrpc components on the SM8550 SoC can require up to 3 IOMMU
entries, this bumps the maxItems to 3 for this purpose.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221125071405.148786-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 months agoMerge tag 'iio-for-6.2a-take2' of https://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Fri, 25 Nov 2022 17:35:16 +0000 (18:35 +0100)]
Merge tag 'iio-for-6.2a-take2' of https://git./linux/kernel/git/jic23/iio into char-misc-next

Jonathan writes:

1st set of IIO new device support, feature and cleanup for 6.2 (take2)

We have finally managed to take the mlock mutex entirely private so as
to avoid it being used for multiple purposes.  Now it is just used to
protect device mode transitions (typically to and from buffered capture).

Includes merge of an immutable i2c branch to get the new
i2c_client_get_device_id() (thanks to Wolfram for providing the branch).

Based on rc3 to pick up some precursor fixes from early in the cycle and
avoid an unnecessarily messy history.

New device support
* adi,ad4310
  - New driver to support this very flexible measurement device including
    a 24 bit ADC. Later fix for documentation build issue.
* adi,adxl355
  - Add support of the ADXL359 accelerometer.
* adi,ltc2983
  - Support additional variants of the temperatures sensor:
    LTC2984 with an EEPROM
    LTC2985, LTC2986 with only 10 channels.
* invensense,icm42600
  - Add support for icm42631 (needed only ID and WHOAMI)
* kionix,kx022a
  - New driver for this 3 axis accelerometer.
* maxim,max11401
  - New driver to support this 24-bit 10 channel ADC.
    Includes some new ABI to support configuration of notch filters.
* mediatek,mt6370
  - Add new driver to support the ADC part of the mt6370.
* st,lsm6dsx
  - Add support for LSM6DSV accelerometer and gyroscope. Simple additional
    of chip specific data and IDs.
  - Add support for LSM6DSV16X accelerometer and gyroscope.  Compatible with
    features currently implemented for the LSM6DSV.
* st,stm32-adc
  - Add support for stm32pm13x SoCs.

core / subsystem wide:
 - Add new IIO_STATIC_CONST_DEVICE_ATTR() which is a dance necessary to
   allow for the wrapping of attributes in the code that duplicates them
   for multiple buffers.
 - Harden against future issues with expectation that all buffer attributes
   are iio_dev_attrs by changing the code to take an array of pointers
   of the correct type.
 - Last transitions of drivers to local locks rather than missuses of mlock.
 - Add an iio_device_claim_buffer_mode() callback to avoid a race in the
   max30100 driver without directly using mlock.
 - Move mlock to the opaque IIO device structure to prevent misuse.
 - Add missing spi_device_id tables to support auto loading of modules.
 - Update some ADI maintainers in DT bindings.
 - A few more moves of bus drivers and core module sets to export
   name spaces.
 - Extensive use of new devm_regulator_get_enable() and friends.
 - Switch a bunch of i2c drivers to probe_new() including the bmp280
   which makes use of the new i2c_client_get_device_id() helper to
   simplify this change.

dt-bindings:
 - More use of spi-peripheral-props.yaml.

Features
* freescale,mpl115
  - Use runtime PM to implement shutdown GPIO support.
* melexis,mlx90632
  - More sophisticated runtime power management
  - Provide access to sampling frequency.
  - Trivial follow up fixes.
* microchip,mcp3911
  - Support control of PGA.
* st,lsm6dsx
  - Add support for software triggers for cases where the IRQ lines
    are not wired up.
* vishay,vcnl4000
  - Add control of integration time.

Minor cleanups and fixes
* adi,ad4130
  - Improve ABI documentation formatting.
  - Kconfig dependency fixup.
* adi,ad5758
  - Minor dt binding fix.
* adi,ad9834
  - Tidy up line breaks.
* adi,ade7854
  - Minor improvement in code clarity by replacing a ternary.
* adi,admv8818
  - Harden code against hardware returning wrong values.
* adi,adxl355
  - Warn only if unknown device ID detected to allow for fall back
    device tree compatibles on future devices.
* adi,ltc2983
  - dt-bindings clarifications and general improvements.
  - Ensure DMA safe buffer for bulk writes without relying on current
    regmap implementation choices.
* avago,adps9960
  - Fix up a disconnect between event enable attributes and what was
    enabled.
* bosch,bma400
  - Switch to dev_err_probe() from open coded EPROBE_DEFER handling.
* cosmic,cc10001
  - Fully devm managed probe() and related tidying up.
* meas,ms5611
  - Add an example of spi-max-frequency.
* meleixs,mlx90632
  - Tidy up confusing error return value.
  - Style improvements.
* multiplexer
  - Switch to dev_err_probe() from open coded EPROBE_DEFER handling.
* qcom,spmi-vadc
  - Minor dt binding improvements.
* rockchip,saradc
  - Add ID for rv1126.
* semtech,sx9360
  - Add SAMM0208 ACPI ID. Doesn't appear to be a valid vendor prefix
    but is in the wild.
* st,lsm6dsx
  - Factor out common code as _device_set_enable().
  - Fix up wrong docs after LSM6DSV addition.
* st,stm32-adc
  - Manage the min sampling time on all internal channels.
* trig,sysfs
  - Improve error labels.

* tag 'iio-for-6.2a-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (146 commits)
  iio: pressure: bmp280: convert to i2c's .probe_new()
  iio: imu: st_lsm6dsx: fix LSM6DSV sensor description
  iio: adc: ad4130: depend on GPIOLIB
  staging: iio: meter: replace ternary operator by if condition
  iio: light: apds9960: Fix iio_event_spec structures
  dt-bindings: iio: imu: Add inv_icm42600 documentation
  iio: imu: inv_icm42600: Add support for icm42631
  dt-bindings: iio: adc: rockchip-saradc: Add saradc for rv1126
  dt-bindings: iio: dac: adi,ad5758: Drop 'contains' from 'adi,dc-dc-mode'
  dt-bindings: iio: imu: st_lsm6dsx: add lsm6dsv16x
  iio: imu: st_lsm6dsx: add support to LSM6DSV16X
  iio: proximity: sx9360: Add a new ACPI hardware ID
  iio: temperature: mlx90632: Add missing static marking on devm_pm_ops
  iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()
  iio: temperature: ltc2983: support more parts
  dt-bindings: iio: temperature: ltc2983: support more parts
  dt-bindings: iio: temperature: ltc2983: use generic node name in example
  dt-bindings: iio: temperature: ltc2983: describe broken mux delay property
  dt-bindings: iio: temperature: ltc2983: refine descriptions
  dt-bindings: iio: temperature: ltc2983: change default excitation for custom thermistors
  ...

20 months agoiio: pressure: bmp280: convert to i2c's .probe_new()
Angel Iglesias [Sun, 13 Nov 2022 17:54:46 +0000 (18:54 +0100)]
iio: pressure: bmp280: convert to i2c's .probe_new()

Use i2c_client_get_device_id() to get the i2c_device_id* parameter in the
.new_probe() callback.

Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/5dcaa389ea2ffe7050091b07a3bc4b0c1c9d586b.1668361368.git.ang.iglesiasg@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoMerge remote-tracking branch 'i2c/i2c/client_device_id_helper-immutable' into togreg
Jonathan Cameron [Mon, 14 Nov 2022 20:38:30 +0000 (20:38 +0000)]
Merge remote-tracking branch 'i2c/i2c/client_device_id_helper-immutable' into togreg

20 months agoiio: imu: st_lsm6dsx: fix LSM6DSV sensor description
Lorenzo Bianconi [Mon, 14 Nov 2022 09:25:34 +0000 (10:25 +0100)]
iio: imu: st_lsm6dsx: fix LSM6DSV sensor description

Fix sensor ODR description for LSM6DSV/LSM6DSVX

Fixes: a1c6d631ff12 ("iio: imu: st_lsm6dsx: add support to LSM6DSV")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/653e14bf79bb88d8581d2bc42da2f784caaf3776.1668417770.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: adc: ad4130: depend on GPIOLIB
Cosmin Tanislav [Mon, 14 Nov 2022 13:36:49 +0000 (15:36 +0200)]
iio: adc: ad4130: depend on GPIOLIB

Fixes undefined references to 'gpiochip_get_data' and
'devm_gpiochip_add_data_with_key'.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 62094060cf3a ("iio: adc: ad4130: add AD4130 driver")
Link: https://lore.kernel.org/r/20221114133649.1737027-1-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agostaging: iio: meter: replace ternary operator by if condition
Deepak R Varma [Sun, 13 Nov 2022 05:28:20 +0000 (10:58 +0530)]
staging: iio: meter: replace ternary operator by if condition

Replace ternary operator by simple if based evaluation of the return
value. Issue identified using coccicheck.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Link: https://lore.kernel.org/r/Y3CAdCa17WdWDYUa@qemulion
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: light: apds9960: Fix iio_event_spec structures
Subhajit Ghosh [Thu, 10 Nov 2022 10:12:41 +0000 (18:12 +0800)]
iio: light: apds9960: Fix iio_event_spec structures

There is only one interrupt enable option for both ALS low and high
thresholds, and one for both Proximity low and high thresholds.

Signed-off-by: Subhajit Ghosh <subhajit.ghosh@vixtechnology.com>
Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20221110101241.10576-1-subhajit.ghosh@vixtechnology.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: imu: Add inv_icm42600 documentation
Jay Greco [Thu, 10 Nov 2022 19:29:33 +0000 (19:29 +0000)]
dt-bindings: iio: imu: Add inv_icm42600 documentation

Update the required documentation for the icm42631.

Signed-off-by: Jay Greco <grecojay@amazon.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://lore.kernel.org/r/20221110192933.13616-3-grecojay@amazon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: imu: inv_icm42600: Add support for icm42631
Jay Greco [Thu, 10 Nov 2022 19:29:32 +0000 (19:29 +0000)]
iio: imu: inv_icm42600: Add support for icm42631

Add the required WHOAMI and device_id definitions to support the
icm42631.

Signed-off-by: Jay Greco <grecojay@amazon.com>
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://lore.kernel.org/r/20221110192933.13616-2-grecojay@amazon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: adc: rockchip-saradc: Add saradc for rv1126
Jagan Teki [Tue, 8 Nov 2022 04:13:53 +0000 (09:43 +0530)]
dt-bindings: iio: adc: rockchip-saradc: Add saradc for rv1126

Add saradc compatible string for rockchip rv1126.

Cc: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jagan Teki <jagan@edgeble.ai>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221108041400.157052-4-jagan@edgeble.ai
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: dac: adi,ad5758: Drop 'contains' from 'adi,dc-dc-mode'
Rob Herring [Fri, 11 Nov 2022 21:28:46 +0000 (15:28 -0600)]
dt-bindings: iio: dac: adi,ad5758: Drop 'contains' from 'adi,dc-dc-mode'

'contains' applies to arrays, but 'adi,dc-dc-mode' is a scalar. So drop
'contains' from the 'if' schema.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221111212846.4104059-1-robh@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: imu: st_lsm6dsx: add lsm6dsv16x
Lorenzo Bianconi [Sun, 6 Nov 2022 14:36:54 +0000 (15:36 +0100)]
dt-bindings: iio: imu: st_lsm6dsx: add lsm6dsv16x

Add device bindings for lsm6dsv16x IMU sensor.
Use lsm6dsv as fallback device for lsm6dsv16x since it implements all the
features currently supported by lsm6dsv16x.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/8d10a63ec6abd22863ab25addd8c2f578dbc9cd9.1667745215.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: imu: st_lsm6dsx: add support to LSM6DSV16X
Lorenzo Bianconi [Sun, 6 Nov 2022 14:36:53 +0000 (15:36 +0100)]
iio: imu: st_lsm6dsx: add support to LSM6DSV16X

Add support to STM LSM6DSV16X (accelerometer and gyroscope) Mems sensor.
The LSM6DSV16X sensor can use LSM6DSV as fallback device since it
implements all the LSM6DSV16X features currently implemented in
st_lsm6dsx.

Datasheet: https://www.st.com/resource/en/datasheet/lsm6dsv16x.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/284b251f861dff30c399e5736a843c8e3a497249.1667745215.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: proximity: sx9360: Add a new ACPI hardware ID
Gwendal Grignou [Sat, 5 Nov 2022 22:51:57 +0000 (15:51 -0700)]
iio: proximity: sx9360: Add a new ACPI hardware ID

From
https://treexy.com/products/driver-fusion/database/sensors/semtech/sx9360-proximity/

sx9360 SAR sensor can be presented with ACPI ID SAMM0208.

Whilst this does not appear to be an official ACPI ID, it is in the wild
(perhaps due to a typo on the SAM PnP ID).

Reported-by: Jordi Torres <majosamaso@gmail.com>
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Link: https://lore.kernel.org/r/20221105225157.10081-1-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: temperature: mlx90632: Add missing static marking on devm_pm_ops
Jonathan Cameron [Sat, 5 Nov 2022 12:51:08 +0000 (12:51 +0000)]
iio: temperature: mlx90632: Add missing static marking on devm_pm_ops

Only used within this file, so should be marked static.

Fixes: 2aebc223fc7c ("iio: temperature: mlx90632 Add runtime powermanagement modes")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-off-by: Crt Mori <cmo@melexis.com>
Link: https://lore.kernel.org/r/20221105125108.383193-3-jic23@kernel.org
20 months agoiio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()
Jonathan Cameron [Sat, 5 Nov 2022 12:51:07 +0000 (12:51 +0000)]
iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()

This call can fail so handling is necessary even if it is very unlikely.

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527134 ("Error handling issues")
Fixes: 2aebc223fc7c ("iio: temperature: mlx90632 Add runtime powermanagement modes")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-off-by: Crt Mori <cmo@melexis.com>
Link: https://lore.kernel.org/r/20221105125108.383193-2-jic23@kernel.org
20 months agoiio: temperature: ltc2983: support more parts
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:41 +0000 (15:00 +0200)]
iio: temperature: ltc2983: support more parts

Add support for the following parts:
 * LTC2984
 * LTC2986
 * LTM2985

The LTC2984 is a variant of the LTC2983 with EEPROM.
The LTC2986 is a variant of the LTC2983 with only 10 channels,
EEPROM and support for active analog temperature sensors.
The LTM2985 is software-compatible with the LTC2986.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20221103130041.2153295-14-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: support more parts
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:40 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: support more parts

Add support for the following parts:
 * LTC2984
 * LTC2986
 * LTM2985

The LTC2984 is a variant of the LTC2983 with EEPROM.
The LTC2986 is a variant of the LTC2983 with only 10 channels,
EEPROM and support for active analog temperature sensors.
The LTM2985 is software-compatible with the LTC2986.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-13-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: use generic node name in example
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:39 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: use generic node name in example

Examples should use the generic IIO node name of temperature-sensor.
Fix it.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20221103130041.2153295-12-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: describe broken mux delay property
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:38 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: describe broken mux delay property

The 'adi,mux-delay-config-us' property is broken. It was supposed to
be in us, but the value is actually written directly to the register.
Describe the fact that it is broken and how it actually works.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-11-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: refine descriptions
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:37 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: refine descriptions

Some descriptions are too verbose, while others are too succint.
Rewrite them all.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-10-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: change default excitation for custom thermistors
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:36 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: change default excitation for custom thermistors

Excitation cannot be set to auto-range when using a custom thermistor
or Steinhart sensor type. Default it to 1000nA to match the driver
and remove the auto-range value from the enum.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-9-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: require 4 wire rtd for current rotate
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:35 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: require 4 wire rtd for current rotate

The driver will error out when current rotation is enabled but the RTD
is not 4-wire. Require it in the binding too.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-8-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: require custom sensor tables
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:34 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: require custom sensor tables

The driver will error out when a custom sensor type is used but a
custom sensor table is not provided. Require it in the binding too.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-7-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: describe matrix items
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:33 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: describe matrix items

Give a little bit of information on what each item in the matrix is
supposed to be.

Also, some matrices put the 'minItems' and 'maxItems' keywords in the
wrong level. They should be on the same level as the 'items' keyword.
Fix it.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-6-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: remove qutations from phandle ref
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:32 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: remove qutations from phandle ref

Not needed, so why have them?

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-5-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: use hex for sensor address
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:31 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: use hex for sensor address

Addresses should be in hex, fix it.

Although the driver initially specified 1-20, it can be made free-range
since the address is supposed to match reg, onto which we can impose
restrictions based on the compatible property value.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-4-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: temperature: ltc2983: add default values
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:30 +0000 (15:00 +0200)]
dt-bindings: iio: temperature: ltc2983: add default values

Binding properties should have default values to let the reader
know if they should change it. Add them based on driver logic.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-3-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: temperature: ltc2983: make bulk write buffer DMA-safe
Cosmin Tanislav [Thu, 3 Nov 2022 13:00:29 +0000 (15:00 +0200)]
iio: temperature: ltc2983: make bulk write buffer DMA-safe

regmap_bulk_write() does not guarantee implicit DMA-safety,
even though the current implementation duplicates the given
buffer. Do not rely on it.

Fixes: f110f3188e56 ("iio: temperature: Add support for LTC2983")
Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20221103130041.2153295-2-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoDocumentation: ad4130: format list of in_voltage-voltage_filter_mode_available modes
Bagas Sanjaya [Sun, 6 Nov 2022 14:02:33 +0000 (21:02 +0700)]
Documentation: ad4130: format list of in_voltage-voltage_filter_mode_available modes

Sphinx reports two warnings on sysfs documentation for AD4130 driver:

Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130:2: WARNING: Unexpected indentation.
Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130:2: WARNING: Block quote ends without a blank line; unexpected unindent.

These are due to misformatting of sinc* modes list. Format it with bullet
list. Since each entry spans multiple lines, separate each with a blank
line.

Fixes: 62094060cf3a ("iio: adc: ad4130: add AD4130 driver")
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Link: https://lore.kernel.org/r/20221106140233.74112-1-bagasdotme@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodrivers: iio: accel: Add support for ADXL359 device
Ramona Bolboaca [Mon, 31 Oct 2022 10:51:29 +0000 (12:51 +0200)]
drivers: iio: accel: Add support for ADXL359 device

Add support for ADXL359 device in already existing ADXL355 driver.

Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/adxl359.pdf
Signed-off-by: Ramona Bolboaca <ramona.bolboaca@analog.com>
Link: https://lore.kernel.org/r/20221031105129.47740-4-ramona.bolboaca@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: accel: Add docs for ADXL359
Ramona Bolboaca [Mon, 31 Oct 2022 10:51:28 +0000 (12:51 +0200)]
dt-bindings: iio: accel: Add docs for ADXL359

Update ADXL355 existing documentation with documentation
for ADXL359 device.

Signed-off-by: Ramona Bolboaca <ramona.bolboaca@analog.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221031105129.47740-3-ramona.bolboaca@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodrivers: iio: accel: Use warning if invalid device id is detected
Ramona Bolboaca [Mon, 31 Oct 2022 10:51:27 +0000 (12:51 +0200)]
drivers: iio: accel: Use warning if invalid device id is detected

Use warning instead of failing driver probe if invalid device id is
detected for ADXL355 device.

Signed-off-by: Ramona Bolboaca <ramona.bolboaca@analog.com>
Link: https://lore.kernel.org/r/20221031105129.47740-2-ramona.bolboaca@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: imu: st_lsm6dsx: add lsm6dsv device bindings
Lorenzo Bianconi [Mon, 31 Oct 2022 11:41:26 +0000 (12:41 +0100)]
dt-bindings: iio: imu: st_lsm6dsx: add lsm6dsv device bindings

Introduce device bindings for LSM6DSV IMU sensor.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/c34cea4468dc26050dff812f47e1a21f8e544758.1667216004.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: imu: st_lsm6dsx: add support to LSM6DSV
Lorenzo Bianconi [Mon, 31 Oct 2022 11:41:25 +0000 (12:41 +0100)]
iio: imu: st_lsm6dsx: add support to LSM6DSV

Add support to STM LSM6DSV (accelerometer and gyroscope)
Mems sensor.

Datasheet: https://www.st.com/resource/en/datasheet/lsm6dsv.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/aad879e7af0fe583bbf043a2b93e32fade79fa19.1667216004.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: imu: st_lsm6dsx: introduce sw trigger support
Lorenzo Bianconi [Fri, 28 Oct 2022 11:23:42 +0000 (13:23 +0200)]
iio: imu: st_lsm6dsx: introduce sw trigger support

There are some hw configuration where irq0 and/or irq1 pins are not
connected to the SPI or I2C/I3C controller. In order to avoid polling
the output register introduce iio-sw trigger support when irq line is
not available (or hw FIFO is not supported).

Suggested-by: Mario Tesi <mario.tesi@st.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/93ae6ff1150b531a9d7a4d3d1b1adb8383613717.1666955685.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: adc: qcom,spmi-vadc: extend example
Krzysztof Kozlowski [Thu, 27 Oct 2022 14:34:11 +0000 (10:34 -0400)]
dt-bindings: iio: adc: qcom,spmi-vadc: extend example

Cleanup existing example (generic node name for spmi, use 4-space
indentation) and add example for ADCv7 copied from
Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221027143411.277980-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: adc: qcom,spmi-vadc: simplify compatible enum
Krzysztof Kozlowski [Thu, 27 Oct 2022 14:34:10 +0000 (10:34 -0400)]
dt-bindings: iio: adc: qcom,spmi-vadc: simplify compatible enum

The second compatible item in oneOf is just an enum, not a list.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221027143411.277980-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: adc: cc10001: Switch remaining IIO calls in probe to devm_ forms.
Jonathan Cameron [Sun, 16 Oct 2022 17:09:50 +0000 (18:09 +0100)]
iio: adc: cc10001: Switch remaining IIO calls in probe to devm_ forms.

As everything else is now handled by devm managed releases the
triggered buffer setup and IIO device registration can also be
moved over to their devm forms allowing dropping of remove().

Only user of drvdata associated with the struct device was the
remove function, so also drop the platform_set_drvdata() call.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016170950.387751-6-jic23@kernel.org
20 months agoiio: adc: cc10001: Use devm_ to call device power down.
Jonathan Cameron [Sun, 16 Oct 2022 17:09:49 +0000 (18:09 +0100)]
iio: adc: cc10001: Use devm_ to call device power down.

It is presumably safe to call the powerdown whether or not we are
in the commented shared state (the driver always did this).

The power down was previously out of order wrt to the probe() function
so move using devm_ will ensure it occurs after the userspace interfaces
are removed.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016170950.387751-5-jic23@kernel.org
20 months agoiio: adc: cc10001: Use devm_clk_get_enabled() to avoid boilerplate.
Jonathan Cameron [Sun, 16 Oct 2022 17:09:48 +0000 (18:09 +0100)]
iio: adc: cc10001: Use devm_clk_get_enabled() to avoid boilerplate.

As this driver just enables clock in probe() and disables in remove()
we can use this new function to replace boilerplate and simplify
error paths.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016170950.387751-4-jic23@kernel.org
20 months agoiio: adc: cc10001: Add devm_add_action_or_reset() to disable regulator.
Jonathan Cameron [Sun, 16 Oct 2022 17:09:47 +0000 (18:09 +0100)]
iio: adc: cc10001: Add devm_add_action_or_reset() to disable regulator.

As the voltage of this regulator is queried, we cannot use the
devm_regulator_get_enable() call and have to role our own disable.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016170950.387751-3-jic23@kernel.org
20 months agoiio: adc: cc10001: Add local struct device *dev variable to avoid repitition
Jonathan Cameron [Sun, 16 Oct 2022 17:09:46 +0000 (18:09 +0100)]
iio: adc: cc10001: Add local struct device *dev variable to avoid repitition

There are lots of uses of this in probe() and we are about to introduce
some more, so add a local variable to simplify this.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016170950.387751-2-jic23@kernel.org
20 months agoiio: Don't silently expect attribute types
Matti Vaittinen [Mon, 3 Oct 2022 08:13:53 +0000 (11:13 +0300)]
iio: Don't silently expect attribute types

The iio_triggered_buffer_setup_ext() and the
devm_iio_kfifo_buffer_setup_ext() were changed by
commit 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
to silently expect that all attributes given in buffer_attrs array are
device-attributes. This expectation was not forced by the API - and some
drivers did register attributes created by IIO_CONST_ATTR().

When using IIO_CONST_ATTRs the added attribute "wrapping" does not copy
the pointer to stored string constant and when the sysfs file is read the
kernel will access to invalid location.

Change the function signatures to expect an array of iio_dev_attrs to
avoid similar errors in the future.

Merge conflict resolved whilst applying due to patch crossing with
two new drivers (kx022a accelerometer and ad4130 ADC).

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/63f54787a684eb1232f1c5d275a09c786987fe4a.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: at91-sama5d2_adc: Use IIO_STATIC_CONST_DEVICE_ATTR()
Matti Vaittinen [Mon, 3 Oct 2022 08:13:31 +0000 (11:13 +0300)]
iio: at91-sama5d2_adc: Use IIO_STATIC_CONST_DEVICE_ATTR()

Slightly simplify by dropping open-coded constant data iio_dev_attr
functions and using the IIO_STATIC_CONST_DEVICE_ATTR() instead.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/4476a4ce852febb3eb863878e66751c787195b18.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: bmc150-accel-core: Use IIO_STATIC_CONST_DEVICE_ATTR()
Matti Vaittinen [Mon, 3 Oct 2022 08:13:10 +0000 (11:13 +0300)]
iio: bmc150-accel-core: Use IIO_STATIC_CONST_DEVICE_ATTR()

Slightly simplify by dropping open-coded constant data iio_dev_attr
functions and using the IIO_STATIC_CONST_DEVICE_ATTR() instead.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/b1b0d662705b43d68594639fb7719bc431101f79.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: adxl372: Use IIO_STATIC_CONST_DEVICE_ATTR()
Matti Vaittinen [Mon, 3 Oct 2022 08:12:48 +0000 (11:12 +0300)]
iio: adxl372: Use IIO_STATIC_CONST_DEVICE_ATTR()

Slightly simplify by dropping open-coded constant data iio_dev_attr
functions and using the IIO_STATIC_CONST_DEVICE_ATTR() instead.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/3632af8849ef101c54ec1f739596f22c773b067c.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: adxl367: Use IIO_STATIC_CONST_DEVICE_ATTR()
Matti Vaittinen [Mon, 3 Oct 2022 08:12:25 +0000 (11:12 +0300)]
iio: adxl367: Use IIO_STATIC_CONST_DEVICE_ATTR()

Slightly simplify by dropping open-coded constant data iio_dev_attr
functions and using the IIO_STATIC_CONST_DEVICE_ATTR() instead.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/c96c55363b8f36017ef7f18fdfe810cd3990e2a4.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: Add IIO_STATIC_CONST_DEVICE_ATTR
Matti Vaittinen [Mon, 3 Oct 2022 08:12:04 +0000 (11:12 +0300)]
iio: Add IIO_STATIC_CONST_DEVICE_ATTR

Add IIO_STATIC_CONST_DEVICE_ATTR macro for creating an read-only
iio_dev_attr which returns constant value. This macro is intended to be
used when replacing the IIO_CONST_ATTR - attributes for triggered
buffers because the triggered buffer attributes must be of type
iio_dev_attr.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/8dd853dd0ef8eb40cb980cc6f6e7a43166de3afb.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: adc: ad4130: Fix spelling mistake "diffreential" -> "differential"
Colin Ian King [Fri, 4 Nov 2022 09:31:48 +0000 (09:31 +0000)]
iio: adc: ad4130: Fix spelling mistake "diffreential" -> "differential"

There is a spelling mistake in an error message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20221104093148.167765-1-colin.i.king@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoMAINTAINERS: Add KX022A maintainer entry
Matti Vaittinen [Mon, 24 Oct 2022 12:40:58 +0000 (15:40 +0300)]
MAINTAINERS: Add KX022A maintainer entry

Add maintainer entry for ROHM/Kionix KX022A accelerometer sensor driver.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/7895435f7fd31a3b576fc6a59b01eb3202c85d36.1666614295.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: Support Kionix/ROHM KX022A accelerometer
Matti Vaittinen [Mon, 24 Oct 2022 12:40:29 +0000 (15:40 +0300)]
iio: accel: Support Kionix/ROHM KX022A accelerometer

KX022A is a 3-axis accelerometer from ROHM/Kionix. The sensor features
include variable ODRs, I2C and SPI control, FIFO/LIFO with watermark IRQ,
tap/motion detection, wake-up & back-to-sleep events, four acceleration
ranges (2, 4, 8 and 16g), and probably some other cool features.

Add support for the basic accelerometer features such as getting the
acceleration data via IIO. (raw reads, triggered buffer [data-ready] or
using the WMI IRQ).

Important things to be added include the double-tap, motion
detection and wake-up as well as the runtime power management.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/758b00d6aea0a6431a5a3a78d557d449c113b21e.1666614295.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: Add KX022A accelerometer
Matti Vaittinen [Mon, 24 Oct 2022 12:40:11 +0000 (15:40 +0300)]
dt-bindings: iio: Add KX022A accelerometer

KX022A is a 3-axis Accelerometer from ROHM/Kionix. The sensor features
include variable ODRs, I2C and SPI control, FIFO/LIFO with watermark IRQ,
tap/motion detection, wake-up & back-to-sleep events, four acceleration
ranges (2, 4, 8 and 16g) and probably some other cool features.

Add the basic device tree description for the accelerometer. Only basic
accelerometer features are considered as of now - new properties may or
may not be needed in the future when rest of the features are supported.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/06f8e1ab29d02ed216db10091a269df4b6abad9a.1666614295.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: trigger: sysfs: rename error label in iio_sysfs_trigger_probe()
Yang Yingliang [Mon, 24 Oct 2022 10:52:50 +0000 (18:52 +0800)]
iio: trigger: sysfs: rename error label in iio_sysfs_trigger_probe()

Rename error label in iio_sysfs_trigger_probe() to make more readable.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221024105250.873394-1-yangyingliang@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: temperature: mlx90632 Style alignment for the driver
Crt Mori [Mon, 24 Oct 2022 10:22:05 +0000 (12:22 +0200)]
iio: temperature: mlx90632 Style alignment for the driver

Changing and aligning the overall style of the driver with the recent
reviews. There is no functional change, only type generalization and
moving to the reverse Christmas tree for variable declarations.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Crt Mori <cmo@melexis.com>
Link: https://lore.kernel.org/r/d59aad00891c1a64e044a0f5bc7d40e42d47e9c7.1666606912.git.cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: vl6180: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:23:02 +0000 (15:23 +0200)]
iio: accel: vl6180: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-24-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: st_magn: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:23:01 +0000 (15:23 +0200)]
iio: accel: st_magn: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-23-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: stk8ba50: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:23:00 +0000 (15:23 +0200)]
iio: accel: stk8ba50: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-22-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: stk8312: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:59 +0000 (15:22 +0200)]
iio: accel: stk8312: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-21-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: mxc6255: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:58 +0000 (15:22 +0200)]
iio: accel: mxc6255: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-20-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: mxc4005: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:57 +0000 (15:22 +0200)]
iio: accel: mxc4005: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-19-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: mma7660: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:53 +0000 (15:22 +0200)]
iio: accel: mma7660: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-15-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: mc3230: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:51 +0000 (15:22 +0200)]
iio: accel: mc3230: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-13-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: kxsd9: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:50 +0000 (15:22 +0200)]
iio: accel: kxsd9: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-12-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: dmard10: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:48 +0000 (15:22 +0200)]
iio: accel: dmard10: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: dmard09: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:47 +0000 (15:22 +0200)]
iio: accel: dmard09: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-9-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: dmard06: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:46 +0000 (15:22 +0200)]
iio: accel: dmard06: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-8-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: da311: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:45 +0000 (15:22 +0200)]
iio: accel: da311: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-7-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: accel: adxl367: Convert to i2c's .probe_new()
Uwe Kleine-König [Sun, 23 Oct 2022 13:22:40 +0000 (15:22 +0200)]
iio: accel: adxl367: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221023132302.911644-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: proximity: sx_common: Use devm_regulator_bulk_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:34:07 +0000 (17:34 +0100)]
iio: proximity: sx_common: Use devm_regulator_bulk_get_enable()

This driver only turns the power for some regulators on at probe and off
via a custom devm_add_action_or_reset() callback. The new
devm_regulator_bulk_get_enable() replaces all this boilerplate code.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-13-jic23@kernel.org
20 months agoiio: light: noa1305: Use devm_regulator_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:34:06 +0000 (17:34 +0100)]
iio: light: noa1305: Use devm_regulator_get_enable()

This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-12-jic23@kernel.org
20 months agoiio: light: ltr501: Use devm_regulator_bulk_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:34:05 +0000 (17:34 +0100)]
iio: light: ltr501: Use devm_regulator_bulk_get_enable()

This driver only turns the power for some regulators on at probe and off
via a custom devm_add_action_or_reset() callback. The new
devm_regulator_bulk_get_enable() replaces all this boilerplate code.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-11-jic23@kernel.org
20 months agoiio: humidity: hts211: Use devm_regulator_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:34:04 +0000 (17:34 +0100)]
iio: humidity: hts211: Use devm_regulator_get_enable()

This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-10-jic23@kernel.org
20 months agoiio: frequency: ad9523: Use devm_regulator_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:34:03 +0000 (17:34 +0100)]
iio: frequency: ad9523: Use devm_regulator_get_enable()

This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.

Note that in event of an error on the devm_regulator_get() the driver
would have continued without enabling the regulator which is probably
not a good idea.  So here we handle any error as a reason to fail the
probe(). In theory this may expose breakage on a platform that was
previously papered over but it seems low risk.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-9-jic23@kernel.org
20 months agoiio: st_sensors: core and lsm9ds0 switch to devm_regulator_bulk_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:34:02 +0000 (17:34 +0100)]
iio: st_sensors: core and lsm9ds0 switch to devm_regulator_bulk_get_enable()

These drivers only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The two regulators were handled
separately so also switch to bulk registration.
The new devm_regulator_bulk_get_enable() replaces all this boilerplate
code.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-8-jic23@kernel.org
20 months agoiio: cdc: ad7150: Use devm_regulator_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:34:01 +0000 (17:34 +0100)]
iio: cdc: ad7150: Use devm_regulator_get_enable()

This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-7-jic23@kernel.org
20 months agoiio: accel: msa311: Use devm_regulator_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:34:00 +0000 (17:34 +0100)]
iio: accel: msa311: Use devm_regulator_get_enable()

This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Dmitry Rokosov <DDRokosov@sberdevices.ru>
Reviewed-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-6-jic23@kernel.org
20 months agoiio: accel: kxcjk-1013: Use devm_regulator_bulk_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:33:59 +0000 (17:33 +0100)]
iio: accel: kxcjk-1013: Use devm_regulator_bulk_get_enable()

This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new
devm_regulator_bulk_get_enable() replaces this boilerplate code.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-5-jic23@kernel.org
20 months agoiio: accel: fxls8962af: Use devm_regulator_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:33:58 +0000 (17:33 +0100)]
iio: accel: fxls8962af: Use devm_regulator_get_enable()

This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Sean Nyekjaer <sean@geanix.com>
Reviewed-by: Sean Nyekjaer <sean@geanix.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-4-jic23@kernel.org
20 months agoiio: accel: adxl367: Use devm_regulator_bulk_get_enable()
Jonathan Cameron [Sun, 16 Oct 2022 16:33:56 +0000 (17:33 +0100)]
iio: accel: adxl367: Use devm_regulator_bulk_get_enable()

This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new
devm_regulator_bulk_get_enable() replaces this boilerplate code.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-2-jic23@kernel.org
20 months agostaging: iio: frequency: ad9834: merge unnecessary split lines
Deepak R Varma [Mon, 17 Oct 2022 06:32:30 +0000 (12:02 +0530)]
staging: iio: frequency: ad9834: merge unnecessary split lines

Improve code readability by merging unnecessary split lines that are
well within the code-style guidelines post merge.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Acked-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/Y0z2/qFe3kW96MTs@debian-BULLSEYE-live-builder-AMD64
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: adc: ad4130: add AD4130 driver
Cosmin Tanislav [Fri, 21 Oct 2022 10:41:15 +0000 (13:41 +0300)]
iio: adc: ad4130: add AD4130 driver

AD4130-8 is an ultra-low power, high precision, measurement solution for
low bandwidth battery operated applications.

The fully integrated AFE (Analog Front-End) includes a multiplexer for up
to 16 single-ended or 8 differential inputs, PGA (Programmable Gain
Amplifier), 24-bit Sigma-Delta ADC, on-chip reference and oscillator,
selectable filter options, smart sequencer, sensor biasing and excitation
options, diagnostics, and a FIFO buffer.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20221021104115.1812486-3-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: adc: add AD4130
Cosmin Tanislav [Fri, 21 Oct 2022 10:41:14 +0000 (13:41 +0300)]
dt-bindings: iio: adc: add AD4130

AD4130-8 is an ultra-low power, high precision, measurement solution for
low bandwidth battery operated applications.

The fully integrated AFE (Analog Front-End) includes a multiplexer for up
to 16 single-ended or 8 differential inputs, PGA (Programmable Gain
Amplifier), 24-bit Sigma-Delta ADC, on-chip reference and oscillator,
selectable filter options, smart sequencer, sensor biasing and excitation
options, diagnostics, and a FIFO buffer.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221021104115.1812486-2-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agodt-bindings: iio: pressure: meas,ms5611: add max SPI frequency to the example
Mitja Spes [Fri, 21 Oct 2022 13:58:22 +0000 (15:58 +0200)]
dt-bindings: iio: pressure: meas,ms5611: add max SPI frequency to the example

Added max SPI frequency setting to the example.

Signed-off-by: Mitja Spes <mitja@lxnav.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221021135827.1444793-4-mitja@lxnav.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: amplifier: hmc425a: simplify using devm_regulator_get_enable()
Matti Vaittinen [Fri, 19 Aug 2022 19:21:02 +0000 (22:21 +0300)]
iio: amplifier: hmc425a: simplify using devm_regulator_get_enable()

Drop open-coded pattern: 'devm_regulator_get(), regulator_enable(),
add_action_or_reset(regulator_disable)' and use the
devm_regulator_get_enable() and drop the pointer to the regulator.
This simplifies code and makes it less tempting to add manual control
for the regulator which is also controlled by devm.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/8b1193fdefb231a6d721e2bded52c48e56039c20.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: adc: max1363: simplify using devm_regulator_get_enable()
Matti Vaittinen [Fri, 19 Aug 2022 19:20:47 +0000 (22:20 +0300)]
iio: adc: max1363: simplify using devm_regulator_get_enable()

Drop open-coded pattern: 'devm_regulator_get(), regulator_enable(),
add_action_or_reset(regulator_disable)' and use the
devm_regulator_get_enable() and drop the pointer to the regulator.
This simplifies code and makes it less tempting to add manual control
for the regulator which is also controlled by devm.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/1286ea127d190e5708a0aaff271819b2d3f8802d.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: adc: max1241: simplify using devm_regulator_get_enable()
Matti Vaittinen [Fri, 19 Aug 2022 19:20:32 +0000 (22:20 +0300)]
iio: adc: max1241: simplify using devm_regulator_get_enable()

Drop open-coded pattern: 'devm_regulator_get(), regulator_enable(),
add_action_or_reset(regulator_disable)' and use the
devm_regulator_get_enable() and drop the pointer to the regulator.
This simplifies code and makes it less tempting to add manual control
for the regulator which is also controlled by devm.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Alexandru Lazar <alazar@startmail.com>
Link: https://lore.kernel.org/r/7c759bf6c06e72ae70bffeebc1939d9903427278.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: adc: ad7606: simplify using devm_regulator_get_enable()
Matti Vaittinen [Fri, 19 Aug 2022 19:20:18 +0000 (22:20 +0300)]
iio: adc: ad7606: simplify using devm_regulator_get_enable()

Drop open-coded pattern: 'devm_regulator_get(), regulator_enable(),
add_action_or_reset(regulator_disable)' and use the
devm_regulator_get_enable() and drop the pointer to the regulator.
This simplifies code and makes it less tempting to add manual control
for the regulator which is also controlled by devm.

Whilst here also switch to dev_err_probe() to provide more information
if a deferred probe occurs.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/521c52f5a9bdc2db04d5775b36df4b233ae338da.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: adc: ad7476: simplify using devm_regulator_get_enable()
Matti Vaittinen [Fri, 19 Aug 2022 19:20:03 +0000 (22:20 +0300)]
iio: adc: ad7476: simplify using devm_regulator_get_enable()

Drop open-coded pattern: 'devm_regulator_get(), regulator_enable(),
add_action_or_reset(regulator_disable)' and use the
devm_regulator_get_enable()

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/33070d66b9b976acac1cee5570facef9278b6b61.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: imu: st_lsm6dsx: Simplify using devm_regulator_*get_enable()
Matti Vaittinen [Fri, 19 Aug 2022 19:19:46 +0000 (22:19 +0300)]
iio: imu: st_lsm6dsx: Simplify using devm_regulator_*get_enable()

Use devm_regulator_bulk_get_enable() instead of open coded bulk-get,
bulk-enable, add-action-to-disable-at-detach - pattern.

A functional change (which seems like a bugfix) is that if
regulator_bulk_get fails, the enable is not attempted.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/876e58428cec056d51070e49eff559e2d7c23b12.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
20 months agoiio: gyro: bmg160_core: Simplify using devm_regulator_*get_enable()
Matti Vaittinen [Fri, 19 Aug 2022 19:19:31 +0000 (22:19 +0300)]
iio: gyro: bmg160_core: Simplify using devm_regulator_*get_enable()

Use devm_regulator_bulk_get_enable() instead of open coded bulk-get,
bulk-enable, add-action-to-disable-at-detach - pattern.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/3fd11489356b1c73a3d7b4bd9dec7e12c9fe8788.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>