- 16 1月, 2020 11 次提交
-
-
由 Dmitry Osipenko 提交于
It is more robust to check completion status in addition to the left time in a case of DMA transfer because transfer's completion happens in two phases [one is ISR, other is tasklet] and thus it is possible that DMA is completed while I2C completion awaiting times out because of the deferred notification done by the DMA driver. The DMA completion status becomes 100% actual after DMA synchronization. This fixes spurious DMA timeouts when system is under load. Tested-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Dmitry Osipenko 提交于
It is possible that I2C could error out in the middle of DMA transfer and in this case DMA channel needs to be reset, otherwise a follow up transfer will fail because DMA channel stays blocked. Tested-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Dmitry Osipenko 提交于
There is nothing to synchronize in regards to memory accesses for PIO transfers and for DMA transfers the DMA API takes care of the syncing. Tested-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Dmitry Osipenko 提交于
DMA is preferred for a larger transfers, while PIO is preferred for a smaller transfers to avoid unnecessary DMA overhead. There is no strict size limitations for the PIO-mode transfers, so let's rename the constant for clarity. Tested-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Dmitry Osipenko 提交于
System shutdown may happen with interrupts being disabled and in this case kernel may hang if atomic transfer isn't supported by driver. There were several occurrences where I found my Nexus 7 completely discharged despite of being turned off and then one day I spotted this in the log: reboot: Power down ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at drivers/i2c/i2c-core.h:40 i2c_transfer+0x95/0x9c No atomic I2C transfer handler for 'i2c-1' Modules linked in: tegra30_devfreq CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 5.4.0-next-20191202-00120-gf7ecd80fb803-dirty #3195 Hardware name: NVIDIA Tegra SoC (Flattened Device Tree) [<c010e4b5>] (unwind_backtrace) from [<c010a0fd>] (show_stack+0x11/0x14) [<c010a0fd>] (show_stack) from [<c09995e5>] (dump_stack+0x85/0x94) [<c09995e5>] (dump_stack) from [<c011f3d1>] (__warn+0xc1/0xc4) [<c011f3d1>] (__warn) from [<c011f691>] (warn_slowpath_fmt+0x61/0x78) [<c011f691>] (warn_slowpath_fmt) from [<c069a8dd>] (i2c_transfer+0x95/0x9c) [<c069a8dd>] (i2c_transfer) from [<c05667f1>] (regmap_i2c_read+0x4d/0x6c) [<c05667f1>] (regmap_i2c_read) from [<c0563601>] (_regmap_raw_read+0x99/0x1cc) [<c0563601>] (_regmap_raw_read) from [<c0563757>] (_regmap_bus_read+0x23/0x38) [<c0563757>] (_regmap_bus_read) from [<c056293d>] (_regmap_read+0x3d/0xfc) [<c056293d>] (_regmap_read) from [<c0562d3b>] (_regmap_update_bits+0x87/0xc4) [<c0562d3b>] (_regmap_update_bits) from [<c0563add>] (regmap_update_bits_base+0x39/0x50) [<c0563add>] (regmap_update_bits_base) from [<c056fd39>] (max77620_pm_power_off+0x29/0x2c) [<c056fd39>] (max77620_pm_power_off) from [<c013bbdd>] (__do_sys_reboot+0xe9/0x170) [<c013bbdd>] (__do_sys_reboot) from [<c0101001>] (ret_fast_syscall+0x1/0x28) Exception stack(0xde907fa8 to 0xde907ff0) 7fa0: 00000000 00000000 fee1dead 28121969 4321fedc 00000000 7fc0: 00000000 00000000 00000000 00000058 00000000 00000000 00000000 00000000 7fe0: 0045adf0 bed9abb8 004444a0 b6c666d0 ---[ end trace bdd18f87595b1a5e ]--- The atomic transferring is implemented by enforcing PIO mode for the transfer and by polling interrupt status until transfer is completed or failed. Now system shuts down properly every time. Tested-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Dmitry Osipenko 提交于
Potentially it is possible that interrupt may fire after transfer timeout. That may not end up well for the next transfer because interrupt handling may race with hardware resetting. This is very unlikely to happen in practice, but anyway let's prevent the potential problem by enabling interrupt only at the moments when it is actually necessary to get some interrupt event. Tested-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
After removal of the parport-light driver, this include is used by the parport driver exclusively and can be included in the main source. Move module parameter declarations to its variable declaration while here. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
The driver is not 'new' anymore, so remove details from the driver it surpassed. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
The justification of a light version of the parport driver was less overhead for embedded systems. Well, today, even if an embedded system still has a parport, it surely can handle the fully-fledged parport driver. Remove it to reduce the maintenance burden. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Dmitry Osipenko 提交于
One of the recent Tegra I2C commits made a change that resumes runtime PM during driver's probe, but it missed to put the RPM in a case of error. Note that it's not correct to use pm_runtime_status_suspended because it breaks RPM refcounting. Fixes: 8ebf15e9 ("i2c: tegra: Move suspend handling to NOIRQ phase") Cc: <stable@vger.kernel.org> # v5.4+ Tested-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Dmitry Osipenko 提交于
I noticed that sometime I2C clock is kept enabled during suspend-resume. This happens because runtime PM defers dynamic suspension and thus it may happen that runtime PM is in active state when system enters into suspend. In particular I2C controller that is used for CPU's DVFS is often kept ON during suspend because CPU's voltage scaling happens quite often. Fixes: 8ebf15e9 ("i2c: tegra: Move suspend handling to NOIRQ phase") Cc: <stable@vger.kernel.org> # v5.4+ Tested-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 14 1月, 2020 1 次提交
-
-
由 Martin Blumenstingl 提交于
Boards with some of the 32-bit SoCs (mostly Meson8 and Meson8m2) use a Ricoh RN5T618 PMU which acts as system power controller. The driver for the system power controller may need to the I2C bus just before shutting down or rebooting the system. At this stage the interrupts may be disabled already. Implement the master_xfer_atomic callback so the driver for the RN5T618 PMU can communicate properly with the PMU when shutting down or rebooting the board. The CTRL register has a status bit which can be polled to determine when processing has completed. According to the public S805 datasheet the value 0 means "idle" and 1 means "running". Signed-off-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com> Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com> [wsa: converted some whitespace alignment] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 06 1月, 2020 5 次提交
-
-
由 Stefan Wahren 提交于
The commit bebff81f ("i2c: bcm2835: Model Divider in CCF") introduced a NULL pointer dereference on driver unload. It seems that we can't fetch the bus clock via devm_clk_get in bcm2835_i2c_remove. As an alternative approach store a pointer to the bus clock in the private driver structure. Fixes: bebff81f ("i2c: bcm2835: Model Divider in CCF") Signed-off-by: NStefan Wahren <wahrenst@gmx.net> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 周琰杰 (Zhou Yanjie) 提交于
Add support for probing i2c driver on the X1000 Soc from Ingenic. call the corresponding fifo parameter according to the device model obtained from the devicetree. Signed-off-by: N周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com> Acked-by: NPaul Cercueil <paul@crapouillou.net> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Christoph Müllner 提交于
This patch changes the I2C fault codes according to the specified values in Documentation/i2c/fault-codes. Signed-off-by: NChristoph Müllner <christoph.muellner@theobroma-systems.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Eugen Hristev 提交于
Platform data structs are initialized by default with zero values. Thus it becomes redundant to initialize them manually to zero (false). Remove extra false initialization for field members in structs. Reported-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NEugen Hristev <eugen.hristev@microchip.com> Reviewed-by: NLudovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Eugen Hristev 提交于
In SAM9X60 datasheet, FLEX_TWI_CWGR register description mentions clock offset of 3 cycles (compared to 4 in eg. SAMA5D3). This is the same offset as in SAMA5D2. Fixes: b0027792 ("i2c: at91: add new platform support for sam9x60") Suggested-by: NCodrin Ciubotariu <codrin.ciubotariu@microchip.com> Signed-off-by: NEugen Hristev <eugen.hristev@microchip.com> Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Reviewed-by: NCodrin Ciubotariu <codrin.ciubotariu@microchip.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 29 11月, 2019 1 次提交
-
-
由 Wolfram Sang 提交于
Move from the deprecated i2c_new_probed_device() to the new i2c_new_scanned_device(). Make use of the new ERRPTR if suitable. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: NMax Staudt <max@enpas.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 26 11月, 2019 1 次提交
-
-
由 Krzysztof Kozlowski 提交于
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org> Acked-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 25 11月, 2019 2 次提交
-
-
由 Andy Shevchenko 提交于
There is no suffix applied to Intel Jasper Lake SOC. Remove it from the comments and definitions. Besides that, it's a SOC, thus replace PCH with SOC where it appropriate. Fixes: e0c61c04 ("i2c: i801: Add support for Intel Jasper Lake") Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Alain Volmat 提交于
Fix a typo in the free slave id search loop. Instead of I2C_CLIENT_PEC, it should have been I2C_CLIENT_TEN. The slave id 1 can only handle 7-bit addresses and thus is not eligible in case of 10-bit addresses. As a matter of fact none of the slave id support I2C_CLIENT_PEC, overall check is performed at the beginning of the stm32f7_i2c_reg_slave function. Fixes: 60d609f3 ("i2c: i2c-stm32f7: Add slave support") Signed-off-by: NAlain Volmat <alain.volmat@st.com> Reviewed-by: NPierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 17 11月, 2019 1 次提交
-
-
由 Lori Hikichi 提交于
Enable handling of i2c repeated start. The current code handles a multi msg i2c transfer as separate i2c bus transactions. This change will now handle this case using the i2c repeated start protocol. The number of msgs in a transfer is limited to two, and must be a write followed by a read. Signed-off-by: NLori Hikichi <lori.hikichi@broadcom.com> Signed-off-by: NRayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> Signed-off-by: NIcarus Chau <icarus.chau@broadcom.com> Signed-off-by: NRay Jui <ray.jui@broadcom.com> Signed-off-by: NShivaraj Shetty <sshetty1@broadcom.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 15 11月, 2019 5 次提交
-
-
由 Peter Ujfalusi 提交于
dma_request_slave_channel_reason() is: #define dma_request_slave_channel_reason(dev, name) \ dma_request_chan(dev, name) Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: NJon Hunter <jonathanh@nvidia.com> Reviewed-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Ujfalusi 提交于
dma_request_slave_channel_reason() is: dma_request_chan(dev, name) Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Ujfalusi 提交于
dma_request_slave_channel_reason() is: #define dma_request_slave_channel_reason(dev, name) \ dma_request_chan(dev, name) Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Peter Ujfalusi 提交于
dma_request_slave_channel_reason() is: #define dma_request_slave_channel_reason(dev, name) \ dma_request_chan(dev, name) Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Reviewed-by: NVinod Koul <vkoul@kernel.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Geert Uytterhoeven 提交于
Variable "rate" already contains the current clock rate, so use that rather than calling clk_get_rate() again. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: NLuca Ceresoli <luca@lucaceresoli.net> Reviewed-by: NNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 12 11月, 2019 7 次提交
-
-
由 Patrick Williams 提交于
With the i2c-pxa driver migrated to the standard i2c-slave APIs, the custom APIs and structures are no longer needed or used. Remove them. Signed-off-by: NPatrick Williams <alpawi@amazon.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Patrick Williams 提交于
The i2c subsystem was enhanced circa 2015 to support operating as an i2c-slave device. Prior to that, the i2c-pxa driver supported an i2c-slave but had its own APIs. There are no existing in-kernel drivers or platforms that utilize the i2c-pxa APIs. Migrate the i2c-pxa driver to the general i2c-slave APIs so that existing drivers, such as the i2c-slave-eeprom, can be used. This has been tested with a Marvell EspressoBin, using i2c-pxa and i2c-slave-eeprom, acting as a slave, and a RaspeberryPi 3, using the at24 driver, acting as a master. Signed-off-by: NPatrick Williams <alpawi@amazon.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Akshu Agrawal 提交于
Add ACPI entry and use device_property_read to get fw value which is common to both dtsi and acpi. Signed-off-by: NAkshu Agrawal <akshu.agrawal@amd.com> Acked-by: NRaul E Rangel <rrangel@chromium.org> Reviewed-by: NEnric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Alain Volmat 提交于
Distinguish between the case where dma information is not provided within the DT and the case of an error during the dma init. Exit the probe with error in case of an error during dma init. Fixes: bb8822cb ("i2c: i2c-stm32: Add generic DMA API") Signed-off-by: NAlain Volmat <alain.volmat@st.com> Reviewed-by: NPierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
i2c_new_{probed|scanned}_device will update the address after scanning. No need to preset it. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: NMax Staudt <max@enpas.org> Tested-by: NMax Staudt <max@enpas.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Shubhrajyoti Datta 提交于
Fix the below warning by adding the description of clock and dev. drivers/i2c/busses/i2c-xiic.c:57: info: Scanning doc for struct xiic_i2c drivers/i2c/busses/i2c-xiic.c:84: warning: Function parameter or member 'dev' not described in 'xiic_i2c' drivers/i2c/busses/i2c-xiic.c:84: warning: Function parameter or member 'clk' not described in 'xiic_i2c' Signed-off-by: NShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: NMichal Simek <michal.simek@xilinx.com> Reviewed-by: NLuca Ceresoli <luca@lucaceresoli.net> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Alain Volmat 提交于
Add missing dma channels free calls in case of error during probe and reorder the remove function so that dma channels are freed after the i2c adapter is deleted. Overall, reorder the remove function so that probe error handling order and remove function order are same. Fixes: 7ecc8cfd ("i2c: i2c-stm32f7: Add DMA support") Signed-off-by: NAlain Volmat <alain.volmat@st.com> Reviewed-by: NPierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 26 10月, 2019 1 次提交
-
-
由 Alain Volmat 提交于
The IP can handle two slave addresses. One address can either be 7 bits or 10 bits while the other can only be 7 bits. In order to ensure that a 10 bits address can always be allocated (assuming there is only one 7 bits address already allocated), pick up the 7-bits only address slot in priority when performing a 7-bits address allocation. Fixes: 60d609f3 ("i2c: i2c-stm32f7: Add slave support") Signed-off-by: NAlain Volmat <alain.volmat@st.com> Reviewed-by: NPierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 25 10月, 2019 5 次提交
-
-
由 Alain Volmat 提交于
Remove the following warning: drivers/i2c/busses/i2c-stm32f7.c:315: warning: cannot understand function prototype: 'struct stm32f7_i2c_spec i2c_specs[] = Replace a comment starting with /** by simply /* to avoid having it interpreted as a kernel-doc comment. Fixes: aeb068c5 ("i2c: i2c-stm32f7: add driver") Signed-off-by: NAlain Volmat <alain.volmat@st.com> Reviewed-by: NPierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Fabrice Gasnier 提交于
When in slave mode, an arbitration loss (ARLO) may be detected before the slave had a chance to detect the stop condition (STOPF in ISR). This is seen when two master + slave adapters switch their roles. It provokes the i2c bus to be stuck, busy as SCL line is stretched. - the I2C_SLAVE_STOP event is never generated due to STOPF flag is set but don't generate an irq (race with ARLO irq, STOPIE is masked). STOPF flag remains set until next master xfer (e.g. when STOPIE irq get unmasked). In this case, completion is generated too early: immediately upon new transfer request (then it doesn't send all data). - Some data get stuck in TXDR register. As a consequence, the controller stretches the SCL line: the bus gets busy until a future master transfer triggers the bus busy / recovery mechanism (this can take time... and may never happen at all) So choice is to let the STOPF being detected by the slave isr handler, to properly handle this stop condition. E.g. don't mask IRQs in error handler, when the slave is running. Fixes: 60d609f3 ("i2c: i2c-stm32f7: Add slave support") Signed-off-by: NFabrice Gasnier <fabrice.gasnier@st.com> Reviewed-by: NPierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Fabrice Gasnier 提交于
The slave-interface documentation [1] states "the bus driver should transmit the first byte" upon I2C_SLAVE_READ_REQUESTED slave event: - 'val': backend returns first byte to be sent The driver currently ignores the 1st byte to send on this event. [1] https://www.kernel.org/doc/Documentation/i2c/slave-interface Fixes: 60d609f3 ("i2c: i2c-stm32f7: Add slave support") Signed-off-by: NFabrice Gasnier <fabrice.gasnier@st.com> Reviewed-by: NPierre-Yves MORDRET <pierre-yves.mordret@st.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Fabien Parent 提交于
Since commit abf4923e ("i2c: mediatek: disable zero-length transfers for mt8183"), there is a NULL pointer dereference for all the SoCs that don't have any quirk. mtk_i2c_functionality is not checking that the quirks pointer is not NULL before starting to use it. This commit add a call to i2c_check_quirks which will check whether the quirks pointer is set, and if so will check if the IP has the NO_ZERO_LEN quirk. Fixes: abf4923e ("i2c: mediatek: disable zero-length transfers for mt8183") Signed-off-by: NFabien Parent <fparent@baylibre.com> Reviewed-by: NCengiz Can <cengiz@kernel.wtf> Reviewed-by: NHsin-Yi Wang <hsinyi@chromium.org> Tested-by: NUlrich Hecht <uli@fpond.eu> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Jarkko Nikula 提交于
Add support for another Intel Comet Lake variant. Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NJean Delvare <jdelvare@suse.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-