aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
AgeCommit message (Collapse)AuthorFilesLines
2023-09-04Merge tag 'i2c-for-6.6-rc1' of ↵Gravatar Linus Torvalds 65-411/+328
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "I2C has mainly cleanups this time and a few driver improvements. Because a lot of developers were on holidays (including myself) it was a good timing to apply lots of cleanups which would normally cause merge conflicts with other floating patches. Extra thanks go to Andi Shyti who backed me up when I was on a four week hiatus. This is also the reason that some patches were commited later than ideal" * tag 'i2c-for-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (67 commits) i2c: at91: Use dev_err_probe() instead of dev_err() I2C: ali15x3: Do PCI error checks on own line i2c: Make return value check more accurate and explicit for devm_pinctrl_get() i2c: designware: Add support for recovery when GPIO need pinctrl i2c: mlxcpld: Add support for extended transaction length i2c: mlxcpld: Allow driver to run on ARM64 architecture i2c: nforce2: Do PCI error check on own line i2c: sis5595: Do PCI error checks on own line i2c: qcom-cci: Fix error checking in cci_probe() i2c: muxes: pca954x: Add regulator support i2c: muxes: pca954x: Add MAX735x/MAX736x support dt-bindings: i2c: Add Maxim MAX735x/MAX736x variants dt-bindings: i2c: pca954x: Correct interrupt support i2c: pnx: Use devm_platform_get_and_ioremap_resource() i2c: pxa: Use devm_platform_get_and_ioremap_resource() i2c: s3c2410: Use devm_platform_get_and_ioremap_resource() i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource() i2c: st: Use devm_platform_get_and_ioremap_resource() i2c: qcom-geni: Convert to devm_platform_ioremap_resource() i2c: stm32f4: Use devm_platform_get_and_ioremap_resource() ...
2023-09-01Merge tag 'media/v6.6-1' of ↵Gravatar Linus Torvalds 3-0/+720
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - new i2c drivers: ds90ub913, ds90ub953, ds90ub960, dw9719, ds90ub913 - new Intel IVSC MEI drivers - some Mediatek platform drivers were moved to a common location - Intel atomisp2 driver is now working with the main ov2680 driver. Due to that, the atomisp2 ov2680 staging one was removed - the bttv driver was finally converted to videobuf2 framework. This was the last one upstream using videobuf version 1 core. We'll likely remove the old videobuf framework on 6.7 - lots of improvements at atomisp driver: it now works with normal I2C sensors. Several compile-mode dependecies to select between ISP2400 and ISP2401 are now solved in runtime - a new ipu-bridge logic was added to work with IVSC MEI drivers - venus driver gained better support for new VPU versions - the v4l core async framework has gained lots of improvements and cleanups - lots of other cleanups, improvements and driver fixes * tag 'media/v6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (358 commits) media: ivsc: Add ACPI dependency media: bttv: convert to vb2 media: bttv: use audio defaults for winfast2000 media: bttv: refactor bttv_set_dma() media: bttv: move vbi_skip/vbi_count out of buffer media: bttv: remove crop info from bttv_buffer media: bttv: remove tvnorm field from bttv_buffer media: bttv: remove format field from bttv_buffer media: bttv: move do_crop flag out of bttv_fh media: bttv: copy vbi_fmt from bttv_fh media: bttv: copy vid fmt/width/height from fh media: bttv: radio use v4l2_fh instead of bttv_fh media: bttv: replace BUG with WARN_ON media: bttv: use video_drvdata to get bttv media: i2c: rdacm21: Fix uninitialized value media: coda: Remove duplicated include media: vivid: fix the racy dev->radio_tx_rds_owner media: i2c: ccs: Check rules is non-NULL media: i2c: ds90ub960: Fix PLL config for 1200 MHz CSI rate media: i2c: ds90ub953: Fix use of uninitialized variables ...
2023-08-30i2c: at91: Use dev_err_probe() instead of dev_err()Gravatar Yann Sionneau 1-4/+3
Change if (IS_ERR(x)) { dev_err(...); return PTR_ERR(x); } into return dev_err_probe() Also, return the correct error instead of hardcoding -ENODEV This change has also the advantage of handling the -EPROBE_DEFER situation. Signed-off-by: Yann Sionneau <yann@sionneau.net> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-30I2C: ali15x3: Do PCI error checks on own lineGravatar Ilpo Järvinen 1-5/+6
Instead of if conditions with line splits, use the usual error handling pattern with a separate variable to improve readability. No functional changes intended. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-26i2c: Make return value check more accurate and explicit for devm_pinctrl_get()Gravatar Jinjie Ruan 2-2/+10
If pinctrl is not available (thus devm_pinctrl_get() returns NULL) then recovery can't work, because we can't switch the I2C pins between the I2C controller and GPIO. So, it is quite correct to print "can't get pinctrl, bus recovery not supported" because the I2C bus can't be recovered without pinctrl. The PTR_ERR() is also fine - because if pinctrl is not present and returns NULL, we'll end up returning zero, which is exactly what we want. However, open code that with a more accurate message will be more explicit for NULL case when CONFIG_PINCTRL is not defined. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Acked-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-25i2c: designware: Add support for recovery when GPIO need pinctrlGravatar Yann Sionneau 1-0/+12
Currently if the SoC needs pinctrl to switch the SCL and SDA from the I2C function to GPIO function, the recovery won't work. scl-gpio = <>; sda-gpio = <>; Are not enough for some SoCs to have a working recovery. Some need: scl-gpio = <>; sda-gpio = <>; pinctrl-names = "default", "recovery"; pinctrl-0 = <&i2c_pins_hw>; pinctrl-1 = <&i2c_pins_gpio>; The driver was not filling rinfo->pinctrl with the device node pinctrl data which is needed by generic recovery code. Signed-off-by: Yann Sionneau <ysionneau@kalray.eu> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-25i2c: mlxcpld: Add support for extended transaction lengthGravatar Vadim Pasternak 1-0/+10
Add support for extended length of read and write transactions. New FPGA logic allows to increase size of the read and write transactions length. This feature is verified through capability register 'CPBLTY_REG'. Two bits 5 and 6 of the register are used for length capability detection. Value '10' indicates support of extended transaction length - 128 bytes for read transactions and 132 for write transactions. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Reviewed-by: Michael Shych <michaelsh@nvidia.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-25i2c: mlxcpld: Allow driver to run on ARM64 architectureGravatar Vadim Pasternak 1-1/+1
Extend driver dependency by ARM64 architecture. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Reviewed-by: Michael Shych <michaelsh@nvidia.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-25i2c: nforce2: Do PCI error check on own lineGravatar Ilpo Järvinen 1-2/+2
Instead of a if condition with a line split, use the usual error handling pattern with a separate variable to improve readability. No functional changes intended. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-25i2c: sis5595: Do PCI error checks on own lineGravatar Ilpo Järvinen 1-10/+10
Instead of if conditions with line splits, use the usual error handling pattern with a separate variable to improve readability. No functional changes intended. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-25i2c: qcom-cci: Fix error checking in cci_probe()Gravatar Harshit Mogalapalli 1-1/+3
devm_clk_bulk_get_all() can return zero when no clocks are obtained. Passing zero to dev_err_probe() is a success which is incorrect. Fixes: 605efbf43813 ("i2c: qcom-cci: Use dev_err_probe in probe function") Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-23i2c: muxes: pca954x: Add regulator supportGravatar Patrick Rudolph 1-5/+23
Add a vdd regulator and enable it for boards that have the mux powered off by default. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-23i2c: muxes: pca954x: Add MAX735x/MAX736x supportGravatar Patrick Rudolph 2-4/+69
Add support for the following Maxim chips using the existing PCA954x driver: - MAX7356 - MAX7357 - MAX7358 - MAX7367 - MAX7368 - MAX7369 All added Maxim chips behave like the PCA954x, where a single SMBUS byte write selects up to 8 channels to be bridged to the primary bus. While the MAX7357/MAX7358 have interrupt support, they don't act as interrupt controller like the PCA9545 does. Thus don't enable IRQ support and handle them like the PCA9548. Tested using the MAX7357. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: bcm-iproc: Fix bcm_iproc_i2c_isr deadlock issueGravatar Chengfeng Ye 1-4/+7
iproc_i2c_rd_reg() and iproc_i2c_wr_reg() are called from both interrupt context (e.g. bcm_iproc_i2c_isr) and process context (e.g. bcm_iproc_i2c_suspend). Therefore, interrupts should be disabled to avoid potential deadlock. To prevent this scenario, use spin_lock_irqsave(). Fixes: 9a1038728037 ("i2c: iproc: add NIC I2C support") Signed-off-by: Chengfeng Ye <dg573847474@gmail.com> Acked-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: pnx: Use devm_platform_get_and_ioremap_resource()Gravatar Yangtao Li 1-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> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: pxa: Use devm_platform_get_and_ioremap_resource()Gravatar Yangtao Li 1-3/+2
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> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: s3c2410: Use devm_platform_get_and_ioremap_resource()Gravatar Yangtao Li 1-3/+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> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()Gravatar Yangtao Li 1-6/+2
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> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: st: Use devm_platform_get_and_ioremap_resource()Gravatar Yangtao Li 1-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> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: qcom-geni: Convert to devm_platform_ioremap_resource()Gravatar Yangtao Li 1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: stm32f4: Use devm_platform_get_and_ioremap_resource()Gravatar Yangtao Li 1-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> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: mlxbf: Use devm_platform_get_and_ioremap_resource()Gravatar Yangtao Li 1-7/+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> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: brcmstb: Convert to devm_platform_ioremap_resource()Gravatar Yangtao Li 1-13/+6
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Kamal Dasu <kamal.dasu@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: iproc: Convert to devm_platform_ioremap_resource()Gravatar Yangtao Li 1-6/+2
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Acked-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: at91: Use devm_platform_get_and_ioremap_resource()Gravatar Yangtao Li 1-7/+3
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> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: sun6i-p2wi: Fix an error message in probe()Gravatar Dan Carpenter 1-1/+2
The "ret" variable is uninitialized. It was the "p2wi->rstc" variable that was intended. We can also use the %pe string format to print the error code name instead of just the number. Fixes: 75ff8a340a81 ("i2c: sun6i-p2wi: Use devm_clk_get_enabled()") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14I2C: Explicitly include correct DT includesGravatar Rob Herring 33-38/+25
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> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14Merge remote-tracking branch 'andi/i2c/andi-for-next' into i2c/for-mergewindowGravatar Wolfram Sang 34-286/+130
Pull the patches Andi kindly collected while I was on hiatus. Thanks, Andi!
2023-08-14i2c: hisi: Only handle the interrupt of the driver's transferGravatar Yicong Yang 1-0/+8
The controller may be shared with other port, for example the firmware. Handle the interrupt from other sources will cause crash since some data are not initialized. So only handle the interrupt of the driver's transfer and discard others. Fixes: d62fbdb99a85 ("i2c: add support for HiSilicon I2C controller") Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230801124625.63587-1-yangyicong@huawei.com Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: tegra: Fix i2c-tegra DMA config option processingGravatar Parker Newman 1-1/+1
Tegra processors prior to Tegra186 used APB DMA for I2C requiring CONFIG_TEGRA20_APB_DMA=y while Tegra186 and later use GPC DMA requiring CONFIG_TEGRA186_GPC_DMA=y. The check for if the processor uses APB DMA is inverted and so the wrong DMA config options are checked. This means if CONFIG_TEGRA20_APB_DMA=y but CONFIG_TEGRA186_GPC_DMA=n with a Tegra186 or later processor the driver will incorrectly think DMA is enabled and attempt to request DMA channels that will never be availible, leaving the driver in a perpetual EPROBE_DEFER state. Fixes: 48cb6356fae1 ("i2c: tegra: Add GPCDMA support") Signed-off-by: Parker Newman <pnewman@connecttech.com> Acked-by: Andi Shyti <andi.shyti@kernel.org> Acked-by: Akhil R <akhilrajeev@nvidia.com> Link: https://lore.kernel.org/r/fcfcf9b3-c8c4-9b34-2ff8-cd60a3d490bd@connecttech.com Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: tegra: Fix failure during probe deferral cleanupGravatar Thierry Reding 1-0/+1
If the driver fails to obtain a DMA channel, it will initiate cleanup and try to release the DMA channel that couldn't be retrieved. This will cause a crash because the cleanup will try to dereference an ERR_PTR()- encoded error code. However, there's nothing to clean up at this point yet, so we can avoid this by simply resetting the DMA channel to NULL instead of storing the error code. Fixes: fcc8a89a1c83 ("i2c: tegra: Share same DMA channel for RX and TX") Signed-off-by: Thierry Reding <treding@nvidia.com> Tested-by: Akhil R <akhilrajeev@nvidia.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: designware: Handle invalid SMBus block data response length valueGravatar Tam Nguyen 1-2/+13
In the I2C_FUNC_SMBUS_BLOCK_DATA case, the invalid length byte value (outside of 1-32) of the SMBus block data response from the Slave device is not correctly handled by the I2C Designware driver. In case IC_EMPTYFIFO_HOLD_MASTER_EN==1, which cannot be detected from the registers, the Master can be disabled only if the STOP bit is set. Without STOP bit set, the Master remains active, holding the bus until receiving a block data response length. This hangs the bus and is unrecoverable. Avoid this by issuing another dump read to reach the stop condition when an invalid length byte is received. Cc: stable@vger.kernel.org Signed-off-by: Tam Nguyen <tamnguyenchi@os.amperecomputing.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20230726080001.337353-3-tamnguyenchi@os.amperecomputing.com Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: designware: Correct length byte validation logicGravatar Quan Nguyen 1-1/+2
Commit 0daede80f870 ("i2c: designware: Convert driver to using regmap API") changes the logic to validate the whole 32-bit return value of DW_IC_DATA_CMD register instead of 8-bit LSB without reason. Later, commit f53f15ba5a85 ("i2c: designware: Get right data length"), introduced partial fix but not enough because the "tmp > 0" still test tmp as 32-bit value and is wrong in case the IC_DATA_CMD[11] is set. Revert the logic to just before commit 0daede80f870 ("i2c: designware: Convert driver to using regmap API"). Fixes: f53f15ba5a85 ("i2c: designware: Get right data length") Fixes: 0daede80f870 ("i2c: designware: Convert driver to using regmap API") Cc: stable@vger.kernel.org Signed-off-by: Tam Nguyen <tamnguyenchi@os.amperecomputing.com> Signed-off-by: Quan Nguyen <quan@os.amperecomputing.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20230726080001.337353-2-tamnguyenchi@os.amperecomputing.com Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: imx-lpi2c: return -EINVAL when i2c peripheral clk doesn't workGravatar Carlos Song 1-0/+3
On MX8X platforms, the default clock rate is 0 if without explicit clock setting in dts nodes. I2c can't work when i2c peripheral clk rate is 0. Add a i2c peripheral clk rate check before configuring the clock register. When i2c peripheral clk rate is 0 and directly return -EINVAL. Signed-off-by: Carlos Song <carlos.song@nxp.com> Acked-by: Dong Aisheng <Aisheng.dong@nxp.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-14i2c: tiny-usb: check usb base class before assuming the interface on device ↵Gravatar Harry Geyer 1-0/+4
is for this driver Patch allows usb devices with multiple interfaces to use this driver without this driver assuming all interfaces are i2c-tiny-usb. Signed-off-by: Harry Geyer <harry.geyer@devtank.co.uk> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230727162255.21551-1-harry.geyer@devtank.co.uk Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-08-10i2c: synquacer: Use dev_err_probe in probe functionGravatar Liao Chang 1-18/+10
Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230808012954.1643834-10-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-10i2c: imx-lpi2c: Use dev_err_probe in probe functionGravatar Liao Chang 1-8/+4
Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230808012954.1643834-9-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-10i2c: dln2: Use dev_err_probe in probe functionGravatar Liao Chang 1-4/+2
Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230808012954.1643834-8-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-10i2c: pxa: Use dev_err_probe in probe functionGravatar Liao Chang 1-4/+3
Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230808012954.1643834-7-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-10i2c: qcom-cci: Use dev_err_probe in probe functionGravatar Liao Chang 1-4/+2
Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230808012954.1643834-6-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-10i2c: hisi: Use dev_err_probe in probe functionGravatar Liao Chang 1-8/+4
Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Yicong Yang <yangyicong@hisilicon.com> Link: https://lore.kernel.org/r/20230808012954.1643834-5-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-10i2c: xlp9xx: Use dev_err_probe in probe functionGravatar Liao Chang 1-4/+2
Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230808012954.1643834-4-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-10i2c: mlxbf: Use dev_err_probe in probe functionGravatar Liao Chang 1-33/+17
Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230808012954.1643834-3-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-10i2c: bcm2835: Use dev_err_probe in probe functionGravatar Liao Chang 1-8/+6
Use the dev_err_probe function instead of dev_err in the probe function so that the printed message includes the return value and also handles -EPROBE_DEFER nicely. Signed-off-by: Liao Chang <liaochang1@huawei.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230808012954.1643834-2-liaochang1@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: mux: ltc4306: Remove an unnecessary ternary operatorGravatar Ruan Jinjie 1-1/+1
The true or false judgement of the ternary operator is unnecessary in C language semantics. So remove it to clean Code. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Acked-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230801025328.3380963-1-ruanjinjie@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: stm32: Do not check for 0 return after calling platform_get_irq()Gravatar Ruan Jinjie 1-4/+4
It is not possible for platform_get_irq() to return 0. Use the return value from platform_get_irq(). Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Acked-by: Alain Volmat <alain.volmat@foss.st.com> Link: https://lore.kernel.org/r/20230731112755.1943630-1-ruanjinjie@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: remove redundant dev_err_probe()Gravatar Zhu Wang 2-4/+3
When platform_get_irq() is called, the error message has been printed, so it need not to call dev_err_probe() to print error. As the comment of platform_get_irq() says, it returned non-zero value when it succeeded, and it returned negative value when it failed. Signed-off-by: Zhu Wang <wangzhu9@huawei.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230801134814.247782-1-wangzhu9@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: imx: Clean up a call to request_irq()Gravatar Dan Carpenter 1-2/+1
This is passing a NULL thread to request_threaded_irq(). So it's not really a threaded IRQ at all. It's more readable to call request_irq() instead. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/fa375cc0-893a-4e64-8bf6-cc37f9ebecf5@moroto.mountain Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: mux: pca954x: Remove #ifdef guards for PM related functionsGravatar Paul Cercueil 1-4/+2
Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/20230722115310.27681-6-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: virtio: Remove #ifdef guards for PM related functionsGravatar Paul Cercueil 1-6/+2
Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Link: https://lore.kernel.org/r/20230722115310.27681-5-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>