- 31 8月, 2018 1 次提交
-
-
由 Wolfram Sang 提交于
a) rename to 'put' instead of 'release' to match 'get' when obtaining the buffer b) change the argument order to have the buffer as first argument c) add a new argument telling the function if the message was transferred. This allows the function to be used also in cases where setting up DMA failed, so the buffer needs to be freed without syncing to the message buffer. Also convert the only user. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 24 8月, 2018 1 次提交
-
-
由 Wolfram Sang 提交于
There aren't any users left. Remove this callback from the 2.4 times. Phew, finally, that took years to reach... Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 09 8月, 2018 1 次提交
-
-
由 Andy Shevchenko 提交于
There are two drivers already using the SDA hold time setting. It might be more in the future, thus, make I2C core to parse the setting for us if provided by firmware. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: NAlexandre Belloni <alexandre.belloni@bootlin.com> Reviewed-by: NAlexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 05 8月, 2018 1 次提交
-
-
由 Wolfram Sang 提交于
Some adapters do not support a message length of 0. Add this as a quirk so drivers don't have to open code it. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Tested-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 25 7月, 2018 1 次提交
-
-
由 Peter Rosin 提交于
If an i2c topology has instances of nested muxes, then a lockdep splat is produced when when i2c_parent_lock_bus() is called. Here is an example: ============================================ WARNING: possible recursive locking detected -------------------------------------------- insmod/68159 is trying to acquire lock: (i2c_register_adapter#2){+.+.}, at: i2c_parent_lock_bus+0x32/0x50 [i2c_mux] but task is already holding lock: (i2c_register_adapter#2){+.+.}, at: i2c_parent_lock_bus+0x32/0x50 [i2c_mux] other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(i2c_register_adapter#2); lock(i2c_register_adapter#2); *** DEADLOCK *** May be due to missing lock nesting notation 1 lock held by insmod/68159: #0: (i2c_register_adapter#2){+.+.}, at: i2c_parent_lock_bus+0x32/0x50 [i2c_mux] stack backtrace: CPU: 13 PID: 68159 Comm: insmod Tainted: G O Call Trace: dump_stack+0x67/0x98 __lock_acquire+0x162e/0x1780 lock_acquire+0xba/0x200 rt_mutex_lock+0x44/0x60 i2c_parent_lock_bus+0x32/0x50 [i2c_mux] i2c_parent_lock_bus+0x3e/0x50 [i2c_mux] i2c_smbus_xfer+0xf0/0x700 i2c_smbus_read_byte+0x42/0x70 my2c_init+0xa2/0x1000 [my2c] do_one_initcall+0x51/0x192 do_init_module+0x62/0x216 load_module+0x20f9/0x2b50 SYSC_init_module+0x19a/0x1c0 SyS_init_module+0xe/0x10 do_syscall_64+0x6c/0x1a0 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Reported-by: NJohn Sperbeck <jsperbeck@google.com> Tested-by: NJohn Sperbeck <jsperbeck@google.com> Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Deepa Dinamani <deepadinamani@google.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Chang <dpf@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will.deacon@arm.com> Cc: Wolfram Sang <wsa@the-dreams.de> Link: http://lkml.kernel.org/r/20180720083914.1950-3-peda@axentia.seSigned-off-by: NIngo Molnar <mingo@kernel.org>
-
- 21 7月, 2018 1 次提交
-
-
由 Wolfram Sang 提交于
When we initialize the pins, make sure it looks like STOP by dividing the delay into halves. It shouldn't matter because SDA is expected to be held low by a device, but for super-safety, let's do it. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NUlrich Hecht <ulrich.hecht+renesas@gmail.com> Reviewed-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 17 7月, 2018 4 次提交
-
-
由 Wolfram Sang 提交于
While refactoring the routine before, it occurred to me that this will make the code much easier to understand. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
Some IP cores have an internal 'bus free' logic which may be more advanced than just checking if SDA is high. Add a separate callback to get this status. Filling it is optional. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
After exiting the while loop, we checked if recovery was successful and sent a STOP to the clients. Meanwhile however, we send a STOP after every pulse, so it is not needed after the loop. If we move the check for a free bus to the end of the while loop, we can shorten and simplify the logic. It is still ensured that at least one STOP will be sent to the wire even if SDA was not stuck low. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
For bus recovery, we either need to bail out early if we can read SDA or we need to send STOP after every pulse. Otherwise recovery might be misinterpreted as an unwanted write. So, require one of those SDA handling functions to avoid this problem. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 13 7月, 2018 1 次提交
-
-
由 Wolfram Sang 提交于
I2C clients may misunderstand recovery pulses if they can't read SDA to bail out early. In the worst case, as a write operation. To avoid that and if we can write SDA, try to send STOP to avoid the misinterpretation. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
- 22 5月, 2018 1 次提交
-
-
由 Boris Brezillon 提交于
Currently, of_i2c_register_devices() is responsible for retaining info->of_node, but we're about to expose a function to parse I2C board info without registering the I2C device. We could possibly let this function retain ->of_node, but this approach is prone to reference leak since people will have to remember to call of_node_put() if something goes wrong between the OF node parsing and the registration step. Let's just retain the ->of_node in i2c_new_register() instead. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 15 5月, 2018 2 次提交
-
-
由 Boris Brezillon 提交于
The only user of i2c_board_info->archdata is the OF parsing code and it just pass a zero-initialized object which has the same effect as leaving ->archdata to NULL since the client object is allocated with kzalloc(). Get rid of this useless field. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Ulf Hansson 提交于
The limitation of being able to check only for -EPROBE_DEFER from dev_pm_domain_attach() has been removed. Hence let's respect all error codes and bail out accordingly. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Acked-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 12 4月, 2018 1 次提交
-
-
由 Ard Biesheuvel 提交于
The API docs describe i2c_transfer() as taking a pointer to an array of i2c_msg containing at least 1 entry, but leaves it to the individual drivers to sanity check the msgs and num parameters. Let's do this in core code instead. Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org> [wsa: changed '<= 0' to '< 1'] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 04 4月, 2018 1 次提交
-
-
由 Davidlohr Bueso 提交于
No changes in refcount semantics -- key init is false; replace static_key_slow_inc|dec with static_branch_inc|dec static_key_false with static_branch_unlikely Added a '_key' suffix to i2c_trace_msg, for better self documentation. Signed-off-by: NDavidlohr Bueso <dbueso@suse.de> Reviewed-by: NDavid Howells <dhowells@redhat.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 03 4月, 2018 1 次提交
-
-
由 Ahbong Chang 提交于
According to the event i2c_result defined in include/trace/events/i2c.h, the second parameter should be the number of messages instead of the ended loop index. The value of ended loop index is the same as ret. Signed-off-by: NAhbong Chang <cwahbong@google.com> Reviewed-by: NTodd Poynor <toddpoynor@google.com> Reviewed-by: NDavid Howells <dhowells@redhat.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 24 3月, 2018 1 次提交
-
-
由 Wolfram Sang 提交于
After previous refactoring, there is only one user in the same file left. Make the function static now. [wsa: added 'int' to bare 'unsigned'] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 06 3月, 2018 1 次提交
-
-
由 Peter Rosin 提交于
Can be used during probe to double check that the probed device is what is expected. Loosely based on code from Adrian Fiergolski <adrian.fiergolski@cern.ch>. Tested-by: NAdrian Fiergolski <adrian.fiergolski@cern.ch> Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NPeter Rosin <peda@axentia.se>
-
- 05 3月, 2018 1 次提交
-
-
由 Javier Martinez Canillas 提交于
The buses should honor the firmware interface used to register the device, but the I2C core reports a MODALIAS of the form i2c:<device> even for I2C devices registered via OF. This means that user-space will never get an OF stype uevent MODALIAS even when the drivers modules contain aliases exported from both the I2C and OF device ID tables. For example, an Atmel maXTouch Touchscreen registered by a DT node with compatible "atmel,maxtouch" has the following module alias: $ cat /sys/class/i2c-adapter/i2c-8/8-004b/modalias i2c:maxtouch So udev won't be able to auto-load a module for an OF-only device driver. Many OF-only drivers duplicate the OF device ID table entries in an I2C ID table only has a workaround for how the I2C core reports the module alias. This patch changes the I2C core to report an OF related MODALIAS uevent if the device was registered via OF. So for the previous example, after this patch, the reported MODALIAS for the Atmel maXTouch will be the following: $ cat /sys/class/i2c-adapter/i2c-8/8-004b/modalias of:NtrackpadT<NULL>Catmel,maxtouch NOTE: This patch may break out-of-tree drivers that were relying on this behavior, and only had an I2C device ID table even when the device was registered via OF. There are no remaining drivers in mainline that do this, but out-of-tree drivers have to be fixed and define a proper OF device ID table to have module auto-loading working. Signed-off-by: NJavier Martinez Canillas <javierm@redhat.com> Tested-by: NDmitry Mastykin <mastichi@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 17 1月, 2018 1 次提交
-
-
由 Lixin Wang 提交于
Reference count of device node was increased in of_i2c_register_device, but without decreasing it in i2c_unregister_device. Then the added device node will never be released. Fix this by adding the of_node_put. Signed-off-by: NLixin Wang <alan.1.wang@nokia-sbell.com> Tested-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
- 16 1月, 2018 3 次提交
-
-
由 Wolfram Sang 提交于
If we managed to get a client release SDA again, send a STOP afterwards to make sure we have a consistent state on the bus again. Tested-by: NPhil Reid <preid@electromag.com.au> Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
If we have a function to control SDA, we should ensure that SDA is not held down by us. So, release the GPIO in this case. Tested-by: NPhil Reid <preid@electromag.com.au> Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
This will be needed when we want to create STOP conditions, too, later. Create the needed fields and populate them for the GPIO case if the GPIO is set to output. Tested-by: NPhil Reid <preid@electromag.com.au> Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 04 12月, 2017 2 次提交
-
-
由 Wolfram Sang 提交于
Those two functions are very similar, the only differences are that one needs the I2C_M_RD flag for its message while the other one needs the buffer casted to drop the const. Introduce a generic helper which allows to specify the flags (also needed later for DMA safe variants of these calls) and let the casting be done in the inlining functions which are now calling the new helper function. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NJonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
One helper checks if DMA is suitable and optionally creates a bounce buffer, if not. The other function returns the bounce buffer and makes sure the data is properly copied back to the message. Reviewed-by: NJonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 28 11月, 2017 3 次提交
-
-
由 Phil Reid 提交于
The correct header to include for the gpiod interface is <linux/gpio/consumer.h>. Fixes: 3991c5c8 ("i2c: Switch to using gpiod interface for gpio bus recovery") Signed-off-by: NPhil Reid <preid@electromag.com.au> Reviewed-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Phil Reid 提交于
Remove all reference to code related to using integer based ids for scl/sda gpio for bus recovery. All in tree drivers are now using the gpio descriptors to specific the required gpios. Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NPhil Reid <preid@electromag.com.au> Reviewed-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Phil Reid 提交于
Currently the i2c gpio recovery code uses gpio integer interface instead of the gpiod. This change switch the core code to use the gpiod while still retaining compatibility with the gpio integer interface. This will allow individual driver to be updated and tested individual to switch to using the gpiod interface. Reviewed-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NPhil Reid <preid@electromag.com.au> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 02 11月, 2017 1 次提交
-
-
由 Andy Shevchenko 提交于
It's a common pattern to be NULL-aware when freeing resources. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 29 10月, 2017 2 次提交
-
-
由 Phil Reid 提交于
Add a call to of_i2c_setup_smbus_alert when a i2c adapter is registered so the the smbalert driver can be registered. Signed-off-by: NPhil Reid <preid@electromag.com.au> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Claudio Foellmi 提交于
Move the check for a stuck SCL before the check for a high SDA. This prevent false positives in the specific case that SDA is fine and SCL is stuck, which previously returned 0. Also check SDA again after the loop, if we can. Together, these changes should lead to a lot more failed recoveries being caught and returning error codes. Signed-off-by: NClaudio Foellmi <claudio.foellmi@ergon.ch> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 27 10月, 2017 1 次提交
-
-
由 Hans de Goede 提交于
For devices not instantiated through ACPI the i2c-client's device-name gets set to <busnr>-<addr> by default, e.g. "0-0022" this means that the device-name is dependent on the order in which the i2c-busses are enumerated. In some cases having a predictable constant device-name is desirable, for example on non device-tree platforms the link between a regulator and its consumers is specified by the platform code by setting regulator_init_data.consumers. This array identifies the regulator's consumers by dev_name and supply(-name). Which requires a constant dev_name. This commit adds a dev_name field to i2c_board_info allowing platform code to set a contstant dev_name so that the device can be identified by its dev_name in other platform code. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Acked-by: Mark Brown <broonie@kernel.org> (live at ELCE17) Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> (live at ELCE17) Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 15 8月, 2017 1 次提交
-
-
由 Javier Martinez Canillas 提交于
I2C drivers were required to have an I2C device ID table even if were for devices that would only be registered using a specific firmware interface (e.g: OF or ACPI). But commit da10c06a ("i2c: Make I2C ID tables non-mandatory for DT'ed devices") changed the I2C core to relax the requirement and allow drivers to avoid defining this table. Unfortunately it only took into account drivers for OF-only devices and forgot about ACPI-only ones, and this was fixed by commit c64ffff7 ("i2c: core: Allow empty id_table in ACPI case as well"). But the latter didn't update the original comment, so it doesn't reflect what the code does now. Signed-off-by: NJavier Martinez Canillas <javierm@redhat.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 31 7月, 2017 1 次提交
-
-
由 Andy Shevchenko 提交于
For now empty ID table is not allowed with ACPI and prevents driver to be probed. Add a check to allow empty ID table. This introduces a helper i2c_acpi_match_device(). Note, we rename some static function in i2c-core-acpi.c to distinguish with public API. Fixes: da10c06a ("i2c: Make I2C ID tables non-mandatory for DT'ed devices") Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: NRajmohan Mani <rajmohan.mani@intel.com> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> [wsa: needed to get some drivers probed again] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 01 6月, 2017 5 次提交
-
-
由 Wolfram Sang 提交于
Finally, apply modern comment rules to the file header. The old style looked very non-Linuxish and challenged my eyes for some time now. I also added my own copyright for the period of me being the maintainer. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
They seem like cruft to me. I couldn't find any evidence that something included from there is actually used. Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
Removes some ifdeffery. Also add the new file to the relevant MAINTAINERS section. Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
Also removes some ifdeffery. Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
Break out the exported SMBus functions and the emulation layer into a separate file. This also involved splitting up the tracing header into an I2C and an SMBus part. Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-