Commit graph

1153438 commits

Author SHA1 Message Date
Yulong Zhang
f2edf0c819 tools/iio/iio_utils:fix memory leak
1. fopen sysfs without fclose.
2. asprintf filename without free.
3. if asprintf return error,do not need to free the buffer.

Signed-off-by: Yulong Zhang <yulong.zhang@metoak.net>
Link: https://lore.kernel.org/r/20230117025147.69890-1-yulong.zhang@metoak.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-21 17:52:26 +00:00
Andy Shevchenko
05f59aba39 iio: core: Sort headers
Sort the headers in alphabetic order in order to ease
the maintenance for this part.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230118074828.66155-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-21 17:35:23 +00:00
Andy Shevchenko
122fb8736e iio: core: Replace iio_sysfs_match_string_with_gaps() by __sysfs_match_string()
None of the current users is using gaps in the list of the items.
No need to have a specific function for that, just replace it by
library available __sysfs_match_string().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230118074828.66155-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-21 17:35:23 +00:00
Andy Shevchenko
cd19fbfedc iio: adc: xilinx-ams: Convert to use fwnode_device_is_compatible()
Replace open coded fwnode_device_is_compatible() in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20230119174749.76769-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-21 16:54:46 +00:00
Andy Shevchenko
c44e031bcf iio: chemical: scd30_core: Switch to use dev_err_probe()
Switch to use dev_err_probe() to simplify the error paths and
unify message template.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230113141917.23725-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-14 16:17:34 +00:00
Andy Shevchenko
ebda75fbfa iio: chemical: scd30_core: use sysfs_emit() to instead of scnprintf()
Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230113141117.23353-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-14 16:15:13 +00:00
Olivier Moysan
bfcae956d9 iio: adc: stm32-dfsdm: add id registers support
Add support of identification registers to STM32 DFSDM
to allow hardware capabilities discovery and configuration check.
The number of filters and channels, are read from registers,
when they are available.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20230105125331.328275-1-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-08 13:11:03 +00:00
Luca Weiss
14e5b7ab19 iio: adc: qcom-spmi-adc5: define ADC5_BAT_ID_100K_PU channel
Define the ADC channel used for battery identification purposes so it
can be used in drivers.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://lore.kernel.org/r/20230106-pm7250b-bat_id-v1-1-82ca8f2db741@fairphone.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-08 13:03:10 +00:00
Stephan Gerhold
721a2a7edc iio: magnetometer: st_magn: Add LSM303C
The magnetometer part of ST LSM303C is similar (perhaps even identical)
to the already supported standalone LIS3MDL magnetometer, so just
add the new st,lsm303c-magn compatible for the existing definitions.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230106102239.9647-4-stephan@gerhold.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-08 13:01:02 +00:00
Stephan Gerhold
23fd6f0bd6 iio: accel: st_accel: Add LSM303C
The accelerometer part of ST LSM303C is similar (perhaps even identical)
to the already supported standalone LIS2HH12 accelerometer, so just
add the new st,lsm303c-accel compatible for the existing definitions.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230106102239.9647-3-stephan@gerhold.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-08 13:01:02 +00:00
Stephan Gerhold
4aaf3e4027 dt-bindings: iio: st-sensors: Add LSM303C accelerometer+magnetometer
The ST LSM303C [1] is a accelerometer and magnetometer combo sensor
compatible with the existing ST sensor bindings. Accelerometer and
magnetometer are exposed through separate I2C/SPI devices, so document
separate compatibles with -accel and -magn suffix.

