summaryrefslogtreecommitdiffstats
path: root/drivers/iio
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'char-misc-6.6-rc1' of ↵Linus Torvalds2023-09-0179-784/+3911
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver updates from Greg KH: "Here is the big set of char/misc and other small driver subsystem changes for 6.6-rc1. Stuff all over the place here, lots of driver updates and changes and new additions. Short summary is: - new IIO drivers and updates - Interconnect driver updates - fpga driver updates and additions - fsi driver updates - mei driver updates - coresight driver updates - nvmem driver updates - counter driver updates - lots of smaller misc and char driver updates and additions All of these have been in linux-next for a long time with no reported problems" * tag 'char-misc-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (267 commits) nvmem: core: Notify when a new layout is registered nvmem: core: Do not open-code existing functions nvmem: core: Return NULL when no nvmem layout is found nvmem: core: Create all cells before adding the nvmem device nvmem: u-boot-env:: Replace zero-length array with DECLARE_FLEX_ARRAY() helper nvmem: sec-qfprom: Add Qualcomm secure QFPROM support dt-bindings: nvmem: sec-qfprom: Add bindings for secure qfprom dt-bindings: nvmem: Add compatible for QCM2290 nvmem: Kconfig: Fix typo "drive" -> "driver" nvmem: Explicitly include correct DT includes nvmem: add new NXP QorIQ eFuse driver dt-bindings: nvmem: Add t1023-sfp efuse support dt-bindings: nvmem: qfprom: Add compatible for MSM8226 nvmem: uniphier: Use devm_platform_get_and_ioremap_resource() nvmem: qfprom: do some cleanup nvmem: stm32-romem: Use devm_platform_get_and_ioremap_resource() nvmem: rockchip-efuse: Use devm_platform_get_and_ioremap_resource() nvmem: meson-mx-efuse: Convert to devm_platform_ioremap_resource() nvmem: lpc18xx_otp: Convert to devm_platform_ioremap_resource() nvmem: brcm_nvram: Use devm_platform_get_and_ioremap_resource() ...
| * Merge 6.5-rc6 into char-misc-nextGreg Kroah-Hartman2023-08-139-33/+73
| |\ | | | | | | | | | | | | | | | We need the char/misc fixes in here as well to build on top of. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | drivers: iio: filter: admv8818: add bypass modeAntoniu Miclaus2023-08-081-9/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add filter bypass mode, which bypasses the low pass filter, high pass filter and disables/unregister the clock rate notifier. Currently a feature like bypassing the filter is not achievable straightforward and not very deductive. The user has to look through the code and call the set_lpf_3db_frequency and set_hpf_3db_frequency iio attributes from the user interface using the corner cases (freq > largest lpf supported by the part, respectively freq < smallest hpf supported by the part). Moreover, in such case of bypassing the filter, the input clock rate change might mess up things so we want to make sure that it is disabled. Also, the feature will help emphasizing the filter behavior, therefore adding it in the userspace will ease the charcaterization of the filter's effects when active/disabled. It was requested by users of the driver to ease the interaction with different configuration modes of the device. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Link: https://lore.kernel.org/r/20230731084928.8302-1-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: light: bd27008: Support BD27010 RGBMatti Vaittinen2023-08-081-2/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ROHM BU27010 is an RGBC sensor with a flickering detection FIFO. The RGBC+IR sensor functionality is largely similar to what the BU27008 has. There are some notable things though: - gain setting is once again new and exotic. Now, there is 6bit gain setting where 4 of the bits are common to all channels and 2 bits can be configured separately for each channel. The BU27010 has similar "1X on other channels vs 2X on IR when selector is 0x0" gain design as BU27008 had. So, we use same gain setting policy for BU27010 as we did for BU27008 - driver sets same gain selector for all channels but shows the gains separately for all channels so users can (at least in theory) detect this 1X vs 2X madness... - BU27010 has suffled all the control register bitfields to new addresses and bit positions while still keeping the register naming same. - Some more power/reset control is added. - FIFO for "flickering detection" is added. The control register suffling made this slightly nasty. Still, it is easier for maintenance perspective to add the BU27010 support in BU27008 driver because - even though the bit positions/addresses were changed - most of the driver structure can be re-used. Writing own driver for BU27010 would mean plenty of duplicate code albeit a tad more clarity. The flickering FIFO is not supported by the driver. Add BU27010 RGBC+IR support to rohm-bu27008 driver. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/111cd217ccece1c1f16ab4287532dc4e1ddb8a3f.1690958450.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: light: bu27008: add chip infoMatti Vaittinen2023-08-081-114/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ROHM BU27010 RGB + flickering sensor is in many regards similar to the BU27008. Prepare for adding support for BU27010 by allowing chip-specific properties to be brought from the of_device_id data. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/d5994648033d5513993b8d72eb186ddda211b5ac.1690958450.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: add MCP4728 I2C DAC driverAndrea Collamati2023-08-053-0/+630
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MCP4728 is a 12-bit quad channel DAC with I2C interface. support for: * per-channel gain * per-channel power state * per-channel power down mode control * per-channel vref selection internal/vdd * store current state to on-chip EEPROM Signed-off-by: Andrea Collamati <andrea.collamati@gmail.com> Link: https://lore.kernel.org/r/a0933003ed3c855f9d80d6ce0a40add2b6f0ba36.1691066050.git.andrea.collamati@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | drivers: iio: admv1013: add vcc regulatorsAntoniu Miclaus2023-08-051-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add regulators for the VCC supplies of the admv1013. The patch aims to align the implementation with the current admv1014 driver where all the VCC supplies are handled as regulators. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Link: https://lore.kernel.org/r/20230731094455.26742-2-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()Andrei Coardos2023-08-051-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file. Reviewed-by: Alexandru Ardelean <alex@shruggie.ro> Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com> Link: https://lore.kernel.org/r/20230802120915.25631-1-aboutphysycs@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: men_z188_adc: Remove redundant initialization owner in men_z188_driverLi Zetao2023-08-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The module_mcb_driver() will set "THIS_MODULE" to driver.owner when register a mcb_driver, so it is redundant initialization to set driver.owner in men_z188_driver statement. Remove it for clean code. Signed-off-by: Li Zetao <lizetao1@huawei.com> Link: https://lore.kernel.org/r/20230804100938.100435-1-lizetao1@huawei.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: cdc: ad7150: relax return value check for IRQ getMatti Vaittinen2023-08-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fwnode_irq_get[_byname]() were changed to not return 0 anymore. The special error case where device-tree based IRQ mapping fails can't no longer be reliably detected from this return value. This yields a functional change in the driver where the mapping failure is treated as an error. The mapping failure can occur for example when the device-tree IRQ information translation call-back(s) (xlate) fail, IRQ domain is not found, IRQ type conflicts, etc. In most cases this indicates an error in the device-tree and special handling is not really required. One more thing to note is that ACPI APIs do not return zero for any failures so this special handling did only apply on device-tree based systems. Drop the special handling for DT mapping failures as these can no longer be separated from other errors at driver side. Change all failures in IRQ getting to be handled by continuing without the events instead of aborting the probe upon certain errors. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/3ad1c6f195ead3dfa8711235e1dead139d27f700.1690890774.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: mb1232: relax return value check for IRQ getMatti Vaittinen2023-08-011-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fwnode_irq_get() was changed to not return 0 anymore. Drop check for return value 0. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/9e18cf49a8bb581a84c3fa548ea577e2a3eb840d.1690890774.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: fix the return value handle for platform_get_irq()Ruan Jinjie2023-07-294-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no possible for platform_get_irq() to return 0 and the return value of platform_get_irq() is more sensible to show the error reason. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Link: https://lore.kernel.org/r/20230727131607.2897937-1-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: potentiometer: mcp4531: Use i2c_get_match_data()Biju Das2023-07-291-68/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace device_get_match_data() and i2c_match_id() by i2c_get_match _data() by making similar I2C and DT-based matching table. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20230723102743.102284-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: potentiometer: mcp4018: Use i2c_get_match_data()Biju Das2023-07-291-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace of_device_get_match_data() and i2c_match_id() by i2c_get_match _data() by making similar I2C and DT-based matching table. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20230723105209.175545-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: core: Fix issues and style of the commentsAndy Shevchenko2023-07-291-20/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `scripts/kernel-doc -v -none -Wall` reports several issues with the kernel doc in IIO core C file. Update the comments accordingly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20230724110204.46285-5-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: core: Switch to krealloc_array()Andy Shevchenko2023-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let the krealloc_array() copy the original data and check for a multiplication overflow. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230724110204.46285-4-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: core: Use sysfs_match_string() helperAndy Shevchenko2023-07-291-39/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use sysfs_match_string() helper instead of open coded variant. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230724110204.46285-2-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: accel: adxl313: Use i2c_get_match_dataBiju Das2023-07-291-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace device_get_match_data() and i2c_match_id() by i2c_get_match _data() as we have similar I2C and DT-based matching table. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230725171624.331283-3-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: accel: adxl313: Fix adxl313_i2c_id[] tableBiju Das2023-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .driver_data in adxl313_i2c_id[] for adxl312 and adxl314 is wrong. Fix this issue by adding corresponding adxl31x_chip_info data. Reported-by: Jonathan Cameron <jic23@kernel.org> Closes: https://lore.kernel.org/all/20230722172832.04ad7738@jic23-huawei Fixes: a7a1c60bc4c9 ("drivers: iio: accel: adxl312 and adxl314 support") Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230725171624.331283-2-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: Remove redundant dev_err_probe()Ruan Jinjie2023-07-295-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to call the dev_err() function directly to print a custom message when handling an error from either the platform_get_irq() or platform_get_irq_byname() functions as both are going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20230727073912.4178659-1-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: Explicitly include correct DT includesRob Herring2023-07-2324-23/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20230714174628.4057920-1-robh@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: imu: adis16475.c: Add has_burst32 flag to adis16477 devicesRamona Bolboaca2023-07-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adis16477 devices support burst32 function, thus has_burst32 flag should be set to true. Signed-off-by: Ramona Bolboaca <ramona.bolboaca@analog.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230719123152.309624-3-ramona.bolboaca@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: imu: adis16475.c: Remove unused enum elementsRamona Bolboaca2023-07-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused enum elements ADIS16475_SCAN_DIAG_S_FLAGS and ADIS16475_SCAN_CRC_FAILURE. Signed-off-by: Ramona Bolboaca <ramona.bolboaca@analog.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230719123152.309624-2-ramona.bolboaca@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: Add driver for Murata IRS-D200Waqar Hameed2023-07-233-0/+971
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Murata IRS-D200 is a PIR sensor for human detection. It has support for raw data measurements and detection event notification. Add a driver with support for triggered buffer and events. Map the various settings to the `iio` framework, e.g. threshold values, sampling frequency, filter frequencies etc. Signed-off-by: Waqar Hameed <waqar.hameed@axis.com> Link: https://lore.kernel.org/r/d218a1bc75402b5ebd6e12a563f7315f83fe966c.1689753076.git.waqar.hameed@axis.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: Add event enums for running period and countWaqar Hameed2023-07-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are devices (such as Murata IRS-D200 PIR proximity sensor) that check the data signal with a running period. I.e. for a specified time, they count the number of conditions that have occurred, and then signal if that is more than a specified amount. `IIO_EV_INFO_PERIOD` resets when the condition no longer is true and is therefore not suitable for these devices. Add a new `iio_event_info` `IIO_EV_INFO_RUNNING_PERIOD` that can be used as a running period. Also add a new `IIO_EV_INFO_RUNNING_COUNT` that can be used to specify the number of conditions that must occur during this running period. Signed-off-by: Waqar Hameed <waqar.hameed@axis.com> Link: https://lore.kernel.org/r/ee4a801ae9b9c4716c7bd23d8f79f232351df8bd.1689753076.git.waqar.hameed@axis.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: amplifiers: ad8366: add support for HMC792A AttenuatorKim Seer Paller2023-07-232-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds support for the HMC792A Digital Attenuator. The HMC792A is a broadband 6-bit GaAs MMIC Digital Attenuator operating from DC to 6.0 GHz with 15.75 dB attenuation control range in 0.25 dB steps. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/hmc792a.pdf Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com> Link: https://lore.kernel.org/r/20230721121038.183404-1-kimseer.paller@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: core: Improve indentation in a few placesAndy Shevchenko2023-07-231-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Improve an indentation in a few places to increase readability. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230721170022.3461-9-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: core: Get rid of redundant 'else'Andy Shevchenko2023-07-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the snippets like the following if (...) return / goto / break / continue ...; else ... the 'else' is redundant. Get rid of it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230721170022.3461-6-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: core: Use min() instead of min_t() to make code more robustAndy Shevchenko2023-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | min() has strict type checking and preferred over min_t() for unsigned types to avoid overflow. Here it's unclear why min_t() was chosen since both variables are of the same type. In any case update to use min(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230721170022.3461-5-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: meson: init voltage control bitsGeorge Stark2023-07-221-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define and init voltage configuration bits. Those bits are inited in vendor boot code (bl2, bl33) already so do it in the driver to not depend on other code. Introduced bits: REG11[0] - selects Vref. 0 - calibration voltage, 1 - VDDA. txlx and later SoCs support VDDA or calibration voltage as Vref, but others support only calibration voltage. For newer platforms vendor uses VDDA as default. REG11[1] - reserved bit. g12a and later SoCs must write 1, others SoCs write 0. REG11[5] - Vref voltage. 0 - 0.9v, 1 - 1.8v. g12a and later SoCs must write 0, others SoCs write 1. REG11[6] - selects common-mode voltage, 0: from AVDD, 1: from Vref. g12a and later SoCs must write 0, others SoCs write 1. Signed-off-by: George Stark <gnstark@sberdevices.ru> Link: https://lore.kernel.org/r/20230715110654.6035-4-gnstark@sberdevices.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: meson: init internal continuous ring counterGeorge Stark2023-07-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable internal continuous ring counter at init stage. Disable value depends on SoC family: gxl and later SoCs write 1, others write 0. This bit are inited in vendor boot code (bl2, bl33) already so do it in the driver to not depend on other code. Signed-off-by: George Stark <gnstark@sberdevices.ru> Link: https://lore.kernel.org/r/20230715110654.6035-3-gnstark@sberdevices.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: meson: init channels 0,1 input muxesGeorge Stark2023-07-221-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Set up input channels 0,1 muxes in the same way as for the channels 2-7 later in the code. Signed-off-by: George Stark <gnstark@sberdevices.ru> Link: https://lore.kernel.org/r/20230715110654.6035-2-gnstark@sberdevices.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: accel: adxl355: Simplify probe()Biju Das2023-07-221-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the probe() by replacing of_device_get_match_data() and i2c_match_id() by i2c_get_match_data() as we have similar I2C and DT-based matching table. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Puranjay Mohan <puranjay12@gmail.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230716175218.130557-2-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: meson: support reading from channel 7 mux inputsGeorge Stark2023-07-201-2/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add IIO channel for all muxed inputs of channel 7. Meson saradc channel 7 is connected to a mux that can switch input to well-known sources like Vdd, GND and several Vdd dividers. Signed-off-by: George Stark <GNStark@sberdevices.ru> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230714114010.293440-7-gnstark@sberdevices.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: meson: add channel labelsGeorge Stark2023-07-201-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add channel labels to provide human-readable names for the inputs. Signed-off-by: George Stark <GNStark@sberdevices.ru> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230714114010.293440-6-gnstark@sberdevices.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: meson: add enum for iio channel numbersGeorge Stark2023-07-201-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Channels could be referenced in the driver code and using enum allows to make it more robust. Signed-off-by: George Stark <GNStark@sberdevices.ru> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230714114010.293440-5-gnstark@sberdevices.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: meson: move meson_sar_adc_set_chan7_mux routine upperGeorge Stark2023-07-201-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | meson_sar_adc_set_chan7_mux is a basic func() for writing single register, defined as static. Moved it up so it could be used in more places. Signed-off-by: George Stark <GNStark@sberdevices.ru> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230714114010.293440-4-gnstark@sberdevices.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: meson: move enums declaration before variables declarationGeorge Stark2023-07-201-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to use enum items for variables initialization. For this, move enums upper in the code. Signed-off-by: George Stark <GNStark@sberdevices.ru> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230714114010.293440-3-gnstark@sberdevices.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: meson: remove unused timestamp channelGeorge Stark2023-07-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove IIO_CHAN_SOFT_TIMESTAMP channel because it's used only for buffering mode which is not implemented. Signed-off-by: George Stark <GNStark@sberdevices.ru> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230714114010.293440-2-gnstark@sberdevices.ru Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: chemical: scd4x: Add pressure compensationRoan van Dijk2023-07-201-6/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds pressure compensation to the scd4x driver. The pressure can be written to the sensor in hPa. The pressure will be compensated internally by the sensor. Signed-off-by: Roan van Dijk <roan@protonic.nl> Link: https://lore.kernel.org/r/20230711101419.2065107-1-roan@protonic.nl Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: Make return value check for set_trigger_state() consistentWaqar Hameed2023-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In `iio_trigger_detach_poll_func()` the return value from `trig->ops->set_trigger_state(trig, false)` is checked with `if (ret)`. However, in `iio_trigger_attach_poll_func()` it is checked with `if (ret < 0)`. Resolve this mismatch by only checking for `if (ret)` in both places. Signed-off-by: Waqar Hameed <waqar.hameed@axis.com> Link: https://lore.kernel.org/r/pndv8eojdey.fsf@axis.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: ti-lmp92064: add buffering supportLeonard Göhrs2023-07-201-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable buffered reading of samples from the LMP92064 ADC. The main benefit of this change is being able to read out current and voltage measurements in a single transfer, allowing instantaneous power measurements. Reads into the buffer can be triggered by any software triggers, e.g. the iio-trig-hrtimer: $ mkdir /sys/kernel/config/iio/triggers/hrtimer/my-trigger $ cat /sys/bus/iio/devices/iio\:device3/name lmp92064 $ iio_readdev -t my-trigger -b 16 iio:device3 | hexdump WARNING: High-speed mode not enabled 0000000 0000 0176 0101 0001 5507 abd5 7645 1768 0000010 0000 016d 0101 0001 ee1e ac6b 7645 1768 ... Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230707063635.1496437-1-l.goehrs@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: stm32-adc: Use devm_platform_get_and_ioremap_resource()Yangtao Li2023-07-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230704095808.33780-1-frank.li@vivo.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: qcom-spmi-adc5: Add ADC5_GPIO2_100K_PUKonrad Dybcio2023-07-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though it existed in bindings for the longest time, ADC5_GPIO2_100K_PU was never assigned in the driver. Do so. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20230627-topic-adc-v1-1-c61581abffa3@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: imu: inv_mpu6050: read the full fifo when processing dataJean-Baptiste Maneyrol2023-07-203-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When processing data read the full fifo data in 1 time. If there are several samples in the FIFO, it means we are experiencing system delay. In this case, it is better to read all data with 1 bus access than to add additional latency by doing several ones. This requires to use a bigger buffer depending on chip FIFO size and do an additional local data copy before sending. But the cost is minimal and behavior is still better like this under system heavy load. Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Link: https://lore.kernel.org/r/20230623082924.283967-1-inv.git-commit@tdk.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: ad7192: Use sysfs_emit_atAlisa Roman2023-07-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace scnprintf with sysfs_emit_at which is the preferred alternative. Also make sure each fractional digit is in its place by padding with zeros up to 3 digits: "...%03d...". Signed-off-by: Alisa Roman <alisa.roman@analog.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230620163135.93780-1-alisa.roman@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: Add Allwinner D1/T113s/R329/T507 SoCs GPADCMaksim Kiselev2023-07-203-0/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The General Purpose ADC (GPADC) can convert the external signal into a certain proportion of digital value, to realize the measurement of analog signal, which can be applied to power detection and key detection. Theoretically, this ADC can support up to 16 channels. All SoCs below contain this GPADC IP. The only difference between them is the number of available channels: T113 - 1 channel D1 - 2 channels R329 - 4 channels T507 - 4 channels Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com> Link: https://lore.kernel.org/r/20230619154252.3951913-3-bigunclemax@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: Kconfig change description for Allwinner GPADCMaksim Kiselev2023-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SoCs names to Allwinner GPADC description to make it more informative. Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com> Link: https://lore.kernel.org/r/20230619154252.3951913-2-bigunclemax@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: light: vcnl4000: Add calibration bias for 4040/4200Astrid Rost2023-07-201-2/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The calibration bias is setting the LED current to change the detection distance. Add read/write attribute for proximity calibration bias and read attribute for available values. This is supported for vcnl4040 and vcnl4200. Signed-off-by: Astrid Rost <astrid.rost@axis.com> Link: https://lore.kernel.org/r/20230613135025.2596641-9-astrid.rost@axis.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: light: vcnl4000: Add oversampling_ratio for 4040/4200Astrid Rost2023-07-201-2/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the proximity multi pulse (PS_MPS) as oversampling_ratio. Instead of one single pulse per every defined time frame, one can program2, 4, or even 8 pulses. This leads to a longer IRED on-time for each proximity measurement value, which also results in a higher detection range. Add read/write attribute for proximity oversampling-ratio and read attribute for available oversampling-ratio. This is supported for vcnl4040 and vcnl4200. Signed-off-by: Astrid Rost <astrid.rost@axis.com> Link: https://lore.kernel.org/r/20230613135025.2596641-8-astrid.rost@axis.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>