Krzysztof Kozlowski
f14ed2f378
dt-bindings: iio: cleanup examples - indentation
...
Use 4-space indentation (for cases when it is neither 4 not 2 space).
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Reviewed-by: Alexandru Lazar <alazar@startmail.com > # max1241
Acked-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20230124081037.31013-5-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-28 16:13:24 +00:00
Krzysztof Kozlowski
57b73eb9a3
dt-bindings: iio: use lowercase hex in examples
...
Use lowercase hex in addresses in examples.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Acked-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20230124081037.31013-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-28 16:13:24 +00:00
Krzysztof Kozlowski
46908557a5
dt-bindings: iio: correct node names in examples
...
Do not use underscores and unneeded suffixes (e.g. i2c0) in node name in
examples.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Acked-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20230124081037.31013-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-28 16:13:24 +00:00
Krzysztof Kozlowski
5c4712316a
dt-bindings: iio: minor whitespace cleanups
...
Drop redundant blank lines and add such when needed.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Acked-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20230124081037.31013-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-28 16:13:23 +00:00
Krzysztof Kozlowski
34d1e75415
dt-bindings: iio: drop unneeded quotes
...
Cleanup by removing unneeded quotes from refs and redundant blank lines.
No functional impact except adjusting to preferred coding style.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Reviewed-by: Dmitry Rokosov <ddrokosov@sberdevices.ru > # memsensing
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com > # sama5d2-adc
Reviewed-by: Puranjay Mohan <puranjay12@gmail.com > # tmp117
Acked-by: Rob Herring <robh@kernel.org >
Acked-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com > # ad7292
Link: https://lore.kernel.org/r/20230124081037.31013-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-28 16:13:23 +00:00
Haibo Chen
354f23ac2c
dt-bindings: iio: adc: Add NXP IMX93 ADC
...
The IMX93 SoC has a new ADC IP, so add binding documentation
for NXP IMX93 ADC.
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Haibo Chen <haibo.chen@nxp.com >
Link: https://lore.kernel.org/r/20230117135137.1735536-3-haibo.chen@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-22 17:17:39 +00:00
Haibo Chen
7d02296ac8
iio: adc: add imx93 adc support
...
The ADC in i.mx93 is a total new ADC IP, add a driver to support
this ADC.
Currently, only support one shot normal conversion triggered by
software. For other mode, will add in future.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com >
Link: https://lore.kernel.org/r/20230117135137.1735536-2-haibo.chen@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-22 17:16:57 +00:00
Hugo Villeneuve
2315b5cea4
dt-bindings: iio: adc: add Texas Instruments ADS7924
...
Add device tree bindings document for the Texas Instruments ADS7924
ADC.
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://lore.kernel.org/r/20230115170623.3680647-3-hugo@hugovil.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-21 18:19:49 +00:00
Hugo Villeneuve
4d82b2f98a
iio: adc: ti-ads7924: add Texas Instruments ADS7924 driver
...
The Texas Instruments ADS7924 is a 4 channels, 12-bit analog to
digital converter (ADC) with an I2C interface.
Datasheet: https://www.ti.com/lit/gpn/ads7924
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com >
Link: https://lore.kernel.org/r/20230115170623.3680647-2-hugo@hugovil.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-21 18:19:49 +00:00
Philippe De Muyter
d354a2ee39
iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel.
...
Signed-off-by: Philippe De Muyter <phdm@macqel.be >
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org >
Link: https://lore.kernel.org/r/1673874434-30750-3-git-send-email-Philippe.DeMuyter@macq.eu
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-21 18:17:25 +00:00
Philippe De Muyter
677a33b51f
iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in st_lsm6dsx_shub.c.
...
We need the name 'st_lsm6dsx_ext_info' for the actual 'iio_chan_spec_ext_info'.
Rename the 'st_lsm6dsx_ext_info' in st_lsm6dsx_shub.c to 'st_lsm6dsx_shub_info'.
For consistency, replace also 'ext' by 'shub' in 'st_lsm6dsx_ext_attributes'
and 'st_lsm6dsx_ext_attribute_group'.
Signed-off-by: Philippe De Muyter <phdm@macqel.be >
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org >
Link: https://lore.kernel.org/r/1673874434-30750-2-git-send-email-Philippe.DeMuyter@macq.eu
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-21 18:17:25 +00:00
Mårten Lindahl
546676121c
iio: light: vcnl4000: Add interrupt support for vcnl4040
...
Add support to configure proximity sensor interrupts and threshold
limits for vcnl4040. If an interrupt is detected an event will be
pushed to the event interface.
Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20230117190017.3789181-4-marten.lindahl@axis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-21 18:04:39 +00:00
Mårten Lindahl
bfb6cfeeb8
iio: light: vcnl4000: Make irq handling more generic
...
This driver supports 4 chips, by which only one (vcnl4010) handles
interrupts and has support for triggered buffer. The setup of these
functions is hardcoded for vcnl4010 inside the generic vcnl4000_probe,
and thus ignores the chip specific configuration structure where all
other chip specific functions are specified.
This complicates adding interrupt handler and triggered buffer support
to chips which may have support for it.
Add members for irq threads and iio_buffer_setup_ops to the generic
vcnl4000_chip_spec struct, so that instead of checking a chip specific
boolean irq support, we check for a chip specific triggered buffer
handler, and/or a chip specific irq thread handler.
Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20230117190017.3789181-3-marten.lindahl@axis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-21 18:04:39 +00:00
Mårten Lindahl
3a52d32a74
iio: light: vcnl4000: Prepare for more generic setup
...
In order to allow the chip_spec array reference the function pointers
for interrupts, the code for these functions need to be moved above the
chip_spec array.
This is a prestep to support a more generic setup of interrupts.
Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20230117190017.3789181-2-marten.lindahl@axis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-21 18:04:39 +00:00
Jonathan Cameron
3b5eea320d
dt-bindings: iio: dac: Maxim max5522 DAC
...
Add binding Doc for this SPI DAC.
The driver was perviously posted but was missing the DT binding document.
https://lore.kernel.org/all/20221106165928.223318-1-angelo.dureghello@timesys.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Angelo Dureghello <angelo.dureghello@timesys.com >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://lore.kernel.org/r/20230115173958.134201-1-jic23@kernel.org
2023-01-21 18:00:29 +00:00
Angelo Dureghello
ba56b46d1c
iio: dac: add support for max5522
...
Add initial support for DAC max5522.
Tested writing DAC A and B with some values,
from 0 to 1023, measured output voltages, driver works properly.
Additions for max5523/24/25 will follow.
Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com >
Link: https://lore.kernel.org/r/20221106165928.223318-1-angelo.dureghello@timesys.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-01-21 17:58:59 +00:00
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