aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-omap.c
AgeCommit message (Collapse)AuthorFilesLines
2024-11-17i2c: Switch back to struct platform_driver::remove()Uwe Kleine-König1-1/+1
After commit 0edb555a65d1 ("platform: Make platform_driver::remove() return void") .remove() is (again) the right callback to implement for platform drivers. Convert all platform drivers below drivers/i2c to use .remove(), with the eventual goal to drop struct platform_driver::remove_new(). As .remove() and .remove_new() have the same prototypes, conversion is done by just changing the structure member name in the driver initializer. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-09-10i2c: don't use ',' after delimitersWolfram Sang1-1/+1
Delimiters are meant to be last, no need for a ',' there. Remove a superfluous newline in the ali1535 driver while here. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Andrew Jeffery <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-07-09i2c: omap: wakeup the controller during suspend() callbackThomas Richard1-0/+22
A device may need the controller up during suspend_noirq() or resume_noirq(). But if the controller is autosuspended, there is no way to wakeup it during suspend_noirq() or resume_noirq() because runtime pm is disabled at this time. The suspend() callback wakes up the controller, so it is available until its suspend_noirq() callback (pm_runtime_force_suspend()). During the resume, it's restored by resume_noirq() callback (pm_runtime_force_resume()). Then resume() callback enables autosuspend. So the controller is up during a little time slot in suspend and resume sequences even if it's not used. Reviewed-by: Andi Shyti <[email protected]> Acked-by: Wolfram Sang <[email protected]> Reviewed-by: Tony Lindgren <[email protected]> Signed-off-by: Thomas Richard <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-07-09i2c: omap: switch to NOIRQ_SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS()Thomas Richard1-7/+7
Replace SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() by NOIRQ_SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS(). The usage of pm_ptr() and these more recent macros allows the compiler to see and drop the dead code. The unnecessary '__maybe_unused' annotations on PM functions can be removed. Signed-off-by: Thomas Richard <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: omap: use 'time_left' variable with wait_for_completion_timeout()Wolfram Sang1-5/+5
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2024-05-06i2c: omap: remove printout on handled timeoutsWolfram Sang1-1/+0
I2C and SMBus timeouts are not something the user needs to be informed about on controller level. The client driver may know if that really is a problem and give more detailed information to the user. The controller should just pass this information upwards. Remove the printout. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
2023-10-10i2c: Use device_get_match_data()Rob Herring1-5/+3
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2023-06-05i2c: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
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 <[email protected]> Acked-by: Alain Volmat <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Acked-by: Baruch Siach <[email protected]> Acked-by: Florian Fainelli <[email protected]> Acked-by: Heiko Stuebner <[email protected]> Acked-by: Jarkko Nikula <[email protected]> Acked-by: Jernej Skrabec <[email protected]> Acked-by: Jochen Friedrich <[email protected]> Acked-by: Peter Rosin <[email protected]> Acked-by: Vadim Pasternak <[email protected]> Reviewed-by: Asmaa Mnebhi <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Chris Packham <[email protected]> Reviewed-by: Chris Pringle <[email protected]> Reviewed-by: Claudiu Beznea <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Martin Blumenstingl <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Reviewed-by: Patrice Chotard <[email protected]> Reviewed-by: Tali Perry <[email protected]> Reviewed-by: Vignesh Raghavendra <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2023-05-03i2c: omap: Fix standard mode false ACK readingsReid Tonking1-1/+1
Using standard mode, rare false ACK responses were appearing with i2cdetect tool. This was happening due to NACK interrupt triggering ISR thread before register access interrupt was ready. Removing the NACK interrupt's ability to trigger ISR thread lets register access ready interrupt do this instead. Cc: <[email protected]> # v3.7+ Fixes: 3b2f8f82dad7 ("i2c: omap: switch to threaded IRQ support") Signed-off-by: Reid Tonking <[email protected]> Acked-by: Vignesh Raghavendra <[email protected]> Reviewed-by: Tony Lindgren <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2023-04-13i2c: omap: Improve error reporting for problems during .remove()Uwe Kleine-König1-3/+6
If pm_runtime_get() fails in .remove() the driver used to return the error to the driver core. The only effect of this (compared to returning zero) is a generic warning that the error value is ignored. So emit a better warning and return zero to suppress the generic (and little helpful) message. Also disable runtime PM in the error case. This prepares changing platform device remove callbacks to return void. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Tony Lindgren <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2022-08-11i2c: move drivers from strlcpy to strscpyWolfram Sang1-1/+1
Follow the advice of the below link and prefer 'strscpy'. Conversion is easy because no driver used the return value and has been done with a simple sed invocation. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2021-04-14i2c: omap: fix reference leak when pm_runtime_get_sync failsQinglang Miao1-4/+4
The PM reference count is not expected to be incremented on return in omap_i2c_probe() and omap_i2c_remove(). However, pm_runtime_get_sync will increment the PM reference count even failed. Forgetting to putting operation will result in a reference leak here. I Replace it with pm_runtime_resume_and_get to keep usage counter balanced. What's more, error path 'err_free_mem' seems not like a proper name any more. So I change the name to err_disable_pm and move pm_runtime_disable below, for pm_runtime of 'pdev->dev' should be disabled when pm_runtime_resume_and_get fails. Fixes: 3b0fb97c8dc4 ("I2C: OMAP: Handle error check for pm runtime") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Qinglang Miao <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Reviewed-by: Vignesh Raghavendra <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2020-08-23treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva1-1/+0
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <[email protected]>
2020-04-18i2c: busses: remove duplicate dev_err()Dejin Zheng1-3/+1
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 <[email protected]> Suggested-by: Markus Elfring <[email protected]> Signed-off-by: Dejin Zheng <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2020-03-24i2c: drivers: Use generic definitions for bus frequenciesAndy Shevchenko1-1/+1
Since we have generic definitions for bus frequencies, let's use them. Reviewed-by: Nicolas Saenz Julienne <[email protected]> Acked-by: Robert Richter <[email protected]> Reviewed-by: Thor Thayer <[email protected]> Acked-by: Elie Morisse <[email protected]> Acked-by: Nehal Shah <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Acked-by: Scott Branden <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Acked-by: Jarkko Nikula <[email protected]> Acked-by: Baruch Siach <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Acked-by: Oleksij Rempel <[email protected]> Acked-by: Vladimir Zapolskiy <[email protected]> Acked-by: Gregory CLEMENT <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Chris Brandt <[email protected]> Reviewed-by: Baolin Wang <[email protected]> Reviewed-by: Pierre-Yves MORDRET <[email protected]> Acked-by: Patrice Chotard <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Reviewed-by: Dmitry Osipenko <[email protected]> Acked-by: Masahiro Yamada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2020-03-10i2c: omap: use devm_platform_ioremap_resource()chenqiwu1-3/+1
Use a new API devm_platform_ioremap_resource() to simplify code. Signed-off-by: chenqiwu <[email protected]> Tested-by: Luca Ceresoli <[email protected]> Reviewed-by: Luca Ceresoli <[email protected]> Reviewed-by: Vignesh Raghavendra <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157Thomas Gleixner1-10/+1
Based on 3 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [graeme] [gregory] [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema] [hk] [hemahk]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1105 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-04-16i2c: omap: Add the master_xfer_atomic hookWolfram Sang1-13/+63
Add the master_xfer_atomic hook to enable i2c transactions in irq disabled contexts like the poweroff case. Signed-off-by: Tero Kristo <[email protected]> Signed-off-by: Keerthy <[email protected]> [wsa: simplified code a little: 'timeout = !ret'] Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2019-02-05i2c: omap: Use noirq system sleep pm ops to idle device for suspendTony Lindgren1-8/+5
We currently get the following error with pixcir_ts driver during a suspend resume cycle: omap_i2c 4802a000.i2c: controller timed out pixcir_ts 1-005c: pixcir_int_enable: can't read reg 0x34 : -110 pixcir_ts 1-005c: Failed to disable interrupt generation: -110 pixcir_ts 1-005c: Failed to stop dpm_run_callback(): pixcir_i2c_ts_resume+0x0/0x98 [pixcir_i2c_ts] returns -110 PM: Device 1-005c failed to resume: error -110 And at least am437x based devices with pixcir_ts will fail to resume to a touchscreen that is configured as the wakeup-source in device tree for these devices. This is because pixcir_ts tries to reconfigure it's registers for noirq suspend which fails. This also leaves i2c-omap in enabled state for suspend. Let's fix the pixcir_ts issue and make sure i2c-omap is suspended by adding SET_NOIRQ_SYSTEM_SLEEP_PM_OPS. Let's also get rid of some ifdefs while at it and replace them with __maybe_unused as SET_RUNTIME_PM_OPS and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS already deal with the various PM Kconfig options. Reported-by: Keerthy <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Acked-by: Vignesh R <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2018-10-05i2c: omap: use core to detect 'no zero length' quirkWolfram Sang1-3/+5
And don't reimplement in the driver. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Acked-by: Tony Lindgren <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2018-05-17i2c: omap: move header to platform_dataWolfram Sang1-1/+1
This header only contains platform_data. Move it to the proper directory. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Tony Lindgren <[email protected]>
2017-10-30i2c: omap: Trigger bus recovery in lockup caseClaudio Foellmi1-2/+23
A very conservative check for bus activity (to prevent interference in multimaster setups) prevented the bus recovery methods from being triggered in the case that SDA or SCL was stuck low. This defeats the purpose of the recovery mechanism, which was introduced for exactly this situation (a slave device keeping SDA pulled down). Also added a check to make sure SDA is low before attempting recovery. If SDA is not stuck low, recovery will not help, so we can skip it. Note that bus lockups can persist across reboots. The only other options are to reset or power cycle the offending slave device, and many i2c slaves do not even have a reset pin. If we see that one of the lines is low for the entire timeout duration, we can actually be sure that there is no other master driving the bus. It is therefore save for us to attempt a bus recovery. Signed-off-by: Claudio Foellmi <[email protected]> Tested-by: Vignesh R <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> [wsa: fixed one return code to -EBUSY] Signed-off-by: Wolfram Sang <[email protected]>
2017-10-18i2c: omap: Fix error handling for clk_get()Tony Lindgren1-0/+14
Otherwise we can get the following if the fck alias is missing: Unable to handle kernel paging request at virtual address fffffffe ... PC is at clk_get_rate+0x8/0x10 LR is at omap_i2c_probe+0x278/0x6ec ... [<c056eb08>] (clk_get_rate) from [<c06f4f08>] (omap_i2c_probe+0x278/0x6ec) [<c06f4f08>] (omap_i2c_probe) from [<c0610944>] (platform_drv_probe+0x50/0xb0) [<c0610944>] (platform_drv_probe) from [<c060e900>] (driver_probe_device+0x264/0x2ec) [<c060e900>] (driver_probe_device) from [<c060cda0>] (bus_for_each_drv+0x70/0xb8) [<c060cda0>] (bus_for_each_drv) from [<c060e5b0>] (__device_attach+0xcc/0x13c) [<c060e5b0>] (__device_attach) from [<c060db10>] (bus_probe_device+0x88/0x90) [<c060db10>] (bus_probe_device) from [<c060df68>] (deferred_probe_work_func+0x4c/0x14c) Signed-off-by: Tony Lindgren <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2017-01-25i2c: omap: constify dev_pm_ops structuresBhumika Goyal1-1/+1
Declare dev_pm_ops structures as const as they are only stored in the pm field of a device_driver structure. This field is of type const, so dev_pm_ops structures having similar properties can be declared const too. Signed-off-by: Bhumika Goyal <[email protected]> Acked-by: Tony Lindgren <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2016-08-22i2c: don't print error when adding adapter failsWolfram Sang1-3/+1
The core will do this for us now. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Acked-by: Peter Korsgaard <[email protected]> Acked-by: Heiko Stuebner <[email protected]> Acked-by: Neil Horman <[email protected]> Acked-by: Thierry Reding <[email protected]> Acked-by: Ray Jui <[email protected]> Acked-by: Vladimir Zapolskiy <[email protected]> Acked-by: Ludovic Desroches <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Acked-by: Laxman Dewangan <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2016-04-24i2c: omap: drop the lock hard irq contextSebastian Andrzej Siewior1-11/+1
The lock is taken while reading two registers. On RT the first lock is taken in hard irq where it might sleep and in the threaded irq. The threaded irq runs in oneshot mode so the hard irq does not run until the thread the completes so there is no reason to grab the lock. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> [[email protected]: drop locking from isr completely and remove lock field from struct omap_i2c_dev] Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2016-02-12i2c: omap: Fix PM regression with deferred probe for pm_runtime_reinitTony Lindgren1-1/+3
Commit 5de85b9d57ab ("PM / runtime: Re-init runtime PM states at probe error and driver unbind") introduced pm_runtime_reinit() that is used to reinitialize PM runtime after -EPROBE_DEFER. This allows shutting down the device after a failed probe. However, for drivers using pm_runtime_use_autosuspend() this can cause a state where suspend callback is never called after -EPROBE_DEFER. On the following device driver probe, hardware state is different from the PM runtime state causing omap_device to produce the following error: omap_device_enable() called from invalid state 1 And with omap_device and omap hardware being picky for PM, this will block any deeper idle states in hardware. The solution is to fix the drivers to follow the PM runtime documentation: 1. For sections of code that needs the device disabled, use pm_runtime_put_sync_suspend() if pm_runtime_set_autosuspend() has been set. 2. For driver exit code, use pm_runtime_dont_use_autosuspend() before pm_runtime_put_sync() if pm_runtime_use_autosuspend() has been set. Fixes: 5de85b9d57ab ("PM / runtime: Re-init runtime PM states at probe error and driver unbind") Signed-off-by: Tony Lindgren <[email protected]> Acked-by: Ulf Hansson <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2015-08-10i2c: omap: fix cleanup regressionWolfram Sang1-1/+1
Patch "i2c: omap: abolish variable name confusion" triggered a coccinelle warning which we fix here: drivers/i2c/busses/i2c-omap.c:1333:5-24: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 1334 Signed-off-by: Wolfram Sang <[email protected]>
2015-08-10i2c: omap: on ->remove() call pm_runtime_put_sync()Felipe Balbi1-1/+1
we're about to remove the module, so we can't really schedule a PM transition in the future, we must wait for it to finish. Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2015-08-10i2c: omap: abolish variable name confusionFelipe Balbi1-299/+299
struct device pointers are usually called dev. Calling our struct omap_i2c_dev pointers also dev has caused enough confusion. This is the result of a few simple sed rules to convert all struct omap_i2c_dev pointers to be called omap instead. Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2015-08-10i2c: omap: switch to dev_get_drvdata()Felipe Balbi1-4/+2
there's no need to fetch the platform_device in order to dereference it back to the dev pointer to access drvdata, we can use dev_get_drvdata() instead. Signed-off-by: Felipe Balbi <[email protected]> Acked-by: Alexander Sverdlin <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2015-07-31i2c: omap: fix bus recovery setupJan Luebbe1-0/+11
At least on the AM335x, enabling OMAP_I2C_SYSTEST_ST_EN is not enough to allow direct access to the SCL and SDA pins. In addition to ST_EN, we need to set the TMODE to 0b11 (Loop back & SDA/SCL IO mode select). Also, as the reset values of SCL_O and SDA_O are 0 (which means "drive low level"), we need to set them to 1 (which means "high-impedance") to avoid unwanted changes on the pins. As a precaution, reset all these bits to their default values after recovery is complete. Signed-off-by: Jan Luebbe <[email protected]> Tested-by: Alexander Sverdlin <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2015-05-12i2c: omap: implement bus recoveryFelipe Balbi1-4/+65
implement bus recovery methods for i2c-omap so we can recover from situations where SCL/SDA are stuck low. Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2015-05-12i2c: omap: Add calls for pinctrl state selectPascal Huerst1-0/+5
This adds calls to pinctrl subsystem in order to switch pin states on suspend/resume if you provide a "sleep" state in DT. If no "sleep" state is provided in the DT, these calls turn to NOPs, so we don't need error checking here. Signed-off-by: Pascal Huerst <[email protected]> Reviewed-by: Sekhar Nori <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2014-12-14Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds1-1/+0
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
2014-12-14Merge branch 'i2c/for-3.19' of ↵Linus Torvalds1-6/+127
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "For 3.19, the I2C subsystem has to offer special candy this time. Right in time for Christmas :) - I2C slave framework: finally, a generic mechanism for Linux being an I2C slave (if the bus driver supports that). Docs are still missing but will come later this cycle, the code is good enough to go. - I2C muxes represent their topology in sysfs much more detailed. This will help users to navigate around much easier. - irq population of i2c clients is now done at probe time, not device creation time, to have better support for deferred probing. - new drivers for Imagination SCB, Amlogic Meson - DMA support added for Freescale IMX, Renesas SHMobile - slightly bigger driver updates to OMAP, i801, AT91, and rk3x (mostly quirk handling, timing updates, and using better kernel interfaces) - eeprom driver can now write with byte-access (very slow, but OK to have) - and the bunch of smaller fixes, cleanups, ID updates..." * 'i2c/for-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (56 commits) i2c: sh_mobile: remove unneeded DMA mask i2c: rcar: add slave support i2c: slave-eeprom: add eeprom simulator driver i2c: core changes for slave support MAINTAINERS: add I2C dt bindings also to I2C realm i2c: designware: Fix falling time bindings doc i2c: davinci: switch to use platform_get_irq Documentation: i2c: Use PM ops instead of legacy suspend/resume i2c: sh_mobile: optimize irq entry i2c: pxa: add support for SCCB devices omap: i2c: don't check bus state IP rev3.3 and earlier i2c: s3c2410: Handle i2c sys_cfg register in i2c driver i2c: rk3x: add Kconfig dependency on COMMON_CLK i2c: omap: add notes related to i2c multimaster mode i2c: omap: don't reset controller if Arbitration Lost detected i2c: omap: implement workaround for handling invalid BB-bit values i2c: omap: cleanup register definitions i2c: rk3x: handle dynamic clock rate changes correctly i2c: at91: enable probe deferring on dma channel request i2c: at91: remove legacy DMA support ...
2014-12-08Merge branch 'pm-runtime'Rafael J. Wysocki1-2/+0
* pm-runtime: (25 commits) i2c-omap / PM: Drop CONFIG_PM_RUNTIME from i2c-omap.c dmaengine / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM drivers: sh / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM e1000e / igb / PM: Eliminate CONFIG_PM_RUNTIME MMC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM MFD / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM misc / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM media / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM input / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM iio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM i2c-hid / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM drm / exynos / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM gpio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM hwrandom / exynos / PM: Use CONFIG_PM in #ifdef block / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM USB / PM: Drop CONFIG_PM_RUNTIME from the USB core PM: Merge the SET*_RUNTIME_PM_OPS() macros PM / Kconfig: Do not select PM directly from Kconfig files PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core ...
2014-12-05i2c-omap / PM: Drop CONFIG_PM_RUNTIME from i2c-omap.cRafael J. Wysocki1-2/+0
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so some #ifdef blocks depending on CONFIG_PM_RUNTIME may be dropped now. Do that in drivers/i2c/busses/i2c-omap.c. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Wolfram Sang <[email protected]>
2014-11-25omap: i2c: don't check bus state IP rev3.3 and earlierAlexander Kochetkov1-3/+5
Commit 0f5768bf894f ("i2c: omap: implement workaround for handling invalid BB-bit values") introduce the error result in boot test fault on OMAP3530 boards. The patch fix the error (disable i2c bus test for OMAP3530). Reported-by: Kevin Hilman <[email protected]> Signed-off-by: Alexander Kochetkov <[email protected]> Fixes: 0f5768bf894f ("i2c: omap: implement workaround for handling invalid BB-bit values") Tested-by: Tony Lindgren <[email protected]> Tested-by: Kevin Hilman <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2014-11-23i2c: omap: add notes related to i2c multimaster modeAlexander Kochetkov1-1/+11
No functional changes. Signed-off-by: Alexander Kochetkov <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2014-11-23i2c: omap: don't reset controller if Arbitration Lost detectedAlexander Kochetkov1-2/+4
Arbitration Lost is an expected situation in a multimaster environment. I2C controller (IP) correctly detect and report AL. The only one visible reason for resetting IP in the AL case is to avoid advisory 1.94 (omap3) and errata i595 (omap4): "I2C: After an Arbitration is Lost the Module Incorrectly Starts the Next Transfer". Errata workaround states: "The MST and STT bits inside I2C_CON should be set to 1 at the same moment (avoid setting the MST bit to 1 while STT = 0)." The driver never set MST and STT bits separately and doesn't create condition for errata. So the reset is not necessary. Also corrected return value for AL to -EAGAIN. Tested on Beagleboard XM C. Tested on BBB and AM437x Starter Kit by Felipe Balbi. Signed-off-by: Alexander Kochetkov <[email protected]> Tested-by: Felipe Balbi <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2014-11-23i2c: omap: implement workaround for handling invalid BB-bit valuesAlexander Kochetkov1-0/+103
In a multimaster environment, after IP software reset, BB-bit value doesn't correspond to the current bus state. It may happen what BB-bit will be 0, while the bus is busy due to another I2C master activity. Any transfer started when BB=0 and bus is busy wouldn't be completed by IP and results in controller timeout. More over, in some cases IP could interrupt another master's transfer and corrupt data on wire. The commit implement method allowing to prevent IP from entering into "controller timeout" state and from "data corruption" state. The one drawback is the need to wait for 10ms before the first transfer. Tested on Beagleboard XM C. Tested on BBB and AM437x Starter Kit by Felipe Balbi. Signed-off-by: Alexander Kochetkov <[email protected]> Tested-by: Felipe Balbi <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2014-11-23i2c: omap: cleanup register definitionsAlexander Kochetkov1-3/+7
Delete STAT_AD0 mask as unrelated to current IP (omap1?). Delete DEBUG conditional around SYSTEST masks group. Add SYSTEST functional mode masks for SCL and SDA. Add STAT_BF mask. Signed-off-by: Alexander Kochetkov <[email protected]> Tested-by: Felipe Balbi <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2014-11-22i2c: omap: fix i207 errata handlingAlexander Kochetkov1-3/+5
commit 6d9939f651419a63e091105663821f9c7d3fec37 (i2c: omap: split out [XR]DR and [XR]RDY) changed the way how errata i207 (I2C: RDR Flag May Be Incorrectly Set) get handled. 6d9939f6514 code doesn't correspond to workaround provided by errata. According to errata ISR must filter out spurious RDR before data read not after. ISR must read RXSTAT to get number of bytes available to read. Because RDR could be set while there could no data in the receive FIFO. Restored pre 6d9939f6514 way of handling errata. Found by code review. Real impact haven't seen. Tested on Beagleboard XM C. Signed-off-by: Alexander Kochetkov <[email protected]> Fixes: 6d9939f651419a63e09110 i2c: omap: split out [XR]DR and [XR]RDY Tested-by: Felipe Balbi <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2014-11-21i2c: omap: fix NACK and Arbitration Lost irq handlingAlexander Kochetkov1-2/+0
commit 1d7afc95946487945cc7f5019b41255b72224b70 (i2c: omap: ack IRQ in parts) changed the interrupt handler to complete transfers without clearing XRDY (AL case) and ARDY (NACK case) flags. XRDY or ARDY interrupts will be fired again. As a result, ISR keep processing transfer after it was already complete (from the driver code point of view). A didn't see real impacts of the 1d7afc9, but it is really bad idea to have ISR running on user data after transfer was complete. It looks, what 1d7afc9 violate TI specs in what how AL and NACK should be handled (see Note 1, sprugn4r, Figure 17-31 and Figure 17-32). According to specs (if I understood correctly), in case of NACK and AL driver must reset NACK, AL, ARDY, RDR, and RRDY (Master Receive Mode), and NACK, AL, ARDY, and XDR (Master Transmitter Mode). All that is done down the code under the if condition: if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) ... The patch restore pre 1d7afc9 logic of handling NACK and AL interrupts, so no interrupts is fired after ISR informs the rest of driver what transfer complete. Note: instead of removing break under NACK case, we could just replace 'break' with 'continue' and allow NACK transfer to finish using ARDY event. I found that NACK and ARDY bits usually set together. That case confirm TI wiki: http://processors.wiki.ti.com/index.php/I2C_Tips#Detecting_and_handling_NACK In order if someone interested in the event traces for NACK and AL cases, I sent them to mailing list. Tested on Beagleboard XM C. Signed-off-by: Alexander Kochetkov <[email protected]> Fixes: 1d7afc9 i2c: omap: ack IRQ in parts Cc: <[email protected]> # v3.7+ Acked-by: Felipe Balbi <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2014-11-07i2c: remove FSF addressWolfram Sang1-4/+0
We have a central copy of the GPL for that. Some addresses were already outdated. Signed-off-by: Wolfram Sang <[email protected]>
2014-10-20i2c: busses: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <[email protected]>
2014-07-16i2c: i2c-omap: Drop class based scanning to improve bootup timeWolfram Sang1-1/+1
This driver has been flagged to drop class based instantiation. The removal improves boot-up time and is unneeded for embedded controllers. Users have been warned to switch for some time now, so we can actually do the removal. Keep the DEPRECATED flag, so the core can inform users that the behaviour finally changed now. After another transition period, this flag can go, too. Signed-off-by: Wolfram Sang <[email protected]>
2014-06-02i2c: remove unnecessary OOM messagesJingoo Han1-3/+1
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. For example, k.alloc and v.alloc failures use dump_stack(). Signed-off-by: Jingoo Han <[email protected]> Acked-by: Guenter Roeck <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Acked-by: Felipe Balbi <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2014-03-27i2c: omap: fix usage of IS_ERR_VALUE with pm_runtime_get_syncNishanth Menon1-3/+3
we use IS_ERR_VALUE to check for error values of pm_runtime_get_sync, when the value can only be < 0 in the case of err. Replace the check with a simpler < 0 check. This fixes the coccicheck warnings: linux-2.6/drivers/i2c/busses/i2c-omap.c:1157:5-24: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 1158 linux-2.6/drivers/i2c/busses/i2c-omap.c:1278:7-26: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 1279 drivers/i2c/busses/i2c-omap.c:638:5-24: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 639 Signed-off-by: Nishanth Menon <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>