summaryrefslogtreecommitdiff
path: root/drivers/i2c
AgeCommit message (Collapse)AuthorFilesLines
2023-08-08i2c: remove redundant dev_err_probe()Zhu Wang2-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()Dan Carpenter1-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 functionsPaul Cercueil1-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 functionsPaul Cercueil1-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>
2023-08-08i2c: sh-mobile: Remove #ifdef guards for PM related functionsPaul Cercueil1-9/+3
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> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230722115310.27681-4-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: s3c2410: Remove #ifdef guards for PM related functionsPaul Cercueil1-11/+3
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> Link: https://lore.kernel.org/r/20230722115310.27681-3-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: rcar: Remove #ifdef guards for PM related functionsPaul Cercueil1-8/+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> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230722115310.27681-2-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: qup: Remove #ifdef guards for PM related functionsPaul Cercueil1-12/+4
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. Note that the driver should probably use the DEFINE_RUNTIME_DEV_PM_OPS() macro, as the system suspend/resume callbacks seem to not do anything more than triggering the runtime-PM states. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115310.27681-1-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: pxa: Remove #ifdef guards for PM related functionsPaul Cercueil1-7/+1
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. Note that the behaviour is slightly different than before; the original code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which resulted in these functions being compiled in but never used when CONFIG_PM_SLEEP was disabled. Now, those functions are only compiled in when CONFIG_PM_SLEEP is enabled. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-17-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: pnx: Remove #ifdef guards for PM related functionsPaul Cercueil1-8/+4
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> Link: https://lore.kernel.org/r/20230722115046.27323-16-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: ocores: Remove #ifdef guards for PM related functionsPaul Cercueil1-7/+3
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> Link: https://lore.kernel.org/r/20230722115046.27323-15-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: nomadik: Remove #ifdef guards for PM related functionsPaul Cercueil1-9/+3
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> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230722115046.27323-14-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: mt65xx: Remove #ifdef guards for PM related functionsPaul Cercueil1-5/+3
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> Link: https://lore.kernel.org/r/20230722115046.27323-13-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: lpc2k: Remove #ifdef guards for PM related functionsPaul Cercueil1-7/+1
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. Note that the behaviour is slightly different than before; the original code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which resulted in these functions being compiled in but never used when CONFIG_PM_SLEEP was disabled. Now, those functions are only compiled in when CONFIG_PM_SLEEP is enabled. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-12-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: kempld: Convert to use regular device PMPaul Cercueil1-11/+8
Provide PM callbacks through platform_driver.driver.pm instead of platform_driver.{suspend,resume} as any good-behaved driver should do. 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> Acked-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230722115046.27323-11-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: img-scb: Remove #ifdef guards for PM related functionsPaul Cercueil1-7/+3
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> Acked-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230722115046.27323-10-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: i801: Remove #ifdef guards for PM related functionsPaul Cercueil1-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> Link: https://lore.kernel.org/r/20230722115046.27323-9-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: hix5hd2: Remove #ifdef guards for PM related functionsPaul Cercueil1-6/+4
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. Note that this driver should probably use the DEFINE_RUNTIME_DEV_PM_OPS() macro, which would allow the devices to be runtime-suspended on system suspend. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-8-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: exynos5: Remove #ifdef guards for PM related functionsPaul Cercueil1-5/+3
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> Link: https://lore.kernel.org/r/20230722115046.27323-7-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: designware: Remove #ifdef guards for PM related functionsPaul Cercueil1-16/+6
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> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20230722115046.27323-6-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: davinci: Remove #ifdef guards for PM related functionsPaul Cercueil1-9/+3
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. Note that the behaviour is slightly different than before; the original code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which resulted in these functions being compiled in but never used when CONFIG_PM_SLEEP was disabled. Now, those functions are only compiled in when CONFIG_PM_SLEEP is enabled. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20230722115046.27323-5-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: brcmstb: Remove #ifdef guards for PM related functionsPaul Cercueil1-5/+3
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> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230722115046.27323-4-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: iproc: Remove #ifdef guards for PM related functionsPaul Cercueil1-9/+1
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: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20230722115046.27323-3-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: au1550: Remove #ifdef guards for PM related functionsPaul Cercueil1-12/+3
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. Note that the behaviour is slightly different than before; the original code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which resulted in these functions being compiled in but never used when CONFIG_PM_SLEEP was disabled. Now, those functions are only compiled in when CONFIG_PM_SLEEP is enabled. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-2-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: s3c2410: Remove redundant dev_err()Ruan Jinjie1-1/+0
There is no need to call the dev_err() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230726174226.2480552-1-ruanjinjie@huawei.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-08-08i2c: imx-lpi2c: directly return ISR when detect a NACKCarlos Song1-6/+4
A NACK flag in ISR means i2c bus error. In such condition, there is no need to do read/write operation. In this patch, i2c will check MSR_NDF, MSR_RDF and MSR_TDF flag in turn, it's making mutually exclusive NACK/read/write. So when a NACK is received(MSR_NDF), i2c will return ISR directly and then stop i2c transfer. Signed-off-by: Carlos Song <carlos.song@nxp.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20230727030347.3552992-1-carlos.song@nxp.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2023-07-14media: i2c: add I2C Address Translator (ATR) supportLuca Ceresoli3-0/+720
An ATR is a device that looks similar to an i2c-mux: it has an I2C slave "upstream" port and N master "downstream" ports, and forwards transactions from upstream to the appropriate downstream port. But it is different in that the forwarded transaction has a different slave address. The address used on the upstream bus is called the "alias" and is (potentially) different from the physical slave address of the downstream chip. Add a helper file (just like i2c-mux.c for a mux or switch) to allow implementing ATR features in a device driver. The helper takes care of adapter creation/destruction and translates addresses at each transaction. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-07-08Merge tag 'i2c-for-6.5-rc1-part2' of ↵Linus Torvalds3-3/+2
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull more i2c updates from Wolfram Sang: - xiic patch should have been in the original pull but slipped through - mpc patch fixes a build regression - nomadik cleanup * tag 'i2c-for-6.5-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: mpc: Drop unused variable i2c: nomadik: Remove a useless call in the remove function i2c: xiic: Don't try to handle more interrupt events after error
2023-07-07Merge tag 'acpi-6.5-rc1-3' of ↵Linus Torvalds1-3/+0
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "These fix a couple of compiler warnings, refine an ACPI device enumeration quirk to address a driver regression and clean up code. Specifics: - Make acpi_companion_match() return a const pointer and update its callers accordingly (Andy Shevchenko) - Move the extern declaration of the acpi_root variable to a header file so as to address a compiler warning (Andy Shevchenko) - Address compiler warnings in the ACPI device enumeration code by adding a missing header file include to it (Ben Dooks) - Refine the SMB0001 quirk in the ACPI device enumeration code so as to address an i2c-scmi driver regression (Andy Shevchenko) - Clean up two pieces of the ACPI device enumeration code (Andy Shevchenko)" * tag 'acpi-6.5-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: scan: Use the acpi_match_acpi_device() helper ACPI: platform: Move SMB0001 HID to the header and reuse ACPI: platform: Ignore SMB0001 only when it has resources ACPI: bus: Introduce acpi_match_acpi_device() helper ACPI: scan: fix undeclared variable warnings by including sleep.h ACPI: bus: Constify acpi_companion_match() returned value ACPI: scan: Move acpi_root to internal header
2023-07-06i2c: mpc: Drop unused variableGuenter Roeck1-1/+0
Fix the following build error. Error log: drivers/i2c/busses/i2c-mpc.c: In function 'mpc_i2c_setup_512x': drivers/i2c/busses/i2c-mpc.c:310:20: error: unused variable 'pval' Fixes: 9d178e00583e ("i2c: mpc: Use of_property_read_reg() to parse "reg"") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-07-06i2c: nomadik: Remove a useless call in the remove functionChristophe JAILLET1-2/+0
Since commit 235602146ec9 ("i2c-nomadik: turn the platform driver to an amba driver"), there is no more request_mem_region() call in this driver. So remove the release_mem_region() call from the remove function which is likely a left over. Fixes: 235602146ec9 ("i2c-nomadik: turn the platform driver to an amba driver") Cc: <stable@vger.kernel.org> # v3.6+ Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-07-06i2c: xiic: Don't try to handle more interrupt events after errorRobert Hancock1-0/+2
In xiic_process, it is possible that error events such as arbitration lost or TX error can be raised in conjunction with other interrupt flags such as TX FIFO empty or bus not busy. Error events result in the controller being reset and the error returned to the calling request, but the function could potentially try to keep handling the other events, such as by writing more messages into the TX FIFO. Since the transaction has already failed, this is not helpful and will just cause issues. This problem has been present ever since: commit 7f9906bd7f72 ("i2c: xiic: Service all interrupts in isr") which allowed non-error events to be handled after errors, but became more obvious after: commit 743e227a8959 ("i2c: xiic: Defer xiic_wakeup() and __xiic_start_xfer() in xiic_process()") which reworked the code to add a WARN_ON which triggers if both the xfer_more and wakeup_req flags were set, since this combination is not supposed to happen, but was occurring in this scenario. Skip further interrupt handling after error flags are detected to avoid this problem. Fixes: 7f9906bd7f72 ("i2c: xiic: Service all interrupts in isr") Signed-off-by: Robert Hancock <robert.hancock@calian.com> Acked-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-07-04ACPI: platform: Move SMB0001 HID to the header and reuseAndy Shevchenko1-3/+0
There are at least two places in the kernel that are using the SMB0001 HID. Make it to be available via acpi_drivers.h header file. While at it, replace hard coded one with a definition. Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Acked-by: Wolfram Sang <wsa@kernel.org> # for I2C Link: https://lore.kernel.org/r/20230621151652.79579-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-07-02Merge tag 'i2c-for-6.5-rc1' of ↵Linus Torvalds99-725/+566
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: - I2C has now a co-maintainer taking care of the host drivers. Welcome Andi Shyti and have fun! - platform remove callback converted to return void in drivers - simplify drivers by using devm_clk_get_enabled() - introduce i2c_get_match_data() to avoid more boilerplate code (especially since the core stopped delivering an i2c_device_id) - and the usual bunch of driver updates * tag 'i2c-for-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (38 commits) i2c: uniphier: Use devm_clk_get_enabled() i2c: uniphier-f: Use devm_clk_get_enabled() i2c: owl: Use devm_clk_get_enabled() i2c: lpc2k: Use devm_clk_get_enabled() i2c: hix5hd2: Use devm_clk_get_enabled() i2c: sun6i-p2wi: Use devm_clk_get_enabled() i2c: pasemi-platform: Use devm_clk_get_enabled() i2c: mt7621: Use devm_clk_get_enabled() i2c: xiic: Use devm_clk_get_enabled() i2c: davinci: Use platform table macro over module_alias i2c: ocores: use devm_ managed clks i2c: nomadik: Use dev_err_probe() whenever possible i2c: nomadik: Use devm_clk_get_enabled() i2c: nomadik: Remove unnecessary goto label usb: typec: ucsi: Mark dGPUs as DEVICE scope i2c: wmt: Use devm_platform_get_and_ioremap_resource() i2c: versatile: Use devm_platform_get_and_ioremap_resource() i2c: hix5hd2: Add I2C_M_STOP flag support for i2c-hix5hd2 driver. i2c: mpc: Use of_property_read_reg() to parse "reg" i2c: imx-lpi2c: Don't open-code DIV_ROUND_UP ...
2023-06-23i2c: imx-lpi2c: fix type char overflow issue when calculating the clock cycleClark Wang1-2/+2
Claim clkhi and clklo as integer type to avoid possible calculation errors caused by data overflow. Fixes: a55fa9d0e42e ("i2c: imx-lpi2c: add low power i2c bus driver") Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> Signed-off-by: Carlos Song <carlos.song@nxp.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: qup: Add missing unwind goto in qup_i2c_probe()Shuai Jiang1-7/+14
Smatch Warns: drivers/i2c/busses/i2c-qup.c:1784 qup_i2c_probe() warn: missing unwind goto? The goto label "fail_runtime" and "fail" will disable qup->pclk, but here qup->pclk failed to obtain, in order to be consistent, change the direct return to goto label "fail_dma". Fixes: 9cedf3b2f099 ("i2c: qup: Add bam dma capabilities") Signed-off-by: Shuai Jiang <d202180596@hust.edu.cn> Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org> Cc: <stable@vger.kernel.org> # v4.6+
2023-06-23i2c: uniphier: Use devm_clk_get_enabled()Andi Shyti1-16/+5
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: uniphier-f: Use devm_clk_get_enabled()Andi Shyti1-16/+5
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: owl: Use devm_clk_get_enabled()Andi Shyti1-14/+4
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: lpc2k: Use devm_clk_get_enabled()Andi Shyti1-17/+5
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: hix5hd2: Use devm_clk_get_enabled()Andi Shyti1-7/+4
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: sun6i-p2wi: Use devm_clk_get_enabled()Andi Shyti1-14/+3
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: pasemi-platform: Use devm_clk_get_enabled()Andi Shyti1-18/+4
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: mt7621: Use devm_clk_get_enabled()Andi Shyti1-16/+4
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: xiic: Use devm_clk_get_enabled()Andi Shyti1-13/+7
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Acked-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: davinci: Use platform table macro over module_aliasAndrew Davis1-2/+6
Generates the same platform module alias. More standard usage. Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> [wsa: rebased to i2c/for-mergewindow] Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-23i2c: ocores: use devm_ managed clksWang Zhang1-43/+21
Smatch complains that: drivers/i2c/busses/i2c-ocores.c:704 ocores_i2c_probe() warn: missing unwind goto? If any wrong occurs in ocores_i2c_of_probe, the i2c->clk needs to be released. But the function returns directly without freeing the clock. Fix this by updating the code to use devm_clk_get_optional_enabled() instead. Use dev_err_probe() where appropriate as well since we are changing those statements. Fixes: f5f35a92e44a ("i2c: ocores: Add irq support for sparc") Signed-off-by: Wang Zhang <silver_code@hust.edu.cn> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-14i2c: nomadik: Use dev_err_probe() whenever possibleAndi Shyti1-8/+6
Make use of dev_err_probe() in order to simplify the code and avoid printing when returning EPROBE_DEFER. Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-14i2c: nomadik: Use devm_clk_get_enabled()Andi Shyti1-15/+3
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
2023-06-14i2c: nomadik: Remove unnecessary goto labelAndi Shyti1-13/+8
The err_no_mem goto label doesn't do anything. Remove it. Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>