- Dec 14, 2020
-
-
gaopan authored
The i2c irq is masked when pcie starts a i2c transfer process during noirq suspend stage. As a result, i2c transfer fails. To solve the problem, IRQF_NO_SUSPEND is added to i2c bus. Signed-off-by:
Gao Pan <b54642@freescale.com> Signed-off-by:
Fugang Duan <B38611@freescale.com> Signed-off-by:
Vipul Kumar <vipul_kumar@mentor.com> (cherry picked from commit d21259d9)
-
Gao Pan authored
use subsys_initcall for i2c driver to improve i2c driver probe priority Signed-off-by:
Gao Pan <pandy.gao@nxp.com> (cherry picked from commit 3661eef8) (cherry picked from commit 9c867985)
-
Leonard Crestez authored
During porting commit ede264ac ("MLK-14982-1 imx8: lpi2c: add ipg clk for lpi2c driver") which replaced the single clk with clk_ipg and clk_per was skipped. Part of the code was later added in commit 96dbdd8c3d0b ("MLK-16713 i2c: imx-lpi2c: add runtime pm support") except the "clk" field was kept and clk_get calls were not updated. Fix imx7ulp boot by fetching both clocks. Fixes: 96dbdd8c3d0b ("MLK-16713 i2c: imx-lpi2c: add runtime pm support") Signed-off-by:
Leonard Crestez <leonard.crestez@nxp.com> Acked-by:
Fugang Duan <fugang.duan@nxp.com> (cherry picked from commit 1b9c92f3)
-
Gao Pan authored
add debug message when i2c peripheral clk rate is 0, then directly return -EINVAL. Signed-off-by:
Gao Pan <pandy.gao@nxp.com> Reviewed-by:
Andy Duan <fugang.duan@nxp.com> (Vipul: Fixed merge conflicts) Signed-off-by:
Vipul Kumar <vipul_kumar@mentor.com> (cherry picked from commit 1e6707bb)
-
Fugang Duan authored
Manage irq resource request/release in runtime pm to save irq domain's power. Signed-off-by:
Frank Li <Frank.Li@nxp.com> Signed-off-by:
Fugang Duan <fugang.duan@nxp.com> Tested-by:
Guoniu.Zhou <guoniu.zhou@nxp.com> Reviewed-by:
Frank Li <Frank.Li@nxp.com> (Vipul: Fixed merge conflicts) Signed-off-by:
Vipul Kumar <vipul_kumar@mentor.com> (cherry picked from commit e1aa13df)
-
Fugang Duan authored
- Add runtime pm support to dynamicly manage the ipg and per clocks. - Put the suspend to suspend_noirq. - Call .pm_runtime_force_suspend() to force runtime pm suspended in .suspend_noirq(). BuildInfo: - SCFW 88456c73, IMX-MKIMAGE 06bc2767, ATF a438801 - U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g7953d47 Signed-off-by:
Fugang Duan <fugang.duan@nxp.com> Signed-off-by:
Gao Pan <pandy.gao@nxp.com> Reviewed-by:
Anson Huang <Anson.Huang@nxp.com> During 4.14 rebase added pm_runtime_get_sync/pm_runtime_put around the reading of LPI2C_PARAM. Signed-off-by:
Leonard Crestez <leonard.crestez@nxp.com> (Vipul: Fixed merge conflicts) Signed-off-by:
Vipul Kumar <vipul_kumar@mentor.com> (cherry picked from commit 31cc4be3)
-
Gao Pan authored
A NACK flag in ISR means i2c bus error. In such codition, there is no need to do read/write operation. It's better to return ISR directly and then stop i2c transfer. Signed-off-by:
Gao Pan <pandy.gao@nxp.com> (cherry-pick from 839d59e48b6fdbd882776a48a88ce26ff14d8b86) Signed-off-by:
Vipul Kumar <vipul_kumar@mentor.com> (cherry picked from commit 3d052746)
-
Clark Wang authored
Add defer probe when rpbus probe, so if the rpmsg channel is not created, the rpbus will try to probe later. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com>
-
Clark Wang authored
For some chips may need long time to get the response from M4 sometimes, enlarge timeout to 500ms. Add a judgement to check if the received data is the current transfer wanted. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 222e201b) (cherry picked from commit 6cfc8578)
-
Clark Wang authored
I2c_lock_bus function in i2c-core-base will not stop the transfer to different devices on different buses at the same time. Since the multiple rpmsg i2c buses share one rpmsg channel, so it has to add mutex to protect rpmsg resource accessing. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit d592afe9) (cherry picked from commit 44622ff8)
-
Peng Fan authored
The alias ID must be defined in device tree, because that will be used as BUS ID to Cortex M4. If the alias ID not defined, linux kernel will automatically allocate one ID which might not be the same number used in Cortex M4 and Cortex M4 will not send msg to I2C controller. So let's add BUG_ON to catch issue as earlier as possible to avoid wasting efforts. Signed-off-by:
Peng Fan <peng.fan@nxp.com> Reviewed-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit b9ff2035) (cherry picked from commit 8e509705)
-
Clark Wang authored
Add virtual i2c driver to send SRTM i2c messages to M4. Each virtual I2C bus has a specal bus id, which is abstracted by M4. Each SRTM message include a bus id for the bus which the device is on. Virtual i2c rpmsg bus will bind rpbus nodes with compatible string "fsl,i2c-rpbus". And "rpmsg-i2c-channel" will probe only one rpmsg channel for all rpbuses. This virtual i2c driver depends on CONFIG_I2C and CONFIG_RPMSG. Signed-off-by:
Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 9feeac93) (cherry picked from commit 379ab839)
-
- Dec 05, 2020
-
-
Wang Xiaojun authored
devm_ioremap and ioremap may return NULL which cannot be checked by IS_ERR. Signed-off-by:
Wang Xiaojun <wangxiaojun11@huawei.com> Reported-by:
Hulk Robot <hulkci@huawei.com> Acked-by:
Khalil Blaiech <kblaiech@nvidia.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Arnd Bergmann authored
If this is not enabled, the interfaces used in this driver do not work: drivers/i2c/busses/i2c-mlxbf.c:1888:3: error: implicit declaration of function 'i2c_slave_event' [-Werror,-Wimplicit-function-declaration] i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value); ^ drivers/i2c/busses/i2c-mlxbf.c:1888:26: error: use of undeclared identifier 'I2C_SLAVE_WRITE_REQUESTED' i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value); ^ drivers/i2c/busses/i2c-mlxbf.c:1890:32: error: use of undeclared identifier 'I2C_SLAVE_WRITE_RECEIVED' ret = i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED, ^ drivers/i2c/busses/i2c-mlxbf.c:1892:26: error: use of undeclared identifier 'I2C_SLAVE_STOP' i2c_slave_event(slave, I2C_SLAVE_STOP, &value); ^ Fixes: b5b5b320 ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC") Signed-off-by:
Arnd Bergmann <arnd@arndb.de> Acked-by:
Khalil Blaiech <kblaiech@nvidia.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- Dec 02, 2020
-
-
Christian Eggers authored
If arbitration is lost, the master automatically changes to slave mode. I2SR_IBB may or may not be reset by hardware. Raising a STOP condition by resetting I2CR_MSTA has no effect and will not clear I2SR_IBB. So calling i2c_imx_bus_busy() is not required and would busy-wait until timeout. Signed-off-by:
Christian Eggers <ceggers@arri.de> Tested (not extensively) on Vybrid VF500 (Toradex VF50): Tested-by:
Krzysztof Kozlowski <krzk@kernel.org> Acked-by:
Oleksij Rempel <o.rempel@pengutronix.de> Cc: stable@vger.kernel.org # Requires trivial backporting, simple remove # the 3rd argument from the calls to # i2c_imx_bus_busy(). Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Christian Eggers authored
Arbitration Lost (IAL) can happen after every single byte transfer. If arbitration is lost, the I2C hardware will autonomously switch from master mode to slave. If a transfer is not aborted in this state, consecutive transfers will not be executed by the hardware and will timeout. Signed-off-by:
Christian Eggers <ceggers@arri.de> Tested (not extensively) on Vybrid VF500 (Toradex VF50): Tested-by:
Krzysztof Kozlowski <krzk@kernel.org> Acked-by:
Oleksij Rempel <o.rempel@pengutronix.de> Cc: stable@vger.kernel.org Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Christian Eggers authored
According to the "VFxxx Controller Reference Manual" (and the comment block starting at line 97), Vybrid requires writing a one for clearing an interrupt flag. Syncing the method for clearing I2SR_IIF in i2c_imx_isr(). Signed-off-by:
Christian Eggers <ceggers@arri.de> Fixes: 4b775022 ("i2c: imx: add struct to hold more configurable quirks") Reviewed-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by:
Oleksij Rempel <o.rempel@pengutronix.de> Cc: stable@vger.kernel.org Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Robert Foss authored
During cci_isr() errors read from register fields belonging to i2c master1 are currently assigned to the status field belonging to i2c master0. This patch corrects this error, and always assigns master1 errors to the status field of master1. Fixes: e5175261 ("i2c: Add Qualcomm CCI I2C driver") Reported-by:
Loic Poulain <loic.poulain@linaro.org> Suggested-by:
Loic Poulain <loic.poulain@linaro.org> Signed-off-by:
Robert Foss <robert.foss@linaro.org> Reviewed-by:
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Zhihao Cheng authored
Fix to return the error code from qup_i2c_change_state() instaed of 0 in qup_i2c_bam_schedule_desc(). Fixes: fbf9921f ("i2c: qup: Fix error handling") Reported-by:
Hulk Robot <hulkci@huawei.com> Signed-off-by:
Zhihao Cheng <chengzhihao1@huawei.com> Reviewed-by:
Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- Nov 06, 2020
-
-
Michael Wu authored
Sometimes we would get the following flow when doing an i2cset: 0x1 STATUS SLAVE_ACTIVITY=0x1 : RAW_INTR_STAT=0x514 : INTR_STAT=0x4 I2C_SLAVE_WRITE_RECEIVED 0x1 STATUS SLAVE_ACTIVITY=0x0 : RAW_INTR_STAT=0x714 : INTR_STAT=0x204 I2C_SLAVE_WRITE_REQUESTED I2C_SLAVE_WRITE_RECEIVED Documentation/i2c/slave-interface.rst says that I2C_SLAVE_WRITE_REQUESTED, which is mandatory, should be sent while the data did not arrive yet. It means in a write-request I2C_SLAVE_WRITE_REQUESTED should be reported before any I2C_SLAVE_WRITE_RECEIVED. By the way, I2C_SLAVE_STOP didn't be reported in the above case because DW_IC_INTR_STAT was not 0x200. dev->status can be used to record the current state, especially Designware I2C controller has no interrupts to identify a write-request. This patch makes not only I2C_SLAVE_WRITE_REQUESTED been reported first when IC_INTR_RX_FULL is rising and dev->status isn't STATUS_WRITE_IN_PROGRESS but also I2C_SLAVE_STOP been reported when a STOP condition is received. Signed-off-by:
Michael Wu <michael.wu@vatics.com> Acked-by:
Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Michael Wu authored
If some bits were cleared by i2c_dw_read_clear_intrbits_slave() in i2c_dw_isr_slave() and not handled immediately, those cleared bits would not be shown again by later i2c_dw_read_clear_intrbits_slave(). They therefore were forgotten to be handled. i2c_dw_read_clear_intrbits_slave() should be called once in an ISR and take its returned state for all later handlings. Signed-off-by:
Michael Wu <michael.wu@vatics.com> Acked-by:
Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Geert Uytterhoeven authored
The Mellanox BlueField I2C controller is only present on Mellanox BlueField SoCs. Hence add a dependency on MELLANOX_PLATFORM, to prevent asking the user about this driver when configuring a kernel without Mellanox platform support. Fixes: b5b5b320 ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC") Signed-off-by:
Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Khalil Blaiech authored
Correct the email addresses of the author and the maintainer of the Mellanox BlueField I2C driver. Fixes: b5b5b320 ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC") Reviewed-by:
Leon Romanovsky <leonro@nvidia.com> Signed-off-by:
Khalil Blaiech <kblaiech@nvidia.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Khalil Blaiech authored
The reference clock frequency remains the same across Bluefield products. Thus, update the frequency and rename the macro. Fixes: b5b5b320 ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC") Reviewed-by:
Leon Romanovsky <leonro@nvidia.com> Signed-off-by:
Khalil Blaiech <kblaiech@nvidia.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Khalil Blaiech authored
Few wrapper functions are useless and can be inlined. So delete mlxbf_i2c_read() and mlxbf_i2c_write() and replace them with readl() and writel(), respectively. Also delete mlxbf_i2c_read_data() and mlxbf_i2c_write() and replace them with ioread32be() and iowrite32be(), respectively. Fixes: b5b5b320 ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC") Reviewed-by:
Leon Romanovsky <leonro@nvidia.com> Reviewed-by:
Vadim Pasternak <vadimp@nvidia.com> Signed-off-by:
Khalil Blaiech <kblaiech@nvidia.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Khalil Blaiech authored
Address warnings "warning: cast to restricted __be32" reported by sparse. Fixes: b5b5b320 ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC") Reported-by:
kernel test robot <lkp@intel.com> Reviewed-by:
Leon Romanovsky <leonro@nvidia.com> Reviewed-by:
Vadim Pasternak <vadimp@nvidia.com> Signed-off-by:
Khalil Blaiech <kblaiech@nvidia.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Khalil Blaiech authored
The build fails with "implicit declaration of function 'acpi_device_uid'" error. Thus, protect ACPI function calls from being called when CONFIG_ACPI is disabled. Fixes: b5b5b320 ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC") Reported-by:
kernel test robot <lkp@intel.com> Reviewed-by:
Leon Romanovsky <leonro@nvidia.com> Reviewed-by:
Vadim Pasternak <vadimp@nvidia.com> Signed-off-by:
Khalil Blaiech <kblaiech@nvidia.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Ulrich Hecht authored
Implements atomic transfers to fix reboot/shutdown on r8a7790 Lager and similar boards. Signed-off-by:
Ulrich Hecht <uli+renesas@fpond.eu> Tested-by:
Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by:
Geert Uytterhoeven <geert+renesas@glider.be> [wsa: some whitespace fixing] Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- Nov 03, 2020
-
-
Qii Wang authored
The i2c driver default do dma reset after i2c reset, but sometimes i2c reset will trigger dma tx2rx, then apdma write data to dram which has been i2c_put_dma_safe_msg_buf(kfree). Move dma reset before i2c reset in mtk_i2c_init_hw to fix it. Signed-off-by:
Qii Wang <qii.wang@mediatek.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- Oct 10, 2020
-
-
Cristian Ciocaltea authored
When the NACK and BUS error bits are set by the hardware, the driver is responsible for clearing them by writing "1" into the corresponding status registers. Hence perform the necessary operations in owl_i2c_interrupt(). Fixes: d211e62a ("i2c: Add Actions Semiconductor Owl family S900 I2C driver") Reported-by:
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by:
Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Wolfram Sang authored
This reverts commit fa4d3055. An updated version was sent. So, revert this version and give the new version more time for testing. Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- Oct 08, 2020
-
-
Nicolas Belin authored
Apparently, 15 cycles of the peripheral clock are used by the controller for sampling and filtering. Because this was not known before, the rate calculation is slightly off. Clean up and fix the calculation taking this filtering delay into account. Fixes: 30021e37 ("i2c: add support for Amlogic Meson I2C controller") Signed-off-by:
Nicolas Belin <nbelin@baylibre.com> Signed-off-by:
Jerome Brunet <jbrunet@baylibre.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Jerome Brunet authored
SCL rate appears to be different than what is expected. For example, We get 164kHz on i2c3 of the vim3 when 400kHz is expected. This is partially due to the peripheral clock being disabled when the clock is set. Let's keep the peripheral clock on after probe to fix the problem. This does not affect the SCL output which is still gated when i2c is idle. Fixes: 09af1c2f ("i2c: meson: set clock divider in probe instead of setting it for each transfer") Signed-off-by:
Jerome Brunet <jbrunet@baylibre.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Jerome Brunet authored
When the slave address is written in do_start(), SLAVE_ADDR is written completely. This may overwrite some setting related to the clock rate or signal filtering. Fix this by writing only the bits related to slave address. To avoid causing unexpected changed, explicitly disable filtering or high/low clock mode which may have been left over by the bootloader. Fixes: 30021e37 ("i2c: add support for Amlogic Meson I2C controller") Signed-off-by:
Jerome Brunet <jbrunet@baylibre.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Christian Eggers authored
According to the "VFxxx Controller Reference Manual" (and the comment block starting at line 97), Vybrid requires writing a one for clearing an interrupt flag. Syncing the method for clearing I2SR_IIF in i2c_imx_isr(). Signed-off-by:
Christian Eggers <ceggers@arri.de> Fixes: 4b775022 ("i2c: imx: add struct to hold more configurable quirks") Reviewed-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: stable@vger.kernel.org Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
- Oct 05, 2020
-
-
Dmitry Osipenko authored
Use proper spelling of "NVIDIA" and don't designate driver as Tegra2-only since newer SoC generations are supported as well. Reviewed-by:
Michał Mirosław <mirq-linux@rere.qmqm.pl> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by:
Thierry Reding <treding@nvidia.com> Tested-by:
Thierry Reding <treding@nvidia.com> Signed-off-by:
Dmitry Osipenko <digetx@gmail.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Dmitry Osipenko authored
Some places in the code are missing newlines or have unnecessary whitespaces and newlines. This creates inconsistency of the code and hurts readability. This patch removes the unnecessary and adds necessary whitespaces / newlines, clears indentation of the code. Reviewed-by:
Michał Mirosław <mirq-linux@rere.qmqm.pl> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by:
Thierry Reding <treding@nvidia.com> Tested-by:
Thierry Reding <treding@nvidia.com> Signed-off-by:
Dmitry Osipenko <digetx@gmail.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Dmitry Osipenko authored
Make all comments to be consistent in regards to capitalization and punctuation, correct spelling and grammar errors, improve wording. Reviewed-by:
Thierry Reding <treding@nvidia.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by:
Thierry Reding <treding@nvidia.com> Signed-off-by:
Dmitry Osipenko <digetx@gmail.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Dmitry Osipenko authored
This patch unifies style of all messages in the driver by starting them with a lowercase letter and using consistent capitalization and wording for all messages. Reviewed-by:
Michał Mirosław <mirq-linux@rere.qmqm.pl> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by:
Thierry Reding <treding@nvidia.com> Tested-by:
Thierry Reding <treding@nvidia.com> Signed-off-by:
Dmitry Osipenko <digetx@gmail.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-
Dmitry Osipenko authored
Rename "ret" variables to "err" in order to make code a bit more expressive, emphasizing that the returned value is an error code. Same vice versa, where appropriate. Rename variable "reg" to "val" in order to better reflect the actual usage of the variable in the code and to make naming consistent with the rest of the code. Use briefer names for a few members of the tegra_i2c_dev structure in order to improve readability of the code. All dev/&pdev->dev are replaced with i2c_dev->dev in order to have uniform code style across the driver. Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by:
Thierry Reding <treding@nvidia.com> Tested-by:
Thierry Reding <treding@nvidia.com> Signed-off-by:
Dmitry Osipenko <digetx@gmail.com> Signed-off-by:
Wolfram Sang <wsa@kernel.org>
-