Claudiu Beznea
563cf94f93
iio: adc: rzg2l_adc: Add suspend/resume support
...
The Renesas RZ/G3S SoC features a power-saving mode where power to most of
the SoC components is turned off, including the ADC IP.
Suspend/resume support has been added to the rzg2l_adc driver to restore
functionality after resuming from this power-saving mode. During suspend,
the ADC resets are asserted, and the ADC is powered down. On resume, the
ADC resets are de-asserted, the hardware is re-initialized, and the ADC
power is restored using the runtime PM APIs.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com >
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Link: https://patch.msgid.link/20241206111337.726244-12-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-11 19:20:44 +00:00
Claudiu Beznea
6dd8a77125
iio: adc: rzg2l_adc: Add support for channel 8
...
The ADC on the Renesas RZ/G3S SoC includes an additional channel (channel
8) dedicated to reading temperature values from the Thermal Sensor Unit
(TSU). There is a direct in-SoC connection between the ADC and TSU IPs.
To read the temperature reported by the TSU, a different sampling rate
(compared to channels 0-7) must be configured in the ADM3 register.
The rzg2l_adc driver has been updated to support reading the TSU
temperature.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com >
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Link: https://patch.msgid.link/20241206111337.726244-11-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-11 19:19:07 +00:00
Claudiu Beznea
a259a8465d
iio: adc: rzg2l_adc: Prepare for the addition of RZ/G3S support
...
The ADC IP available on the RZ/G3S differs slightly from the one found on
the RZ/G2L. The identified differences are as follows:
- different number of channels (one being used for temperature conversion);
consequently, various registers differ
- different default sampling periods
- the RZ/G3S variant lacks the ADVIC register.
To accommodate these differences, the rzg2l_adc driver has been updated by
introducing the struct rzg2l_adc_hw_params, which encapsulates the
hardware-specific differences between the IP variants. A pointer to an
object of type struct rzg2l_adc_hw_params is embedded in
struct rzg2l_adc_data.
Additionally, the completion member of struct rzg2l_adc_data was relocated
to avoid potential padding, if any.
The code has been adjusted to utilize hardware-specific parameters stored
in the new structure instead of relying on plain macros.
The check of chan->channel in rzg2l_adc_read_raw() function, against the
driver specific mask was removed as the subsystem should have already
been done this before reaching the rzg2l_adc_read_raw() function. Along
with it the local variable ch was dropped as chan->channel could be used
instead.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com >
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Link: https://patch.msgid.link/20241206111337.726244-10-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-11 19:18:55 +00:00
Claudiu Beznea
d7c3e34634
iio: adc: rzg2l_adc: Enable runtime PM autosuspend support
...
Enable runtime PM autosuspend support for the rzg2l_adc driver. With this
change, consecutive conversion requests will no longer cause the device to
be runtime-enabled/disabled after each request. Instead, the device will
transition based on the delay configured by the user.
This approach reduces the frequency of hardware register access during
runtime PM suspend/resume cycles, thereby saving CPU cycles.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com >
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Link: https://patch.msgid.link/20241206111337.726244-9-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-11 19:18:48 +00:00
Claudiu Beznea
5d7fb2d589
iio: adc: rzg2l_adc: Simplify the locking scheme in rzg2l_adc_read_raw()
...
Simplify the locking scheme in rzg2l_adc_read_raw() by using
guard(mutex)().
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com >
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Link: https://patch.msgid.link/20241206111337.726244-8-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-11 19:18:37 +00:00
Claudiu Beznea
b7549624af
iio: adc: rzg2l_adc: Use read_poll_timeout()
...
Replace the driver-specific implementation with the read_poll_timeout()
function. This change simplifies the code and improves maintainability by
leveraging the standardized helper.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com >
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Link: https://patch.msgid.link/20241206111337.726244-7-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-11 19:18:27 +00:00
Claudiu Beznea
7842ef74c5
iio: adc: rzg2l_adc: Switch to RUNTIME_PM_OPS() and pm_ptr()
...
The use of SET_RUNTIME_PM_OPS() is now deprecated and requires
__maybe_unused annotations to avoid warnings about unused functions.
Switching to RUNTIME_PM_OPS() and pm_ptr() eliminates the need for such
annotations because the compiler can directly reference the runtime PM
functions, thereby suppressing the warnings. As a result, the
__maybe_unused markings can be removed.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com >
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Link: https://patch.msgid.link/20241206111337.726244-6-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-11 19:18:18 +00:00
Claudiu Beznea
89ee8174e8
iio: adc: rzg2l_adc: Simplify the runtime PM code
...
All Renesas SoCs using the rzg2l_adc driver manage ADC clocks through PM
domains. Calling pm_runtime_{resume_and_get, put_sync}() implicitly sets
the state of the clocks. As a result, the code in the rzg2l_adc driver that
explicitly manages ADC clocks can be removed, leading to simpler and
cleaner implementation.
Additionally, replace the use of rzg2l_adc_set_power() with direct PM
runtime API calls to further simplify and clean up the code.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com >
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Link: https://patch.msgid.link/20241206111337.726244-5-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-11 19:18:06 +00:00
Claudiu Beznea
b010b10467
iio: adc: rzg2l_adc: Use devres helpers to request pre-deasserted reset controls
...
Starting with commit d872bed850 ("reset: Add devres helpers to request
pre-deasserted reset controls"), devres helpers are available to simplify
the process of requesting pre-deasserted reset controls. Update the
rzg2l_adc driver to utilize these helpers, reducing complexity in this
way.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com >
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Link: https://patch.msgid.link/20241206111337.726244-4-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-11 19:17:58 +00:00
Claudiu Beznea
a34dc289f8
iio: adc: rzg2l_adc: Convert dev_err() to dev_err_probe()
...
Convert all occurrences of dev_err() in the probe path to dev_err_probe().
This improves readability and simplifies the code.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com >
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Link: https://patch.msgid.link/20241206111337.726244-3-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-11 19:17:51 +00:00
Matti Vaittinen
a8ec0b44c7
iio: kx022a: document new chip_info structure members
...
The kx022a driver supports a few different HW variants. A chip-info
structure is used to describe sensor specific details. Support for
sensors with different measurement g-ranges was added recently,
introducing sensor specific scale arrays.
The members of the chip-info structure have been documented using
kerneldoc. The newly added members omitted the documentation. It is nice
to have all the entries documented for the sake of the consistency.
Furthermore, the scale table format may not be self explatonary, nor how
the amount of scales is informed.
Add documentation to scale table entries to maintain consistency and to
make it more obvious how the scales should be represented.
Suggested-by: Mehdi Djait <mehdi.djait@linux.intel.com >
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com >
Link: https://patch.msgid.link/Z1LDUj-naUdGSM6n@mva-rohm
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-08 18:26:31 +00:00
Christophe JAILLET
56f8c1759b
iio: proximity: aw96103: Constify struct iio_info
...
'struct iio_info' is not modified in this driver.
Constifying this structure moves some data to a read-only section, so
increase overall security, especially when the structure holds some
function pointers.
On a x86_64, with allmodconfig:
Before:
======
text data bss dec hex filename
17366 1454 16 18836 4994 drivers/iio/proximity/aw96103.o
After:
=====
text data bss dec hex filename
17526 1294 16 18836 4994 drivers/iio/proximity/aw96103.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Link: https://patch.msgid.link/da4918af46fef03903ab0e9fdcb4f23e014f3821.1733522812.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:54:21 +00:00
Javier Carrasco
582d732bf6
iio: light: veml6030: add support for triggered buffer
...
All devices supported by this driver (currently veml6030, veml6035
and veml7700) have two 16-bit channels, and can profit for the same
configuration to support data access via triggered buffers.
The measurements are stored in two 16-bit consecutive registers
(addresses 0x04 and 0x05) as little endian, unsigned data.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com >
Link: https://patch.msgid.link/20241124-veml6030_triggered_buffer-v3-1-565bb6b4b5c8@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:52:44 +00:00
Jiasheng Jiang
c437190cea
iio: trigger: stm32-timer-trigger: Add check for clk_enable()
...
Add check for the return value of clk_enable() in order to catch the
potential exception.
Reviewed-by: David Lechner <dlechner@baylibre.com >
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com >
Link: https://patch.msgid.link/20241123220149.30655-1-jiashengjiangcool@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:52:44 +00:00
Javier Carrasco
e895f2edfe
iio: core: fix doc reference to iio_push_to_buffers_with_ts_unaligned
...
Use the right name of the function, which is defined in
drivers/iio/industrialio-buffer.c
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com >
Link: https://patch.msgid.link/20241125-iio_memset_scan_holes-v1-11-0cb6e98d895c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:52:44 +00:00
Frank Li
8278c08ad2
iio: adc: vf610_adc: limit i.MX6SX's channel number to 4
...
i.MX6SX only has 4 ADC channels, so limit channel numbers to 4 for
compatible string 'fsl,imx6sx-adc'.
Reviewed-by: Haibo Chen <haibo.chen@nxp.com >
Signed-off-by: Frank Li <Frank.Li@nxp.com >
Link: https://patch.msgid.link/20241126195256.2441622-2-Frank.Li@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:52:43 +00:00
Frank Li
207149d9f7
iio: adc: vf610_adc: use devm_* and dev_err_probe() to simple code
...
Use devm_* and dev_err_probe() simplify probe function and remove
vf610_adc_remove().
Reviewed-by: Haibo Chen <haibo.chen@nxp.com >
Signed-off-by: Frank Li <Frank.Li@nxp.com >
Link: https://patch.msgid.link/20241126195256.2441622-1-Frank.Li@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:52:43 +00:00
Matti Vaittinen
0ecb42a16c
iio: accel: kx022a: Support KX134-1211
...
The ROHM KX134-1211 has very similar register interface as KX132-1211
does. The main differencies are the content of the "Who am I"
identification register and different g-ranges. The KX132-1211 can
measure ranges from +/- 2g to +/-16g where the KX134-1211 supports
measuring ranges +/- 8g to +/- 64g.
Support the ROHM KX134-1211.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/6e95af6b425df6a5ff5218825ec8923f1341f7c3.1732783834.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:52:39 +00:00
Matti Vaittinen
046b460d05
dt-bindings: iio: kx022a: Support KX134-1211
...
The ROHM KX134-1211 is very similar to KX132-1211. The main difference is
supported g-ranges. The KX132-1211 can measure ranges from +/- 2g to
+/-16g where the KX134-1211 supports measuring ranges +/- 8g to +/- 64g.
Support the ROHM KX134-1211.
Acked-by: Conor Dooley <conor.dooley@microchip.com >
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/48b50cbda3d6c3a58a7b7c9ff23ed4dc7f418a5e.1732783834.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:52:06 +00:00
Matti Vaittinen
48e4f3cb67
iio: kx022a: Support ROHM KX134ACR-LBZ
...
The register interface of the ROHM KX134ACR-LBZ accelerometer is
almost identical to the KX132ACR-LBZ. The main difference between these
accelerometers is that the KX134ACR-LBZ supports different G-ranges. The
driver can model this by informing different scale to users. Also, the
content of the "who_am_I" register is different.
Add an ID and scales for the KX134ACR-LBZ.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/27c43c595de1f3f698ace671922d4f5a48c3cd54.1732783834.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:51:52 +00:00
Matti Vaittinen
720c8b777a
dt-bindings: ROHM KX134ACR-LBZ
...
>From the software point of view, the KX134ACR-LBZ is almost identical to
the KX132ACR-LBZ. They, however, have different g ranges and ID register
values which makes them incompatible.
Add compatible and information for ROHM KX134ACR-LBZ accelerometer.
Acked-by: Conor Dooley <conor.dooley@microchip.com >
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/2efe2bf7078704be3f020663960fef563ab21aca.1732783834.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:49:11 +00:00
Matti Vaittinen
64eb1c6fae
iio: accel: kx022a: Support ICs with different G-ranges
...
The register interface of the ROHM KX134ACR-LBZ accelerometer is almost
identical to the KX132ACR-LBZ. Main difference between these
accelerometers is that the KX134ACR-LBZ supports G-ranges +/- 8, 16,
32 and 64G. All the other sensors supported by the kx022a driver can
measure +/- 2, 4, 8 and 16G.
Prepare supporting the KX134ACR-LBZ with different G-ranges by storing
a pointer to the scale tables in IC specific structure.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/fc667b1495adf4e3f29ecbb336495c1f18b47e61.1732783834.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:49:11 +00:00
Matti Vaittinen
725521e1f4
iio: accel: kx022a: Use cleanup.h helpers
...
A few functions in KX022A need to use mutex for protecting the
enabling/disabling of the measurement while configurations are being
made. Some of the functions can be slightly simplified by using the
__cleanup based scoped mutexes, which allows dropping the goto based
unlocking at error path.
Simplify error paths using guard(mutex).
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/4785f841ad5f131356ba78b4f3c76f676d86a2e8.1732783834.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:49:11 +00:00
Robert Budai
0c39208bc3
iio: imu: adis: Remove documented not used elements
...
This patch removes elements from adis.h that are documented
but not used anymore.
Signed-off-by: Robert Budai <robert.budai@analog.com >
Link: https://patch.msgid.link/20241125133520.24328-2-robert.budai@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:49:11 +00:00
Matti Vaittinen
14a2ed21ef
dt-bindings: iio: light: Drop BU27008 and BU27010
...
The ROHM BU27008 and BU27010 RGB sensors got cancelled. I was informed
they never reached mass production stage.
Keeping the bindings around is waste of maintenance resources. Drop the
bindings.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Acked-by: Conor Dooley <conor.dooley@microchip.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://patch.msgid.link/3be66a8ec15fedd18ef13afae48ebb182196da13.1732819203.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:49:11 +00:00
Matti Vaittinen
91407b5518
iio: light: Drop BU27008 and BU27010
...
The ROHM BU27008 and BU27010 RGB sensors got cancelled. I was informed
they never reached mass production stage.
Keeping the drivers around is waste of maintenance resources. Drop the
drivers.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://patch.msgid.link/f4d0aa31f29f160a06cba4856a034fa5636d3372.1732819203.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:49:09 +00:00
Han Xu
7a91aee8ef
iio: gyro: Add support for iam20380 sensor
...
Add support for the Invensense IAM20380 sensor to the MPU6050 driver. It is
similar to the IAM20680. But IAM20380 only supports gyro and WHOAMI
register data is difference.
Signed-off-by: Han Xu <han.xu@nxp.com >
Signed-off-by: Frank Li <Frank.Li@nxp.com >
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com >
Link: https://patch.msgid.link/20241115-iam20380-v2-2-d8d9dc6891f5@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:59 +00:00
Han Xu
b305412152
dt-bindings: iio: imu: mpu6050: Add invensense,iam20380 compatible string
...
Add compatible string "invensense,iam20380" for the Invensense IAM20380
sensor. The IAM20380 is similar to the IAM20680, but only supports gyro.
Signed-off-by: Han Xu <han.xu@nxp.com >
Acked-by: Conor Dooley <conor.dooley@microchip.com >
Signed-off-by: Frank Li <Frank.Li@nxp.com >
Link: https://patch.msgid.link/20241115-iam20380-v2-1-d8d9dc6891f5@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:59 +00:00
David Lechner
cb3e9a4467
iio: adc: ad_sigma_delta: add tab to align irq_line
...
Align the irq_line field in struct ad_sigma_delta with the other fields.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241122-iio-adc-ad_signal_delta-fix-align-v1-1-d0a071d2dc83@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
David Lechner
a05dc8b4d4
iio: buffer-dmaengine: document iio_dmaengine_buffer_setup_ext
...
The iio_dmaengine_buffer_setup_ext() function is public and should be
documented. Also, while touching this, fix the description of @dev in
related functions. @dev does not strictly have to be the parent of the
IIO device. It is only passed to dma_request_chan() so strictly
speaking, it can be any device that is a valid DMA channel consumer.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241115-dlech-mainline-spi-engine-offload-2-v5-9-bea815bd5ea5@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
Cibil Pankiras
df81f90c50
iio: light: cm3232: Reset before reading HW ID
...
According to the datasheet, the chip requires a reset before any data
can be read. This commit moves the device identification logic to
occur after the reset to ensure proper initialization.
Cc: Kevin Tsai <ktsai@capellamicro.com >
Signed-off-by: Cibil Pankiras <cibil.pankiras@aerq.com >
Link: https://patch.msgid.link/20241114091323.7415-1-cibil.pankiras@aerq.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
David Lechner
2d69419329
dt-bindings: iio: adc: adi,ad4695: change include path
...
Change the include path for the adi,ad4695.h header since it has been
moved to the include/dt-bindings/iio/adc/ directory.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Reviewed-by: Rob Herring (Arm) <robh@kernel.org >
Link: https://patch.msgid.link/20241113-iio-adc-ad4695-move-dt-bindings-header-v1-2-aba1f0f9b628@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
David Lechner
435004291c
iio: adc: ad4695: move dt-bindings header
...
Move the dt-bindings header file to the include/dt-bindings/iio/adc/
directory. ad4695 is an ADC driver, so it should be in the adc/
subdirectory for better organization. Previously, it was in the iio/
subdirectory.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241113-iio-adc-ad4695-move-dt-bindings-header-v1-1-aba1f0f9b628@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
Matti Vaittinen
534674463a
iio: bm1390: simplify using guard(mutex)
...
The BM1390 uses mutex for protecting the fifo read sequence. The clean-up
for a few of the functions can be slightly simplified by removing the
goto-based error handling/unlocking and by utilizing the guard(mutex)
scoped mutex handling instead.
Simplify driver by using the scoped mutexes.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com >
Link: https://patch.msgid.link/a4c2f21189964132d245531b77fb0865562443a1.1732193263.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
Matti Vaittinen
439c2cef81
iio: bu27034: simplify using guard(mutex)
...
The BU27034 uses mutex for protecting the gain / time / scale changes.
The clean-up for a few of the functions can be slightly simplified by
removing the goto-based error handling/unlocking and by utilizing the
guard(mutex) scoped mutex handling instead.
Simplify driver by using the scoped mutexes.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com >
Link: https://patch.msgid.link/4e65a4725c211b166906f70fdb5ba90f2af0f570.1732193263.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
Matti Vaittinen
d95986fb81
iio: accel: kx022a: Improve reset delay
...
All the sensors supported by kx022a driver seemed to require some delay
after software reset to be operational again. More or less a random
msleep(1) was added to cause the driver to go to sleep so the sensor has
time to become operational again.
Now we have official docuumentation available:
https://fscdn.rohm.com/kionix/en/document/AN010_KX022ACR-Z_Power-on_Procedure_E.pdf
https://fscdn.rohm.com/kionix/en/document/TN027-Power-On-Procedure.pdf
https://fscdn.rohm.com/kionix/en/document/AN011_KX134ACR-LBZ_Power-on_Procedure_E.pdf
stating the required time is 2 ms.
Due to the nature of the current msleep implementation, the msleep(1) is
likely to be sleeping more than 2ms already - but the value "1" is
misleading in case someone needs to optimize the start time and change
the msleep to a more accurate delay. Hence it is better for
"documentation" purposes to use value which actually reflects the
specified 2ms wait time.
Change the value of delay after software reset to match the
specifications and add links to the power-on procedure specifications.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/ac1b6705945cded0e79593d64e55522681e00f9a.1732105157.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
Victor Duicu
9fdf1d0333
iio: adc: pac1921: Add ACPI support to Microchip pac1921
...
This patch implements ACPI support to Microchip pac1921.
The driver can read the shunt resistor value and label from the ACPI table.
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Acked-by: Matteo Martelli <matteomartelli3@gmail.com >
Signed-off-by: Victor Duicu <victor.duicu@microchip.com >
Link: https://patch.msgid.link/20241115133436.13204-1-victor.duicu@microchip.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
Karan Sanghavi
26f9fd646c
iio: dac: Fix converters spelling typo.
...
Correct the converters typo error
"convertors" => "converters"
Signed-off-by: Karan Sanghavi <karansanghvi98@gmail.com >
Link: https://patch.msgid.link/20241111-dackconfigcodespell-v1-1-2498567be34c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
David Lechner
9598866317
iio: dac: max5821: use devm_regulator_get_enable_read_voltage()
...
Simplify the code by using devm_regulator_get_enable_read_voltage().
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-11-d5a5360f7ec3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
David Lechner
6f05886078
iio: dac: ltc2688: use devm_regulator_get_enable_read_voltage()
...
Simplify the code by using devm_regulator_get_enable_read_voltage().
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-10-d5a5360f7ec3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:58 +00:00
David Lechner
3ebb535f4f
iio: dac ltc2632: drop driver remove function
...
Remove driver remove callback for the ltc2632 driver.
By making use of devm_iio_device_register(), we no longer need a driver
remove callback. Also since this was the last user of spi_get_drvdata(),
we can drop the call to spi_set_drvdata().
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-9-d5a5360f7ec3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:57 +00:00
David Lechner
c15031ef6e
iio: dac: ltc2632: use devm_regulator_get_enable_read_voltage()
...
Simplify the code by using devm_regulator_get_enable_read_voltage().
Some use of dev_err() is replaced with dev_err_probe() to simplify
things even more since we are refactoring these lines anyway.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-8-d5a5360f7ec3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:57 +00:00
David Lechner
276821d1e0
iio: dac ad8801: drop driver remove function
...
Remove driver remove callback in the ad8801 driver.
By making use of devm_iio_device_register(), we no longer need a driver
remove callback. Also since this was the last user of spi_get_drvdata(),
we can drop the call to spi_set_drvdata().
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-7-d5a5360f7ec3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:57 +00:00
David Lechner
451bdc1dc9
iio: dac: ad8801: use devm_regulator_get_enable_read_voltage()
...
Simplify the code by using devm_regulator_get_enable_read_voltage().
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-6-d5a5360f7ec3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:57 +00:00
David Lechner
6c009e5592
iio: dac: ad5686: use devm_regulator_get_enable_read_voltage()
...
Simplify the code by using devm_regulator_get_enable_read_voltage().
There is a small change in behavior. Before, all errors from
devm_regulator_get_optional() were ignored and assumed to mean that
the external reference supply was absent. Now, only -ENODEV is checked
and other errors will cause a failure to probe. So now, this will
catch errors, like using the wrong data type for the devicetree
property.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-3-d5a5360f7ec3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:47:35 +00:00
David Lechner
f596651dd6
iio: dac: ad5686: fix struct name in doc comment
...
Fix a copy/paste mistake in the struct ad5686_state doc comment.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-2-d5a5360f7ec3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:11:01 +00:00
David Lechner
d6d9c45c90
iio: dac: ad5624r: fix struct name in doc comment
...
Fix a copy/paste mistake in the struct ad5624r_state doc comment.
Signed-off-by: David Lechner <dlechner@baylibre.com >
Link: https://patch.msgid.link/20241120-iio-regulator-cleanup-round-6-v1-1-d5a5360f7ec3@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:11:01 +00:00
Han Xu
4cd8568554
iio: accel: fxls8962af: add fxls8967af support
...
fxls8967af is similar with fxls8962af, the only difference is the device id
change to 0x87.
Signed-off-by: Han Xu <han.xu@nxp.com >
Reviewed-by: Sean Nyekjaer <sean@geanix.com >
Signed-off-by: Frank Li <Frank.Li@nxp.com >
Link: https://patch.msgid.link/20241115-fxls-v2-4-95f3df9228ed@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:11:01 +00:00
Haibo Chen
f7c0bc2019
iio: accel: fxls8962af: add fxls8974cf support
...
fxls8974cf is similar with fxls8962af, the only difference is the device id
change to 0x86.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com >
Reviewed-by: Clark Wang <xiaoning.wang@nxp.com >
Reviewed-by: Sean Nyekjaer <sean@geanix.com >
Signed-off-by: Frank Li <Frank.Li@nxp.com >
Link: https://patch.msgid.link/20241115-fxls-v2-3-95f3df9228ed@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:11:01 +00:00
Han Xu
db61f1b7a7
dt-bindings: iio: accel: fxls8962af: add compatible string 'nxp,fxls8974cf'
...
Add 'nxp,fxls8974cf' compatible for the FXLS8974CF sensor, falling back to
'nxp,fxls8962af' as the only difference is the ID.
Signed-off-by: Han Xu <han.xu@nxp.com >
Reviewed-by: Sean Nyekjaer <sean@geanix.com >
Signed-off-by: Frank Li <Frank.Li@nxp.com >
Acked-by: Rob Herring (Arm) <robh@kernel.org >
Link: https://patch.msgid.link/20241115-fxls-v2-2-95f3df9228ed@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-12-07 17:11:01 +00:00