- 22 5月, 2020 1 次提交
-
-
由 Andy Shevchenko 提交于
Do not spread PCI specifics over common code. It seems to be a layering violation which can be easily avoided. Refactor PCI driver and drop PCI specifics from common code. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
- 20 5月, 2020 9 次提交
-
-
由 Russell King 提交于
Implement generic GPIO-based I2C bus recovery for the PXA I2C driver. Reviewed-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Wolfram Sang 提交于
Merge tag 'for-5.8-i2c' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into i2c/for-5.8 i2c: tegra: Changes for v5.8-rc1 This includes a few improvements to make the Tegra I2C controller behave properly on suspend/resume, does a bit of cleanup and adds support for the VI-variant of the I2C controller that is used primarily for video capture purposes.
-
由 Atsushi Nemoto 提交于
Protect altr_i2c_int_enable() by the mutex and remove unneeded spinlock. Signed-off-by: NAtsushi Nemoto <atsushi.nemoto@sord.co.jp> Reviewed-by: NThor Thayer <thor.thayer@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Wolfram Sang 提交于
-
由 Bibby Hsieh 提交于
Although in the most platforms, the bus power of i2c are alway on, some platforms disable the i2c bus power in order to meet low power request. We get and enable bulk regulator in i2c adapter device. Signed-off-by: NBibby Hsieh <bibby.hsieh@mediatek.com> Reviewed-by: NTomasz Figa <tfiga@chromium.org> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Bibby Hsieh 提交于
In some platforms, they disable the power-supply of i2c due to power consumption reduction. This patch add bus-supply property. Signed-off-by: NBibby Hsieh <bibby.hsieh@mediatek.com> Acked-by: NRob Herring <robh@kernel.org> [wsa: rebased to i2c/for-next] Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Wolfram Sang 提交于
Atomic transfers are not only about sending messages like the original wording suggested. Speak of 'accessing' now like in i2c.h. Reported-by: NMichał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Wolfram Sang 提交于
I don't plan to support every EEPROM type, but the 24c512 ones need a tiny code update, so let's have that upstream. Reported-by: NPatrick Williams <patrick@stwcx.xyz> Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NPatrick Williams <patrick@stwcx.xyz> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Qii Wang 提交于
This patch adds a algorithm to calculate some ac-timing parameters which can fully meet I2C Spec. Signed-off-by: NQii Wang <qii.wang@mediatek.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
- 15 5月, 2020 6 次提交
-
-
由 Qii Wang 提交于
Add Qii Wang as maintainer for mediatek i2c controller driver. Signed-off-by: NQii Wang <qii.wang@mediatek.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Gustavo A. R. Silva 提交于
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] sizeof(flexible-array-member) triggers a warning because flexible array members have incomplete type[1]. There are some instances of code in which the sizeof operator is being incorrectly/erroneously applied to zero-length arrays and the result is zero. Such instances may be hiding some bugs. So, this work (flexible-array member conversions) will also help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732 ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Christophe JAILLET 提交于
A call to 'i2c_demux_deactivate_master()' is missing in the error handling path, as already done in the remove function. Fixes: 50a5ba87 ("i2c: mux: demux-pinctrl: add driver") Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Atsushi Nemoto 提交于
Use a mutex to protect access to idev->msg_len, idev->buf, etc. which are modified by both altr_i2c_xfer_msg() and altr_i2c_isr(). This is the minimal fix for easy backporting. A cleanup to remove the spinlock will be added later. Signed-off-by: NAtsushi Nemoto <atsushi.nemoto@sord.co.jp> Acked-by: NThor Thayer <thor.thayer@linux.intel.com> [wsa: updated commit message] Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Wolfram Sang 提交于
The 'pengutronix' address is defunct for years. Use the proper contact address. Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Codrin Ciubotariu 提交于
devm_gpiod_get() usually calls gpio_request_enable() for non-strict pinmux drivers. These puts the pins in GPIO mode, whithout notifying the pinctrl driver. At this point, the I2C bus no longer owns the pins. To mux the pins back to the I2C bus, we use the pinctrl driver to change the state of the pins to GPIO, before using devm_gpiod_get(). After the pins are received as GPIOs, we switch theer pinctrl state back to the default one, Fixes: d3d3fdcc ("i2c: at91: implement i2c bus recovery") Signed-off-by: NCodrin Ciubotariu <codrin.ciubotariu@microchip.com> Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
- 13 5月, 2020 7 次提交
-
-
由 Andy Shevchenko 提交于
Allow slave mode for PCI enumerated devices by calling a common i2c_dw_probe() instead of i2c_dw_probe_master(). While dropping dependency to platform driver in slave module, move its configuration section above, closer to core. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Andy Shevchenko 提交于
As a preparatory patch to support slave mode for PCI enumerated devices rename i2c_dw_probe() to i2c_dw_probe_master() and split common i2c_dw_probe() as inline helper. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Andy Shevchenko 提交于
Since we have available helper to configure master mode, let's use it in the PCI driver instead of spread open-coded variant. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Andy Shevchenko 提交于
Move configuration routines to respective modules, i.e. master and slave. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Andy Shevchenko 提交于
Use devm_platform_ioremap_resource() instead of platform_get_resource() + devm_ioremap_resource(). Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Thierry Reding 提交于
Tegra210 has an extra instance of the I2C controller that is in the domain of host1x and usually used for camera use-cases. The programming model for the VI variant of the controller is roughly the same as for the other variants, except that the I2C registers start at an offset and are spaced further apart. VI I2C also doesn't support slave mode. Signed-off-by: NThierry Reding <treding@nvidia.com>
-
由 Thierry Reding 提交于
Using these macros helps increase readability of the code. Signed-off-by: NThierry Reding <treding@nvidia.com>
-
- 12 5月, 2020 10 次提交
-
-
由 Russell King 提交于
Use master-abort to send the stop condition after an address cycle rather than resetting the controller. Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Russell King 提交于
If we timeout during a message transfer, the control register may contain bits that cause an action to be set. Read-modify-writing the register leaving these bits set may trigger the hardware to attempt one of these actions unintentionally. Always clear these bits when cleaning up after a message or after a timeout. Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Russell King 提交于
Remove unnecessary show_state() in the loop inside i2c_pxa_pio_set_master(), which can be unnecessarily verbose. Remove the i2c_pxa_scream_blue_murder() in i2c_pxa_pio_xfer(), which will trigger if we are probing the I2C bus and a slave does not respond; this is a normal event, and not something to report. Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Russell King 提交于
Ensure that the various timeout messages can identify where in the code they were produced from to aid debugging. Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Russell King 提交于
Running i2cdetect on a PXA I2C adapter is very noisy; it complains whenever a slave fails to respond to the address cycle. Since it is normal to probe for slaves in this way, we should not fill the kernel log. This is especially true with SFP modules that take a while to respond on the I2C bus, and probing via the I2C bus is the only way to detect that they are ready. Fix this by changing the internal transfer return code from I2C_RETRY to a new NO_SLAVE code (mapped to -ENXIO, as per the I2C documentation for this condition, but we still return -EREMOTEIO to the I2C stack to maintain long established driver behaviour.) Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Russell King 提交于
Most of i2c_pxa_pio_xfer() and i2c_pxa_xfer() are identical; the only differences are that i2c_pxa_pio_xfer() may reset the bus, and they use different underlying transfer functions. The retry loop is the same. Consolidate these two functions. Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Andy Shevchenko 提交于
Use a shorter SPDX identifier instead of pasting the whole license. While here, replace duplicating PCA954x with PCA984x. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Andy Shevchenko 提交于
device_create_file() is called the last in ->probe() but pca954x_cleanup(), which is called earlier in error path, tries to remove never created file. Move device_remove_file() call outside of pca954x_cleanup() to make it slightly closer to what pca954x_init() is doing. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Andy Shevchenko 提交于
Device property API allows to gather device resources from different sources, such as ACPI. Convert the drivers to unleash the power of device property API. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Andy Shevchenko 提交于
Refactor pca954x_irq_handler() to: - use for_each_set_bit() macro - use IRQ_RETVAL() macro Above change makes code easy to read and understand. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
- 08 5月, 2020 4 次提交
-
-
由 Dmitry Osipenko 提交于
DMA transfer could be completed, but CPU (which handles DMA interrupt) may get too busy and can't handle the interrupt in a timely manner, despite of DMA IRQ being raised. In this case the DMA state needs to synchronized before terminating DMA transfer in order not to miss the DMA transfer completion. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NThierry Reding <treding@nvidia.com>
-
由 Dmitry Osipenko 提交于
Boot CPU0 always handle I2C interrupt and under some rare circumstances (like running KASAN + NFS root) it may stuck in uninterruptible state for a significant time. In this case we will get timeout if I2C transfer is running on a sibling CPU, despite of IRQ being raised. In order to handle this rare condition, the IRQ status needs to be checked after completion timeout. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NThierry Reding <treding@nvidia.com>
-
由 Thierry Reding 提交于
One of the I2C controllers on Tegra SoCs is typically connected to a system PMIC, which provides controls for critical power supplies for most platforms. Some drivers, such as PCI, need to disable these regulators during a very late stage during suspend and resume them at a very early stage during resume. To support these use-cases, keep interrupts disabled during suspend/ resume. Suggested-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NThierry Reding <treding@nvidia.com>
-
由 Thierry Reding 提交于
Depending on the board design, the I2C controllers found on Tegra SoCs may require pinmuxing in order to function. This is done as part of the driver's runtime suspend/resume operations. However, the PM core does not allow devices to go into runtime suspend during system sleep to avoid potential races with the suspend/resume of their parents. As a result of this, when Tegra SoCs resume from system suspend, their I2C controllers may have lost the pinmux state in hardware, whereas the pinctrl subsystem is not aware of this. To fix this, make sure that if the I2C controller is not runtime suspended, the runtime suspend code is still executed in order to disable the module clock (which we don't need to be enabled during sleep) and set the pinmux to the idle state. Conversely, make sure that the I2C controller is properly resumed when waking up from sleep so that pinmux settings are properly restored. This fixes a bug seen with DDC transactions to an HDMI monitor timing out when resuming from system suspend. Signed-off-by: NThierry Reding <treding@nvidia.com>
-
- 07 5月, 2020 1 次提交
-
-
由 Thierry Reding 提交于
This reverts commit 9f42de8d. It's not safe to use pm_runtime_force_{suspend,resume}(), especially during the noirq phase of suspend. See also the guidance provided in commit 1e2ef05b ("PM: Limit race conditions between runtime PM and system sleep (v2)"). Signed-off-by: NThierry Reding <treding@nvidia.com>
-
- 05 5月, 2020 2 次提交
-
-
由 Codrin Ciubotariu 提交于
After a transfer timeout, some faulty I2C slave devices might hold down the SDA pin. We can generate a bus clear command, hoping that the slave might release the pins. If the CLEAR command is not supported, we will use gpio recovery, if available, to reset the bus. Signed-off-by: NCodrin Ciubotariu <codrin.ciubotariu@microchip.com> Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: NWolfram Sang <wsa@kernel.org>
-
由 Wolfram Sang 提交于
The old email is still active, but for easier handling, I am going to use my kernel.org address from now on. Also, add a mailmap for the now defunct Pengutronix address. Signed-off-by: NWolfram Sang <wsa@kernel.org>
-