summaryrefslogtreecommitdiffstats
path: root/drivers/iio
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'char-misc-6.3-rc1' of ↵Linus Torvalds2023-02-2451-508/+2981
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc and other driver subsystem updates from Greg KH: "Here is the large set of driver changes for char/misc drivers and other smaller driver subsystems that flow through this git tree. Included in here are: - New IIO drivers and features and improvments in that subsystem - New hwtracing drivers and additions to that subsystem - lots of interconnect changes and new drivers as that subsystem seems under very active development recently. This required also merging in the icc subsystem changes through this tree. - FPGA driver updates - counter subsystem and driver updates - MHI driver updates - nvmem driver updates - documentation updates - Other smaller driver updates and fixes, full details in the shortlog All of these have been in linux-next for a while with no reported problems" * tag 'char-misc-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (223 commits) scripts/tags.sh: fix incompatibility with PCRE2 firmware: coreboot: Remove GOOGLE_COREBOOT_TABLE_ACPI/OF Kconfig entries mei: lower the log level for non-fatal failed messages mei: bus: disallow driver match while dismantling device misc: vmw_balloon: fix memory leak with using debugfs_lookup() nvmem: stm32: fix OPTEE dependency dt-bindings: nvmem: qfprom: add IPQ8074 compatible nvmem: qcom-spmi-sdam: register at device init time nvmem: rave-sp-eeprm: fix kernel-doc bad line warning nvmem: stm32: detect bsec pta presence for STM32MP15x nvmem: stm32: add OP-TEE support for STM32MP13x nvmem: core: use nvmem_add_one_cell() in nvmem_add_cells_from_of() nvmem: core: add nvmem_add_one_cell() nvmem: core: drop the removal of the cells in nvmem_add_cells() nvmem: core: move struct nvmem_cell_info to nvmem-provider.h nvmem: core: add an index parameter to the cell of: property: add #nvmem-cell-cells property of: property: make #.*-cells optional for simple props of: base: add of_parse_phandle_with_optional_args() net: add helper eth_addr_add() ...
| * Merge 6.2-rc7 into char-misc-nextGreg Kroah-Hartman2023-02-0610-30/+143
| |\ | | | | | | | | | | | | | | | | | | We need the char-misc driver fixes in here as other patches depend on them. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | iio: adc: ad7291: Fix indentation error by adding extra spacesAnup Sharma2023-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added extra spaces before statements to fix following indentation warnings reported by checkpatch.pl. WARNING: Statements should start on a tabstop + return 0; Signed-off-by: Anup Sharma <anupnewsmail@gmail.com> Link: https://lore.kernel.org/r/Y9Vf4Tp8JKvy+y0u@yoga Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: accel: mma9551_core: Prevent uninitialized variable in ↵Harshit Mogalapalli2023-01-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mma9551_read_config_word() Smatch Warns: drivers/iio/accel/mma9551_core.c:299 mma9551_read_config_word() error: uninitialized symbol 'v'. When (offset >= 1 << 12) is true mma9551_transfer() will return -EINVAL without 'v' being initialized, so check for the error and return. Note: No actual bug as caller checks the return value and does not use the parameter in the problem case. Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Link: https://lore.kernel.org/r/20230126153610.3586243-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: accel: mma9551_core: Prevent uninitialized variable in ↵Harshit Mogalapalli2023-01-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mma9551_read_status_word() Smatch Warns: drivers/iio/accel/mma9551_core.c:357 mma9551_read_status_word() error: uninitialized symbol 'v'. When (offset >= 1 << 12) is true mma9551_transfer() will return -EINVAL without 'v' being initialized, so check for the error and return. Note: Not a bug as such because the caller checks return value and doesn't not use this parameter in the problem case. Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Link: https://lore.kernel.org/r/20230126152147.3585874-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: imu: fix spdx formatTom Rix2023-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | checkpatch reports WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 FILE: drivers/iio/imu/bno055/bno055_ser_trace.c:1: +//SPDX-License-Identifier: GPL-2.0 Add a space Fixes: 2eef5a9cc643 ("iio: imu: add BNO055 serdev driver") Signed-off-by: Tom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20230124194301.656518-1-trix@redhat.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: imx93: Fix spelling mistake "geting" -> "getting"Colin Ian King2023-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Thrre is a spelling mistake in a dev_err_probe message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20230124100413.684416-1-colin.i.king@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| * | iio: adc: add imx93 adc supportHaibo Chen2023-01-223-0/+495
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: ti-ads7924: add Texas Instruments ADS7924 driverHugo Villeneuve2023-01-213-0/+486
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel.Philippe De Muyter2023-01-211-2/+3
| | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in st_lsm6dsx_shub.c.Philippe De Muyter2023-01-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: vcnl4000: Add interrupt support for vcnl4040Mårten Lindahl2023-01-211-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: vcnl4000: Make irq handling more genericMårten Lindahl2023-01-211-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: vcnl4000: Prepare for more generic setupMårten Lindahl2023-01-211-128/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: dac: add support for max5522Angelo Dureghello2023-01-213-0/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: core: Sort headersAndy Shevchenko2023-01-211-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: core: Replace iio_sysfs_match_string_with_gaps() by __sysfs_match_string()Andy Shevchenko2023-01-211-31/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: xilinx-ams: Convert to use fwnode_device_is_compatible()Andy Shevchenko2023-01-211-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: chemical: scd30_core: Switch to use dev_err_probe()Andy Shevchenko2023-01-141-26/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: chemical: scd30_core: use sysfs_emit() to instead of scnprintf()Andy Shevchenko2023-01-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: stm32-dfsdm: add id registers supportOlivier Moysan2023-01-082-35/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: qcom-spmi-adc5: define ADC5_BAT_ID_100K_PU channelLuca Weiss2023-01-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: magnetometer: st_magn: Add LSM303CStephan Gerhold2023-01-085-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: accel: st_accel: Add LSM303CStephan Gerhold2023-01-085-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | drivers: iio: cdc: Drop redundant if checkAlexander Vorwerk2023-01-081-2/+1
| | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: max11410: Use asm intead of asm-genericAndy Shevchenko2023-01-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: ti-adc128s052: Sort headersAndy Shevchenko2023-01-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: ti-adc128s052: Drop anti-pattern of ACPI_PTR() useAndy Shevchenko2023-01-081-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: ti-adc128s052: Switch to use spi_get_device_match_data()Andy Shevchenko2023-01-081-23/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: ep93xx: Enable wider build testing with COMPILE_TESTJonathan Cameron2023-01-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | iio: adc: ep93xx: Add OF supportAlexander Sverdlin2022-12-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: qcom-spmi-adc5: Suppress probe-deferral error messageMarijn Suijten2022-12-281-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: imu: kmx61: Fix spelling mistake "Errow" -> "Error"Colin Ian King2022-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: Keep Makefile sorted by module nameAndy Shevchenko2022-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: sort header inclusion alphabeticallyAndy Shevchenko2022-12-281-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: Use dev_get_drvdata() directly in PM callbacksAndy Shevchenko2022-12-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: Utilise temporary variable for struct deviceAndy Shevchenko2022-12-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: Drop legacy platform data codeAndy Shevchenko2022-12-281-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: Simplify with dev_err_probeAndy Shevchenko2022-12-281-18/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: Drop unused defintion(s)Andy Shevchenko2022-12-281-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: Make use of the macros from bits.hAndy Shevchenko2022-12-281-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: Configure INT in one placeAndy Shevchenko2022-12-281-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: Use i2c_smbus_write_word_data() in tsl2563_configure()Andy Shevchenko2022-12-281-33/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: light: tsl2563: Do not hardcode interrupt trigger typeFerry Toth2022-12-281-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: 388be4883952 ("staging:iio: tsl2563 abi fixes and interrupt handling") Fixes: bdab1001738f ("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>
| * | iio: light: max44009: Convert to i2c's .probe_new()Uwe Kleine-König2022-12-281-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: pressure: ms5611: Switch to fully devm_ managed registration.Jonathan Cameron2022-12-284-27/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: pressure: ms5611: Use devm_regulator_get_enable()Jonathan Cameron2022-12-282-30/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | iio: accel: bma400: Use devm_regulator_bulk_get_enable()Jonathan Cameron2022-12-282-29/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | iio: common: scmi_iio: use sysfs_emit() to instead of scnprintf()ye xingchen2022-12-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | iio: adc: at91-sama5d2_adc: use sysfs_emit() to instead of scnprintf()ye xingchen2022-12-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>