#
92e494a7 |
| 28-Jun-2024 |
Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com> |
i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr
[ Upstream commit f63b94be6942ba82c55343e196bd09b53227618e ]
When del_timer_sync() is called in an interrupt context it th
i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr
[ Upstream commit f63b94be6942ba82c55343e196bd09b53227618e ]
When del_timer_sync() is called in an interrupt context it throws a warning because of potential deadlock. The timer is used only to exit from wait_for_completion() after a timeout so replacing the call with wait_for_completion_timeout() allows to remove the problematic timer and its related functions altogether.
Fixes: 41561f28e76a ("i2c: New Philips PNX bus driver") Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
#
08e3351b |
| 10-Jul-2023 |
Yangtao Li <frank.li@vivo.com> |
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
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>
show more ...
|
#
6184f92f |
| 22-Jul-2023 |
Paul Cercueil <paul@crapouillou.net> |
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 d
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>
show more ...
|
#
e190a0c3 |
| 08-May-2023 |
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> |
i2c: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling
i2c: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Alain Volmat <alain.volmat@foss.st.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Acked-by: Baruch Siach <baruch@tkos.co.il> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Acked-by: Jochen Friedrich <jochen@scram.de> Acked-by: Peter Rosin <peda@axentia.se> Acked-by: Vadim Pasternak <vadimp@nvidia.com> Reviewed-by: Asmaa Mnebhi <asnaa@nvidia.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Reviewed-by: Chris Pringle <chris.pringle@phabrix.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Tali Perry <tali.perry@nuvoton.com> Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
show more ...
|
#
3e0f8672 |
| 20-May-2021 |
Lee Jones <lee.jones@linaro.org> |
i2c: busses: i2c-pnx: Provide descriptions for 'alg_data' data structure
Fixes the following W=1 kernel build warning(s):
drivers/i2c/busses/i2c-pnx.c:147: warning: Function parameter or member 'a
i2c: busses: i2c-pnx: Provide descriptions for 'alg_data' data structure
Fixes the following W=1 kernel build warning(s):
drivers/i2c/busses/i2c-pnx.c:147: warning: Function parameter or member 'alg_data' not described in 'i2c_pnx_start' drivers/i2c/busses/i2c-pnx.c:147: warning: Excess function parameter 'adap' description in 'i2c_pnx_start' drivers/i2c/busses/i2c-pnx.c:202: warning: Function parameter or member 'alg_data' not described in 'i2c_pnx_stop' drivers/i2c/busses/i2c-pnx.c:202: warning: Excess function parameter 'adap' description in 'i2c_pnx_stop' drivers/i2c/busses/i2c-pnx.c:231: warning: Function parameter or member 'alg_data' not described in 'i2c_pnx_master_xmit' drivers/i2c/busses/i2c-pnx.c:231: warning: Excess function parameter 'adap' description in 'i2c_pnx_master_xmit' drivers/i2c/busses/i2c-pnx.c:301: warning: Function parameter or member 'alg_data' not described in 'i2c_pnx_master_rcv' drivers/i2c/busses/i2c-pnx.c:301: warning: Excess function parameter 'adap' description in 'i2c_pnx_master_rcv'
Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
show more ...
|
#
f80531c8 |
| 11-Jun-2020 |
Jarkko Nikula <jarkko.nikula@linux.intel.com> |
i2c: Use separate MODULE_AUTHOR() statements for multiple authors
Modules with multiple authors should use multiple MODULE_AUTHOR() statements according to comment in include/linux/module.h.
Split
i2c: Use separate MODULE_AUTHOR() statements for multiple authors
Modules with multiple authors should use multiple MODULE_AUTHOR() statements according to comment in include/linux/module.h.
Split the i2c modules with multiple authors to use multiple MODULE_AUTHOR() statements.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@kernel.org>
show more ...
|
#
e42688ed |
| 16-Apr-2020 |
Dejin Zheng <zhengdejin5@gmail.com> |
i2c: busses: remove duplicate dev_err()
it will print an error message by itself when platform_get_irq() goes wrong. so don't need dev_err() in here again.
Reviewed-by: Andy Shevchenko <andriy.shev
i2c: busses: remove duplicate dev_err()
it will print an error message by itself when platform_get_irq() goes wrong. so don't need dev_err() in here again.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Suggested-by: Markus Elfring <Markus.Elfring@web.de> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
17b3fe8b |
| 15-Jan-2020 |
Krzysztof Kozlowski <krzk@kernel.org> |
i2c: pnx: Use proper printk format for resource_size_t
resource_size_t should be printed with its own size-independent format to fix warnings when compiling on 64-bit platform (e.g. with COMPILE_TES
i2c: pnx: Use proper printk format for resource_size_t
resource_size_t should be printed with its own size-independent format to fix warnings when compiling on 64-bit platform (e.g. with COMPILE_TEST):
drivers/i2c/busses/i2c-pnx.c: In function ‘i2c_pnx_probe’: drivers/i2c/busses/i2c-pnx.c:737:47: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘resource_size_t {aka long long unsigned int}’ [-Wformat=]
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
caaccda1 |
| 19-Apr-2018 |
Wolfram Sang <wsa@the-dreams.de> |
i2c: pnx: move header into the driver
There are no platform_data users anymore. Move the structs into the driver.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Vladimir Zapolskiy <vz@ml
i2c: pnx: move header into the driver
There are no platform_data users anymore. Move the structs into the driver.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Vladimir Zapolskiy <vz@mleia.com>
show more ...
|
#
b9e43e36 |
| 16-Oct-2017 |
Kees Cook <keescook@chromium.org> |
i2c/busses: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer(
i2c/busses: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly.
Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
ad3caf8a |
| 18-Aug-2017 |
Bhumika Goyal <bhumirks@gmail.com> |
i2c: busses: make i2c_algorithm const
Make these const as they are only stored in the algo field of i2c_adapter structure, which is const.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-o
i2c: busses: make i2c_algorithm const
Make these const as they are only stored in the algo field of i2c_adapter structure, which is const.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
ea734404 |
| 09-Aug-2016 |
Wolfram Sang <wsa-dev@sang-engineering.com> |
i2c: don't print error when adding adapter fails
The core will do this for us now.
Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.co
i2c: don't print error when adding adapter fails
The core will do this for us now.
Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Peter Korsgaard <peter@korsgaard.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Ray Jui <ray.jui@broadcom.com> Acked-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
77133e1c |
| 25-Oct-2015 |
Wolfram Sang <wsa@the-dreams.de> |
i2c: pnx: remove superfluous assignment
smatch rightfully says:
drivers/i2c/busses/i2c-pnx.c:499 i2c_pnx_xfer warn: unused return: stat = ioread32()
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
|
#
43e9f2aa |
| 20-Oct-2015 |
Muhammad Falak R Wani <falakreyaz@gmail.com> |
i2c: pnx: Use setup_timer instead of open coding it
Use timer API function setup_timer instead of init_timer to initialize the timer.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Sig
i2c: pnx: Use setup_timer instead of open coding it
Use timer API function setup_timer instead of init_timer to initialize the timer.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
5dd32eae |
| 17-Oct-2015 |
Vladimir Zapolskiy <vz@mleia.com> |
i2c: pnx: fix runtime warnings caused by enabling unprepared clock
The driver can not be used on a platform with common clock framework until clk_prepare/clk_unprepare calls are added, otherwise clk
i2c: pnx: fix runtime warnings caused by enabling unprepared clock
The driver can not be used on a platform with common clock framework until clk_prepare/clk_unprepare calls are added, otherwise clk_enable calls will fail and a WARN is generated.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
1ecc4335 |
| 20-Oct-2014 |
Wolfram Sang <wsa@the-dreams.de> |
i2c: busses: drop owner assignment from platform_drivers
A platform_driver does not need to set an owner, it will be populated by the driver core.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
|
#
d1ccc125 |
| 13-Jan-2014 |
Jingoo Han <jg1.han@samsung.com> |
i2c: pnx: Use devm_*() functions
Use devm_*() functions to make cleanup paths simpler, and remove redundant return value check of platform_get_resource() because the value is checked by devm_ioremap
i2c: pnx: Use devm_*() functions
Use devm_*() functions to make cleanup paths simpler, and remove redundant return value check of platform_get_resource() because the value is checked by devm_ioremap_resource().
Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
4edd65e6 |
| 16-Oct-2013 |
Sachin Kamat <sachin.kamat@linaro.org> |
i2c: Include linux/of.h header
'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off
i2c: Include linux/of.h header
'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
498c0146 |
| 22-Aug-2013 |
Wei Yongjun <yongjun_wei@trendmicro.com.cn> |
i2c: pnx: fix error return code in i2c_pnx_probe()
Fix to return a negative error code in the irq get error handling case instead of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongju
i2c: pnx: fix error return code in i2c_pnx_probe()
Fix to return a negative error code in the irq get error handling case instead of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> [wsa: fixed wrong exit point, too] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
687b81d0 |
| 11-Jul-2013 |
Wolfram Sang <wsa@the-dreams.de> |
i2c: move OF helpers into the core
I2C of helpers used to live in of_i2c.c but experience (from SPI) shows that it is much cleaner to have this in the core. This also removes a circular dependency b
i2c: move OF helpers into the core
I2C of helpers used to live in of_i2c.c but experience (from SPI) shows that it is much cleaner to have this in the core. This also removes a circular dependency between the helpers and the core, and so we can finally register child nodes in the core instead of doing this manually in each driver. So, fix the drivers and documentation, too.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
d2f18534 |
| 14-Jul-2013 |
Jingoo Han <jg1.han@samsung.com> |
i2c: pnx: add CONFIG_PM_SLEEP to suspend/resume functions
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sle
i2c: pnx: add CONFIG_PM_SLEEP to suspend/resume functions
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled.
drivers/i2c/busses/i2c-pnx.c:599:12: warning: 'i2c_pnx_controller_suspend' defined but not used [-Wunused-function] drivers/i2c/busses/i2c-pnx.c:608:12: warning: 'i2c_pnx_controller_resume' defined but not used [-Wunused-function]
Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
55827f4a |
| 15-Feb-2013 |
Doug Anderson <dianders@chromium.org> |
i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls
There is simply no reason to be manually setting the private driver data to NULL in the remove/fail to probe cases. This is just extra cruft co
i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls
There is simply no reason to be manually setting the private driver data to NULL in the remove/fail to probe cases. This is just extra cruft code that can be removed.
A few notes: * Nothing relies on drvdata being set to NULL. * The __device_release_driver() function eventually calls dev_set_drvdata(dev, NULL) anyway, so there's no need to do it twice. * I verified that there were no cases where xxx_get_drvdata() was being called in these drivers and checking for / relying on the NULL return value.
This could be cleaned up kernel-wide but for now just take the baby step and remove from the i2c subsystem.
Reported-by: Wolfram Sang <wsa@the-dreams.de> Reported-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Jean Delvare <khali@linux-fr.org> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
show more ...
|
#
0b255e92 |
| 27-Nov-2012 |
Bill Pemberton <wfp5p@virginia.edu> |
i2c: remove __dev* attributes from subsystem
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away.
Remove use of __devinit, __devexit_p, __devinitdata, __dev
i2c: remove __dev* attributes from subsystem
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away.
Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Peter Korsgaard <peter.korsgaard@barco.com> (for ocores and mux-gpio) Acked-by: Havard Skinnemoen <hskinnemoen@gmail.com> (for i2c-gpio) Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn> (for puf3) Acked-by: Barry Song <baohua.song@csr.com> (for sirf) Reviewed-by: Jean Delvare <khali@linux-fr.org> [wsa: Fixed "foo* bar" flaws while we are here] Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
show more ...
|
#
c076ada4 |
| 08-Aug-2012 |
Roland Stigge <stigge@antcom.de> |
i2c: pnx: Fix read transactions of >= 2 bytes
On transactions with n>=2 bytes, the controller actually wrongly clocks in n+1 bytes. This is caused by the (wrong) assumption that RFE in the Status Re
i2c: pnx: Fix read transactions of >= 2 bytes
On transactions with n>=2 bytes, the controller actually wrongly clocks in n+1 bytes. This is caused by the (wrong) assumption that RFE in the Status Register is 1 iff there is no byte already ordered (via a dummy TX byte). This lead to the implementation of synchronized byte ordering, e.g.:
Dummy-TX - RX - Dummy-TX - RX - ...
But since RFE actually stays high after some Dummy-TX, it rather looks like:
Dummy-TX - Dummy-TX - RX - Dummy-TX - RX - (RX)
The last RX byte is clocked in by the bus controller, but ignored by the kernel when filling the userspace buffer.
This patch fixes the issue by asking for RX via Dummy-TX asynchronously. Introducing a separate counter for TX bytes.
Signed-off-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
show more ...
|
#
b3aafe80 |
| 08-Aug-2012 |
Roland Stigge <stigge@antcom.de> |
i2c: pnx: Fix bit definitions
The I2C Control Register bits RFDAIE and RFFIE were mixed up. In addition to this fix, this patch adds the missing bit DRSIE for completeness.
Signed-off-by: Roland St
i2c: pnx: Fix bit definitions
The I2C Control Register bits RFDAIE and RFFIE were mixed up. In addition to this fix, this patch adds the missing bit DRSIE for completeness.
Signed-off-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
show more ...
|