aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-07-23i2c: davinci: Avoid zero value of CLKHAlexander Sverdlin1-2/+6
If CLKH is set to 0 I2C clock is not generated at all, so avoid this value and stretch the clock in this case. Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> Acked-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: aspeed: Adjust spinlock scope in the irq handlerJae Hyun Yoo1-6/+10
This patch adjusts spinlock scope to make it wrap the whole irq handler using a single lock/unlock which covers both master and slave handlers. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: aspeed: Fix initial values of master and slave stateJae Hyun Yoo1-2/+2
This patch changes the order of enum aspeed_i2c_master_state and enum aspeed_i2c_slave_state defines to make their initial value to ASPEED_I2C_MASTER_INACTIVE and ASPEED_I2C_SLAVE_STOP respectively. In case of multi-master use, if a slave data comes ahead of the first master xfer, master_state starts from an invalid state so this change fixes the issue. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: aspeed: Add newline characters into message printings.Jae Hyun Yoo1-9/+9
There are some log printing without a newline character. This patch adds the missing newline characters. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: exynos5: Describe the hardware variant for readabilityKrzysztof Kozlowski1-8/+14
The driver supports multiple hardware variants of Exynos I2C controller which differ in FIFO depth, handling of interrupts and bus recovery in HSI2C_MASTER_ST_LOSE state. The difference in variant was a single bit set for Exynos7 variants and implicit lack of this bit for other variants. Make each variant explicit which also fixes the GCC warning about documentation: drivers/i2c/busses/i2c-exynos5.c:223: warning: Function parameter or member 'hw' not described in 'exynos_hsi2c_variant' No change in functionality. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: recovery: make pin init look like STOPWolfram Sang1-9/+10
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: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> Reviewed-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: fsi: Add bus recoveryEddie James1-0/+132
Bus recovery should reset the bus with the standard i2c recovery procedure. Populate the necessary fields so that the standard procedure can perform the reset. Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com> Tested-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: fsi: Add I2C master lockingEddie James1-4/+12
Since there are many ports per master, each with it's own adapter and chardev, we need some locking to prevent transfers from changing the master state while other transfers are in progress. Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: fsi: Add transfer implementationEddie James1-2/+193
Execute I2C transfers from the FSI-attached I2C master. Use polling instead of interrupts as we have no hardware IRQ over FSI. Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: fsi: Add abort and hardware reset proceduresEddie James1-0/+91
Add abort procedure for failed transfers. Add engine reset procedure that is executed during the abort to recover from various fault conditions. Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com> Tested-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: fsi: Add port structuresEddie James1-0/+91
Add and initialize I2C adapters for each port on the FSI-attached I2C master. Ports for each master are defined in the devicetree. Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com> Tested-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-21i2c: Add FSI-attached I2C master algorithmEddie James3-0/+251
Add register definitions for FSI-attached I2C master and functions to access those registers over FSI. Add an FSI driver so that our I2C bus is probed up during an FSI scan. Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-20i2c: smbus: add unlocked __i2c_smbus_xfer variantPeter Rosin1-8/+20
Removes all locking from i2c_smbus_xfer and renames it to __i2c_smbus_xfer, then adds a new i2c_smbus_xfer function that simply grabs the lock while calling the unlocked variant. This is not perfectly equivalent, since i2c_smbus_xfer was callable from atomic/irq context if you happened to end up emulating SMBus with an I2C transfer, and that is no longer the case with this patch. It is unknown (to me) if anything depends on that quirk, but it seems fragile enough to simply break those cases and require them to call i2c_transfer directly instead. While at it, for consistency rename the 2nd to last argument (size) of the i2c_smbus_xfer declaration to protocol and remove the surplus extern marker. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-17i2c: recovery: rename variable for easier understandingWolfram Sang1-7/+7
While refactoring the routine before, it occurred to me that this will make the code much easier to understand. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-17i2c: rcar: use the new get_bus_free callbackWolfram Sang1-10/+11
To break out of recovery as early as possible, feed back the bus_free logic state. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-17i2c: recovery: add get_bus_free callbackWolfram Sang1-4/+23
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: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-17i2c: recovery: refactor recovery functionWolfram Sang1-18/+6
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: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-17i2c: recovery: require either get_sda or set_sdaWolfram Sang1-1/+6
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: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-17Merge tag 'v4.18-rc5' into i2c/for-4.19Wolfram Sang4-12/+21
Linux 4.18-rc5
2018-07-13Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linuxLinus Torvalds3-11/+19
Pull i2c fixes from Wolfram Sang: - I2C core bugfix regarding bus recovery - driver bugfix for the tegra driver - typo correction * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: recovery: if possible send STOP with recovery pulses i2c: tegra: Fix NACK error handling i2c: stu300: use non-archaic spelling of failes
2018-07-13Merge branch 'i2c/precise-locking-names_immutable' into i2c/for-4.19Wolfram Sang7-39/+39
2018-07-13i2c: remove i2c_lock_adapter and use i2c_lock_bus directlyPeter Rosin6-36/+36
The i2c_lock_adapter name is ambiguous since it is unclear if it refers to the root adapter or the adapter you name in the argument. The natural interpretation is the adapter you name in the argument, but there are historical reasons for that not being the case; it in fact locks the root adapter. Just remove the function and force users to spell out the I2C_LOCK_ROOT_ADAPTER name to indicate what is really going on. Also remove i2c_unlock_adapter, of course. This patch was generated with git grep -l 'i2c_\(un\)\?lock_adapter' \ | xargs sed -i 's/i2c_\(un\)\?lock_adapter(\([^)]*\))/'\ 'i2c_\1lock_bus(\2, I2C_LOCK_ROOT_ADAPTER)/g' followed by white-space touch-up. Signed-off-by: Peter Rosin <peda@axentia.se> Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com> Tested-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-13i2c: mux: pca9541: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)Peter Rosin1-3/+3
Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-12i2c: recovery: if possible send STOP with recovery pulsesWolfram Sang1-1/+10
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: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
2018-07-10i2c: tegra: Fix NACK error handlingJon Hunter1-9/+8
On Tegra30 Cardhu the PCA9546 I2C mux is not ACK'ing I2C commands on resume from suspend (which is caused by the reset signal for the I2C mux not being configured correctl). However, this NACK is causing the Tegra30 to hang on resuming from suspend which is not expected as we detect NACKs and handle them. The hang observed appears to occur when resetting the I2C controller to recover from the NACK. Commit 77821b4678f9 ("i2c: tegra: proper handling of error cases") added additional error handling for some error cases including NACK, however, it appears that this change conflicts with an early fix by commit f70893d08338 ("i2c: tegra: Add delay before resetting the controller after NACK"). After commit 77821b4678f9 was made we now disable 'packet mode' before the delay from commit f70893d08338 happens. Testing shows that moving the delay to before disabling 'packet mode' fixes the hang observed on Tegra30. The delay was added to give the I2C controller chance to send a stop condition and so it makes sense to move this to before we disable packet mode. Please note that packet mode is always enabled for Tegra. Fixes: 77821b4678f9 ("i2c: tegra: proper handling of error cases") Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@vger.kernel.org
2018-07-03i2c: i801: Add support for Intel Ice LakeMika Westerberg2-0/+5
Intel Ice Lake has the same SMBus host controller than Intel Cannon Lake. Add the PCI ID to the drivers list of supported devices. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> [jarkko.nikula@linux.intel.com: Add entries to Documentation and Kconfig] Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: i801: Consolidate chipset names in documentation and KconfigJarkko Nikula1-7/+3
Make list of supported chipsets a little bit shorter by consolidating names that belong to the same family. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: stu300: use non-archaic spelling of failesThadeu Lima de Souza Cascardo1-1/+1
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: tegra: Add support for Tegra194Thierry Reding1-14/+76
In order to support advanced features, the I2C FIFO interface was changed in the version of the Tegra I2C controller found in Tegra194. The changes are backwards incompatible, so the driver needs to be programmed in a slightly different way on new chips. Add support for MST FIFO programming and add an OF match entry for Tegra194. At the same time, mark all prior generations of this controller as not having the MST FIFO interface. Acked-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: gpio: fault-injector: add incomplete_write_byteWolfram Sang1-0/+21
Add another injector for an incomplete transfer. As mentioned in the docs, this one is important to check bus recovery algorithms with it. Otherwise random data may be sent to devices! Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: gpio: fault-injector: refactor incomplete transferWolfram Sang1-14/+22
Make the incomplete_transfer routine reusable, so we can add other test cases with different patterns later. Prepare the docs for that, too. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: designware: Add debug print for bus speedJarkko Nikula1-2/+19
Trivial added debug print for dev->clk_freq doesn't necessarily tell the actual bus speed or mode the controller is operating. For instance it may indicate 1 MHz Fast Mode Plus or 3.4 MHz High Speed but driver ends up using 400 kHz Fast Mode due missing timing parameters or missing support from HW. Add a debug print that prints the bus speed based on the validated speed that gets programmed into a HW. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: designware: Add debug print for SDA hold time valueJarkko Nikula1-0/+4
SDA hold time is an important timing parameter and often reason for arbitration lost errors if not set to a correct value. Add a debug print for it in order to see what value gets programmed to a HW. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: designware: Separate timing parameter setting from HW initalizationJarkko Nikula1-50/+80
Mixed timing parameter validation, calculation and their debug prints with HW initialization in i2c_dw_init_master() and i2c_dw_init_slave() as been bothering me some time. It makes function a little bit unclear to follow, doesn't show what steps are needed to do only once during probe and what are needed whenever HW needs to be reinitialized. Also those debug prints show information that doesn't change runtime and thus are also needlessly printed multiple times whenever HW is reinitialized. Thus let the i2c_dw_init_master() and i2c_dw_init_slave() to do only HW initialization and move out one time parameter setting and debug prints to separate functions which are called only during probe. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: designware: Move SDA hold time configuration to common codeJarkko Nikula4-42/+56
SDA hold time configuration is common to both master and slave code. It is also something that can be done once during probe and do only register write when HW needs to be reinitialized. Remove duplication and move SDA hold time configuration to common code. It will be called from slave probe and for master code from a new i2c_dw_set_timings_master() to where we will populate more probe time timing parameter setting. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: designware: Call i2c_dw_clk_rate() only once in i2c_dw_init_master()Jarkko Nikula1-4/+5
This is rather readability update than micro-optimization, or if not optimization at all. We take the input clock rate to a variable and pass that to SCL timing parameter calculation functions. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: designware: Don't use internal ___constant_swab32Jarkko Nikula1-1/+2
It looks ___constant_swab32 is an internal byte swap detail. Switch to swap32() and include header file for it explicitly. Now it comes implicitly via linux/i2c.h include. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: designware: Move register access detection to common codeJarkko Nikula4-28/+43
Move register access detection out from master and slave HW initialization code to common code. Motivation for this is to have register access configured before HW initialization and remove duplicated code. This allows to do further separation between probe time initialization and runtime reinitialization code. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: designware: Remove needless variable from i2c_dw_init_slave()Jarkko Nikula1-3/+1
Commit 43df43e6ba13 ("i2c: designware: Don't set SCL timings and speed mode when in slave mode") made variable comp_param1 needless in i2c_dw_init_slave(). Remove it now. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: mux: make use of __i2c_smbus_xferPeter Rosin1-2/+2
Calling the __i2c_smbus_xfer wrapper in __i2c_mux_smbus_xfer provides retries and thus makes the parent-locked case consistent with the both mux-locked (i2c_mux_smbus_xfer) and the I2C transfer cases. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: mux: pca954x: make use of __i2c_smbus_xferPeter Rosin1-23/+4
This simplifies the code, and you get retries for free if the adapter does not support ->master_xfer. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: mux: pca9541: make use of __i2c_smbus_xferPeter Rosin1-58/+11
This simplifies the code, and you get retries for free if the adapter does not support ->master_xfer. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: mux: mlxcpld: make use of __i2c_smbus_xferPeter Rosin1-24/+4
This simplifies the code, and you get retries for free if the adapter does not support ->master_xfer. Signed-off-by: Peter Rosin <peda@axentia.se> Acked-by: Michael Shych <michaelsh@mellanox.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-03i2c: smbus: add unlocked __i2c_smbus_xfer variantPeter Rosin1-8/+20
Removes all locking from i2c_smbus_xfer and renames it to __i2c_smbus_xfer, then adds a new i2c_smbus_xfer function that simply grabs the lock while calling the unlocked variant. This is not perfectly equivalent, since i2c_smbus_xfer was callable from atomic/irq context if you happened to end up emulating SMBus with an I2C transfer, and that is no longer the case with this patch. It is unknown (to me) if anything depends on that quirk, but it seems fragile enough to simply break those cases and require them to call i2c_transfer directly instead. While at it, for consistency rename the 2nd to last argument (size) of the i2c_smbus_xfer declaration to protocol and remove the surplus extern marker. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-02i2c-cht-wc: Fix bq24190 supplierHans de Goede1-1/+2
Commit f2a8aa053c17 ("typec: tcpm: Represent source supply through power_supply") moved the code to register a power_supply representing the device supplying power to the type-C connector, from the fusb302 code to the generic tcpm code. This has caused the power-supply registered by the fusb302 driver, which determines how much current the bq24190 can draw, to change name from "fusb302-typec-source" to "tcpm-source-psy-i2c-fusb302". Fixes: f2a8aa053c17 ("typec: tcpm: Represent source supply through...") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Wolfram Sang <wsa@the-dreams.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-29i2c: gpio: initialize SCL to HIGH againWolfram Sang1-2/+2
It seems that during the conversion from gpio* to gpiod*, the initial state of SCL was wrongly switched to LOW. Fix it to be HIGH again. Fixes: 7bb75029ef34 ("i2c: gpio: Enforce open drain through gpiolib") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
2018-06-29i2c: smbus: kill memory leak on emulated and failed DMA SMBus xfersPeter Rosin1-5/+9
If DMA safe memory was allocated, but the subsequent I2C transfer fails the memory is leaked. Plug this leak. Fixes: 8a77821e74d6 ("i2c: smbus: use DMA safe buffers for emulated SMBus transactions") Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
2018-06-29i2c: algos: bit: mention our experience about initial statesWolfram Sang1-0/+5
So, if somebody wants to re-implement this in the future, we pinpoint to a problem case. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-06-29Revert "i2c: algo-bit: init the bus to a known state"Wolfram Sang1-5/+0
This reverts commit 3e5f06bed72fe72166a6778f630241a893f67799. As per bugzilla #200045, this caused a regression. I don't really see a way to fix it without having the hardware. So, revert the patch and I will fix the issue I was seeing originally in the i2c-gpio driver itself. I couldn't find new users of this algorithm since, so there should be no one depending on the new behaviour. Reported-by: Sergey Larin <cerg2010cerg2010@mail.ru> Fixes: 3e5f06bed72f ("i2c: algo-bit: init the bus to a known state") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Tested-by: Sergey Larin <cerg2010cerg2010@mail.ru> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
2018-06-14Merge branch 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linuxLinus Torvalds58-386/+1592
Pull i2c updates from Wolfram Sang: - mainly feature additions to drivers (stm32f7, qup, xlp9xx, mlxcpld, ...) - conversion to use the i2c_8bit_addr_from_msg macro consistently - move includes to platform_data - core updates to allow the (still in review) I3C subsystem to connect - and the regular share of smaller driver updates * 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (68 commits) i2c: qup: fix building without CONFIG_ACPI i2c: tegra: Remove suspend-resume i2c: imx-lpi2c: Switch to SPDX identifier i2c: mxs: Switch to SPDX identifier i2c: busses: make use of i2c_8bit_addr_from_msg i2c: algos: make use of i2c_8bit_addr_from_msg i2c: rcar: document R8A77980 bindings i2c: qup: Add command-line parameter to override SCL frequency i2c: qup: Correct duty cycle for FM and FM+ i2c: qup: Add support for Fast Mode Plus i2c: qup: add probe path for Centriq ACPI devices i2c: robotfuzz-osif: drop pointless test i2c: robotfuzz-osif: remove pointless local variable i2c: rk3x: Don't print visible virtual mapping MMIO address i2c: opal: don't check number of messages in the driver i2c: ibm_iic: don't check number of messages in the driver i2c: imx: Switch to SPDX identifier i2c: mux: pca954x: merge calls to of_match_device and of_device_get_match_data i2c: mux: demux-pinctrl: use proper parent device for demux adapter i2c: mux: improve error message for failed symlink ...