Commit Graph

5565 Commits

Author SHA1 Message Date
Ilpo Järvinen
1da18b3896 i2c: sis5595: Do PCI error checks on own line
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-25 22:11:03 +02:00
Harshit Mogalapalli
7f2e65a8f5 i2c: qcom-cci: Fix error checking in cci_probe()
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: 605efbf438 ("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-25 22:07:10 +02:00
Patrick Rudolph
6c30ac917a i2c: muxes: pca954x: Add regulator support
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-23 23:09:12 +02:00
Patrick Rudolph
81694437b6 i2c: muxes: pca954x: Add MAX735x/MAX736x support
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-23 23:09:03 +02:00
Yangtao Li
08e3351b4b i2c: pnx: Use devm_platform_get_and_ioremap_resource()
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-14 18:10:14 +02:00
Yangtao Li
733f41f702 i2c: pxa: Use devm_platform_get_and_ioremap_resource()
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-14 18:10:10 +02:00
Yangtao Li
b15eb80322 i2c: s3c2410: Use devm_platform_get_and_ioremap_resource()
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-14 18:10:05 +02:00
Yangtao Li
3735e4318f i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
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-14 18:10:01 +02:00
Yangtao Li
8f2056ff20 i2c: st: Use devm_platform_get_and_ioremap_resource()
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-14 18:09:57 +02:00
Yangtao Li
02ebc01dde i2c: qcom-geni: Convert to devm_platform_ioremap_resource()
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-14 18:09:53 +02:00
Yangtao Li
8086ea443d i2c: stm32f4: Use devm_platform_get_and_ioremap_resource()
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-14 18:09:48 +02:00
Yangtao Li
8f4bc41800 i2c: mlxbf: Use devm_platform_get_and_ioremap_resource()
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-14 18:09:44 +02:00
Yangtao Li
f9dce8d649 i2c: brcmstb: Convert to devm_platform_ioremap_resource()
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-14 18:09:39 +02:00
Yangtao Li
c71d80d384 i2c: iproc: Convert to devm_platform_ioremap_resource()
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-14 18:09:35 +02:00
Yangtao Li
0a310eef70 i2c: at91: Use devm_platform_get_and_ioremap_resource()
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-14 18:09:30 +02:00
Rob Herring
59738ab266 I2C: Explicitly include correct DT includes
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-14 17:47:21 +02:00
Wolfram Sang
60c089b2e2 Merge remote-tracking branch 'andi/i2c/andi-for-next' into i2c/for-mergewindow
Pull the patches Andi kindly collected while I was on hiatus. Thanks,
Andi!
2023-08-14 16:54:36 +02:00
Harry Geyer
3253f6923a i2c: tiny-usb: check usb base class before assuming the interface on device 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-14 15:14:42 +02:00
Liao Chang
7a34bab2da i2c: synquacer: Use dev_err_probe in probe function
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-10 10:13:57 +02:00
Liao Chang
5d51af11f4 i2c: imx-lpi2c: Use dev_err_probe in probe function
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-10 10:13:48 +02:00
Liao Chang
235712aa7e i2c: dln2: Use dev_err_probe in probe function
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-10 10:13:40 +02:00
Liao Chang
d29066600a i2c: pxa: Use dev_err_probe in probe function
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-10 10:13:30 +02:00
Liao Chang
605efbf438 i2c: qcom-cci: Use dev_err_probe in probe function
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-10 10:13:24 +02:00
Liao Chang
3c5e6ae401 i2c: hisi: Use dev_err_probe in probe function
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-10 10:13:09 +02:00
Liao Chang
9a648b3f56 i2c: xlp9xx: Use dev_err_probe in probe function
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-10 10:12:55 +02:00
Liao Chang
45a7a0524b i2c: mlxbf: Use dev_err_probe in probe function
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-10 10:12:47 +02:00
Liao Chang
7aec2f39a1 i2c: bcm2835: Use dev_err_probe in probe function
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-10 10:12:22 +02:00
Ruan Jinjie
0c89b3257b i2c: mux: ltc4306: Remove an unnecessary ternary operator
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-08 15:36:58 +02:00
Ruan Jinjie
5140b46caf i2c: stm32: Do not check for 0 return after calling platform_get_irq()
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-08 15:36:58 +02:00
Zhu Wang
adcf6eae6d i2c: remove redundant dev_err_probe()
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-08 15:36:55 +02:00
Dan Carpenter
f5d5bc5fda i2c: imx: Clean up a call to request_irq()
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-08 15:36:54 +02:00
Paul Cercueil
ea738c06a9 i2c: mux: pca954x: Remove #ifdef guards for PM related functions
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-08 15:36:53 +02:00
Paul Cercueil
b221df9c4e i2c: virtio: Remove #ifdef guards for PM related functions
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-08 15:36:53 +02:00
Paul Cercueil
426b67422b i2c: sh-mobile: Remove #ifdef guards for PM related functions
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-08 15:36:52 +02:00
Paul Cercueil
67cd435186 i2c: s3c2410: Remove #ifdef guards for PM related functions
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-08 15:36:52 +02:00
Paul Cercueil
941b99ac57 i2c: rcar: Remove #ifdef guards for PM related functions
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-08 15:36:51 +02:00
Paul Cercueil
d19941ac22 i2c: qup: Remove #ifdef guards for PM related functions
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-08 15:36:50 +02:00
Paul Cercueil
1ea4e6b56e i2c: pxa: Remove #ifdef guards for PM related functions
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-08 15:36:50 +02:00
Paul Cercueil
6184f92fb1 i2c: pnx: Remove #ifdef guards for PM related functions
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-08 15:36:50 +02:00
Paul Cercueil
0ad93449b0 i2c: ocores: Remove #ifdef guards for PM related functions
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-08 15:36:49 +02:00
Paul Cercueil
e159fe0d0c i2c: nomadik: Remove #ifdef guards for PM related functions
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-08 15:36:49 +02:00
Paul Cercueil
ba733668dc i2c: mt65xx: Remove #ifdef guards for PM related functions
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-08 15:36:49 +02:00
Paul Cercueil
9f38edaf4a i2c: lpc2k: Remove #ifdef guards for PM related functions
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-08 15:36:49 +02:00
Paul Cercueil
2e4ff22b60 i2c: kempld: Convert to use regular device PM
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-08 15:36:49 +02:00
Paul Cercueil
775a3c4741 i2c: img-scb: Remove #ifdef guards for PM related functions
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-08 15:36:49 +02:00
Paul Cercueil
a6273e413a i2c: i801: Remove #ifdef guards for PM related functions
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-08 15:36:48 +02:00
Paul Cercueil
28f3fb1cd8 i2c: hix5hd2: Remove #ifdef guards for PM related functions
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-08 15:36:48 +02:00
Paul Cercueil
375b26c952 i2c: exynos5: Remove #ifdef guards for PM related functions
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-08 15:36:48 +02:00
Paul Cercueil
a9e4d8b641 i2c: designware: Remove #ifdef guards for PM related functions
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-08 15:36:48 +02:00
Paul Cercueil
a6624009a1 i2c: davinci: Remove #ifdef guards for PM related functions
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-08 15:36:48 +02:00