[1]: https://www.st.com/resource/en/datasheet/lsm303c.pdf

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230106102239.9647-2-stephan@gerhold.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-08 13:01:02 +00:00
Alexander Vorwerk
eae3e6f1c8 drivers: iio: cdc: Drop redundant if check
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Alexander Vorwerk <zabe@avorwerk.net>
Link: https://lore.kernel.org/r/20230105025351.12099-1-zabe@avorwerk.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-08 12:59:44 +00:00
Andy Shevchenko
591a6bc7f4 iio: adc: max11410: Use asm intead of asm-generic
There is no point to specify asm-generic for the unaligned.h.
Drop the 'generic' suffix and move the inclusion to be after
the non-IIO linux/* ones.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230103144903.39905-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-08 12:13:09 +00:00
Andy Shevchenko
4b570fe0d4 iio: adc: ti-adc128s052: Sort headers
Sort the headers in alphabetic order in order to ease
the maintenance for this part.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230102173450.29882-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-08 12:12:10 +00:00
Andy Shevchenko
c87d5e94fc iio: adc: ti-adc128s052: Drop anti-pattern of ACPI_PTR() use
ACPI_PTR() is more harmful than helpful. For example, in this case
if CONFIG_ACPI=n, the ID table left unused and code is obfuscated
by ifdeffery.

Drop anti-pattern of ACPI_PTR() use.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230102173450.29882-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-08 12:12:10 +00:00
Andy Shevchenko
d5f0da0c69 iio: adc: ti-adc128s052: Switch to use spi_get_device_match_data()
The spi_get_device_match_data() helps to get driver data from the
firmware node or SPI ID table. Use it instead of open coding.

While at it, switch ID tables to provide an acrual pointers to
the configuration data.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230102173450.29882-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-08 12:12:10 +00:00
Jonathan Cameron
b7b81d1c65 iio: adc: ep93xx: Enable wider build testing with COMPILE_TEST
It is useful to be able to build this driver without needing
to build support for ARCH_EP93XX.

Also add an explicit dependency on HAS_IOMEM so we have
devm_platform_ioremap_resource() etc available.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://lore.kernel.org/r/20221231144128.489810-1-jic23@kernel.org
2023-01-08 12:04:01 +00:00
Alexander Sverdlin
80cbddf590 iio: adc: ep93xx: Add OF support
Prepare for EP93xx conversion to DT.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://lore.kernel.org/r/20221223162636.6488-2-alexander.sverdlin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-30 18:05:16 +00:00
Alexander Sverdlin
08025a3bd9 dt-bindings: iio: adc: ep93xx: Add cirrus,ep9301-adc description
Add device tree bindings for Cirrus Logic EP9301/EP9302 internal SoCs' ADC
block.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://lore.kernel.org/r/20221223162636.6488-1-alexander.sverdlin@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-30 18:05:16 +00:00
Rayyan Ansari
471a444fff dt-bindings: iio/adc: qcom,spmi-iadc: document PM8226 compatible
Document the compatible for the IADC used on PM8226.

Signed-off-by: Rayyan Ansari <rayyan@ansari.sh>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221228230421.56250-5-rayyan@ansari.sh
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-30 17:22:23 +00:00
Krzysztof Kozlowski
bbd9b7e19b dt-bindings: iio: adc: maxim,max1363: fix interface typo
Correct inteface->interface in description.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221223162231.120216-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:46 +00:00
Fabio Estevam
6108136559 dt-bindings: iio: adc: max1238: Fix a typo in the description
Fix a typo in the description, where "interface" is spelled incorrectly.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20221216004015.2902966-1-festevam@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:46 +00:00
Marijn Suijten
0410484273 iio: adc: qcom-spmi-adc5: Suppress probe-deferral error message
Much like 807efb7102e8 ("thermal: qcom-spmi-adc-tm5: suppress
probe-deferral error message") the ADC5 driver also spams a similar
probe-deferral error on startup when a channel is not yet available:

    [    0.343136] qcom-spmi-adc-tm5 1c40000.spmi:pmic@0:adc-tm@3500: get dt data failed: -517

Suppress it by using dev_err_probe instead, which also takes care of
storing the message as reason for deferring.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Martin Botka <martin.botka@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20221216190945.902754-1-marijn.suijten@somainline.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:46 +00:00
Colin Ian King
5d1c74b155 iio: imu: kmx61: Fix spelling mistake "Errow" -> "Error"
There is a spelling mistake in a dev_err message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20221209233202.222083-1-colin.i.king@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:46 +00:00
Andy Shevchenko
c12f0148f1 iio: light: tsl2563: Keep Makefile sorted by module name
The Makefile is sorted by a module name, keep it that way.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-11-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:46 +00:00
Andy Shevchenko
3582a83b1f iio: light: tsl2563: sort header inclusion alphabetically
Sort header inclusion alphabetically.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-10-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:46 +00:00
Andy Shevchenko
571b97fd87 iio: light: tsl2563: Use dev_get_drvdata() directly in PM callbacks
PM callbacks take struct device pointer as a parameter, use
dev_get_drvdata() to retrieve it instead of unneeded double
loop of referencing via i2c_get_clientdata(to_i2c_client(dev)).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-9-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:46 +00:00
Andy Shevchenko
85a6b728ef iio: light: tsl2563: Utilise temporary variable for struct device
We have a temporary variable to keep pointer to struct device.
Utilise it inside the ->probe() implementation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:46 +00:00
Andy Shevchenko
1f5e408f6a iio: light: tsl2563: Drop legacy platform data code
There is no in-kernel user for legacy platform data.
Otherwise, a new one can use software nodes instead.
Hence, drop legacy platform data code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:46 +00:00
Andy Shevchenko
2080c8d346 iio: light: tsl2563: Simplify with dev_err_probe
Code can be a bit simpler with dev_err_probe().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
Andy Shevchenko
bbabf91991 iio: light: tsl2563: Drop unused defintion(s)
The CALIB_FRAC() is defined and might had been used in
tsl2563_calib_from_sysfs(). But let's just move a comment
from it to the latter function.

CLAIB_FRAC_HALF is used in a single place, i.e. in
tsl2563_calib_to_sysfs(). So, let's just inline it there.

While at it, switch to use DIV_ROUND_CLOSEST().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
Andy Shevchenko
b90619c4ef iio: light: tsl2563: Make use of the macros from bits.h
Make use of BIT() and GENMASK() where it makes sense.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
Andy Shevchenko
aca68c0273 iio: light: tsl2563: Configure INT in one place
Introduce tsl2563_configure_irq() to configure INT in one place.

While at it, make use of TSL2563_INT_LEVEL and newly introduced
TSL2563_INT_MASK.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
Andy Shevchenko
3c183534f2 iio: light: tsl2563: Use i2c_smbus_write_word_data() in tsl2563_configure()
Driver already uses the word accessors when it makes sense, but
in the tsl2563_configure(). Switch the latter to use word accessor.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
Ferry Toth
027641b52f iio: light: tsl2563: Do not hardcode interrupt trigger type
Instead of hardcoding IRQ trigger type to IRQF_TRIGGER_RAISING,
let's respect the settings specified in the firmware description.
To be compatible with the older firmware descriptions, if trigger
type is not set up there, we'll set it to default (raising edge).

Fixes: 388be48839 ("staging:iio: tsl2563 abi fixes and interrupt handling")
Fixes: bdab100173 ("staging:iio:light:tsl2563 remove old style event registration.")
Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20221207190348.9347-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
Uwe Kleine-König
22cd9320b1 iio: light: max44009: 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/20221118224540.619276-133-uwe@kleine-koenig.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
Jonathan Cameron
caa6693e40 iio: pressure: ms5611: Switch to fully devm_ managed registration.
All the remaining calls in probe() have devm_ equivalents so
switching to those allows the remove() callbacks to be deleted.
No functional change.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Tomasz Duszynski <tduszyns@gmail.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/20221016163409.320197-15-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
Jonathan Cameron
122ef59a2a iio: pressure: ms5611: Use devm_regulator_get_enable()
This driver only turns the power on at probe and off at remove.
The new devm_regulator_get_enable() replaces this boilerplate code.
Some additional refactoring to drop now unnecessary unwinding after
this change.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Tomasz Duszynski <tduszyns@gmail.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/20221016163409.320197-14-jic23@kernel.org
2022-12-28 17:19:45 +00:00
Jonathan Cameron
4da9438d29 iio: accel: bma400: 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: Jagath Jog J <jagathjog1996@gmail.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/20221016163409.320197-3-jic23@kernel.org
2022-12-28 17:19:45 +00:00
ye xingchen
f9e51aacc7 iio: common: scmi_iio: use sysfs_emit() to instead of scnprintf()
Replace the open-code with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/202212011156314630626@zte.com.cn
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
ye xingchen
7ae267954a iio: adc: at91-sama5d2_adc: use sysfs_emit() to instead of scnprintf()
Replace the open-code with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/202212011142333790361@zte.com.cn
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
Fabio Estevam
58c2630020 iio: dac: ad5686: Add support for AD5337
AD5337 belongs to the same family as the AD5338.

The difference is that the AD5337 has 8-bit precision instead of 10-bit.

Add support for the AD5337 chip in the driver.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20221130182632.3856675-2-festevam@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:45 +00:00
Fabio Estevam
611370fe48 dt-bindings: iio: dac: ad5686: Add an entry for AD5337
AD5337 belongs to the same family as the AD5338.

The difference is that the AD5337 has 8-bit resolution instead of 10-bit.

Add a compatible entry for AD5337.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221130182632.3856675-1-festevam@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:44 +00:00
Leonard Göhrs
6271989426 iio: adc: add ADC driver for the TI LMP92064 controller
The TI LMP92064 is a dual 12 Bit ADC connected via SPI.
The two channels are intended for simultaneous measurements of the voltage
across- and current through a load to allow accurate instantaneous power
measurements.
The driver does not yet take advantage of this feature, as buffering is not
yet implemented.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Link: https://lore.kernel.org/r/20221128133503.1355898-2-l.goehrs@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:44 +00:00
Leonard Göhrs
51f3e9696c dt-bindings: iio: adc: add TI LMP92064 controller
Add binding documentation for the TI LMP92064 dual channel SPI ADC.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221128133503.1355898-1-l.goehrs@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:44 +00:00
Samuel Holland
c9d8b868f4 dt-bindings: iio: adc: ti,adc081c: Document the binding
Linux has a driver for these ADCs at drivers/iio/adc/ti-adc081c.c, but
the compatible strings were undocumented. Add a binding for them. The
hardware has an alert interrupt output, but existing ti,adc081c users
do not provide the 'interrupts' property, so leave it as optional.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221125220903.8632-1-samuel@sholland.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:44 +00:00
Gerald Loacker
866a138917 iio: magnetometer: add ti tmag5273 driver
Add support for TI TMAG5273 Low-Power Linear 3D Hall-Effect Sensor.
Additionally to temperature and magnetic X, Y and Z-axes the angle and
magnitude are reported.
The sensor is operating in continuous measurement mode and changes to sleep
mode if not used for 5 seconds.

Datasheet: https://www.ti.com/lit/gpn/tmag5273
Signed-off-by: Gerald Loacker <gerald.loacker@wolfvision.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20221201072220.402585-4-gerald.loacker@wolfvision.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:44 +00:00
Gerald Loacker
fbb6d04eab dt-bindings: iio: magnetometer: add ti tmag5273 documentation file
Add bindings for TI TMAG5273.

Signed-off-by: Gerald Loacker <gerald.loacker@wolfvision.net>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221201072220.402585-3-gerald.loacker@wolfvision.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:44 +00:00
Gerald Loacker
08f01cc1d6 iio: add struct declaration for iio types
Add struct for iio type arrays such as IIO_AVAIL_LIST which can be used
instead of int arrays.

Signed-off-by: Gerald Loacker <gerald.loacker@wolfvision.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20221201072220.402585-2-gerald.loacker@wolfvision.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:44 +00:00
Linus Torvalds
1b929c02af Linux 6.2-rc1 2022-12-25 13:41:39 -08:00